Cultofmetatron has quit [Remote host closed the connection]
panpainter has quit [Quit: panpainter]
qwerxy has joined #ruby
arya has joined #ruby
Cultofmetatron has joined #ruby
chimkan has joined #ruby
arya has quit [Client Quit]
dpk has quit [Excess Flood]
emmanuelux has joined #ruby
ksaw123 has joined #ruby
sandstorm has quit []
qwerxy has quit [Client Quit]
<ksaw123>
hey guys getting a "wrong number of arguments error" on line 21 can someone help please. http://pastie.org/5337665
dpk has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<cirwin>
ksaw123: the actual error is one line below that in the backtrace: puts "\n\n\t\tSeat #: " + Pass.book_seat(@choice.to_s)
<cirwin>
You can't pass an argument to book_seat because it doesn't take an argument
cakehero has quit [Quit: Computer has gone to sleep.]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
<ksaw123>
hm gotcha. know a way to fix it?
strangeworks has quit [Quit: Leaving]
<cirwin>
ksaw123: either don't pass an argument
arya has joined #ruby
<cirwin>
or make it "def book_seat(choice)" so that it accepts an argument
cirwin has left #ruby [#ruby]
<ksaw123>
ok, if i make it def book_seat(choice) i can still have the user enter 1 or 2 yes?
keyvan has joined #ruby
postmodern has joined #ruby
anachronistic has left #ruby [#ruby]
mahmoudimus has joined #ruby
Virunga has quit [Remote host closed the connection]
hadees has joined #ruby
SCommette has quit [Quit: SCommette]
chessguy has joined #ruby
keyvan has quit [Remote host closed the connection]
butblack has joined #ruby
elico has quit [Quit: elico]
horofox has quit [Quit: horofox]
sheerun has quit [Quit: and thanks for all the fish]
SCommette has joined #ruby
arya has quit [Ping timeout: 244 seconds]
ksaw123 has quit [Remote host closed the connection]
arya has joined #ruby
centipedefarmer has quit [Remote host closed the connection]
horofox has joined #ruby
mmitchell has quit [Remote host closed the connection]
Orcris has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
Araxia has quit [Remote host closed the connection]
lenovodroid has joined #ruby
Russell^^ has joined #ruby
philcrissman has joined #ruby
centipedefarmer has joined #ruby
slainer68 has quit [Remote host closed the connection]
enderx86 has joined #ruby
punkrawkR has quit [Read error: Connection reset by peer]
jrist-aafk is now known as jrist
tatsuya_o has quit [Remote host closed the connection]
k610 has joined #ruby
tehlulz has joined #ruby
<RobZ1>
Hi, I'm getting a SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) What can I do to resolve?
mmitchell has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
k610 has quit [Ping timeout: 240 seconds]
k610 has joined #ruby
volty has joined #ruby
<davidcelis>
what OS?
k610 has quit [Ping timeout: 260 seconds]
<davidcelis>
do you have ssl certs installed?
<RobZ1>
davidcelis: ubuntu 12.04 yes certs are installed
<havenn>
RobZ1: In irb does "require 'openssl'
<havenn>
" work?
<havenn>
sry for multi-line fail.
TheFuzzball has quit [Read error: Operation timed out]
<havenn>
RobZ1: You probably need to compile Ruby with openssl
fyolnish has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
<havenn>
RobZ1: If RVM: 'rvm pkg install openssl'
<RobZ1>
havenn: yes it does. And then visiting a https site works too. But trying to use activemerchant with a providers pem file and it fails (although works fine on local dev machine and another server)
<havenn>
RobZ1: Never mind about openssl then...
jenrzzz has joined #ruby
osvico has quit [Ping timeout: 248 seconds]
sailias has joined #ruby
freakazoid0223 has joined #ruby
tommyvyo has joined #ruby
arya has quit [Read error: Connection reset by peer]
arya has joined #ruby
slainer68 has joined #ruby
TheFuzzball has joined #ruby
cpruitt has joined #ruby
chrisja has joined #ruby
mercwithamouth has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<ksaw123>
i changed most of my code. I cant get @choice to return the random number. It assigns seat 1 and 2 need help plsplspls. have 2.6 hours to complete.
<davidokner>
What I think is stupid is that they are not teaching backbone.js using Coffeescript over at codeschool.com
<tehlulz>
davidokner: for web stuff, do you use rails? or sinatra?
<davidokner>
I will use Rails.
sn0wb1rd has joined #ruby
<davidokner>
Actually not familiar with Sinatra, other than in name.
<davidokner>
And I've only done some minor practice with rails so far. I'm focusing on ruby right now.
khakimov has quit [Ping timeout: 252 seconds]
joeycarmello has joined #ruby
xsbeats has joined #ruby
khakimov has joined #ruby
<davidokner>
I might go back and take ruby classes from the free sources after I finish pragmatic studio
<tehlulz>
does the ruby bits cover more then the try ruby?
stephenjudkins has quit [Quit: stephenjudkins]
<davidokner>
YES
<davidokner>
Ruby bits is much better
<tehlulz>
sweet
<tehlulz>
cause yeh, try ruby kinda put me off
<tehlulz>
didn't explain much at all
<davidokner>
Ruby bits by code school and Ruby on Code Academy are comprehensive from what I can tell.
<davidokner>
If you want to spend $200 there is Pragmatic Studio ruby course.
<davidokner>
Try Ruby is not systematic or comprehensive
<davidokner>
Just look at PragmaticStudio.com too
<davidokner>
CodeSchool is very good for rails I think.
<davidokner>
But you want to start with Ruby
<tehlulz>
well, id like to learn ruby before jumping into rails haha
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
tbrock_ has joined #ruby
atlantaman has joined #ruby
mneorr has quit [Remote host closed the connection]
etrnl has joined #ruby
freeayu has joined #ruby
adeponte has quit [Remote host closed the connection]
u89 has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 244 seconds]
<etrnl>
keep getting " A JSON text must at least contain two octets! (JSON::ParserError)" when trying to open and parse a json formatted response, cna't figure out why
<ksaw123>
what is the difference between @ and $
<ksaw123>
$ global?
sepp2k1 has quit [Remote host closed the connection]
<Spaceghostc2c>
ksaw123: One makes me want to cry if you abuse them.
<ksaw123>
lol one just tries to pass ISA 3010
<ksaw123>
http://pastie.org/5338075 is my code, I can't get it to return the right value from arrays I am thinking maybe if i change @choice to $choice?
J-_-L has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<ksaw123>
and for some reason I have to input the seat type twice?
scx has quit [Ping timeout: 276 seconds]
dakine has joined #ruby
tehlulz has quit [Read error: Connection reset by peer]
linoj has joined #ruby
tehlulz has joined #ruby
caleb_io has joined #ruby
mahmoudimus has joined #ruby
maxer has quit [Quit: maxer]
scx has joined #ruby
zastern has joined #ruby
samphipp_ has joined #ruby
<ksaw123>
can anyone see why i have to input the number twice?
samphippen has quit [Ping timeout: 252 seconds]
samphipp_ is now known as samphippen
philcrissman has joined #ruby
Progster has quit [Ping timeout: 276 seconds]
levabalkin has joined #ruby
horofox has quit [Quit: horofox]
ksaw123 has quit [Quit: irc2go]
Hanmac1 has joined #ruby
darkwing_duck has quit [Read error: Connection reset by peer]
ilyam has quit [Quit: ilyam]
levabalkin has quit [Ping timeout: 260 seconds]
yshh has quit [Ping timeout: 246 seconds]
Hanmac has quit [Ping timeout: 246 seconds]
horofox has joined #ruby
haxrbyte has joined #ruby
medik has quit [Quit: medik has no reason]
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
chrisja has quit [Quit: leaving]
wizard` has joined #ruby
darkwing_duck has joined #ruby
chimkan has joined #ruby
_alejandro has quit [Remote host closed the connection]
chendo_ is now known as chendo
`brendan has joined #ruby
<etrnl>
diving deeper into this issue, i'm getting a nil response from the server, at least while setting the variable, the error I get returns the response text
JonnieCache has quit [Ping timeout: 252 seconds]
tnk1 has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
tpe11etier has joined #ruby
keyvan has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
<mercwithamouth>
what would be a eloquent way to write unless @blah.empty.each do |t| .... end
<mercwithamouth>
unless the array is empty execute
fmcgeough has quit [Quit: fmcgeough]
tnk1 has joined #ruby
kokainepizza has joined #ruby
mrkris has joined #ruby
<mrkris>
'evening
havenn has joined #ruby
tpe11etier has quit [Ping timeout: 240 seconds]
horofox has quit [Quit: horofox]
imbric has joined #ruby
Ruler_Of_Heaven_ has quit [Ping timeout: 252 seconds]
pipopopo has joined #ruby
<imbric>
hey guys. I'm new to writing Ruby libraries and I have a testing question. Is it a good idea to use both Minitest::Unit and Minitest::Spec ? Or do they serve the same purpose but in different ways?
Servidorv has joined #ruby
Servidorv has quit [Client Quit]
havenn has quit [Ping timeout: 256 seconds]
<imbric>
I'm sort of leaning towards this layout…. test/helper.rb does high level setup…. then each of test/unit/ and test/spec/ have a *_helper.rb which does any specialized setup….
<imbric>
is this sane?
rockets has joined #ruby
philcrissman has quit [Remote host closed the connection]
bier_ has quit [Ping timeout: 268 seconds]
joeycarmello has quit [Remote host closed the connection]
hsbt is now known as hsbt_away
zastern has quit [Ping timeout: 248 seconds]
Grieg has quit [Ping timeout: 268 seconds]
ilyam has joined #ruby
radic has quit [Disconnected by services]
scx has quit [Read error: Connection reset by peer]
radic_ has joined #ruby
kiyoura has quit [Quit: Leaving]
`brendan has quit [Ping timeout: 246 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
`brendan has joined #ruby
<davidcelis>
kinda weird to use both Unit and Spec, IMO
chimkan has quit [Ping timeout: 260 seconds]
<davidcelis>
they're both for unit testing, they just use a different DSL. you should pick one and stick with it
<davidcelis>
imbric: ^
x82_nicole has joined #ruby
<x82_nicole>
How can I work on someone else's gem? I've cloned it to my computer. How exactly do I edit, and "reload" it to see my changes?
lushious is now known as lushbot
lushbot is now known as lushious
<imbric>
ok…. then, do you think its reasonable to have separate test classes for "unit level tests" (like when I test my low-level implementation as I'm building auxiliary helper methods) versus more high level (testing the library's public interface)
chessguy has quit [Remote host closed the connection]
chimkan_ has joined #ruby
BrianJ has quit [Quit: BrianJ]
gozes has left #ruby [#ruby]
alvaro_o has quit [Quit: Ex-Chat]
BrianJ has joined #ruby
theRoUS has quit [Ping timeout: 264 seconds]
`brendan has quit [Ping timeout: 240 seconds]
<shevy>
x82_nicole: all gems that you install, will be downloaded. you can find them in the cache/ subdirectory
nateberkopec has quit [Quit: Leaving...]
d2dchat has quit [Remote host closed the connection]
<shevy>
on my system this is at /usr/lib/ruby/gems/1.9.1/cache/
<shevy>
there you can extract the .gem file, make your changes, then rebuild the gem again
<x82_nicole>
Hmm, so I edit them, and then once I'm happy, go back to the one I've forked on GitHub, clone it, and paste those changes?
<shevy>
if you use github anyway, there is no need to modify the gem itself
cakehero has quit [Quit: Computer has gone to sleep.]
<shevy>
you can just use git
chimkan_ has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<etrnl>
still keep getting "A JSON text must at least contain two octets! (JSON::ParserError)" when trying to open and parse a json formatted response, can't figure out why
artnez has joined #ruby
Tombar has quit [Remote host closed the connection]
wizard` has quit [Ping timeout: 240 seconds]
caleb_io has quit [Quit: caleb_io]
stephenjudkins has joined #ruby
wmoxam has quit [Quit: leaving]
caleb_io has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
lenodroid has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
bapa has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
siyusong has quit [Quit: Computer has gone to sleep.]
x82_nicole has quit [Quit: Computer has gone to sleep.]
Tombar has joined #ruby
ananthakumaran has joined #ruby
chimkan_ has joined #ruby
joeycarmello has joined #ruby
sn0wb1rd_ has joined #ruby
mneorr has joined #ruby
n_blownapart has joined #ruby
linoj has quit [Quit: linoj]
nga4 has quit [Ping timeout: 276 seconds]
sn0wb1rd has quit [Ping timeout: 246 seconds]
sn0wb1rd_ is now known as sn0wb1rd
<n_blownapart>
hi any tips on why this won't work? getting the longest error message ever. thanks: http://pastie.org/5338344
levabalkin has joined #ruby
krz has joined #ruby
hbpoison has joined #ruby
chimkan_ has quit [Ping timeout: 255 seconds]
rockets has quit [Remote host closed the connection]
Tombar has quit [Read error: Connection reset by peer]
zastern has joined #ruby
darkwing_duck has quit [Quit: Lost terminal]
zastern has quit [Read error: Connection reset by peer]
Tombar has joined #ruby
hbpoison has quit [Ping timeout: 248 seconds]
cakehero has joined #ruby
zastern has joined #ruby
linoj has joined #ruby
bapa has joined #ruby
zastern has quit [Remote host closed the connection]
Progster has joined #ruby
mrkris has left #ruby ["'MURICA!"]
areil has joined #ruby
gnnr has quit [Read error: Connection reset by peer]
Ry_ has quit [Ping timeout: 240 seconds]
bradhe has joined #ruby
cyong has joined #ruby
Progster has quit [Ping timeout: 264 seconds]
kamsky has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
<kamsky>
hi guys, need ur help, do u see anything wrong here?
<kamsky>
def send_email( from='Nano Store <whatever@asd.com>', to, subject='Nanocellulose', body, attachment=nil, smtp_info)
centipedefarmer has quit [Remote host closed the connection]
joofsh has joined #ruby
roadt_ has joined #ruby
joofsh has quit [Remote host closed the connection]
artOfWar has quit [Remote host closed the connection]
artOfWar has joined #ruby
PraiseChaos has quit [Quit: PraiseChaos]
jgrevich_ has joined #ruby
<SirFunk>
Is there some way to do something like Array.each until a certain value is returned?
jgrevich has quit [Ping timeout: 240 seconds]
jgrevich_ is now known as jgrevich
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
kil0byte_ has joined #ruby
freakazoid0223 has quit [Ping timeout: 240 seconds]
<heftig>
SirFunk: break out of the loop
<heftig>
or use Array.find
<heftig>
er, Array#find
<heftig>
find will terminate as soon as the block returns true
<SirFunk>
i don't see find on the array docs?
<heftig>
Enumerable
JohnBat26 has quit [Read error: Connection reset by peer]
Guest10501 has quit [Quit: Guest10501]
kil0byte has quit [Ping timeout: 246 seconds]
xpen has joined #ruby
freakazoid0223 has joined #ruby
BoomCow has joined #ruby
<BoomCow>
sup pimpins
<SirFunk>
hmm.. find seems like almost what i need
<SirFunk>
here's what i'm trying to do. I have an array of Package objects. I need to loop through the Packages running Package.add(item) until one of them returns true (the package was added) otherwise make a new one and push it onto the array
Juul has joined #ruby
<SirFunk>
... maybe array.find would do that
<Paradox>
you could just use a while loop
<Paradox>
packageval = false
JohnBat26 has joined #ruby
<Paradox>
while !packageval ¬ packageval = Package.add(herp) ¬ end
siyusong has quit [Quit: Computer has gone to sleep.]
Andrew__ has joined #ruby
<SirFunk>
yeah, i kinda feel like that's clunky and not ruby-esque
<SirFunk>
but it would work
adeponte has quit [Remote host closed the connection]
margle has quit [Quit: Computer has gone to sleep.]
<SirFunk>
what is 'ifnone'
<SirFunk>
can that be a function or is it just a value that will be returned?
<BoomCow>
why don't you just make an array
<BoomCow>
and push the objects into the array
<BoomCow>
new_package = []
Andrew__ is now known as andrewhl
crackfu has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 246 seconds]
<SirFunk>
the packages have a maximum number of items they can contain aswell as a max weight
<SirFunk>
so whenever I add_item it checks if it can be added or not
erichmenge has joined #ruby
<BoomCow>
I feel like I joined mid convo
<SirFunk>
perhaps
<SirFunk>
I was trying to find a way to loop through my aray of packages attempting to add an item to each of them until one successfully ads
xsbeats_ has left #ruby [#ruby]
<SirFunk>
otherwise make a new package and add to that
<BoomCow>
packages.each { |p| new_package << p unless !p }
<BoomCow>
.each do*
<BoomCow>
each.do*
SCommette has quit [Quit: SCommette]
roadt_ has quit [Read error: Connection reset by peer]
<SirFunk>
that wouldn't try to add the items to it.. that would only create the pacakge if there is none, correct?
Trioke has quit [Ping timeout: 260 seconds]
Jonah11_ has quit [Ping timeout: 244 seconds]
skaczor has quit [Remote host closed the connection]
davidcelis has joined #ruby
thecreators has quit [Quit: thecreators]
cakehero has quit [Quit: Computer has gone to sleep.]
ltsstar has quit [Quit: ltsstar]
<BoomCow>
do you have a gist
<BoomCow>
SirFunk,
<SirFunk>
i can, hangon
yxhuvud has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<SirFunk>
it 'sends' that command to the object... It's just so i can pass in object properties like Order.new(:shippingaddress => this, :billingaddress => that)
<SirFunk>
that's how active record models work but i'm not using active record so you need that bit to get the same type of functionality
<BoomCow>
so you're iterating through the package?
<BoomCow>
I have no idea what's going on in this line
<SirFunk>
through the packageS yes
<SirFunk>
well.. that's the bit i haven't tested yet.. but from my understanding it should run that block on each package until one returns something non false
<BoomCow>
give me a min
nga4 has quit []
bradhe has quit [Ping timeout: 252 seconds]
Chryson has quit [Quit: Leaving]
robbyoconnor has joined #ruby
kamsky has quit [Ping timeout: 260 seconds]
minijupe has quit [Quit: minijupe]
gabrielrotbart has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
Mon_Ouie has quit [Ping timeout: 246 seconds]
rippa has quit [Ping timeout: 252 seconds]
<BoomCow>
SirFunk, I'm having a tough time trying to figure out what you're trying to accomplish
<SirFunk>
ok
<SirFunk>
I can try to re-explain
<BoomCow>
let me show you what i've tried to do so far
<SirFunk>
I have a bunch of Items and depending on their type (in this code it's actually Item.gallery.slug that distinguishes) they have different weight and they take up a different amount of spaces in a Package. I need to figure out the optimal number of packages to fit all the items into. So what I'm doing is iterating over the list of existing pacakges, trying to add the item to the package (if it has space) if none of them have space I'll create
<SirFunk>
a new pacakge and add the item to that
sagax has joined #ruby
<BoomCow>
ahh
<BoomCow>
so what is packageval
khakimov has quit [Ping timeout: 256 seconds]
<SirFunk>
just a true/false value
fixl has joined #ruby
rohit has joined #ruby
straind has joined #ruby
khakimov has joined #ruby
<SirFunk>
mocking objects for specs can be a pain
straind` has quit [Read error: Connection reset by peer]
pu22l3r_ has joined #ruby
<BoomCow>
has i'm still working on your thing
<SirFunk>
yeah me too. I'm trying to write a unit test
<SirFunk>
writing the test may be harder than writing the code that makes it pass :-P
<BoomCow>
agreed
carlyle has quit [Ping timeout: 245 seconds]
pu22l3r has quit [Ping timeout: 265 seconds]
Ry_ has quit [Quit: Ry_]
<SirFunk>
hmm
<BoomCow>
hold on
<BoomCow>
I'm still working on it
<SirFunk>
unless nil ... does that execute or not?
<BoomCow>
I"m just rewriting it
ABK has quit [Ping timeout: 245 seconds]
adeponte has joined #ruby
<SirFunk>
oh wow this spec is making me find all kinds of problems with my logic :-p
awestroke has quit [Remote host closed the connection]
<maasha>
hey, what is the best way to dump a data structure as XML?
AndChat| has quit [Ping timeout: 260 seconds]
* maasha
is looking at xml-simple
margle has quit [Quit: Computer has gone to sleep.]
amacgregor_osx has quit [Read error: Operation timed out]
<JonnieCache>
xmlsimple does the job. if you want heavy duty xml handling nokogiri is the one
<maasha>
Right
manizzle has quit [Remote host closed the connection]
Ry_ has joined #ruby
jprovazn has joined #ruby
horofox has joined #ruby
<Muz>
ActiveSupport specifies a #to_xml method on the Hash class. May not output the exact XML you need and something a bit more heavy weight may be desirable.
Xeago has quit [Remote host closed the connection]
<Muz>
Also, there's the given "eurgh" of using a gem named /^Active\S+/
Xeago has joined #ruby
jprovazn has quit [Ping timeout: 240 seconds]
Erfankam has quit [Quit: Leaving.]
anderse has joined #ruby
<JonnieCache>
activesupport is good
amacgregor_osx has joined #ruby
<JonnieCache>
you can require it a piece at a time these days
k610 has quit [Ping timeout: 255 seconds]
samphippen has joined #ruby
whitedawg has joined #ruby
maxer has joined #ruby
hbpoison has joined #ruby
banister_ has joined #ruby
fermion has joined #ruby
kil0byte_ has joined #ruby
jbw has quit [Remote host closed the connection]
bradhe has joined #ruby
Grieg has quit [Quit: laterz! :D]
tonini has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
kil0byte has quit [Ping timeout: 252 seconds]
kil0byte has joined #ruby
baphled has joined #ruby
banister_ has quit [Ping timeout: 268 seconds]
hbpoison has quit [Ping timeout: 260 seconds]
jprovazn has joined #ruby
kil0byte_ has quit [Ping timeout: 246 seconds]
hamed_r has joined #ruby
Grieg has joined #ruby
Grieg has quit [Changing host]
Grieg has joined #ruby
bradhe has quit [Ping timeout: 264 seconds]
swex_ has joined #ruby
swex has quit [Ping timeout: 248 seconds]
schaary has joined #ruby
schaary has left #ruby [#ruby]
reinaldob has joined #ruby
manizzle has joined #ruby
margle has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
topek has quit [Remote host closed the connection]
jds has quit [Ping timeout: 240 seconds]
greenarrow has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
yshh has quit [Remote host closed the connection]
jds has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Serial_Killer_C has quit [Remote host closed the connection]
samphippen has joined #ruby
runciter has quit [Quit: sleep!]
schaary has joined #ruby
zz_chrismcg is now known as chrismcg
d3vic3 has quit [Ping timeout: 252 seconds]
d3vic3 has joined #ruby
iamjarvo has joined #ruby
ohsiris has left #ruby [#ruby]
codecaster has quit [Quit: Leaving.]
havenn has joined #ruby
fyolnish has joined #ruby
Shrink has quit [Ping timeout: 265 seconds]
_Astral has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby
Edward__ has joined #ruby
fir_ed has joined #ruby
hamed_r has quit [Ping timeout: 246 seconds]
havenn has quit [Ping timeout: 256 seconds]
k610 has joined #ruby
sepp2k has joined #ruby
icole has joined #ruby
bradhe has joined #ruby
carloslopes has joined #ruby
icole has quit [Read error: Operation timed out]
berserkr has joined #ruby
Serial_Killer_C has joined #ruby
FlyingFoX has quit [Read error: Operation timed out]
etehtsea has quit [Quit: Computer has gone to sleep.]
timonv has quit [Ping timeout: 252 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
timonv has joined #ruby
FlyingFoX has joined #ruby
pigoz has joined #ruby
Shrink has joined #ruby
reinaldob has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
beiter has joined #ruby
reinaldob has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
adambeynon has joined #ruby
codecaster has joined #ruby
bier has quit [Ping timeout: 240 seconds]
ZubKonst_ has quit [Remote host closed the connection]
Averna has quit [Quit: Leaving.]
ZubKonst has joined #ruby
vlad_starkov has quit [Ping timeout: 252 seconds]
cezar-b has quit [Ping timeout: 276 seconds]
Progster has joined #ruby
jrajav has joined #ruby
vlad_starkov has joined #ruby
hbpoison has joined #ruby
scx has joined #ruby
beachandbytes2 has quit [Ping timeout: 276 seconds]
carloslopes has quit [Remote host closed the connection]
radic has quit [Disconnected by services]
radic_ has joined #ruby
horofox has joined #ruby
arietis has joined #ruby
carloslopes has joined #ruby
krz has quit [Quit: krz]
hbpoison has joined #ruby
bradhe has joined #ruby
u89 has joined #ruby
u89 has quit [Remote host closed the connection]
Xeago_ has quit [Remote host closed the connection]
Xeago has joined #ruby
test3 has joined #ruby
Edward__ has quit [Ping timeout: 255 seconds]
ZubKonst has quit [Read error: Connection reset by peer]
fir_ed has quit [Ping timeout: 255 seconds]
ZubKonst has joined #ruby
Jdubs has joined #ruby
radic has joined #ruby
chussenot has quit [Quit: chussenot]
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
radic_ has quit [Ping timeout: 268 seconds]
yshh has joined #ruby
topek has joined #ruby
polymar has joined #ruby
hbpoison has quit [Ping timeout: 256 seconds]
wicky has joined #ruby
test3 has quit [Quit: Leaving.]
daniel_- has joined #ruby
ttt_ has quit [Remote host closed the connection]
hamed_r has joined #ruby
Progster has quit [Ping timeout: 252 seconds]
<Jdubs>
Hi guys, I'm about halfway through Why's poignant guide, and I finished the codeacademy Ruby page, where should I go from here? I'd like to do something to take a break from Why's guide and go back to it later
<Xeago>
Jdubs: write a number series, like fibonacci
<Xeago>
or a series of primes
<Jdubs>
that's pretty easy, i need something harder
dreamz__ has quit [Ping timeout: 276 seconds]
bradhe has quit [Ping timeout: 265 seconds]
<Jdubs>
I'm trying to get good enough to write a small text game (current goal)
timonv has quit [Remote host closed the connection]
<Jdubs>
long term goal is a job working with Ruby :)
<Xeago>
write a quiz
<Xeago>
which reads out questions from a file
<Xeago>
as ruby code
<Xeago>
so you want a nice dsl there
<Xeago>
and then collect information on the answers
<Jdubs>
So you program it to replace all instances of question with the other part?
<Xeago>
they have nice relationships
slainer68 has joined #ruby
<Xeago>
there was a nice article about DSL's a while ago
<Xeago>
sec
<Jdubs>
ok
<JonnieCache>
Jdubs: they are a good way to learn about metaprogramming
<JonnieCache>
and to have fun
<Jdubs>
ahh!
<Jdubs>
that's the part i was doing in the poignants guide
<Jdubs>
but it got a bit confusing, so i wanted to take a break lol
<Jdubs>
I'm also trying to work through the About.com text based game guide
<Jdubs>
btw, i meant the metaprogramming section of poignants guide
Zai00 has quit [Quit: Zai00]
slainer68 has quit [Ping timeout: 246 seconds]
zemanel has joined #ruby
slainer68 has joined #ruby
SPYGAME has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
ffranz has joined #ruby
timonv has joined #ruby
reisl has joined #ruby
eqbaqu has joined #ruby
<Xeago>
Jdubs: if I craft you a valid ruby file, your assignment is to make a program that asks the user for a file to load, and then asks the user questions
fyolnish has quit [Remote host closed the connection]
<Jdubs>
ok!
<eqbaqu>
Hi everyone, I'm using jruby implementation, and i'm creating an application that is supposed to habdle at least 10k open TCP connections, it's more like a social networking app, anyways, I tried so many solution like celluloid and others but keep getting the same error which is i can't get more than 1.2 K Threads anyways
<Jdubs>
I'll do my best
<Jdubs>
You want me to post the answer to pastebin?
<JonnieCache>
eqbaqu: sounds like an OS limit
<eqbaqu>
is there anyways to enhance that ? like to do some workaround something like changing the limit's in my OS
<JonnieCache>
eqbaqu: have you tried increasing some unix paramaters? ulimit and os on?
<eqbaqu>
JonnieCache thanks for your welling to helo here
larissa has quit [Ping timeout: 246 seconds]
<JonnieCache>
look at ulimit and stuff
<eqbaqu>
but no i didn't , i would appreciate any help here
<JonnieCache>
also there is a jruby channel on here
<eqbaqu>
so is this related to jruby ? is this channel for MRI implementation ?
<greenail>
but calling {:foo => obj.class}.to_json is expanding into {"foo",{[obj1,obj2]}
<ddd>
Muz: but why would that cause an array of that_class objects to be returned? (curious myself as to the answer, didn't think that would do that)
<greenail>
ya, i'm assuming datamapper or rails is mokeypatching .class
<Muz>
What's defining to_json?
<greenail>
rails i guess
kil0byte_ has quit [Remote host closed the connection]
<greenail>
or json
<Muz>
Either datamapper or something else is monkeypatching .class (!!!), or has different handling for a String vs a Constant
<greenail>
ya String works fine
<greenail>
but it was soo odd
<greenail>
i had to ask
<Muz>
My point is that Object.class is not equal to Object.class.to_s due to different return values. :)
<greenail>
agreed
hammond has left #ruby [#ruby]
<greenail>
i'll go bug the datamapper folks thanks
greenail has left #ruby [#ruby]
daniel_- has quit [Quit: WeeChat 0.3.9]
<ddd>
his point makes perfect sense. i would have thought, based on what he said, that you would have been populated with a constant not an array. like he's saying that tells me (now that he made the behaviour clear) there's a bug in whichever is hadling the to_json. I can't think of an instance where returning an array because you used .class is valid.
dekroning has joined #ruby
<ddd>
when you figure out which it is (rails or the json gem) i'd file a bug. that's .. unexpected.. behaviour in just about any instance.
<ddd>
unless someone else disagrees.
krawchyk has joined #ruby
jlwestsr has joined #ruby
Araxia has quit [Quit: Araxia]
mikecmpbll has quit [Quit: Computer has gone to sleep.]
thecreators has joined #ruby
<JonnieCache>
i bet its rails
flip_digits has joined #ruby
rippa has quit [Ping timeout: 264 seconds]
dekroning has quit [Ping timeout: 260 seconds]
Ry_ has joined #ruby
ltsstar has quit [Quit: ltsstar]
skaczor has quit [Remote host closed the connection]
jprovazn has joined #ruby
skaczor has joined #ruby
Katniss has quit [Ping timeout: 248 seconds]
dekroning has joined #ruby
bradhe has quit [Ping timeout: 276 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
geekbri has joined #ruby
ddv has quit [Ping timeout: 240 seconds]
<Muz>
JonnieCache: it often is. Too much magic for its own good!
Elhu has joined #ruby
linoj has joined #ruby
slainer68 has quit [Remote host closed the connection]
<ddd>
tis why i've stayed away from it for awhile. but i've a contract dealing with a rails app, so, no more hiding for me :/
philcrissman has joined #ruby
Katniss has joined #ruby
Tania has quit [Read error: Connection reset by peer]
moshee has quit [Ping timeout: 260 seconds]
ddv has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
jprovazn has quit [Ping timeout: 260 seconds]
seanyo has joined #ruby
tbrock_ has joined #ruby
Shrink has quit [Ping timeout: 265 seconds]
crocket has joined #ruby
mikecmpbll has joined #ruby
<crocket>
Is it possible to deploy multiple instances of a rails application via NameVirtualHosts with different values of RAILS_ENV variable?
radic has quit [Disconnected by services]
radic_ has joined #ruby
<Hanmac>
crocket you are in the wrong channel
hamed_r has quit [Quit: Leaving]
<Hanmac>
you are looking for #rubyonrails
<ddd>
#rubyonrails and no, not that i know of
skaczor has quit [Remote host closed the connection]
iPhoneMRZ has joined #ruby
skaczor has joined #ruby
dr_bob has joined #ruby
enderx86 has quit [Remote host closed the connection]
<Xeago>
which is what rails and sinatra are build on
<jozefk>
sinatra is CMS or something like that yeah?
<Xeago>
no
<ddd>
sinatra, padrino, ramaze, and a couple others
chussenot has quit [Quit: chussenot]
<heftig>
sinatra is a minimal app framework
awestroke has quit [Remote host closed the connection]
<JonnieCache>
theyre all frameworks
<Jdubs>
Xeago: ok, just wanted to let you know, i had to cook lunch etc so i was gone a bit, in case you were wondering why i was taking so long :)
<Jdubs>
Xeago: I think I'm close to a solution, I hope
<jozefk>
I see. same like rails is framework as well
tatsuya_o has quit [Remote host closed the connection]
<jozefk>
so I guess nothing is wrong with rails then :)
jprovazn has joined #ruby
<Xeago>
not really, people love it, people hate it
chussenot has joined #ruby
<Xeago>
like with everything
Shrink has joined #ruby
krawchyk_ has joined #ruby
<jozefk>
but it works good enough and most of the time I believe
<ddd>
its more a matter of that A) is does a LOT of magic behind the scenes so it can be difficult to figure out what exactly is going on, and B) that so many people think that you can't use ruby without rails that it puts a shadow on ruby itself directly that is undeserved
kamsky has quit [Ping timeout: 248 seconds]
<jozefk>
it seems you can't use ruby for web without framework but that's normal I guess
<heftig>
the most minimal thing is using CGI, i guess
<ddd>
there is Net::HTTP and others
<ddd>
you most assuredly can use ruby for the web without frameworks. frameworks just dot he magic and building of core pieces for you
<jozefk>
CGI like with perl for example?
tbrock_ has quit [Quit: Computer has gone to sleep.]
<Xeago>
'ish, you can get comfortably low with rack
robinbowes has joined #ruby
<robinbowes>
Afternoon all
Jdubs has quit [Read error: Operation timed out]
<JonnieCache>
the problem with rails is that it can do everything, therefore people do everything with it
<JonnieCache>
rather than judging if its appropriate or not
<jozefk>
:)
<ddd>
i'll agree with that
<robinbowes>
I'm writing a custom function for puppet to pass in a hash and a list of key names and ensure that a) all keys are present and b) all values are non-empty
<jozefk>
what is Rails best for?
krawchyk has quit [Ping timeout: 255 seconds]
<Xeago>
happy developers
<Xeago>
sometimes
<jozefk>
haha
<robinbowes>
I'm struggling to come up with a test for "non-emptiness"
<JonnieCache>
its good for people who dont really know where theyre going, but want to get there fast
arkiver has joined #ruby
<JonnieCache>
startups and the like
<ddd>
best is subjective. it all depends on who you're talking to. that kind of question willg et you 400 different answers out of 400 different people
jprovazn has quit [Ping timeout: 260 seconds]
<jozefk>
sounds like Rails is not bad at all :)
<JonnieCache>
robinbowes: value.present?
<heftig>
it's not
<JonnieCache>
dunno if thats part of stdlib or not
<robinbowes>
Ooo, sounds promising...
<Xeago>
I think it is active support
<ddd>
it isn't. some people will implement certain things differently and don't like this or that implementation within the framework, but that can be said of every framework in existance
<Xeago>
I think that is nil and blank
crocket has left #ruby ["Leaving"]
<heftig>
robinbowes: present? being provided by rails (activesupport)
<ddd>
really the only answer is to look at what rails framework can do, and see if it fits your needs/wants
<robinbowes>
Mmm, am not using rails
<ddd>
and btw, know that you can use the gems that rails uses without using rails itself.
mark_locklear has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 240 seconds]
<jozefk>
nice
<ddd>
I use the behometh called ActiveRecord, along with ActiveModel, ActiveSupport, and Arel without rails in a lot of my personal projects
hemanth has quit [Read error: Connection reset by peer]
<Jdubs>
ok
<Xeago>
and you will want classes to represent questions
hemanth has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
<Jdubs>
hmmm
<Jdubs>
Like...a separate class for each question?
krawchyk_ has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
<Xeago>
a separate instance of class question per question
joofsh has joined #ruby
krawchyk has joined #ruby
<Hanmac>
File.new is not what you want ...
csaunders has joined #ruby
<Jdubs>
ahhh i see
pothibo has joined #ruby
<Jdubs>
so for instance question1 = question.new?
<Xeago>
Jdubs: the way I would approach this is to ask myself, how does a question look like?
AndChat- has joined #ruby
<Xeago>
e.g. what is the data structure I will be working with and how do I want to interact with it?
arietis has quit [Quit: Computer has gone to sleep.]
<robinbowes>
heftig: Ended up with this: Array(args[1]).each {|k| raise "Value of key #{k} not set" if (args[0][k].respond_to?(:empty?) ? args[0][k].empty? : !args[0][k])}
mark_locklear has joined #ruby
invisime has joined #ruby
<Jdubs>
ok
<Jdubs>
Keep in mind this is the first real program I've written in Ruby, and the first time I've done metaprogramming lol
AndChat| has quit [Ping timeout: 260 seconds]
<Jdubs>
But I think I have an idea
<Jdubs>
I need to use class_eval right?
<Jdubs>
to input more classes?
JonnieCache has quit [Read error: Operation timed out]
<Xeago>
Jdubs: don't think on that level when starting, start by defining your classes => models
<Jdubs>
ok
Banistergalaxy has quit [Ping timeout: 260 seconds]
horofox has quit [Quit: horofox]
bradhe has quit [Ping timeout: 264 seconds]
Banistergalaxy has joined #ruby
carlyle has joined #ruby
<Xeago>
ask the following questions, what makes up a question
AndChat- has quit [Ping timeout: 260 seconds]
<Xeago>
it might have answers like: A question-text, wrong answers and correct answers
JonnieCache has joined #ruby
jrist-afk is now known as jrist
jonathanwallace has joined #ruby
jeffreybaird has joined #ruby
<Xeago>
a question type, multiple-choice, open
atmosx has joined #ruby
bbttxu has joined #ruby
<atmosx>
hello
kil0byte has joined #ruby
sheerun has joined #ruby
<atmosx>
I received an email from a company looking for a ROR dev, relocation in berlin. if anyone is interested drop a pm.
<Jdubs>
Hanmac: is it interchangable? If so, I prefer if both work the same
<JonnieCache>
atmosx: no decent ones who are unemployed
<Jdubs>
I prefer .self*
<JonnieCache>
tbh we havent been looking very hard
gmci has joined #ruby
<Xeago>
Jdubs: that intialize defines a structure but does not lay out a structure, also this requires the answers, and the questions known before initialization
mikepack has joined #ruby
<Xeago>
tbh, that looks java'ish
<atmosx>
JonnieCache: can I ask you a question that you might probably be able to answer :-P
<Xeago>
Jdubs: do you know what a block is?
<atmosx>
JonnieCache: why do you need relocation in Brighton and can't the guy work via internet?
<Jdubs>
Xeago: any group of code basically
<Hanmac>
Jdubs they are not interchangeable but in your case, @ would be better
<Xeago>
Jdubs: aight, look at the file I gave you, are there blocks in there?
<Jdubs>
Xeago yeah
rjsamson has joined #ruby
<Xeago>
shall I give you a hand in how I'd like it to look?
<JonnieCache>
atmosx: because remote working is much less eficient than having people in the office
<Jdubs>
Xeago, would it be better if I try again? perhaps with just a general hint or something?
<Jdubs>
Xeago, I don't like to give up
pothibo has quit [Quit: pothibo]
<JonnieCache>
i think if they wanted remote workers they already have freelancers they know and have used before
<Xeago>
Jdubs: not sure if I am competent enough to describe it as a hint, may I give it in code?
<Jdubs>
Xeago: yeah that's fine
<atmosx>
JonnieCache: and out of curiosity, what is the monthly avg salary for a ror dev in UK?
lake has quit [Quit: WeeChat 0.3.7]
gmci has quit [Client Quit]
iamjarvo has quit [Quit: Computer has gone to sleep.]
<Xeago>
you are altering the representation of an answer inside a question
guns has quit [Client Quit]
<Xeago>
there's no need to prefix a number when constructing a question
<Jdubs>
ummm
nedbat has joined #ruby
<Jdubs>
The numbers are so they will know what number to enter
<Xeago>
do that when you ask the user
<Jdubs>
and then the program can reference the number to the answer
gmci has joined #ruby
<Jdubs>
to determine if it is correct
<Xeago>
neither the question nor the answer need to know which answer they are
francisfish has quit [Ping timeout: 265 seconds]
<nedbat>
I'm a ruby newby, trying to edit a rakefile. I have Dir["common/lib/*"].each do |lib| etc, but it's finding regular files as well as subdirectories. I want to only loop over the subdirectories. How can I do that?
<Hanmac>
scx "0a".scan(/([0-9]+)([a-z]*)/)[0] or "0a".match(/([0-9]+)([a-z]*)/)[1..-1]
<scx>
Hanmac: thanks
rafter has joined #ruby
<Xeago>
Jdubs: however, answers always returns @false, @true in that order
<Xeago>
use a .shuffle on them :)
rjsamson has joined #ruby
<Jdubs>
I don't know that command yet
<Jdubs>
How do I use it?
<Xeago>
Array#shuffle
<Xeago>
[1,2,3].shuffle => [3,1,2]
gmci has quit [Quit: Computer has gone to sleep.]
<Xeago>
it shuffles the array, randomly
margle has quit [Quit: Computer has gone to sleep.]
<Xeago>
you can add arrays together: [1,2]+[3,4] = [1,2,3,4]
francisfish has joined #ruby
<Xeago>
([1,2]+[3,4]).shuffle => [2,4,3,1]
Astral has joined #ruby
gmci has joined #ruby
<Jdubs>
ok so return [@false , @true].shuffle ?
Astral is now known as Guest84680
<Xeago>
to answer your earlier issue: you can def correct? (text); @true.contains? text; end
SPYGAME has quit [Read error: Connection reset by peer]
<jrajav>
Xeago: How's the VM coming?
<Xeago>
no, (@false + @true).shuffle
BrianJ has joined #ruby
<Jdubs>
ah i see
<Xeago>
vagrant is harder than I thought
elsifaka has quit [Read error: Connection reset by peer]
<Xeago>
booting it up next this weekend to just see how the vm itself is set up
<Xeago>
and then decide to either leave it running
siyusong has joined #ruby
iamjarvo has joined #ruby
<Xeago>
or do other stuff
elsifaka has joined #ruby
<jrajav>
I still don't understand why it has to be vagrant :P
<jrajav>
Couldn't you just use virtualbox
<Xeago>
vagrant makes managing the box a bit easier
bdnelson has joined #ruby
<Xeago>
which leads me to this question, I'll have to modify the vm with a screen attached (vbox-vnc prolly), right?
siyusong has quit [Client Quit]
<Xeago>
to get my ssh-key in it
<Jdubs>
Xeago: I made the change on the return, am I ready for the next step?
bdnelson has left #ruby [#ruby]
<Xeago>
Jdubs: next step is to parse the file and call question(text,&block) :)
bbttxu has joined #ruby
radic has joined #ruby
bradhe has joined #ruby
<Xeago>
you probably want to do something like this
<jrajav>
Xeago: Uh, well.. you would need a screen attached at some point to start the bot and/or set up stuff, so yeah
heftig has quit [Quit: leaving]
<Xeago>
I mean a gui*
<Muz>
Fortunately, Virtualbox has the vrdp adapter for displays.
<jrajav>
Right, but you need the gui to set up stuff for headless too
<Muz>
Which means you could boot it up on a headless box and from another machine, RDP to the host:port
<Appineer>
Are there any good GUI bindings for Ruby? I've seen GTK-ruby but it seems rather out of date.
qwerxy has quit [Quit: offski]
t4nk310 has joined #ruby
<Xeago>
Muz: I'd prefer the vnc version of that
<Muz>
Appineer: shoes, Qt4. What're you trying ot achieve?
<t4nk310>
Hello
<t4nk310>
where can i find where yard stores documentation?
guns has joined #ruby
<t4nk310>
YARD gem*
<Appineer>
Muz: I've got a collection of dev related scripts that I want to create a graphical interface for, for some of the less tech savvy people on my team to feel more comfortable using.
<Jdubs>
Xeago: will this run the file? "instance_eval(File.read(file))"
<Muz>
Appineer: shoes may be a lightweight-enough solution.
<Xeago>
Jdubs: that I don't know
gmci has quit [Quit: Computer has gone to sleep.]
<Appineer>
Muz: Cool, I will check that out.
centipedefarmer has joined #ruby
Serial_Killer_C has joined #ruby
<Xeago>
Jdubs: look at the docs if you can pass instance_eval a string
sambio has joined #ruby
yshh has quit [Remote host closed the connection]
krz has joined #ruby
gmci has joined #ruby
bdnelson has joined #ruby
KindTwo has joined #ruby
<Jdubs>
hmmm
BadProphet has joined #ruby
<Jdubs>
Xeago: how would you do it?
<Xeago>
probably load(file)
seanyo has quit [Ping timeout: 246 seconds]
t4nk310 has quit [Client Quit]
timonv has quit [Remote host closed the connection]
SCommette has joined #ruby
radic has quit [Read error: Operation timed out]
mpereira has quit [Ping timeout: 260 seconds]
radic has joined #ruby
reisl has quit [Quit: Leaving]
zommi has quit [Quit: Leaving.]
<Jdubs>
ok i think i probably need to read some documentationon file io..i haven't done any, not even in other langauges :/
timonv has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
jamescarr has quit [Quit: Page closed]
hamed_r has joined #ruby
SPYGAME has joined #ruby
rippa has joined #ruby
Serial_Killer_C has joined #ruby
tk__ has quit [Quit: ばいばい]
polymar has quit [Ping timeout: 245 seconds]
Ry_ has quit [Read error: Connection reset by peer]
<butblack>
quick question on the ruby api documentation.. I was reading through Why's book and saw that you can do something like File.open( cool.txt, "w") … I'm now looking at the ruby api and don't see that "w" option… http://ruby-doc.org/core-1.9.3/File.html#method-c-open
dhruvasagar has joined #ruby
_alejandro has joined #ruby
<butblack>
i guess my question is, how do you know which parameters can be passed
<butblack>
jrajav: yeah for sure, imagine going through the source code that often!
<Jdubs>
Xeago: Should I be trying to parse the information and then call question from the parser using an array of texts and array of blocks?
Ry_ has joined #ruby
<jrajav>
butblack: Well, most of posix has nice manpages :)
<butblack>
jrajav: always found it hilarious that they are called manpages
<Xeago>
Jdubs: the file contains method calls
mahmoudimus has quit [Client Quit]
<Xeago>
therefore it can be executed
<jrajav>
butblack: For instance, in this case, 'man 2 open'
baroquebobcat has joined #ruby
<Jdubs>
Xeago, alright i'll try to figure that out
<Xeago>
and hence no parsing by you (but the ruby interpreter)
<Jdubs>
Xeago, just haven't worked with files really lol
<Ry_>
[offtopic, but no idea where to post this.. anyone here online from china?]
jenrzzz has quit [Ping timeout: 260 seconds]
Floydzy has joined #ruby
SPYGAME has quit [Ping timeout: 252 seconds]
zaargy has joined #ruby
<zaargy>
if /home/somebody/src/something/lib is in my $LOAD_PATH then should i be able to resolve Something::One from my spec where one is in in /home/somebody/src/something/lib/one.rb?
<Jdubs>
Xeago: Okay, I'm going to be honest here, I'm having trouble finding anything in the documentation to help me do this...Any suggestions on what methods to read up on?
quest88 has joined #ruby
JonnieCache has quit [Quit: Reconnecting]
JonnieCache has joined #ruby
<Xeago>
just use load()
<Xeago>
and have def qustion at that level
<Hanmac>
zaargy ruby does not have this per default
<Hanmac>
so it does not require one.rb automaticly
<zaargy>
yes i know but i'm using bundler
<zaargy>
and i can see lib is my load path
kn330 has joined #ruby
jenrzzz has joined #ruby
bbttxu has quit [Quit: bbttxu]
<Hanmac>
zaargy did you know that bundler has an extra channel?
<zaargy>
yes...
u89 has joined #ruby
<Hanmac>
because in this channel there are users that never needed bundler
<Jdubs>
Xeago: okay I just added "def run(file); load(file);end" Is that good?
ananthakumaran has joined #ruby
sn0wb1rd_ has joined #ruby
codecaster has quit [Quit: Leaving.]
d3vic3 has quit [Ping timeout: 245 seconds]
<Xeago>
Jdubs: no idea,
Araxia has joined #ruby
elsifaka has quit [Quit: Veloma e!]
Araxia has quit [Client Quit]
d3vic3 has joined #ruby
seanyo has joined #ruby
esya has quit [Quit: esya]
alex__c2022 has joined #ruby
aganov has quit [Remote host closed the connection]
sn0wb1rd has quit [Ping timeout: 276 seconds]
sn0wb1rd_ is now known as sn0wb1rd
erichmenge has quit [Quit: Be back later]
zaargy has left #ruby [#ruby]
iamjarvo has quit [Ping timeout: 268 seconds]
iamjarvo has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
SPYGAME has joined #ruby
jaygen has joined #ruby
starship has joined #ruby
y5wars has joined #ruby
hotovson has quit [Ping timeout: 246 seconds]
apeiros_ has quit [Remote host closed the connection]
atmosx has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
lxsameer has joined #ruby
atmosx has joined #ruby
hotovson has joined #ruby
<Jdubs>
Xeago: Okay I'm experimenting in IRB to try and run the txt file, I can't get it to work
<JonnieCache>
we already have named arguments with the implicit hash arguments
<JonnieCache>
arguments dont get any more named than that
<JonnieCache>
i dont see why people complain
<metrix>
I would like logger to send an E-mail if a fatal error occurs.. is there a plugin out there to do this? Googling hasn't returned much.
fyolnish has quit [Remote host closed the connection]
d3vic3 has quit [Ping timeout: 260 seconds]
zemanel has quit [Quit: Remote hottie closed the connection]
ckrailo has joined #ruby
abbey has joined #ruby
davidcelis has quit [Quit: K-Lined.]
J-_-L has joined #ruby
d3vic3 has joined #ruby
seanyo_ has joined #ruby
<abbey>
hiii
Shamgar has joined #ruby
Morkel has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
seanyo has quit [Ping timeout: 246 seconds]
maletor has joined #ruby
slash_nick has joined #ruby
davidcelis has joined #ruby
<abbey>
how is everyone?
rjsamson has joined #ruby
jprovazn has joined #ruby
hackerdude has joined #ruby
esya has joined #ruby
yshh has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
<Jdubs>
Xeago: I must be really stupid because I replaced my whole .rb file with what you just sent me...and required it from IRB, and STILL getting an error when I try to use the load function
<Jdubs>
Xeago: I'm typing load('questions.txt')
<Jdubs>
and the error is
<Jdubs>
NameError: undefined local variable or method 'questions' for main:Object
<Jdubs>
from (irb):3
abbey has left #ruby [#ruby]
emptyflask has joined #ruby
<Jdubs>
from usr/bin/irb:12:in '<main>'
<matti>
Jdubs: Ig you want to use variables inside this .txt file, they need to be either in current scope (and will not be), or global.
<matti>
Jdubs: Or, you can abuse eval which is always bad.
levabalkin has quit [Read error: Connection reset by peer]
apok has joined #ruby
<matti>
Jdubs: Write proper thing and just require ;]
Cultofmetatron has joined #ruby
levabalkin has joined #ruby
<Jdubs>
Well the whole point is that he is trying to teach me DSL :(
beachandbytes has joined #ruby
Servidorv has quit [Read error: Connection reset by peer]
beachandbytes has quit [Client Quit]
richardjapenga has quit [Quit: Leaving]
BSaboia has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<matti>
With DSL you won't load.
pestouille has joined #ruby
lenovodroid has quit [Remote host closed the connection]
<matti>
A common idion is to read content and instance_eval a block inside.
<Xeago>
Jdubs: as I said before questions => @questions
<Xeago>
yea, but I don't know how to out of the top of my head
<Xeago>
haven't touched io in ages
<Xeago>
I know load just evals the file in the current context
v0n has quit [Read error: Operation timed out]
<Xeago>
which is good enough for what I am trying him to learn
<Xeago>
Jdubs: I paste it inside irb
<Xeago>
and that works okay
<Jdubs>
I can't paste into IRB :/
<Jdubs>
my terminal doesn't let me copy or paste
rasbonics has quit [Quit: rasbonics]
<Jdubs>
so i have to save as RB file and run it
<Xeago>
I can $ irb question.rb
<matti>
Jdubs: LOL
<Xeago>
which runs that and then quits
<matti>
Jdubs: You need to get yourself better terminal emulator ;s
<matti>
Jdubs: Even xterm, which de-facto is older tham me (probably) can do it ;p
<Xeago>
you sure you can't paste?
<Xeago>
some paste on right click
hackerdude has quit [Remote host closed the connection]
<Xeago>
selecting with cursor copy's
<matti>
rxvt can do it.
F1skr has joined #ruby
<Jdubs>
i think i have another terminal emulator
<Jdubs>
let me try that one
<Xeago>
what do you have?
<Jdubs>
can't paste in that one either
<Xeago>
what os are you running?
<Jdubs>
XTerm and UXTerm
<Jdubs>
Lubuntu
<Xeago>
try rightclicking?
<Jdubs>
Just selects everything like a shift click
filipe has quit [Ping timeout: 240 seconds]
juarlex has quit [Remote host closed the connection]
<Xeago>
that sucks..
<Jdubs>
yeah :/
<Xeago>
no edit->paste menu either?
<Jdubs>
nope
<matti>
Hard to belive.
<Jdubs>
what's a better terminal I can download with apt-get?
<matti>
;]
<Xeago>
but irb <file> should run without errors with the last link
<matti>
Jdubs: Terminator
ABK has quit [Read error: Connection reset by peer]
* JonnieCache
just found out you can do #{} in the middle of haml templates
<matti>
;p
haxrbyte has joined #ruby
werdnativ has joined #ruby
<matti>
JonnieCache: >_>
ABK has quit [Read error: Connection reset by peer]
<Jdubs>
hmmm
ABK has joined #ruby
<Xeago>
Jdubs: you can use do and end in irb aswell
jimmy1980 has quit [Ping timeout: 256 seconds]
<Jdubs>
yeah
<Xeago>
try typing the example at line 30-33 in irb
<Xeago>
including the enters
<Xeago>
you give an argument, and pass in a block with do-end
k610 has quit [Ping timeout: 240 seconds]
tommyvyo_ has joined #ruby
gglitch has joined #ruby
andrewhl has joined #ruby
Trioke has joined #ruby
<Jdubs>
line 30-33 of what? my rb file?
alvaro_o has joined #ruby
krzd has quit [Quit: Leaving]
margle has joined #ruby
<Jdubs>
that didn't give me an error
<gglitch>
Hello. I'm trying to use backticks to call rsync from a ruby script, but there are spaces in the path. I've tried all kinds of quotes, double-quotes, etc. Anyone know how to do this?
<apeiros_>
gglitch: a) require 'shellwords' and use that, b) use spawn
mercwithamouth has joined #ruby
<Xeago>
what apeiros_ siad is better
haxrbyte has quit [Ping timeout: 245 seconds]
<gglitch>
Not familiar with those, but I'll look them up. THank you.
<apeiros_>
and with b), use the version of spawn where you pass the arguments individually, which bypasses shell interpolation (and thus doesn't create issues with special chars like spaces)
v0n has joined #ruby
<apeiros_>
spawn is found under Kernel#spawn
<apeiros_>
(ruby 1.9+)
<apeiros_>
shellwords exists for like forever
gmci has joined #ruby
gmci has quit [Max SendQ exceeded]
psycho_one has joined #ruby
arya_ has quit [Read error: Connection reset by peer]
gmci has joined #ruby
gmci is now known as Guest25517
arya_ has joined #ruby
minijupe has quit [Quit: minijupe]
dr_bob has quit [Quit: Leaving.]
<gglitch>
apeiros_: thank you. Being new, I'm sure those will help. Since I'll have to learn them both, which do think I should learn first?
margle has quit [Client Quit]
Banistergalaxy has joined #ruby
<apeiros_>
spawn
<apeiros_>
in my ~8y of ruby, I've used shellwords like 2 times
<apeiros_>
and spawn is very powerful, you should generally not use any other way of subprocess invocation as of 1.9
<apeiros_>
(except maybe fork)
SmoothSage has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<Xeago>
i've seen people use a shell script to receive base64, and then execute that
timonv has quit [Remote host closed the connection]
callenb has joined #ruby
nasso has quit [Ping timeout: 245 seconds]
ABK has joined #ruby
krz has quit [Quit: krz]
banisterfiend has quit [Ping timeout: 245 seconds]
<n_blownapart>
hi I'm a bit confused (beginner to programming) about where/how to set up the "hash_contents" file in this prog to get it to work. and/or if there are other problems. thanks alot: http://pastie.org/5338344
<Xeago>
apeiros_: got some time this weekend, around 2-7pm GMT?
timmow__ has joined #ruby
<apeiros_>
sc2?
<Xeago>
yea
timmow has quit [Read error: Connection reset by peer]
timmow__ is now known as timmow
<apeiros_>
I might
<apeiros_>
my brother might even join
<Xeago>
:O ok!
arya_ has quit [Ping timeout: 244 seconds]
chussenot has quit [Quit: chussenot]
nasso has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
gift has quit [Quit: it puts the packet in the socket or else it gets the close again]
bluenemo has quit [Read error: Connection reset by peer]
ewag has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Ping timeout: 276 seconds]
dpatel has joined #ruby
filipe has quit [Remote host closed the connection]
<n_blownapart>
saints encouraged to answer: hi I'm a bit confused (beginner to programming) about where/how to set up the "hash_contents" file in this prog to get it to work. and/or if there are other problems. thanks alot: http://pastie.org/5338344
timmow_ has quit [Ping timeout: 252 seconds]
aantix has joined #ruby
mityaz has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
ABK has quit [Read error: Connection reset by peer]
<apeiros_>
n_blownapart: doesn't look like you'd have to set it up
<apeiros_>
it'll be created in your current working directory by that code
anderse has quit [Quit: anderse]
rasbonics has quit [Quit: rasbonics]
ABK has joined #ruby
<Jdubs>
Xeago: I think I give up on that assignment...I can't get it to work :( I guess I'll just read that article you suggested
mneorr has quit [Remote host closed the connection]
<n_blownapart>
apeiros_: that's what I thought. thanks ! but then something else is going sour
<Xeago>
okay, fair enough
<Jdubs>
Xeago: then maybe after i can try again, or you can give me a new assignment
andrewhl has quit [Remote host closed the connection]
mneorr has joined #ruby
blazes816 has joined #ruby
davidcelis has joined #ruby
kokainepizza has joined #ruby
<apeiros_>
n_blownapart: I ran the code and the issue is that you monkey-patch a core class
<apeiros_>
YAML itself needs Hash
<apeiros_>
and you override Hash#[]=, which is used by to_yaml too, now you've got an infinite recursion
brendan` has quit [Read error: Connection reset by peer]
<apeiros_>
n_blownapart: also, for future reference, if you encounter an error, you say so when asking for help.
<apeiros_>
and you paste the error alongside the code
brendan` has joined #ruby
ABK has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
ABK has joined #ruby
hadees has quit [Quit: hadees]
<n_blownapart>
apeiros_: thanks, got it on the protocol. hmmm, the book says I will get 'yaml-ized' hashes printed out. the weird thing is that the error message seems like an infinite loop
<apeiros_>
because it is
<lxsameer>
is there any program (except of ruby itself) to check a ruby code syntax and styling ?
<apeiros_>
as said, YAML uses Hash#[]= in order to work
jgrevich_ has joined #ruby
atlantaman has joined #ruby
artOfWar has joined #ruby
jgrevich has quit [Read error: Operation timed out]
jgrevich_ is now known as jgrevich
<n_blownapart>
apeiros_: ok then this code, typed exactly as the book example, is trying to teach me something and should have a normal output. so I don't see the point...
samphippen has joined #ruby
<apeiros_>
n_blownapart: I guess the book example was written back when YAML worked differently and didn't use Hash#[]=, i.e. it'd have worked back then.
<apeiros_>
you could try by installing ruby 1.8.6 or older and see whether it works
<apeiros_>
but yeah, the example teaches you something which you shouldn't do (at least not lightly)
AlbireoX has joined #ruby
atlantaman has quit [Client Quit]
<n_blownapart>
apeiros_: o.k. thanks. the book covers 1.9.1 and so far all the examples have been working
<n_blownapart>
apeiros_: many thanks I can move on !
<apeiros_>
n_blownapart: you could rewrite the example and name the method something else than []=
<apeiros_>
should work just fine then
v0n has quit [Ping timeout: 255 seconds]
Musk has joined #ruby
Musk has left #ruby [#ruby]
<n_blownapart>
apeiros_: thanks will work on it in afternoon
<Jdubs>
what does .ask do?
n_blownapart has quit [Remote host closed the connection]
<Xeago>
ask for input usually
<Jdubs>
so how is it different from gets?
rakm has joined #ruby
rakm has quit [Max SendQ exceeded]
<Xeago>
read the docs
<Xeago>
I don't know sorry
ABK has quit [Read error: Connection reset by peer]
rakm has joined #ruby
siyusong has joined #ruby
ABK has joined #ruby
margle has joined #ruby
<Jdubs>
ok
horofox has quit [Quit: horofox]
ryanlecompte has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
idzuna has joined #ruby
joeycarmello has joined #ruby
xorigin has quit [Quit: leaving]
esya has quit [Quit: esya]
mneorr has quit [Remote host closed the connection]
philcrissman has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
Servidorv has joined #ruby
<Servidorv>
hey guys
slainer68 has quit [Ping timeout: 264 seconds]
<Servidorv>
how are you all??
<Servidorv>
i have a quick question
<Jdubs>
Xeago: Just wanted to say thanks for all your help and patience :)
<Servidorv>
here i have get the max best = hash.max {|a,b| a[1] <=> b[1]} || []
sn0wb1rd has joined #ruby
<Xeago>
no problem!
<Servidorv>
now i want to get the second max
<Servidorv>
is there a way to do so??
<Xeago>
you can remove the item from the hash
<Xeago>
and do max again
<Servidorv>
thanks bro, didn't thought of that
<Servidorv>
thanks
<Jdubs>
hi servidorv o/
<Servidorv>
hi guys
<Servidorv>
:)
<Jdubs>
I'm a ruby newb, but I'll probably be here most every day from now on
<Jdubs>
I have a thirst for learnin that cannot be quenced
<Jdubs>
quenched*
<Jdubs>
XD
h4mz1d has joined #ruby
<Servidorv>
lol, me too
<Jdubs>
anyways, bbiab dinner
<Servidorv>
thats the reason why im here
otters has quit [Ping timeout: 252 seconds]
ij has quit [Read error: Connection reset by peer]
vickaita has joined #ruby
ij has joined #ruby
bradhe has quit [Remote host closed the connection]
FlyingFoX has quit [Ping timeout: 276 seconds]
philcrissman has joined #ruby
und3f has quit [Quit: Leaving.]
ABK has quit [Read error: Connection reset by peer]
jmeeuwen has quit [Ping timeout: 244 seconds]
ABK has joined #ruby
caveat- has quit [Disconnected by services]
caveat- has joined #ruby
otters has joined #ruby
robbyoconnor has quit [Quit: Konversation terminated!]
jmeeuwen has joined #ruby
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
ABK has quit [Read error: Connection reset by peer]
vickaita has quit [Ping timeout: 240 seconds]
ABK has joined #ruby
<Servidorv>
hey guys i have one question
<Servidorv>
how do i use pry on a goliath stage
<Servidorv>
??
clj_newb has quit [Ping timeout: 252 seconds]
hasse has joined #ruby
samphippen has joined #ruby
<blazes816>
servidorv: check out pry-remote or pry-remote-em
<Servidorv>
opk thanks
baphled has joined #ruby
jrajav has quit []
iamjarvo has quit [Ping timeout: 260 seconds]
carloslopes has quit [Remote host closed the connection]
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
wwalker has joined #ruby
ABK has quit [Read error: Connection reset by peer]
zodiak has quit [Read error: Operation timed out]
ABK has joined #ruby
katherinem13 has quit [Ping timeout: 256 seconds]
mikepack has joined #ruby
FlyingFoX has joined #ruby
tbrock_ has joined #ruby
krz has joined #ruby
horofox has joined #ruby
lxsameer has quit [Quit: Leaving]
<wwalker>
vim colorscheme? syntax/ruby.vim exposes 90+ element types, yet most color schemes lump them all into about 7 colors. anyone using a scheme that is dark background and uses more colors (not 90, but maybe 10 to 15 differentiating some more stuff?
ABK has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
ABK has joined #ruby
gglitch has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
SuperrMann has quit [Quit: Computer has gone to sleep.]
zodiak has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
skum has quit [Quit: Leaving...]
ryanlecompte has joined #ruby
Tombar has quit [Remote host closed the connection]
erichmenge has joined #ruby
axl_ has quit [Quit: axl_]
elaptics is now known as elaptics`away
katherinem13 has joined #ruby
arya_ has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
ngoldman has quit [Remote host closed the connection]
theRoUS has quit [Remote host closed the connection]
ddd has quit [Quit: Leaving.]
strangeworks has quit [Read error: Connection reset by peer]
strangeworks has joined #ruby
ngoldman has joined #ruby
strangeworks has quit [Max SendQ exceeded]
bradhe has joined #ruby
strangeworks has joined #ruby
otters has quit [Ping timeout: 252 seconds]
cezar-b has quit [Remote host closed the connection]
strangeworks has quit [Max SendQ exceeded]
Servidorv has quit [Quit: Easy as 3.14159265358979323846...]
strangeworks has joined #ruby
arya has quit [Ping timeout: 244 seconds]
strangeworks has quit [Max SendQ exceeded]
iamjarvo has joined #ruby
c0rn has joined #ruby
strangeworks has joined #ruby
nomenkun has joined #ruby
kn330 has quit [Quit: Ex-Chat]
margle has quit [Quit: Computer has gone to sleep.]
callenb has left #ruby [#ruby]
strangeworks has quit [Max SendQ exceeded]
strangeworks has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
c0rn has quit [Ping timeout: 260 seconds]
ABK has quit [Read error: Connection reset by peer]
vickaita has joined #ruby
ABK has joined #ruby
jj`` has joined #ruby
<jj``>
is there a channel dedicated to ruby-gtk queries ?
<jj``>
i'd like the window to be either old widget content or black (modify_bg color) when switching back to the desktop holding this window, before the expose_event
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
enroxorz-work is now known as baraxorz
<FemaleEngineer>
Hi every1
<baraxorz>
I dont believe you are a FemaleEngineer
<apeiros_>
FemaleEngineer: this is not a C# channel
<Xeago>
line 10 is useless
dmiller has joined #ruby
<baraxorz>
apeiros_: that was 2000 and late bro
baphled has quit [Quit: Lost terminal]
<apeiros_>
baraxorz: ?
Hanmac has quit [Ping timeout: 265 seconds]
arturaz has quit [Remote host closed the connection]
timmow has quit [Ping timeout: 252 seconds]
baphled has joined #ruby
<baraxorz>
apeiros_: the FemaleEngineer and C# thing. I pointed her to where she needed to be a while back. hence 2000 and late. lame joke is lame, but whatever im in a good mood.
seanyo has joined #ruby
v0n has quit [Ping timeout: 268 seconds]
Neomex has joined #ruby
<apeiros_>
baraxorz: I know that you did. but I wasn't here then. I'm here now. And she asked now too. And I reacted to that.
strangeworks has quit [Quit: Leaving]
<minijupe>
anyone know how to list the gems in an rvm gemset?
<baraxorz>
irocksu: did you look into mini_magick?
Virunga has quit [Ping timeout: 256 seconds]
otters has joined #ruby
burgestrand has joined #ruby
ABK has joined #ruby
chrxn has joined #ruby
awestroke has joined #ruby
manizzle has quit [Ping timeout: 248 seconds]
margle has quit [Quit: Computer has gone to sleep.]
<Jdubs>
Apeiros: I think this task is way above my level :(
jenrzzz has joined #ruby
<Xeago>
google for the result of one
<Xeago>
study it
<Xeago>
try the other one
<apeiros_>
Jdubs: start off with this problem then: given an array [1,2,3,4], create an array with each item multiplied by 10
kbeddingfield has joined #ruby
mattsgarrison has joined #ruby
horofox has quit [Quit: horofox]
ABK has quit [Read error: Connection reset by peer]
<apeiros_>
Jdubs: everything goes, i.e. everything is allowed.
mikepack has quit [Remote host closed the connection]
ABK has joined #ruby
Araxia_ has joined #ruby
phantasm66 has joined #ruby
Araxia has quit [Read error: Connection reset by peer]
Araxia_ is now known as Araxia
<apeiros_>
atmosx: you need CGI.escape
TheFuzzball has quit [Ping timeout: 240 seconds]
<Hanmac>
Jdubs: look at Rubys Enumerable module ... you may need it someday
Uranio has quit [Quit: WeeChat 0.3.8]
<atmosx>
url_encoded_string = CGI::escape("'Stop!' said Fred") <--
<atmosx>
thanks apeiros_ :D
ABK has quit [Read error: Connection reset by peer]
<Jdubs>
def arraytimesten( array )
<Jdubs>
newarray ||= []
<Jdubs>
end
<Jdubs>
end
<Jdubs>
array.each do | num |
<Jdubs>
newarray << num*10
<apeiros_>
eeeeeew, don't use :: to invoke methods
<apeiros_>
Jdubs: pastie
<Jdubs>
how's that?
ABK has joined #ruby
ekristen has joined #ruby
mikepack has joined #ruby
<apeiros_>
yes, that's good. don't use ||= there, though
<ekristen>
I'm new to ruby, whats the difference between array['value'] and array[:value] ?
<apeiros_>
just do a straight new_array = []
<apeiros_>
ekristen: 'value'.class # => String
v0n has joined #ruby
<apeiros_>
:value.class # => Symbol
minijupe has quit [Quit: minijupe]
<Jdubs>
What's wrong with ||=? I thought it was always better?
<swarley>
no
<Hanmac>
ekristen and your array is not an array its an Hash
judd7 has joined #ruby
<apeiros_>
ekristen: there's a vast amount of resources on 'ruby string vs. symbol' (google)
<swarley>
||= defines it if it is undefined
<swarley>
unknown_var ||= 1
<swarley>
known_var = 1
<apeiros_>
Jdubs: gist.github.com or pastie.org for future pastes btw. please
ABK has quit [Read error: Connection reset by peer]
<ekristen>
apeiros_: which is better? string or symbol?
<Hanmac>
Jdubs: ||= is only usefull if you need to init an instance_variable inside an method
<Jdubs>
Aperios: ok
mmitchell has joined #ruby
<swarley>
read ||= as 'or equals'
<Hanmac>
ekristen: depends
<swarley>
ekristen; it depends
ABK has joined #ruby
<apeiros_>
ekristen: there are no silver bullets. if one was in all regards better than the other, the other wouldn't exist.
<Jdubs>
Hanmac: Alright thanks
<Jdubs>
Apeiros: is my code okay besides the ||=? What should I do next?
ABK has quit [Read error: Connection reset by peer]
jlwestsr has joined #ruby
ABK has joined #ruby
<apeiros_>
ekristen: I suggest you google the term I gave you. I'll gladly help if you - after reading some of the resources - still have troubles with it
emptyflask has quit [Remote host closed the connection]
Morkel has quit [Read error: Connection reset by peer]
<ekristen>
I'm reading one right now -- thanks
<apeiros_>
Jdubs: use that code to implement Array#map, because that's what you just did ;-)
Morkel has joined #ruby
_bart has quit [Quit: _bart]
<Jdubs>
Apeiros: hmmm :O
tvw has quit [Read error: Connection reset by peer]
krz has quit [Quit: krz]
swarley has quit [Read error: Connection reset by peer]
<Jdubs>
But I thought map uses a block that is provided ?
sebastorama has quit [Quit: Computer has gone to sleep.]
<apeiros_>
Xeago: I prefer ternary for such terse things
krawchyk has joined #ruby
<Xeago>
even multiline ternary?
<JohnTeddy>
If I get rid of the round_to() function I can pass the first 2/3 tests, though on the last test it says: Failures, 1) temperature conversion functions#ftoc converts body temperature, Failure/Error: ftoc(98.6).should == 37, expected 37, got: 36.99999999999999 (using ==)
<JohnTeddy>
So I wrote the round_to part to try to get 36.999999999999 to 36 even, so it would pass the rspec test. I'm not sure if these beginner Ruby tests were written on ruby 1.8* or something... have things changed since that would affect this?
<apeiros_>
Jdubs: taking a look
axl_ has quit [Ping timeout: 260 seconds]
axl__ is now known as axl_
<apeiros_>
Jdubs: yes, getting close. not there yet, though :)
ABK has joined #ruby
Drewch has joined #ruby
<apeiros_>
Jdubs: you don't want to store the result of map2, you want to return it. so don't use an instance variable, a local variable is good. but you have to return it at the end.
<apeiros_>
Jdubs: map yields the array item, not the index (you currently yield the index)
krawchyk_ has quit [Ping timeout: 260 seconds]
<apeiros_>
those are the two only things I think
baphled has quit [Quit: Lost terminal]
<Jdubs>
Apeiros: I still have trouble understanding what variables i'm referencing with the | a, b, c | system
<apeiros_>
Jdubs: they are new variables. they are filled with the value passed by yield
kirun_ has quit [Read error: Operation timed out]
philcrissman has quit [Remote host closed the connection]
<apeiros_>
(`foo { |x| puts x }` and `foo do |x| puts x end` do mostly the same, you can safely ignore the difference between them for now)
pu22l3r has quit [Ping timeout: 252 seconds]
Servidorv has joined #ruby
<Xeago>
apeiros_: what is the difference?
<Xeago>
I thought only their notation was different?
<apeiros_>
Xeago: precedence
<Servidorv>
hey guys
<Servidorv>
back again
<Xeago>
ah ok
tbrock_ has joined #ruby
<apeiros_>
Xeago: foo bar do … end # do/end belongs to foo
<apeiros_>
foo bar { … } # { … } belongs to bar
<Servidorv>
you know im trying to remove a value from a hash since i already have the best.max worst.min, i need to eliminate them from the has, so i can find the second best.max worst.min
dsog has joined #ruby
<Xeago>
foo "bar" { … } aswell?
<apeiros_>
Xeago: yes, which is why you get a syntax error
<Xeago>
well didn't know that
<apeiros_>
since a string not being a method can't accept a block
<Servidorv>
but the problem is that both of my codes return the same best.max
philcrissman has quit [Remote host closed the connection]
<Jdubs>
You know, even though spending all day in this chatroom doing stuff for people has made me feel really stupid, it's also helped me learn a lot lol
Xeago_ has quit [Remote host closed the connection]
<apeiros_>
Jdubs: just clicked it ;-)
<Jdubs>
awesome!
<apeiros_>
Jdubs: you can delete line 4 btw.
kokainepizza has joined #ruby
<burgestrand>
csmrfx: what’s up with all the random strings above the methods? this is not python
TheFuzzball has joined #ruby
<apeiros_>
(the `counter = 0` line)
ABK has quit [Quit: Leaving]
<csmrfx>
burgestrand: those are multiline comments
Goles has quit [Remote host closed the connection]
timonv has joined #ruby
<burgestrand>
csmrfx: no they are not, they are strings
rjsamson has quit [Remote host closed the connection]
<csmrfx>
burgestrand: You dislike them?
<Jdubs>
Apeiros: are you here often? I'm trying to get into a developer academy bootcamp and I want to be as prepared as possible before I get there...So I have about 3 months to train...I don't mind spending 40+ hours a week studying. know anyone that might want to mentor me?
alem0lars has quit [Quit: quit]
ngoldman has quit [Remote host closed the connection]
<csmrfx>
burgestrand: they are comments in the sense that they have no effect on the modules function
hotovson has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 255 seconds]
<burgestrand>
csmrfx: comments in ruby start with either a # or =begin — you use both of those, and string sprinkling.
rjsamson has joined #ruby
<apeiros_>
Jdubs: I used to be here like all the time. but nowadays, that's not a given anymore.
<burgestrand>
csmrfx: you are not consistent.
<burgestrand>
csmrfx: I’m just saying it’s not idiomatic.
<apeiros_>
it's also ugly
<csmrfx>
burgestrand: yep, moving towards ' ' comments cause =begin =end cannot be indented -> ugly
<Jdubs>
Apeiros: My code is ugly?
<apeiros_>
Jdubs: no, that was @ csmrfx
<apeiros_>
Jdubs: sorry :)
<Jdubs>
@apeiros lol!
<apeiros_>
csmrfx: just use # like everybody else
<apeiros_>
any sane editor allows you to block-comment with them
<burgestrand>
csmrfx: ^
<burgestrand>
csmrfx: you already do that within the methods.
<Jdubs>
Apeiros: Do you know anyone who might be willing to mentor me though? or should I just be here every day asking people for assignments?
<reactormonk>
apeiros_, depends on your definition of block-commenting
<apeiros_>
Jdubs: speaking as an op - it's perfectly fine if you just ask for assignments here
Ry_ has quit [Quit: Ry_]
dzhulk has joined #ruby
<Jdubs>
Should I keep everything in a github so people can see what I've worked on?
dzhulk has quit [Client Quit]
cczona has joined #ruby
* csmrfx
makes note
ghanima has quit [Ping timeout: 240 seconds]
<apeiros_>
Jdubs: I think that's a great idea
<Servidorv>
can any one help??? i need to get the second hash.max and the second hash.min
<cczona>
Why is Time.at is giving an unexpected year value, i.e. Time.at 1383181200000 => 45801-04-08 09:00:00 -0700
<apeiros_>
servidorv: your calculate_best_worst gives you back an array of the form [[max_key, max_value], [min_key, min_value]], all you have to do is get min_key and max_key from that
<apeiros_>
and pass that to the delete
<apeiros_>
cczona: what is it supposed to return?
<apeiros_>
cczona: 2013-10-31 02:00:00 +0100 ?
<yxhuvud>
cczona: because you feed it with milliseconds since 1970 instead of seconds.
<apeiros_>
cczona: coming from javascript? :) js uses ms, ruby uses s
<cczona>
coming from json
emmanuelux has quit [Quit: emmanuelux]
<cczona>
Interesting
<apeiros_>
which is *javascript* object notation. so ms
<cczona>
yep
<cczona>
it's coming from an API, so I don't control it. how do I convert?
<apeiros_>
also, json has no representation of dates/times.
havenn has quit [Remote host closed the connection]
Shamgar has quit [Read error: Connection reset by peer]
<apeiros_>
cczona: errrrr, srsly?
<apeiros_>
you really ask how to convert between milliseconds and seconds? o0
<csmrfx>
use the 1000
havenn has joined #ruby
<Servidorv>
thanks apeiros_
<cczona>
"ms" wasn't self-explanatory. now, yep
baphled has quit [Quit: Lost terminal]
<apeiros_>
cczona: then you probably should have asked what I meant by it…
<apeiros_>
though I thought it was evident, given that yxhuvud spelled it out
v0n has quit [Ping timeout: 245 seconds]
<pothibo>
Is it possible to fetch keys matching regex in a hash?
cocainepizza has joined #ruby
<apeiros_>
pothibo: not directly. you have to iterate over the hash.
freakazoid0223 has quit [Ping timeout: 246 seconds]
<pothibo>
I see
<apeiros_>
which defeats its purpose, of course
cczona has quit [Quit: cczona]
<pothibo>
apeiros_: If I was to extend Ruby hash to include the ~= operator to return an array of key matching the regex, is there anything I should be awared of?
sheerun_ has joined #ruby
punkrawkR has joined #ruby
sheerun_ has left #ruby [#ruby]
<apeiros_>
pothibo: well, for starters that it is =~, not ~= :-p
<yxhuvud>
hmm. constructing an index that takes a regexp doesn't seem trivial.
<pothibo>
apeiros_: :)
stephenjudkins has quit [Quit: stephenjudkins]
pestouille has quit [Quit: pestouille]
<apeiros_>
pothibo: naming it =~ is a bad idea
<apeiros_>
=~ is supposed to return true/false
etehtsea has joined #ruby
<pothibo>
apeiros_: You are right
maletor has quit [Quit: Computer has gone to sleep.]
<apeiros_>
or well, should be usable in a boolean context
etehtsea is now known as Guest74625
havenn has quit [Ping timeout: 246 seconds]
<pothibo>
apeiros_: match() could work tho, a bit like String#match
<apeiros_>
pothibo: also, hash.keys.grep(/regex/)
sheerun has quit [Ping timeout: 240 seconds]
<apeiros_>
I don't think it's worth to monkey patch Hash if getting there is so easy
<pothibo>
hmm, good idea
<Jdubs>
Apeiros: Git is a bit confusing lol
kokainepizza has quit [Ping timeout: 256 seconds]
<Jdubs>
Apeiros: Anyways I think I got it setup right
<pothibo>
didn't think of grep. I've been doing JS the whole day
<apeiros_>
Jdubs: heh, yeah, it's not very beginner friendly
<csmrfx>
git is not confusing, but you need to understand it
mneorr has quit [Remote host closed the connection]
Serial_Killer_C has quit [Ping timeout: 246 seconds]
havenn has quit [Ping timeout: 252 seconds]
Serial_Killer_C has joined #ruby
<apeiros_>
try to solve it outside of array. that is - given: `array = [1,-2,-3,4,5]; new_array = []`, how do I fill new_array with all values which are greater than zero?
<apeiros_>
and then, just like you did with map, try to move it into the Array class. call the method `select2`
aetcore has joined #ruby
caleb_io has quit [Quit: caleb_io]
<apeiros_>
Jdubs: also, you can try to replace `self.length.times do | counter |` in your map2 with a variant which uses `each` instead
TheFuzzball has joined #ruby
caleb_io has joined #ruby
kokainepizza has joined #ruby
philcrissman has joined #ruby
kbeddingfield has quit [Remote host closed the connection]
<swarley>
That's still not how select works, select applies the block provided to each element and returns all that it results as a true return. For example [1,2,3,4,5].select {|x| x > 2 } would return [3,4,5]
manizzle has joined #ruby
<swarley>
apeiros_; did you teach him about map?
<swarley>
oh, well nevermind
haxrbyte has quit [Ping timeout: 245 seconds]
<swarley>
i see that was a dumb question now
<apeiros_>
Jdubs: the part `if yield(element) == true then` is good. you can shorten it to just `if yield(element) then`
k610 has joined #ruby
rjsamson has joined #ruby
<apeiros_>
but as swarley already said, the next line is not yet good. `new_array << yield(element)` means you call the block a second time for the value
<apeiros_>
and you append the return value of the block to the result
<apeiros_>
but we do not want the return value of the block in the result. we want the array element.
<Jdubs>
Ahhhh!!!
<Jdubs>
:D
F1skr has quit [Quit: WeeChat 0.3.9]
<Jdubs>
Success!!!
<Jdubs>
I didn't really understand the select function
<Jdubs>
but when you said it that way, i finally understood it
<swarley>
Invokes the block passing in successive elements from self, returning an array containing those elements for which the block returns a true value (equivalent to Enumerable#select).
[Neurotic] has joined #ruby
<apeiros_>
Jdubs: looks good :)
<swarley>
pretty close to what i said. Nifty
<apeiros_>
Jdubs: Enumerable in general has a couple of methods which are fun to implement yourself. Enumerable only uses the `each` method for all of its methods.
awestroke has quit [Remote host closed the connection]
emptyflask has quit [Remote host closed the connection]
<apeiros_>
Jdubs: write a small class `Hero`, it should have the methods hit(damage), health_points and alive?
<swarley>
NuclearL1cifer; t.send(:baz)
<apeiros_>
when you create it, you should pass the name of the hero
minijupe has joined #ruby
<swarley>
wait
<swarley>
sorry, i read that too quickly
<NuclearL1cifer>
swarley, And how can I pass any args to baz method? 't.send(:baz(args))'?
<swarley>
are you sure you dont mean to use include instead of extend?
<apeiros_>
NuclearL1cifer: require 'lib/…' is wrong in and of itself
<apeiros_>
NuclearL1cifer: that lib/fuuuu contains Foo::Bar is wrong in and of itself
Araxia has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
<apeiros_>
NuclearL1cifer: and to actually solve your problem: you want include, not extend
nanderoo has quit [Quit: Leaving.]
<NuclearL1cifer>
hm
<apeiros_>
extend adds a module's methods as class methods
k610 has quit [Ping timeout: 276 seconds]
<NuclearL1cifer>
didn't realize that.. So what's the different between extend and include? When should I use extend and when include?
k610 has joined #ruby
<NuclearL1cifer>
s/different/difference/
daniel_- has quit [Ping timeout: 240 seconds]
dsog has left #ruby [#ruby]
strangeworks has joined #ruby
<apeiros_>
NuclearL1cifer: errr, I just told you?
<apeiros_>
22:21 apeiros_: extend adds a module's methods as class methods
sn0wb1rd has joined #ruby
<NuclearL1cifer>
apeiros_, ah, my bad, sorry.
JSchwag has joined #ruby
icole has quit [Remote host closed the connection]
<Jdubs>
Apeiros_: What should the HP method do?
<JSchwag>
hey guys im having some trouble with 'gem install pg'
<JSchwag>
wondering if anyone can give me a quick hand
sambio has joined #ruby
<apeiros_>
Jdubs: return the current amount of health points the hero has left
icole has joined #ruby
ngoldman has joined #ruby
<apeiros_>
the hit(damage) should reduce the health points by the amount of damage
fantazo has quit [Remote host closed the connection]
c0rn has quit [Quit: Lates.]
<apeiros_>
JSchwag: we don't know whether we can help until you actually said something describing your problem…
<Hanmac>
NuclearL1cifer that also means you could extend an Module into an single Object like o = Object.new; o.extend(Enumerable) and o does have all Enumerable methods, but not the other Objects
<JSchwag>
im doing a 'bundle install' and this PG gem keeps giving me problems. how do i disable it from being installed?
<havenn>
JSchwag: Could you gist the error output?
<stenno\splat>
swarley: can your module also parse ansi-term, or only speak it?
<JustinAiken>
Hey all! I'm looking to integrate rabbitmq queuing between two different apps, and I'm wondering if anyone knows of some really good examples, that move beyond a simple 'how to set it up' and shows how to set it up for fault tolerance?
<apeiros_>
Jdubs: ooh, it should only accept an integer value. take a look at attr_accessor
<swarley>
stenno\splat; i made something else to parse terminal values. Its not in that library
<Jdubs>
Apeiros_ Is the extra functionality not good?
<swarley>
its incorrect
<apeiros_>
Jdubs: small steps ;-)
<Jdubs>
:(
<apeiros_>
also I don't think it works right now
<swarley>
it doesnt
theoros has joined #ruby
<stenno\splat>
swarley: a) is that code working good and b) can i use it? ^^"
<swarley>
Jdubs; are you coming from php?
<stenno\splat>
hehe
<Jdubs>
I did C awhile back, before that (many years) I did html/javascript and MIRC scripts
maxer has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<Jdubs>
Why?
<swarley>
stenno\splat; I can't remember, I'd have to look for it. It just outputs a tree like CodeRay so that it can be transfered to a library i was going to code
<swarley>
Jdubs; @trousers['name' => name, 'ac' => ac] because seeing people do things like that who come from php is common
kbeddingfield has joined #ruby
<stenno\splat>
swarley: fair enough. my attempt to build a grammar tree failed somehow because i got bored soon. used treetop iirc
<Jdubs>
Swarley: what's wrong with hashes?
emptyflask has joined #ruby
<swarley>
No, Im sorry i wasnt clear
<swarley>
I mean, using hashes that havnt been initialized as hashes, or wanting to go multiple levels down in a hash without ever putting a hash in its place
Hanmac has quit [Read error: Connection reset by peer]
_cheney has quit [Ping timeout: 260 seconds]
Hanmac has joined #ruby
<Jdubs>
Apeiros: is there a method to make sure the variable is an integer?
<Jdubs>
like ac.is_i?
<swarley>
i see a lot of foo[1][:ho][:lol][1][:hi] = 2 when they did foo = {} on the line before
_cheney has joined #ruby
<stenno\splat>
that is rather terrible :|
philcrissman has quit [Remote host closed the connection]
<swarley>
yeah, i thing its a php thing.. Not sure though
<apeiros_>
Jdubs: you could test for it, but I wouldn't right now. just assume that the value passed is indeed an integer
siyusong has quit [Quit: Computer has gone to sleep.]
<tUze>
gimme ideas to create an application in ruby related with music. please
gener1c has quit [Ping timeout: 268 seconds]
<apeiros_>
Jdubs: as said, small steps ;-)
<stenno\splat>
quack quack!
<Jdubs>
apeiros what is that thing youa re talking about with attr?
<Jdubs>
do I need that?
theRoUS has quit [Ping timeout: 240 seconds]
<apeiros_>
Jdubs: yes. use attr_accessor for this step.
<swarley>
attr_accessor is a convenience method to do what you're already doing
<swarley>
but faster
<apeiros_>
Jdubs: also ensure (via the initialize method) that all of those properties start with the value 0
<Jdubs>
Ok, I don't really know what to do with it, i need to go read
<burgestrand>
(would’ve suggested writing an audio player, but I know what that’s like and nobody should have to do that but me)
Araxia has quit [Read error: Connection reset by peer]
rellin has quit [Ping timeout: 276 seconds]
Araxia_ has joined #ruby
<swarley>
I hate dealing with audio/video files
kbeddingfield has quit [Ping timeout: 246 seconds]
geekbri has quit [Remote host closed the connection]
<swarley>
tUze; make a command line tool that makes a bass drop starting at a given frequency and make it modulate down and up a random amount of times before stopping
<Jdubs>
Apeiros: do you have a link to a better explanation? that one didn't help any
mneorr has joined #ruby
<apeiros_>
Jdubs: I'd have to google
<Jdubs>
Apeiros: nevermind i didnt see it continued
<apeiros_>
create a directory 'apeiros_rpg', cd into it, then do:
cousine has quit [Read error: Connection reset by peer]
Kudos has joined #ruby
<betz>
so i installed ruby-1.9 and dev, but it always tries to install it with 1.8 "Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/capybara-webkit"
<JustinAiken>
@aperios_ you shold attr_accessor up heatlh_points
thinkdevcode has quit [Remote host closed the connection]
SuperrMann has joined #ruby
carlyle has quit [Remote host closed the connection]
<apeiros_>
you've got skype?
<Jdubs>
error: src refspec master does not match any.
<Jdubs>
error: failed to push some refs to '
<Jdubs>
yeah
<Jdubs>
I can't voice chat atm though
awestroke has joined #ruby
joofsh has quit [Ping timeout: 246 seconds]
<apeiros_>
Jdubs: sent you a private message
<apeiros_>
as long as screen sharing is possible… :)
JustinAiken has left #ruby [#ruby]
stephenjudkins has quit [Ping timeout: 264 seconds]
Araxia has quit [Read error: Connection reset by peer]
<Eiam>
when i have a data structure like x=[[1,2],[3,4]] I can do x.each {|k,v| } and k is 1 and v is 2. but when i try x.each_with_index { |k,v,index| } k becomes [1,2] and v becomes the index..
<Eiam>
what gives?
stephenjudkins_ has joined #ruby
tommyvyo_ has joined #ruby
<apeiros_>
Eiam: your params are value and index, and value is [1,2]
<apeiros_>
in the .each ruby automatically expands (splats) the [1,2] to k,v
<apeiros_>
just like: a,b = [1,2]; # a # => 1
SCommette has quit [Quit: SCommette]
baphled has joined #ruby
baphled has quit [Client Quit]
<apeiros_>
Eiam: you can force it with each_with_index: each_with_index { |(k,v), index|
<Eiam>
apeiros_: okay, so i figured maybe i should try to splat it, like Hash[*x].each_with_index but its an "odd number of arguments"
pestouille has joined #ruby
elaptics`away is now known as elaptics
<Eiam>
apeiros_: okay thats more what i was after. i mean I understood that .each {|k,v| } was sort of 'cheating' by automatically treating my [1,2] as two different items
jlogsdon has quit [Remote host closed the connection]
<Eiam>
but i figured each_with_index would extend the same courtesy =0
esya has joined #ruby
slash_nick has quit [Ping timeout: 246 seconds]
Araxia has joined #ruby
jlogsdon has joined #ruby
sriehl has quit [Remote host closed the connection]
<Eiam>
apeiros_: ill give that a shot, kind of intersting that it would work
<apeiros_>
Eiam: it's not a function of the method, it's a function of rubys syntax
v0n has quit [Ping timeout: 245 seconds]
<apeiros_>
and just like it won't expand `a,b,c = [1,2],3` to 1,2,3, it won't do with here either
<Eiam>
so how does the { |(k,v),index| } part work, its seeing that the input is an array and splatting it into two params for me?
<Eiam>
i don't quite understand the mechanism by which (k,v) is doing something
daniel_- has joined #ruby
<Eiam>
(in the each_with_index example)
<apeiros_>
(k,v),index <- two params, (k,v) and index
ChampS666 has quit []
qwerxy has quit [Quit: offski]
<apeiros_>
now it's k,v = [1,2] again, which it can splat automatically
banseljaj is now known as imami|afk
<Eiam>
ahhh okay, i was thinking souldn't it be |[k,v],index|
<Eiam>
i see now, its saying pass the 'block function for parameters' these two values
<Eiam>
which its going to splat like it does for .each
k610 has quit [Ping timeout: 240 seconds]
<Eiam>
apeiros_: thank you =)
<Eiam>
very helpful (as usual ha)
rjsamson has quit [Remote host closed the connection]
otters has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
stephenjudkins has quit [Ping timeout: 264 seconds]
stephenjudkins has joined #ruby
sertaconay has joined #ruby
swex_ has quit [Remote host closed the connection]
swex has joined #ruby
<reactormonk>
apeiros_, rbenv was the other way to install?
alex__c2022 has quit [Quit: alex__c2022]
swarley has quit [Ping timeout: 260 seconds]
TheFuzzball has joined #ruby
Morkel has quit [Quit: Morkel]
kbeddingfield has joined #ruby
sailias has quit [Quit: Leaving.]
Araxia has quit [Read error: Connection reset by peer]
Araxia_ has joined #ruby
<apeiros_>
reactormonk: what?
<RubyPanther>
Does anybody have an example of a really, really crufty legacy schema that they can release? I am looking for "real world" examples to help me show how to migrate to modern practices, while maintaining backwards compatibility
dmiller has joined #ruby
<reactormonk>
apeiros_, besides rvm
csaunders has quit [Read error: Operation timed out]
kbedding_ has joined #ruby
macabre has quit [Remote host closed the connection]
kbeddingfield has quit [Read error: Connection reset by peer]
strangeworks has quit [Read error: Connection reset by peer]
erichmenge has joined #ruby
<RubyPanther>
I started looking through my old code, and it turns out almost every legacy schema I have is under NDA
tUze has quit [Quit: The computer fell asleep]
<apeiros_>
reactormonk: rbenv only manages versions
<apeiros_>
ruby-build or somesuch was the build tool of choice of rbenv
<apeiros_>
I'm sure they've got a link on rbenv
awestroke has quit [Remote host closed the connection]
nkts has quit [Ping timeout: 260 seconds]
<csmrfx>
Whats a legacy schema?
GoGoGarrett has quit [Remote host closed the connection]
nitti has quit [Remote host closed the connection]
slash_nick has joined #ruby
mpereira has quit [Ping timeout: 260 seconds]
jmeeuwen has quit [Read error: Connection reset by peer]
jmeeuwen has joined #ruby
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
bbttxu has quit [Quit: bbttxu]
alanp has joined #ruby
<RubyPanther>
a legacy schema is one that is ugly, doesn't use modern naming conventions, isn't consistently divided, has PKs of different types, or has at least 3 major warts that would make connecting with a modern ORM inconvenient.
Tuxist has quit [Read error: Connection reset by peer]
<RubyPanther>
if you look at it and think, "ugh, we don't do it that way anymore, yikes" then it is "legacy." ;)
Tombar_ has quit [Remote host closed the connection]
v0n has joined #ruby
medik has joined #ruby
Xeago has joined #ruby
alanp_ has quit [Read error: Operation timed out]
reinaldob has joined #ruby
headius has joined #ruby
<booyakah>
I'm new to Ruby, haven't coded basically anything in 2+ years. I used to do basically web development with html/php/sql etc
<booyakah>
and i want to purchase a book
<booyakah>
i'm having a hard time grasping some concepts of ruby
<booyakah>
like "everything is an object"
<booyakah>
rather, i understand it. but it's hard to convert it into thinking
<booyakah>
i've found this book "Beginning Ruby"
<booyakah>
have anyone read it?
kirun has quit [Quit: Client exiting]
<booyakah>
what i want to know, i know basic programming but not much ruby. Would this help me get better understanding of ruby?
Araxia_ has quit [Read error: No route to host]
Araxia has joined #ruby
chrismcg is now known as zz_chrismcg
fantazo has joined #ruby
Shamgar has quit [Ping timeout: 255 seconds]
Serial_Killer_C has quit [Remote host closed the connection]
<wwalker>
booyakah: or maybe going through the Ruby Koans if you are a hands on learner rather than a reading learner
dmiller has joined #ruby
mneorr has joined #ruby
<wwalker>
Eloquent Ruby is the only book I've actually read, in order, and gotten anything out of. I'm a hands on learner
<booyakah>
wwalker, oh yeah. learning by doing is how i've learned what i know so far.
<booyakah>
but it's nice to have a reference to fall back on
havenn has quit [Ping timeout: 240 seconds]
yakko has quit [Ping timeout: 276 seconds]
<booyakah>
GeekOnCoffee, ruby-bits seems like a nice resource
<GeekOnCoffee>
also +1 for the ruby koans
butblack has quit [Quit: butblack]
Floydzy has joined #ruby
gabrielrotbart has joined #ruby
iamjarvo has joined #ruby
v0n has quit [Remote host closed the connection]
BrianJ has quit [Quit: BrianJ]
<GeekOnCoffee>
booyakah: writing bad code is like many things… the first step is admitting you have a problem ;)
mneorr has quit [Remote host closed the connection]
<booyakah>
GeekOnCoffee, yeah :)
mneorr has joined #ruby
qwerxy has joined #ruby
reinaldob has joined #ruby
<booyakah>
while i'm at it. you might noticed all those sql queries
BSaboia has quit [Read error: Connection reset by peer]
<booyakah>
i just discovered activerecord like 2 weeks ago
L0L0L0L0L has joined #ruby
mneorr has quit [Remote host closed the connection]
<wwalker>
loka: personally I like adding whitespace (blank lines). I'd add a line after lines 5 and 11. Instead of 4,5,6 and 27,28,29, I'd do at 4 : while cid = queue_mutex.synchronize { queue.empty? ? nil : queue.pop(true) }
<booyakah>
and it seems like a better solution for what i'm doing
mneorr has joined #ruby
dmiller has quit [Remote host closed the connection]
c0rn has joined #ruby
SuperrMann has quit [Quit: Computer has gone to sleep.]
<wwalker>
booyakah: AR makes much cleaner code in many cases. But under some circumstances the performance of AR will force you back to raw SQL. I AM recommending AR, just realize when performance is killin g you AR is the likely culprit
nitti has joined #ruby
<loka>
wwalker: okay, whitespace is always good. but why don't you re-paste instead of writing your changes here
<booyakah>
wwalker, thanks. for the moment performance is nothing i have to worry about though
reinaldob has quit [Read error: Connection reset by peer]
reinaldob has joined #ruby
fjfish has joined #ruby
BadProphet has quit [Remote host closed the connection]
francisfish has quit [Ping timeout: 245 seconds]
nari has joined #ruby
otters has quit [Ping timeout: 252 seconds]
moshee has quit [Ping timeout: 255 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<JSchwag>
guy im getting a strange error when i try and migrate_plugins
<JSchwag>
guys*
<JSchwag>
"undefined method `deep_symbolize_keys' for "%s horas registradas ao projeto":String"
<JSchwag>
thats all the info i get
lenovodroid has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
butblack has joined #ruby
banisterfiend has quit [Ping timeout: 246 seconds]
medik has quit [Quit: medik has no reason]
jjang has joined #ruby
stephenjudkins has joined #ruby
apeiros_ has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rburton- has joined #ruby
Xeago has quit [Remote host closed the connection]
minijupe has quit [Quit: minijupe]
siyusong has quit [Quit: Computer has gone to sleep.]
mytec has joined #ruby
LennyLinux has quit [Remote host closed the connection]
enderx86 has quit [Remote host closed the connection]
khakimov has joined #ruby
punkrawkR has quit [Read error: Connection reset by peer]
awestroke has joined #ruby
amacgregor_osx has joined #ruby
<booyakah>
is active record used like hmm.. how should i put it
<booyakah>
like a wrapper for sqlite for instance
lledet has joined #ruby
cousine has joined #ruby
<GeekOnCoffee>
booyakah: yes
<GeekOnCoffee>
basically
<booyakah>
so i need activerecord AND something?
<GeekOnCoffee>
sqlite or mysql or postres
<booyakah>
ok
<GeekOnCoffee>
if you do it right, your code should be interchangeable between them
awestroke has quit [Remote host closed the connection]