jonathanwallace has quit [Ping timeout: 256 seconds]
tealmage has joined #ruby
freerobby has joined #ruby
sambao21 has joined #ruby
AndChat| has joined #ruby
notrin has joined #ruby
timkohrumel has joined #ruby
timkohrumel has left #ruby [#ruby]
arya has quit [Ping timeout: 248 seconds]
_Drewch has quit [Quit: Computer has gone to sleep.]
mklappstuhl has joined #ruby
whowantstolivef1 has quit [Ping timeout: 245 seconds]
tealmage has quit [Ping timeout: 252 seconds]
marr has joined #ruby
intrin has quit [Ping timeout: 245 seconds]
Banistergalaxy has quit [Ping timeout: 256 seconds]
freerobby has quit [Ping timeout: 260 seconds]
kemist has joined #ruby
<jaybe>
lol. working through guides.rubyonrails.org/getting_started and giggling like a schoolgirl. and feeling like an ignorant chump for continuing to deal and haggle with certain other bloated, unfriendly, unhelpful technologies forever. wheeeeeeee!!
caveat- has joined #ruby
yannis has joined #ruby
kemist_ has joined #ruby
r0bglees0n has joined #ruby
DonRichie has quit [Ping timeout: 276 seconds]
DonRichie has joined #ruby
kemist has quit [Quit: kemist]
sambao21 has quit [Quit: Computer has gone to sleep.]
mklappstuhl has quit [Ping timeout: 260 seconds]
caveat- has quit [Read error: Connection reset by peer]
kemist has quit [Remote host closed the connection]
marr has quit [Ping timeout: 252 seconds]
hiroyuki_ has joined #ruby
jdunck has quit [Client Quit]
arya has joined #ruby
vlad_starkov has quit [Ping timeout: 255 seconds]
hiroyuki has quit [Ping timeout: 256 seconds]
kemist has joined #ruby
Spooner has quit [Remote host closed the connection]
feedbackloop has joined #ruby
chipotle_ has joined #ruby
m8 has quit [Quit: Sto andando via]
ab3 has joined #ruby
c0rn has joined #ruby
kemist has quit [Remote host closed the connection]
josedonizetti has quit [Quit: josedonizetti]
floo has left #ruby [#ruby]
bonhoeffer has quit [Quit: bonhoeffer]
freerobby has joined #ruby
mklappstuhl has joined #ruby
atyz has quit [Quit: Leaving...]
xardas has quit [Ping timeout: 268 seconds]
rickmasta has joined #ruby
Banistergalaxy has joined #ruby
AndChat| has quit [Read error: Connection reset by peer]
freerobby has quit [Ping timeout: 276 seconds]
patronus has joined #ruby
kofno has joined #ruby
kemist has joined #ruby
arya has quit [Ping timeout: 268 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Remote host closed the connection]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
eka has joined #ruby
<unstable>
I have a question that's not about ruby. Though it's very low volume right now so I don't think people will mind. I'm using the yelp/google maps api in some project I'm making for fun. The yelp api gives me these business images that are 100x100 pixels. They're often poor quality and very low resolution. On their website for the same business they have nice user generated content graphics that are high resolutions/pretty.
<unstable>
If I use nokogiri and just scrape the nice images to be used in my app.. is that generally a no no? to hot link to a graphic say. Or is it likely it will work fine.. and no one will care/notice.
mercwithamouth has joined #ruby
wesside has quit [Quit: I think I heard an ice cream truck..]
<unstable>
I wouldn't be surprised if it's against some terms of service somewhere. Though if it works.. I don't care that much. I have a working api key with yelp.
kemist has quit [Remote host closed the connection]
jdunck has joined #ruby
moted has quit [Quit: moted]
rton has left #ruby [#ruby]
Hanmac1 has joined #ruby
kemist has joined #ruby
enthrops has joined #ruby
luckyruby has quit [Remote host closed the connection]
rickmasta has quit [Quit: Leaving...]
arya has joined #ruby
slainer68 has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
felipillo has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
Hanmac has quit [Ping timeout: 260 seconds]
luckyruby has joined #ruby
rickmasta has joined #ruby
TMM has quit [Quit: Bye]
TMM has joined #ruby
TMM has quit [Changing host]
TMM has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
atno has quit [Ping timeout: 260 seconds]
splittingred has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
arya_ has joined #ruby
nari_ has joined #ruby
atno has joined #ruby
mixel has quit [Quit: mixel]
arya has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
alexgordon has joined #ruby
newTech has joined #ruby
atyz has joined #ruby
nateberkopec has joined #ruby
Banistergalaxy has joined #ruby
bonhoeffer has joined #ruby
DonRichie has quit [Quit: Verlassend]
enthrops has quit [Quit: enthrops]
freerobby has quit [Ping timeout: 276 seconds]
AndChat| has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has quit [Ping timeout: 255 seconds]
mercwithamouth has joined #ruby
thomasl__ has joined #ruby
emergion has joined #ruby
Banistergalaxy has joined #ruby
perun0 has quit [Quit: Leaving]
thomasl__ has quit [Remote host closed the connection]
atyz has quit [Ping timeout: 264 seconds]
Hanmac has joined #ruby
ZachBeta has quit [Read error: Connection reset by peer]
tjbiddle has quit [Quit: tjbiddle]
AndChat| has quit [Ping timeout: 255 seconds]
ZachBeta has joined #ruby
slainer68 has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 256 seconds]
tvw has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby
slainer68 has joined #ruby
idkazuma has quit [Remote host closed the connection]
sepp2k1 has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 260 seconds]
jamesfung14 has quit [Ping timeout: 245 seconds]
hiroyuki_ has quit [Read error: Connection reset by peer]
brianherman has quit [Read error: Connection reset by peer]
volte has quit [Ping timeout: 245 seconds]
falood has joined #ruby
mmitchell has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
GeissT has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
arya_ has joined #ruby
TDJACR has quit [Quit: Network Failure]
tommyvyo has quit [Quit:]
mmitchell has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 264 seconds]
rushed has quit [Quit: rushed]
eboaz has quit [Quit: ircII EPIC5-1.1.2 -- Are we there yet?]
akashj87_ has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
wesside has joined #ruby
baroquebobcat has joined #ruby
arya has quit [Ping timeout: 256 seconds]
akashj87 has quit [Ping timeout: 256 seconds]
volte has joined #ruby
DouweM has quit [Quit: Leaving...]
dhruvasagar has joined #ruby
Hanmac1 has joined #ruby
idkazuma has joined #ruby
huoxito has joined #ruby
bubblehead has joined #ruby
baroquebobcat has quit [Client Quit]
jduan1981 has quit [Read error: Connection reset by peer]
Hanmac has quit [Ping timeout: 245 seconds]
jduan1981 has joined #ruby
pzula has joined #ruby
idkazuma has quit [Remote host closed the connection]
s2013 has joined #ruby
poga has joined #ruby
dhruvasagar has quit [Ping timeout: 268 seconds]
reppardw has joined #ruby
<reppardw>
hello people
reppardw has quit [Client Quit]
bonhoeffer has quit [Quit: bonhoeffer]
LineByLine has joined #ruby
wedgex has joined #ruby
kofno has quit [Remote host closed the connection]
krainboltgreene has joined #ruby
<pzula>
hello hello
kofno has joined #ruby
<pzula>
what's a good book for beginning ruby?
<sam113101>
The Well-Grounded Rubyist
wedgex has quit [Remote host closed the connection]
<pzula>
sam113101: and it is still a relevant start?
<pzula>
(not outdated)?
dhruvasagar has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
arya_ has quit [Ping timeout: 256 seconds]
failshell has joined #ruby
arya has joined #ruby
Leighton has quit [Quit: Leaving]
mikestok has joined #ruby
zackiv31 has quit [Remote host closed the connection]
c0rn has joined #ruby
failshell has quit [Remote host closed the connection]
c0rn has quit [Client Quit]
krainboltgreene has quit [Ping timeout: 256 seconds]
mikestok has quit [Quit: Computer has gone to sleep.]
wedgex has quit [Remote host closed the connection]
sam113101 has quit [Quit: WeeChat 0.4.0]
ab3 has quit [Ping timeout: 246 seconds]
toquonce has quit [Read error: Operation timed out]
atyz has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
emergion has joined #ruby
ZachBeta has quit [Read error: Connection reset by peer]
slainer68 has quit [Read error: Connection reset by peer]
freewizard has quit [Ping timeout: 248 seconds]
slainer68 has joined #ruby
Faris9 has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
freerobby has joined #ruby
ZachBeta has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
rushed has joined #ruby
sam113101 has joined #ruby
cyberarm has quit [Quit: Bye]
pzula has quit [Remote host closed the connection]
mr0wl has quit [Quit: leaving]
josedonizetti has joined #ruby
freewizard has joined #ruby
Empty_One has joined #ruby
arya has quit [Ping timeout: 268 seconds]
Z_Mass has joined #ruby
pilgo has quit [Quit: pilgo]
Hanmac has joined #ruby
jduan1981 has quit [Quit: jduan1981]
rickmasta has quit [Quit: Leaving...]
slainer68 has quit [Remote host closed the connection]
arya has joined #ruby
Hanmac1 has quit [Ping timeout: 276 seconds]
hornairs has joined #ruby
<hornairs>
good evening felloy Ruby enthusiasts!
<hornairs>
does anyone know if there is a way to ask Pysch in 2.0.0 to deal with unknown tags without raising?
pilgo has joined #ruby
danieldax has joined #ruby
<hornairs>
there used to be a thing called Syck::Object which Syck used to use to wrap unkown classes and still return something useful, but Pysch just barfs
emmanuelux has quit [Ping timeout: 246 seconds]
freewizard has quit [Read error: No route to host]
freewiza_ has joined #ruby
arya has quit [Ping timeout: 276 seconds]
newTech has quit [Quit: newTech]
freewiza_ has quit [Read error: Connection reset by peer]
jonathanwallace has joined #ruby
threesome has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
Banistergalaxy has joined #ruby
freewizard has joined #ruby
freerobby has quit [Quit: Leaving.]
newTech has joined #ruby
arya has joined #ruby
krainboltgreene has quit [Quit: krainboltgreene]
jovy88 has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
jovy88 has joined #ruby
subbyyy has quit [Read error: Connection reset by peer]
AndChat| has joined #ruby
subbyyy has joined #ruby
mmitchell has quit [Read error: No route to host]
mmitchel_ has joined #ruby
DementedInsanity has quit [Ping timeout: 264 seconds]
emmanuelux has joined #ruby
tylersmith has quit [Remote host closed the connection]
mklappstuhl has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 252 seconds]
radic has quit [Disconnected by services]
radic_ has joined #ruby
arubin has joined #ruby
AndChat| has quit [Ping timeout: 252 seconds]
yshh_ has quit [Remote host closed the connection]
emmanuelux has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 260 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
felipillo has joined #ruby
Banistergalaxy has joined #ruby
mockra has quit [Remote host closed the connection]
<MrZYX>
because you're inside an object already, try running p self, self.class, and method definitions don't inherit the local variables from the parent context
<MrZYX>
consider using a new class or passing it in as a parameter though
<survili>
MrZYX, I still don't get it, p self inside main method writes "main" and outside it gives error that self is nil. why self is nil outside of the method, and how come inside method it has self ?
tylersmith has quit [Ping timeout: 255 seconds]
<MrZYX>
hm it is?
mneorr has joined #ruby
<MrZYX>
what ruby version are you on?
<shevy>
passerine I dunno, the documentation and the API is so annoying :(
rakl has quit [Quit: sleeping]
subbyyy has quit [Ping timeout: 268 seconds]
<shevy>
I am starting to wonder why the documentation in ruby sucks so much
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
<shevy>
my new theory is that a complex language leads to complex APIs
bjensen has quit [Quit: bjensen]
<tobiasvl>
survili: self is nil outside the method because there's no class/object wrapped around the method
<tobiasvl>
what would you expect self to be there??
<tobiasvl>
survili: and self is 'main' inside the method because that's what the method is called ...
spider-mario has joined #ruby
<tobiasvl>
remember, in ruby, methods are objects too
eval-in has quit [Remote host closed the connection]
Criztian has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
passerine has left #ruby [#ruby]
TH34D has quit [Ping timeout: 256 seconds]
jbpros has joined #ruby
tealmage has joined #ruby
jbpros has quit [Client Quit]
LennyLinux has joined #ruby
Myk267 has left #ruby [#ruby]
infecto has quit [Ping timeout: 252 seconds]
infecto has joined #ruby
monkegjinni has joined #ruby
vlad_starkov has joined #ruby
tealmage has quit [Ping timeout: 264 seconds]
marr has joined #ruby
joesavage has joined #ruby
bluOxigen has joined #ruby
poga has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
blueOxigen has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Ping timeout: 246 seconds]
<joesavage>
I need to write some raw binary data into a file via Ruby, but after some research I'm still really none the wiser how to do this. Does anyone have any suggestions on converting integers like '256' into a binary representation and then writing this raw data into a file?
<joesavage>
I'm creating a basic flat file datastore and want to do this as efficiently as possible, so essentially I have a whole bunch of numbers which I want to be writing as bytes to the file (much more efficient than writing the string "256" to the file or whatever)
hiyakashi has joined #ruby
ZachBeta_ has joined #ruby
<charliesome>
joesavage: Array#pack
<charliesome>
>> ["256".to_i].pack("L<")
bluOxigen has quit [Ping timeout: 246 seconds]
<charliesome>
wtf where is that bot
<joesavage>
charliesome: I had a brief look at 'pack', but dismissed it as it was an array method which seemed inappropriate -- I'll take a further look at it now
yshh has quit [Remote host closed the connection]
eval-in has joined #ruby
yshh has joined #ruby
radic_ has quit [Ping timeout: 255 seconds]
ZachBeta has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
blueOxigen has joined #ruby
radic has joined #ruby
<charliesome>
joesavage: basically the L means unsigned 32 bit integer
<charliesome>
joesavage: the < means little endian
<charliesome>
freenode must be having network problems
s0ber_ has joined #ruby
lethan has joined #ruby
browndawg has quit [Ping timeout: 252 seconds]
greenarrow has quit [Ping timeout: 255 seconds]
greenarrow has joined #ruby
17SACWMLN has joined #ruby
17SACWMLN has quit [Remote host closed the connection]
<LennyLinux>
It's Sunday
hamed_r has quit [Quit: Leaving]
<joesavage>
charliesome: This seems like it's a great solution here, thanks! Is there any easy way to output that raw data after the 'pack' to check it's actually the value I was expecting? (puts isn't doing the job so great..)
staafl has quit [Read error: Connection reset by peer]
sayan has joined #ruby
<charliesome>
joesavage: you can call #inspect on the string
s0ber has quit [Ping timeout: 260 seconds]
<charliesome>
joesavage: or use 'p str' which is basically 'puts str.inspect'
s0ber_ is now known as s0ber
staafl has joined #ruby
airtonix has quit [Ping timeout: 260 seconds]
tyl_ has joined #ruby
m8 has quit [Changing host]
m8 has joined #ruby
airtonix has joined #ruby
threesome has joined #ruby
roryhughes has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<roryhughes>
hey
ckrailo has quit [Quit: Computer has gone to sleep.]
HecAtic has quit [Quit: Àá¼ö]
devyn is now known as oh
marr has quit [Ping timeout: 252 seconds]
<joesavage>
charliesome: You're a lifesaver, it worked a treat -- thanks!
<charliesome>
joesavage: np
marr has joined #ruby
pkh has joined #ruby
LineByLine has joined #ruby
atyz has quit [Quit: Leaving...]
sayan has quit [Read error: Connection reset by peer]
felixjet has quit [Read error: Connection reset by peer]
jovy88 has quit [Read error: Connection reset by peer]
<Spooner>
Khazix, No, be because in Ruby 0 is NOT false.
<Spooner>
It is an idiom from Python/Perl/etc, not Ruby.
<Khazix>
Oh, right.
<waxjar>
be careful with not, or and and instead of !, || and && khazix, they work differently
<Spooner>
Khazix, Only false and nil are "falsy" in Ruby. Everything else is "truthy".
motto has joined #ruby
<Khazix>
Thanks! waxjar, will google that, thanks too.
Palantir has quit [Ping timeout: 256 seconds]
<Spooner>
waxjar, You could argue it either way (be careful of !||&&; they operate differently than and/or/not ;P).
bluOxigen has quit [Ping timeout: 255 seconds]
<waxjar>
true, depends a bit on where you come from
<MrZYX>
Spooner: though most people expect the behavior of && and not the one of and
<MrZYX>
etc
sivoais has quit [Ping timeout: 245 seconds]
<Spooner>
I know people expect them to be the same, but usually the argument from that is to only use the symbols, not the words, which is believe is not entirely logical.
rton has left #ruby [#ruby]
tealmage has joined #ruby
m8 has quit [Ping timeout: 264 seconds]
<waxjar>
i guess it's mostly a readability thing
sivoais has joined #ruby
<Spooner>
I feel, to some extent, that words are more Rubyish, since they allow you to use methods without parentheses ('if fish :paste and fish :pie' rather than 'if fish(:paste) && fish(:pie)')
survili has quit [Quit: Leaving]
<Spooner>
But still, it is a true Ruby horror that they operate differently just for the sake of it ;)
<MrZYX>
lets conduct an experiment: Khazix what do you think a = true; b = false; ([false, nil].include? a and b) returns?
<waxjar>
that's one of the few situations i use them, to make a 2 line method a readable one-liner :P
Proshot has joined #ruby
vlad_starkov has joined #ruby
<Khazix>
MrZYX, false
<Khazix>
?
<MrZYX>
yeah, right. can you explain why?
<Khazix>
order of precedence?
tealmage has quit [Ping timeout: 252 seconds]
<MrZYX>
so you know the difference between and and && already, thx anyway
arietis has joined #ruby
<Khazix>
oh, that's the only difference?
<MrZYX>
yup
<MrZYX>
[false, nil].include? a && b would return true
<Spooner>
Yeah, [false, nil].include?(a && b) vs [false, nil].include?(a) and b (being how they are parsed)
Spooner has quit [Remote host closed the connection]
cofin has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
freeayu__ has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
iPhoneMRZ has joined #ruby
sivoais has quit [Ping timeout: 268 seconds]
iPhoneMRZ has quit [Client Quit]
breakingthings has quit [Quit: breakingthings]
sivoais has joined #ruby
freeayu has quit [Ping timeout: 260 seconds]
whowantstolivef1 has joined #ruby
aaronmcadam has quit [Quit: Leaving...]
hamed_r has joined #ruby
niklasb has joined #ruby
freeayu__ has quit [Ping timeout: 252 seconds]
kofno has joined #ruby
freeayu has joined #ruby
Liothen has quit [Remote host closed the connection]
arietis has quit [Quit: Computer has gone to sleep.]
mixel has joined #ruby
codecop has quit [Remote host closed the connection]
sivoais has quit [Ping timeout: 252 seconds]
codecop has joined #ruby
roryhughes has quit [Quit: roryhughes]
kofno has quit [Remote host closed the connection]
jovy88 has quit [Read error: Connection reset by peer]
mmitchell has quit [Remote host closed the connection]
jovy88 has joined #ruby
blueOxigen has quit [Ping timeout: 264 seconds]
feedbackloop has joined #ruby
<Kurion>
Hi can someone help me, pastebin.com/eAd2shqs
<Kurion>
For some odd reason I'm getting an error saying I cannot use this 'private' method
<Kurion>
However the code is exactly how it's typed in the book
lethan has joined #ruby
rton has joined #ruby
pcarrier has joined #ruby
nari_ has joined #ruby
mmitchell has joined #ruby
sivoais has quit [Ping timeout: 252 seconds]
saward has joined #ruby
iMadper has joined #ruby
dzied has joined #ruby
<Mon_Ouie>
Can you paste the exact error?
feedbackloop has quit [Ping timeout: 264 seconds]
<saward>
Hi. I'm experiencing a wierdness with a set which contains a hash. I do myset.each do |obj| (where obj is a hash), then obj["some_key"] += 1, then anotherset.add obj. Then, when I loop over anotherset, the hash that's in it does not match the has in myset
<saward>
Why would these hashes be different?
<Kurion>
Yes, pastebin.com/nghbee6x
<Mon_Ouie>
saward: Modifying objects that are in a set doesn't work well
<Mon_Ouie>
Because it changes their hash value
<Mon_Ouie>
(Similarly modifying the keys of a hash doesn't work)
sivoais has joined #ruby
<saward>
Something in the back of my mind tells me I've read something about this before, but I don't remember...
<Mon_Ouie>
saward: Do you know how a hash table works?
<saward>
Mon_Ouie, only *very* crudely, so no, not really
arietis has joined #ruby
atyz has quit [Quit: Leaving...]
Guest85414 has joined #ruby
rubycode has joined #ruby
<Mon_Ouie>
Keys are mapped to integers using a hashing function (the #hash method in Ruby). That gives you, basically, an index in an array to access the key without having to look at all the others.
<Mon_Ouie>
So if the key object is mutated, its hash will be changed but it is still stored at the same place in the array (the same bucket)
sandGorgon has quit [Ping timeout: 245 seconds]
mmitchell has quit [Remote host closed the connection]
<saward>
Ok thanks, I'll give something else a try, and look more into that too
<Mon_Ouie>
Kurion: I tried your code and it does work. There must be something else.
<Kurion>
That's odd...
<Mon_Ouie>
(the line numbers don't match in your error, so it looks like there's something above)
vlad_starkov has joined #ruby
<Kurion>
Oh I didn't print the whole code, let me do that
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
Neomex has joined #ruby
Neomex has quit [Client Quit]
<Kurion>
pastebin.com/kRur9mYj
casheew has quit [Read error: Connection reset by peer]
mixel has quit [Quit: mixel]
arietis has quit [Quit: Computer has gone to sleep.]
<Kurion>
Hm now it's giving me a syntax error
<Mon_Ouie>
Still fine. What ruby version are you running?
sivoais has quit [Ping timeout: 264 seconds]
<Kurion>
Hmm, I'm not too sure, I used sudo apt-get install ruby
<saward>
Mon_Ouie, thanks again for your help. I need to head off
<Mon_Ouie>
Type ruby -v to see it
saward has quit [Quit: Leaving]
<Kurion>
1.9.3p194
<Mon_Ouie>
That sounds like it should be fine.
<Mon_Ouie>
(The syntax error probably has to do with the '~'s at the end.
casheew has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
sivoais has joined #ruby
<Kurion>
Hmm one moment, I need to fix the code I have. copy and paste has kind of messed with it.
mikestok has joined #ruby
<Kurion>
It works!
<Kurion>
That's odd I wonder what was up with that.
<Kurion>
Heh, thanks for testing it out for me. TBQH if I hadn't known it should've worked I would've been chasing a wild logical error that didnt exist.
<Kurion>
Most likely a syntax error
cha1tanya has quit [Ping timeout: 276 seconds]
airtonix_ has joined #ruby
whowantstolivef2 has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
whowantstolivef1 has quit [Ping timeout: 245 seconds]
airtonix has quit [Ping timeout: 256 seconds]
mklappstuhl has joined #ruby
Khazix has quit [Ping timeout: 252 seconds]
sivoais has quit [Ping timeout: 245 seconds]
sivoais has joined #ruby
ZachBeta_ has quit [Read error: Connection reset by peer]
TheFuzzball has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
bonhoeffer has joined #ruby
tomzx_mac has joined #ruby
cofin has quit [Quit: cofin]
rickruby has joined #ruby
<bijumon>
hi, I have posts nested inside sites, sites -> posts, instead of doing Sites.find_each, I want or query recently updates 'n' posts from All sites, can u help?
kofno has joined #ruby
<MrZYX>
bijumon: -> #RubyOnRails
<bijumon>
MrZYX: mhm, I keep asking q there, so far they've been soo helpful :(
t_p has joined #ruby
t_p has quit [Client Quit]
mklappstuhl has quit [Remote host closed the connection]
sambao21 has joined #ruby
mneorr has quit [Remote host closed the connection]
<bijumon>
MrZYX: do u got any clue about this m8? :)
<MrZYX>
I'm not sure I understand the question
<MrZYX>
Post.order('updated_at DESC').limit(n) ?
sepp2k has joined #ruby
sayan has quit [Ping timeout: 245 seconds]
<apeiros>
bijumon: cross posting without stating that you cross-post is rude.
sivoais has quit [Ping timeout: 264 seconds]
iMadper has quit [Remote host closed the connection]
<shevy>
ack, ruby on rails infiltration!
<shevy>
raise the shields!
<shevy>
pew pew pew laser counter attack!
<bijumon>
MrZYX: i dont have resources :posts
<MrZYX>
:P
<shevy>
we are the ruby borg
phacele55 has joined #ruby
<MrZYX>
bijumon: you're confusing routes with models
<shevy>
your syntactic differences will be assimilated
<bijumon>
shevy: thou shall love thy frameworks
<shevy>
bijumon not rails, no
kristofers has joined #ruby
<shevy>
it's like its own language
<shevy>
rails 5.0
sivoais has joined #ruby
<bijumon>
mediko: yea but if i put resources :posts in routes, users can access /posts/post-name right? i dont want that
Astral_ has quit [Ping timeout: 246 seconds]
<bijumon>
damn that prev tell was to MrZYX
nari_ has quit [Ping timeout: 264 seconds]
Hanmac1 has joined #ruby
<MrZYX>
if you don't want that then don't do it
guardian has joined #ruby
<bijumon>
MrZYX: so I can do Post.order from inside sites#index?
<MrZYX>
sure thing
<MrZYX>
I'd suggest you invest the $20 and do the basic courses at codeschool, you got some fundamental misconceptions there
<guardian>
hello, is there a oneliner that would split an array in two equal parts? something like lhs, rhs = <split array in two halves>
casheew has quit [Read error: Connection reset by peer]
rdark has quit [Ping timeout: 256 seconds]
sivoais has quit [Ping timeout: 256 seconds]
io_syl has joined #ruby
atyz has quit [Ping timeout: 246 seconds]
khismetix has joined #ruby
sumark has quit [Remote host closed the connection]
whowantstolivef1 has quit [Ping timeout: 252 seconds]
sivoais has joined #ruby
tealmage has quit [Ping timeout: 276 seconds]
roadt has quit [Ping timeout: 276 seconds]
sumark has joined #ruby
casheew has joined #ruby
DaniG2k has joined #ruby
LennyLinux has quit [Remote host closed the connection]
bonhoeffer has quit [Quit: bonhoeffer]
cha1tanya has quit [Ping timeout: 245 seconds]
<DaniG2k>
guys I'm wondering why is it that if I do require 'myfile' I'm being told that LoadError: cannot load such file
<apeiros>
DaniG2k: because no file named 'myfile.rb' was in any of the directories listed in $LOAD_PATH
casheew has quit [Read error: Connection reset by peer]
<apeiros>
note that '.' (current working dir) is NOT in $LOAD_PATH
guardian has left #ruby [#ruby]
<DaniG2k>
i'm doing it from irb
<apeiros>
same
<DaniG2k>
and I've cd'ed into the proper directory
<DaniG2k>
it doesnt seem to be loading the file from the directory I'm in
<shevy>
DaniG2k put '.' $LOAD_PATH into your irbrc
<DaniG2k>
is there something equivalent to Python's import that just imports a file even from the current directory?
<apeiros>
DaniG2k: again: 15:31 apeiros: note that '.' (current working dir) is NOT in $LOAD_PATH
LennyLinux has joined #ruby
LennyLinux has quit [Read error: Connection reset by peer]
bonhoeffer has joined #ruby
<apeiros>
irb -I.
<apeiros>
or within irb: $LOAD_PATH << File.expand_path('.')
LennyLinux has joined #ruby
<apeiros>
both will add . to $LOAD_PATH.
<DaniG2k>
ah ok
<DaniG2k>
that worked, thanks
mmitchell has quit [Ping timeout: 245 seconds]
casheew has joined #ruby
banisterfiend has quit [Remote host closed the connection]
Astralum has joined #ruby
MrZYX has quit [Ping timeout: 256 seconds]
roadt has joined #ruby
sivoais has quit [Ping timeout: 256 seconds]
iambic has joined #ruby
iambic has quit [Client Quit]
DaniG2k has quit [Quit: Leaving]
banisterfiend has joined #ruby
sivoais has joined #ruby
jetblack has joined #ruby
MrZYX has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<MrZYX>
or use require_relative
<apeiros>
ew
<apeiros>
for one-offs, ok. otherwise: ew.
<MrZYX>
do you have a write up why require_relative is bad?
<MrZYX>
never saw one
<apeiros>
it's simple: knowledge of what is where does not belong into a library.
<apeiros>
application and framework level: ok
<apeiros>
library level: not ok
<MrZYX>
but how is it different from to adding . to $LOAD_PATH?
cha1tanya has joined #ruby
<apeiros>
if you add . in your library to load path? nothing. then you're doing it the same wrong.
<apeiros>
your application (or framework) should set up the load path. from then on, your requires should just work.
phacele55 has quit [Changing host]
phacele55 has joined #ruby
arya has joined #ruby
<MrZYX>
mkay
<apeiros>
in most cases, rubygems will already set up the load path
<apeiros>
the biggest off-case is "I develop a gem"
<MrZYX>
I don't think we should assume by default that people are writing libs here
<apeiros>
i.e., the gem is not installed and thus rubygems will not have its lib dir in load path
<MrZYX>
yeah, to solve that I use bundler :P
mklappstuhl has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
<apeiros>
yes, we should. in every application, application level code is the total minority
davetherat has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
davetherat has joined #ruby
<apeiros>
in a well done application, it should be something below 10-20 lines.
sayan has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
arya_ has joined #ruby
<MrZYX>
hm, I'll still prefer require_relative over adding . to the $LOAD_PATH though, global modification vs local, isolated one
<apeiros>
i.e., a good application will look something like `#!/usr/bin/env ruby; require 'myapp/cli`; MyApp::CLI.run(ARGV)`
<shevy>
death to require_relative!
tos9_ is now known as tos9
tos9 has quit [Changing host]
tos9 has joined #ruby
<shevy>
imagine if python would have
<shevy>
import_this
<apeiros>
MrZYX: fallacy IMO
arya has quit [Ping timeout: 248 seconds]
<apeiros>
it's not a modification. it's an env setup. ruby does part of it. your app the rest. if the load path is part of it, so be it.
sivoais has quit [Ping timeout: 252 seconds]
<apeiros>
(loading a library is a "global modification" too - you add constants, classes etc.)
sayan has quit [Max SendQ exceeded]
sayan has joined #ruby
<MrZYX>
okay, bad example, but still widely used: rails generates things like require File.expand_path('../boot', __FILE__) which is essentially reinventing require_relative's implementation
<apeiros>
correct. and rails is a bad role model there.
<apeiros>
actually not just there. but lets not get into that :D
arya_ is now known as arya
sivoais has joined #ruby
<MrZYX>
so the proper way would be adding the config/ directory to the $LOAD_PATH?
mikestok has quit [Quit: Computer has gone to sleep.]
<apeiros>
hell no
<apeiros>
but what the heck does a "boot.rb" in a config? :)
<MrZYX>
it sets up, one could say configures, the environment
<apeiros>
meh
<MrZYX>
only loads bundler by default, but still....
<apeiros>
also, ever read the boot.rb? it's totally unecessary.
braincra- has quit [Ping timeout: 256 seconds]
<MrZYX>
well, then lets take require File.expand_path('../application', __FILE__) for the sake of the example
freerobby has joined #ruby
<apeiros>
yeah, that's require_relative. no point in using that over require_relative.
<apeiros>
but that's not being my point.
<apeiros>
my point is about knowledge of where is what. and that does not belong into a library. the tool used to achieve it does not matter.
<apeiros>
(well, "no point" unless you want - for whatever reason - stay compatible with 1.8 - but I guess that's not what we're arguing)
<MrZYX>
I still think totally banning require_relative will only lead to constructs like this, I see them a lot
<MrZYX>
I don't want to say the usage of it wouldn't be a code smell
<apeiros>
you see it a lot because people don't understand $LOAD_PATH
<MrZYX>
but there are some rare cases where it's the better alternative
<apeiros>
and people who did not understand $LOAD_PATH and used bad constructs spread those bad constructs.
visof has joined #ruby
<apeiros>
I don't say there's absolutely no use for require_relative. but some 99% where it is being used, it is the wrong tool.
sivoais has quit [Ping timeout: 246 seconds]
<MrZYX>
which brings us back to the start, why teaching about -I. and $LOAD_PATH.push '.' but not about require_relative
yakko_zzz is now known as yakko
<apeiros>
sometimes it's also laziness ("what? I should run `ruby -Ilib` while developing? feck that, I'll just relatively require all my stuff instead" - awesome)
<MrZYX>
I think the usecases for adding . to the $LOAD_PATH are even rarer than the ones for using require_relative
<apeiros>
depends on what you count
roryhughes has quit [Quit: roryhughes]
<apeiros>
I use ruby -Ilib all the time. since I'm developing libs all the time.
sivoais has joined #ruby
<MrZYX>
sure, but that's very different from -I. IMO and not the point currently
mmitchell has joined #ruby
<apeiros>
it's the same mechanic. and I teach the mechanic.
roryhughes has joined #ruby
<Hanmac1>
MrZYX: i think its because about the whinies that still wants to use 1.8 ruby
Hanmac1 is now known as Hanmac
<MrZYX>
maybe they do magic there but a fresh generated rails app uses 1.9 hash syntax
<roryhughes>
Is there much speed/performance improvment with ruby 2.0 over 1.9?
<MrZYX>
if you require a lot of libraries, yes
<MrZYX>
but mainly in boot time
<roryhughes>
But for pure number crunching? (I already use 2, but just curious)
<Xeago>
apeiros: Array.flstten smells imo
<apeiros>
hey, howdi Xeago!
<apeiros>
Xeago: yeah, feeling the same
<apeiros>
that one I can't really explain, though :)
<shevy>
I would hate .flstten as well
* apeiros
flsttens shevy
<apeiros>
Xeago: up for a game today?
<Xeago>
got my right hand in plaster :\
<apeiros>
d'oh
<shevy>
what did you do with your right hand
<Xeago>
about 2 weeks now
<Xeago>
stumbled..
<apeiros>
:-S
<apeiros>
too bad… wanted to try something wrt cannon rushes
<Xeago>
stumbled over keys against the stairs
<apeiros>
get well soon then!
subbyyy has joined #ruby
<Xeago>
might be able to get a trackball mouse soon
<Xeago>
not sure how well that will go tho, at least I can mpuse with my right hand then
<Xeago>
luckily there be lots of streams this weekend =D
<Xeago>
no, can't move my arm quickly enough, can move my thumb over a ball tho
<Xeago>
website navigation is decent using a trackpad
<Xeago>
what are you watching besides SCA?
<apeiros>
I watch a german tournament
<Xeago>
ah, scheiße!
<apeiros>
they managed to attract even some top level korean players
<apeiros>
next one they have $10k for the winner alone
<Xeago>
:O cool! wcs europe having too awful casters for me
<Xeago>
wow, that is good money
<apeiros>
well, the casters are not the best - but very entertaining :D
mmitchell has quit [Remote host closed the connection]
sivoais has quit [Ping timeout: 252 seconds]
<apeiros>
yeah. last one they had an off-line finals (will have this time too) with some 2k spectators
<Xeago>
some cool stuff, missed out dreamhack cuz of the fracture :\
<Xeago>
had a ticket but couldn't go
bluOxigen has joined #ruby
<apeiros>
whaaaat? that's sad :(
sivoais has joined #ruby
<Xeago>
was able to sell the ticket with profit last moment tho
<apeiros>
I wanted to buy tickets for the wcs finals. but as I understood, that's in the US this year, so no-go for me =(
<Xeago>
is it?
<apeiros>
beijing last year would have been awesome. but missed to buy there…
<Xeago>
thought it was in korea
<apeiros>
I thought they said it would be at blizzcon?
shevy has quit [Ping timeout: 246 seconds]
<Xeago>
I don't know
tk__ has quit [Quit: ばいばい]
Hanmac1 has joined #ruby
aaronmcadam has joined #ruby
<apeiros>
tbh, I find information about where stuff happens at wcs far too difficult to find
<apeiros>
poorly done by blizzard IMO
<Xeago>
I agree, did you read the stuff about mlg/miya/genna?
<apeiros>
"running from April 4 through the weekend of November 8, when it all caps off with the WCS Global Finals at BlizzCon 2013"
<Xeago>
tough decisions genna made there
<apeiros>
no, what happened?
Hanmac has quit [Ping timeout: 252 seconds]
<Xeago>
miya was told at 10:30 PM (after their gstl win against prime) the next match would have been on may 6th 4:30AM
<Xeago>
all matches on MLG would have been on may 5th
_md has quit [Quit: Leaving...]
<Xeago>
so miya could have spotted it
<Xeago>
at 2:30 AM (KST)
<Xeago>
miya was messaged, but not present, that the next match was in 2 hours on may5th 4:30am
<apeiros>
"BlizzCon 2013 - November 8-9, 2013 at the Anaheim Convention Center"
<Xeago>
miya obviously asleep did not receive the message
tonini has joined #ruby
<Xeago>
miya got WO'ed into the loser bracket, and won the match there
<Xeago>
the original opponent was 1-1 against the next person in the WB
<Xeago>
and this is 4 hours after schedule
<Xeago>
MLG wanted to reverse everything back, genna told them to stick to the rules and instead devote attention to making sure these wrongful communications don[t happen again
pcarrier has quit [Quit: Computer has gone to sleep.]
<apeiros>
what does WO stand for btw.? (I understand it means "auto-win because opponent did not show up or got disqualified", but I don't know the words used)
braincrash has joined #ruby
sivoais has quit [Ping timeout: 276 seconds]
skoovdebo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
atyz has joined #ruby
sivoais has joined #ruby
tealmage has joined #ruby
chipotle_ has quit [Quit: cya]
<apeiros>
ah, WalkOver it seems
<Xeago>
didn't know it either, until I read the article
DouweM has quit [Ping timeout: 260 seconds]
chipotle_ has joined #ruby
shevy has joined #ruby
mneorr_ has joined #ruby
mklappstuhl has joined #ruby
rton has joined #ruby
<apeiros>
sad that the elite toss CPU does not have a cannon rush strategy to choose from :(
ToApolytoXaos has joined #ruby
atyz has quit [Ping timeout: 252 seconds]
tealmage has quit [Ping timeout: 256 seconds]
<Kurion>
Hi guys can someone help me with an error message. pastebin.com/d0a0xka1
monkegjinni has joined #ruby
mneorr has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Remote host closed the connection]
tonini has quit [Remote host closed the connection]
spider-mario has quit [Read error: Connection reset by peer]
jon_w has joined #ruby
predator117 has joined #ruby
jon_w has quit [Client Quit]
dhruvasagar has quit [Ping timeout: 255 seconds]
Astral_ has joined #ruby
mmitchell has joined #ruby
Boki has joined #ruby
freerobby has quit [Quit: Leaving.]
sivoais has joined #ruby
rton has left #ruby [#ruby]
Astralum has quit [Ping timeout: 264 seconds]
predator117 has quit [Ping timeout: 260 seconds]
kofno has quit [Remote host closed the connection]
predator117 has joined #ruby
shock_one has joined #ruby
ravster has joined #ruby
mmitchell has quit [Ping timeout: 256 seconds]
TH34D has joined #ruby
sivoais has quit [Ping timeout: 256 seconds]
mmitchell has joined #ruby
Davey has joined #ruby
cha1tanya has joined #ruby
Hanmac has joined #ruby
sivoais has joined #ruby
Hanmac1 has quit [Ping timeout: 272 seconds]
sebcioz has left #ruby [#ruby]
gyre007 has joined #ruby
emmanuelux has joined #ruby
postmodern has quit [Quit: Leaving]
darkapex has quit [Ping timeout: 245 seconds]
forlin has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
aaronmcadam has quit [Quit: Leaving...]
visof has quit [Excess Flood]
TH34D has quit [Read error: Connection reset by peer]
waxjar has quit [Ping timeout: 245 seconds]
mmitchell has quit [Remote host closed the connection]
nmeum has joined #ruby
waxjar has joined #ruby
altivec has joined #ruby
bigmac has joined #ruby
bigmac has quit [Client Quit]
roryhughes has quit [Quit: roryhughes]
joofsh has joined #ruby
sayan has quit [Read error: Connection reset by peer]
darkapex has joined #ruby
sivoais has quit [Ping timeout: 264 seconds]
sivoais has joined #ruby
KevinSjoberg has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
JohnRKD has joined #ruby
xingo has joined #ruby
tealmage has joined #ruby
tealmage has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 246 seconds]
Roots47 has joined #ruby
<_br_>
Sinatra problem... Trying to pass in variables from config.ru into sinatra (Sinatra::Base) but they seem only avaiable in the e.g. before scope or later, but not in the configure block? Any idea why that is so?
xingo has quit [Remote host closed the connection]
wallerdev has quit [Ping timeout: 252 seconds]
Hanmac has joined #ruby
<Roots47>
Hey all, I'm having an issue where an integer variable exists prior to a while loop, but is gone for the loop expression, which is causing the loop to run every time. Here's a pastie http://pastie.org/7804596
chandankumar has joined #ruby
<Roots47>
refer to lines 4-7
roryhughes has joined #ruby
brianpWins has quit [Quit: brianpWins]
<KevinSjoberg>
I would really like some help or pointers to the right direction. I'm trying to implement a DSL-like behaviour but fail. See https://gist.github.com/KevinSjoberg/5521070. Any ideas how to achieve that?
TH34D has joined #ruby
<apeiros>
Roots47: gets returns a string. always.
<Roots47>
apeiros ah ok
<apeiros>
(gets == get string)
<Roots47>
apeiros: Also, another weird thing, is that the print from within loop is not displaying guess
Davey has quit [Quit: Computer has gone to sleep.]
sivoais has quit [Ping timeout: 256 seconds]
<apeiros>
o0
visof has joined #ruby
<apeiros>
Roots47: does for me
<Roots47>
apeiros: If I make the line say print "#{guess.to_i} is not equal to #{randomNumber}, please enter a new guess: " it works
<Roots47>
:\
<Roots47>
what version of ruby are you using?
<apeiros>
Roots47: but notice that gets includes the newline
<Roots47>
I see that, I would have to use chomp to get rid of it
<apeiros>
so the output is e.g. "9\n is not …"
<Roots47>
oh
<apeiros>
i.e., it's on a separate line
arya_ has joined #ruby
<Roots47>
ahh
<slash_nick>
the puts in the loop works fine for me?
brianpWins has joined #ruby
<Roots47>
Ok, it works... sorry, this is literally my first 20 minutes with ruby
<apeiros>
np
sivoais has joined #ruby
<Roots47>
thanks for the help :)
<slash_nick>
Roots47: neato have fun
<apeiros>
yw ;-)
johnjohnson has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
arya has quit [Ping timeout: 248 seconds]
danman has joined #ruby
TH34D has quit [Ping timeout: 252 seconds]
yacks has joined #ruby
subbyyy has quit [Ping timeout: 256 seconds]
atyz has joined #ruby
krainboltgreene has joined #ruby
arya has joined #ruby
cofin has joined #ruby
sivoais has quit [Ping timeout: 256 seconds]
subbyyy has joined #ruby
Kurion has left #ruby [#ruby]
arya_ has quit [Ping timeout: 248 seconds]
yannis has quit [Quit: Bye!]
atyz has quit [Ping timeout: 272 seconds]
sivoais has joined #ruby
freeayu has quit [Remote host closed the connection]
ctp has joined #ruby
arya_ has joined #ruby
mikestok has quit [Quit: Computer has gone to sleep.]
arya has quit [Ping timeout: 248 seconds]
Scient- is now known as Scient
breakingthings has joined #ruby
icecandy has quit [Remote host closed the connection]
chandankumar has quit [Quit: Leaving]
browndawg has quit [Quit: Leaving.]
visof has quit [Quit: Leaving]
spider-mario has joined #ruby
krainboltgreene has quit [Ping timeout: 260 seconds]
pcarrier has joined #ruby
wallerdev has joined #ruby
Kricir has joined #ruby
sivoais has quit [Ping timeout: 256 seconds]
eka has quit [Quit: Computer has gone to sleep.]
arya has joined #ruby
mixel has joined #ruby
ctp_ has joined #ruby
sivoais has joined #ruby
whowantstolivef1 has joined #ruby
altivec has quit [Quit: Computer has gone to sleep.]
arya_ has quit [Ping timeout: 256 seconds]
ctp has quit [Read error: Operation timed out]
roadt has quit [Quit: 暂离]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
richcollins has joined #ruby
77CAA2O50 has quit [Quit: Leaving]
Mattix has joined #ruby
whowantstolivef1 has quit [Remote host closed the connection]
crazed_ has quit [Ping timeout: 245 seconds]
johchri has joined #ruby
generalissimo has joined #ruby
sivoais has quit [Ping timeout: 246 seconds]
ctp has joined #ruby
chandankumar has joined #ruby
bubblehead has joined #ruby
LennyLinux has quit [Remote host closed the connection]
sleetdrop has quit [Quit: Computer has gone to sleep.]
aaronmcadam has joined #ruby
johnjohnson has quit [Quit: johnjohnson]
ctp_ has quit [Ping timeout: 245 seconds]
ctp_ has joined #ruby
generalissimo has quit [Ping timeout: 272 seconds]
ctp has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby
headius has joined #ruby
wedgex has joined #ruby
wedgex has quit [Remote host closed the connection]
ctp_ has quit [Ping timeout: 272 seconds]
niklasb has quit [Ping timeout: 252 seconds]
generalissimo has joined #ruby
spider-mario has quit [Ping timeout: 272 seconds]
JohnRKD has quit []
poga has quit [Remote host closed the connection]
nobitanobi has joined #ruby
ctp has joined #ruby
LennyLinux has joined #ruby
LennyLinux has quit [Remote host closed the connection]
mmitchell has joined #ruby
ctp has quit [Read error: Operation timed out]
Banistergalaxy has quit [Ping timeout: 245 seconds]
newTech has joined #ruby
whowantstolivef1 has joined #ruby
yashshah has joined #ruby
roryhughes has quit [Quit: roryhughes]
sivoais has joined #ruby
CyberMaN has joined #ruby
mmitchell has quit [Remote host closed the connection]
ctp has joined #ruby
sayan has joined #ruby
DouweM has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
roryhughes has joined #ruby
My_Hearing has joined #ruby
mixel has quit [Quit: mixel]
faceless_ has joined #ruby
nari_ has joined #ruby
krainboltgreene has joined #ruby
brianpWins has quit [Quit: brianpWins]
Mon_Ouie has quit [Ping timeout: 256 seconds]
jblack has quit [Quit: Lost terminal]
phacele55 has quit [Ping timeout: 252 seconds]
cha1tanya has quit [Ping timeout: 256 seconds]
faceless_ is now known as faceless
dhruvasagar has quit [Ping timeout: 260 seconds]
faceless is now known as phacele55
phacele55 has quit [Changing host]
phacele55 has joined #ruby
dzied has quit [Ping timeout: 260 seconds]
nobitanobi has quit [Ping timeout: 246 seconds]
sivoais has quit [Ping timeout: 256 seconds]
forlin has quit [Ping timeout: 260 seconds]
lyanchih has quit [Quit: lyanchih]
sivoais has joined #ruby
soulcake has joined #ruby
freerobby has joined #ruby
sayan has quit [Read error: Connection reset by peer]
arubin has joined #ruby
richcollins has quit [Quit: richcollins]
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
freerobby has quit [Client Quit]
mixel has joined #ruby
nhhagen has joined #ruby
kofno has joined #ruby
atyz has joined #ruby
arya has quit [Ping timeout: 256 seconds]
arya has joined #ruby
Heero has joined #ruby
Heero has quit [Changing host]
Heero has joined #ruby
sivoais has quit [Ping timeout: 268 seconds]
atyz has quit [Ping timeout: 272 seconds]
kofno has quit [Remote host closed the connection]
sivoais has quit [Read error: Connection reset by peer]
<phacele55>
any ideas?
sivoais has joined #ruby
robscomputer has joined #ruby
<apeiros>
phacele55: let me guess - you installed ruby using apt?
<phacele55>
yep
<apeiros>
I'm inclined to tell you to go to #debian or #ubuntu or whatever channel is responsible for apt
<phacele55>
so its not a ruby issue?
<apeiros>
since they fucked it up. they fail to do a proper ruby installation with apt-get ruby
<apeiros>
not really. it's an "incomplete ruby installation" issue.
<apeiros>
you're missing mkmf
<waxjar>
don't people just google the error message anymore? :(
<phacele55>
yeah i figured i was missing a library
<waxjar>
works everytime :D
<MrZYX>
hm, wasn't there ruby-full or something like that which improves things?
<apeiros>
MrZYX: you mean the one which also installs emacs and whatnot? :)
robscomputer_ has joined #ruby
<phacele55>
and actually i did google it and tried the entire first page of explanations, and i'm still here
<MrZYX>
who cares :P
<waxjar>
fair enough
<apeiros>
MrZYX: anyway, it's the wrong way round. "install ruby" should install a complete ruby. if you want a light-weight "interpreter only" package, name that one differently.
<apeiros>
for anything else you should be flayed.
<MrZYX>
yeah and if you want a decent one use a version manager, I know
<apeiros>
well, apt is a package manager already. but the packagers (i.e. the people providing the packages) fail IMO.
DouweM has joined #ruby
slainer68 has joined #ruby
<MrZYX>
that's why I love arch, so easy to hack and adapt the packages without polluting your system with sudo make installs
<phacele55>
well when you download a package you expect it to be complete, so that people like me don't end up here so i would have to agree
robonerd has joined #ruby
<robonerd>
hi any blind ppl here?
robscomputer has quit [Ping timeout: 264 seconds]
mixel has quit [Quit: mixel]
<phacele55>
apeiros: got any ideas? I could try another page of google, i suppose but all the "fixes" don't really fix
forlin has quit [Remote host closed the connection]
<apeiros>
phacele55: well, ask in #debian or #ubuntu on how to install a complete ruby, i.e. one with dev headers and mkmf.
<MrZYX>
did you try installing ruby-full?
<waxjar>
did the apt install ruby-dev thing not work?
wesside has joined #ruby
<apeiros>
I don't know apt and I don't want to either.
tylersmith has joined #ruby
<MrZYX>
apeiros: what's your distro?
feedbackloop has joined #ruby
<phacele55>
lol i will try ruby-full
<apeiros>
MrZYX: osx
<apeiros>
I install ruby via rvm
nari_ has quit [Ping timeout: 246 seconds]
jduan1981 has joined #ruby
mixel has joined #ruby
<phacele55>
ok i just got the same exact error but with pg instead of json
<robonerd>
any jews in here? (real jews, hebrew speakers)
forlin has joined #ruby
dmiller has joined #ruby
DrCode has quit [Remote host closed the connection]
mneorr_ has quit [Remote host closed the connection]
<waxjar>
seems like you're missing some build tools phacele55
atyz has joined #ruby
<phacele55>
lol yeah gonna hop in #debian and see if they know why
DrCode has joined #ruby
cofin has quit [Quit: cofin]
ariedler has joined #ruby
pierre__ has joined #ruby
mixel has quit [Quit: mixel]
mahmoudimus has joined #ruby
mockra has quit [Ping timeout: 276 seconds]
LineByLine has joined #ruby
roryhughes has quit [Quit: roryhughes]
roryhughes has joined #ruby
dmiller has quit [Ping timeout: 264 seconds]
nhhagen has quit [Remote host closed the connection]
mockra has joined #ruby
mneorr has joined #ruby
locriani has joined #ruby
<slash_nick>
what kind of question is that
yashshah_ has joined #ruby
yashshah has quit [Read error: Connection reset by peer]
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
infecto has quit [Read error: Operation timed out]
<shevy>
robonerd this is #ruby, the programming language ruby
infecto has joined #ruby
<shevy>
phacele55 it would be debian's responsibility to not have you use a crippled system
<robonerd>
oh, i was looking for a gemstone cutter
<shevy>
robonerd ironically, ruby's main package system is called "gem" and there is even a gem called "gemcutter" :P
vlad_starkov has quit [Remote host closed the connection]
joofsh has joined #ruby
<DouweM_>
object.methods - Object.new.methods ?
<MrZYX>
.methods(false) but I wonder what's your usecase if it isn't introspection
<DouweM_>
although #to_a is not on Object
<Mattix>
I'm talking about .methods in an instance of a class
<Mattix>
Whatever.new.methods
<Mattix>
MrZYX, the use case is: I want to know what methods a class defines because the documentation is incomplete :P
<MrZYX>
there's pry for that! :P
<Mattix>
yeah, I guess I could have used pry too
<MrZYX>
ls object
jhn has joined #ruby
vlad_starkov has joined #ruby
lewix has joined #ruby
<shevy>
rm object
platzhirsch has joined #ruby
<MrZYX>
dir object
<injekt>
cat object
<shevy>
love object
kraljev2 has joined #ruby
<kraljev2>
Why doesn't Set respond properly to #to_json ?
<Mattix>
"object.methods false" returns []
<Mattix>
o.o
<Mattix>
I'm going to try with pry now
<MrZYX>
then it doesn't define any methods on its own (probably just method_missing)
<MrZYX>
which would explain why the docs are incomplete
Kricir has joined #ruby
<platzhirsch>
Having a class inside a module: Metrics::Accuracy (path model/metrics/accuracy.rb) I want to access a class at path model/workers/accuracy_worker.rb. But when I invoke Workers::AccuracyWorker, it complains, that there is no such constant Metrics::Workers::AccuracyWorker. Can I access the content of another module? ;)
<injekt>
kraljev2: it does
brain_shim_ has quit [Quit: Leaving]
soulcake has joined #ruby
<Mattix>
maybe it inherits from another class that defines the methods? in that case would .methods(false) list them?
Empty_One has joined #ruby
<MrZYX>
it wouldn't
<kraljev2>
irb(main):006:0> Set[1,2,3].to_json
<kraljev2>
=> "\"#<Set:0x0000000231f6a8>\""
<kraljev2>
I have said properly :)
<DouweM_>
platzhirsch ::Workers::AccuracyWorker
<injekt>
oh right didn't see that part
<kraljev2>
not #to_s fallback
<platzhirsch>
DouweM_: ah great, thanks :)
pcarrier has quit [Ping timeout: 276 seconds]
spider-mario has joined #ruby
v0n has quit [Ping timeout: 255 seconds]
<DouweM_>
kraljev2 #to_json isn't on Array, Hash either, it seems to be added by Rails
<DouweM_>
kraljev2 No idea why Set was skipped
dmiller has joined #ruby
<kraljev2>
on Array and Hash it works properly
<kraljev2>
I hate Rails
<injekt>
DouweM_: yes it is, the json lib adds them to enumerable
<shevy>
I believe I finally have a project where I must use tests
mikestok has quit [Quit: Computer has gone to sleep.]
<injekt>
oO
atno has joined #ruby
Spami has quit [Ping timeout: 264 seconds]
Politoed has left #ruby [#ruby]
<Hanmac>
imo inherit from the BaseClasses like Integer and Array is a little bit bad idea
nahiluhmot has joined #ruby
sambao21 has joined #ruby
tommyvyo has joined #ruby
CyberMaN has quit [Quit: later]
mmitchell has joined #ruby
notVert has joined #ruby
bonhoeffer has quit [Quit: bonhoeffer]
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
Vert has quit [Read error: Connection reset by peer]
My_Hearing is now known as Mon_Ouie
v0n has quit [Ping timeout: 256 seconds]
taotetek has joined #ruby
dmiller has joined #ruby
DouweM has joined #ruby
Morkel has quit [Quit: Morkel]
mockra_ has quit [Remote host closed the connection]
mockra has joined #ruby
Astral__ has joined #ruby
jamie_ca_ has joined #ruby
dmiller has quit [Ping timeout: 264 seconds]
DouweM_ has quit [Ping timeout: 252 seconds]
jamie_ca_ has quit [Client Quit]
Astral_ has quit [Ping timeout: 256 seconds]
solidoodlesuppor has quit [Quit: ChatZilla 0.9.90 [Firefox 20.0.1/20130409194949]]
rakl has joined #ruby
rakl has quit [Max SendQ exceeded]
Neomex has joined #ruby
Neomex has quit [Client Quit]
rakl has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
blacktulip has joined #ruby
freerobby has joined #ruby
tommyvyo has quit [Quit:]
roryhughes has quit [Quit: roryhughes]
timkohrumel has joined #ruby
KevinSjoberg has joined #ruby
mixel has joined #ruby
roryhughes has joined #ruby
ebobby has joined #ruby
sayan has quit [Ping timeout: 256 seconds]
nomenkun has joined #ruby
caveat- has quit [Ping timeout: 268 seconds]
dcope has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Remote host closed the connection]
benlieb has joined #ruby
jduan1981 has joined #ruby
pilgo has quit [Quit: pilgo]
gyre007 has quit [Remote host closed the connection]
dr_bob has joined #ruby
ekh has left #ruby [#ruby]
altivec has joined #ruby
Z_Mass has joined #ruby
timkohrumel has quit [Remote host closed the connection]
<waxjar>
kraljev2, asking the same question again and again won't make it suddenly possible. the #| method on Array returns a new array object. if you inherit that method from the Array class, it will run that when you call #| on your new class. it will always return a new Array
<apeiros>
a couple of Array methods return the subclass, though
<apeiros>
one of them being Array#replace
<apeiros>
Array#replace + Array::new make it relatively easy to implement a subclass
dmiller has quit [Remote host closed the connection]
jcromartie has quit [Ping timeout: 252 seconds]
Kricir has joined #ruby
<kousu>
MrZYX, I have a prototype of what I'm trying to accomplish, if you (or anyone else) would be willing to take a look: http://pastebin.com/0HDcfSwB
<kousu>
I'm stumped by " @renderer.call do |line|"
mneorr has joined #ruby
Astralum has joined #ruby
tjbiddle has quit [Ping timeout: 260 seconds]
tjbiddle_ is now known as tjbiddle
<kousu>
In python I would just store renderer as a function and call it at will, but Ruby doesn't do first class functions the same way. I think Ruby can be cleaner as a DSL for me, but I don't know what magic invocation I need :(
berkes has quit [Quit: Ex-Chat]
Astral__ has quit [Ping timeout: 272 seconds]
atyz has quit [Quit: Leaving...]
r0bglees0n has quit [Ping timeout: 256 seconds]
r0bgleeson has joined #ruby
TH34D has joined #ruby
<Mon_Ouie>
kousu: do |&block| block.call end
<Mon_Ouie>
That's because yield takes the block that was passed to the current method
<kousu>
Mon_Ouie: inside of render or page?
<apeiros>
kousu: Object#method can convert a method into a Method instance
<Mon_Ouie>
In the page
<MrZYX>
I wonder how ERB solves this
<Mon_Ouie>
This allows def foo; 1.upto(10) { |x| yield(x) } end to not mess up
forlin has quit [Remote host closed the connection]
<apeiros>
how ERB solves what?
Kricir has quit [Remote host closed the connection]
<shevy>
how ERB solves world peace
bonhoeffer has quit [Quit: bonhoeffer]
<shevy>
I always thought it is a reason for war
<shevy>
:(
Kricir has joined #ruby
<kousu>
I want the page method to just store the content until it's ready to be used, Mon_Ouie
<kousu>
i'm either misunderstanding or neither of these things help me
Olipro has quit [Changing host]
Olipro has joined #ruby
s0ber_ has joined #ruby
HecAtic has joined #ruby
s0ber has quit [Read error: Operation timed out]
s0ber_ is now known as s0ber
<kousu>
I want to be able to conditionally render different text but I don't want to have to write all this cruft: class Page1 < Page def render yield "first line"; yield "second line"; yield "third"; end end
jbpros has quit [Quit: jbpros]
ckrailo has quit [Quit: Computer has gone to sleep.]
<kousu>
I am trying to avoid writing a method. I want to just stash a block
<kousu>
Can ruby do this? Am I misunderstanding ruby closures really hard?
<Mon_Ouie>
Then you have to use that syntax I mentioned
DouweM has joined #ruby
ozzloy has joined #ruby
<csmrfx>
hm, ruby usb-to-midi -translator
<csmrfx>
whatchamacallit
<kousu>
Okay, Mon_Ouie, where do I put that?
<Mon_Ouie>
page do |&block| … end
dr_bob has quit [Quit: Leaving.]
bonhoeffer has joined #ruby
<kousu>
oohhhh, instead of saying yield
<Mon_Ouie>
Or not using yield to send the lines (e.g. you could have an object with a #<< method to pass new lines)
<Mon_Ouie>
This actually looks a lot like an Enumerator, you might take advantage of that.
TH34D has quit [Quit: Verlassend]
jbpros has joined #ruby
<Mon_Ouie>
Enumerator.new { |y| y << "a" << "b" }.to_a # => ["a", "b"]
DouweM_ has quit [Ping timeout: 264 seconds]
* kousu
reads up on ruby enumerators
Czupa has quit [Remote host closed the connection]
* Hanmac1
never needed to use Enumerator.new directly
<waxjar>
you'll love them
<kousu>
oh, they're just like python generators
Hanmac1 is now known as Hanmac
<kousu>
Yes, I think that is the right solution. Thanks! You're all darlings.
richcollins has joined #ruby
alienvenom has quit [Read error: Operation timed out]
mmitchell has joined #ruby
Z_Mass has quit [Ping timeout: 256 seconds]
zph has joined #ruby
zph has quit [Excess Flood]
pilgo has quit [Quit: pilgo]
ckrailo has joined #ruby
Adr1an00 has joined #ruby
sambao21 has joined #ruby
julian-delphiki has quit [Quit: Leaving]
<apeiros>
what's a darling? I only know zergling…
kofno has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 264 seconds]
<kousu>
apeiros: it's a term of endearment and affection
<kousu>
#ruby helped me out and I am grateful
<kousu>
I am doing a gamejam
<kousu>
we have 3 hours :P
nhhagen has joined #ruby
_br_ has quit [Ping timeout: 264 seconds]
<apeiros>
kousu: I was just kidding ;-)
dmiller has joined #ruby
nmeum has quit [Ping timeout: 256 seconds]
codecop has quit [Remote host closed the connection]
_br_ has joined #ruby
nhhagen has quit [Remote host closed the connection]
teclator has joined #ruby
nhhagen has joined #ruby
zipace has quit [Read error: Operation timed out]
<kousu>
apeiros: oh, sorry. your name made me think you were latin american. but your ISP says .ch , oops :P
<kousu>
i didn't want to be a jerk!
<apeiros>
lol
<apeiros>
apeiros is greek, not spanish ;-)
<apeiros>
and .ch is switzerland (some people think it was china :-p)
<waxjar>
hmm, what is china's tld?
<kousu>
.cn
jbpros has quit [Quit: jbpros]
jwang has quit [Read error: Connection reset by peer]
jwang has joined #ruby
mixel has joined #ruby
osvico has joined #ruby
<shevy>
a zergling is a darling where, after sex, the claws rip through your stomach!
<matti>
?
<matti>
That was deep, man.
* matti
touched
<shevy>
matti I like splatter and horror movies
<Hanmac>
shevy a zergling compared with a dog is more cool as a pet ;P
<shevy>
and best coupled with science fiction... alien I... predator I ... terminator I ...
<matti>
Hanmac: I can imagine how much its poo has to smell/
<shevy>
matti you are so gross
<Hanmac>
but i think he is right ;P
alienvenom has joined #ruby
<shevy>
he reads dog and instantly thinks about poo
<matti>
No.
<apeiros>
matti: yes, the claws go deep
<matti>
Your fault.
mmitchell has joined #ruby
jacktrick has joined #ruby
<matti>
I did watched all the cinematics from SC2 on YT.
<matti>
Nice story.
marr has quit [Ping timeout: 246 seconds]
<Hanmac>
matti you should play magic the Gathering with a Simic deck .. one of the keycards has this as text: "Nature is a wonderful engineer but works far too slowly for my tastes."
ozzloy has quit [Ping timeout: 264 seconds]
slainer68 has joined #ruby
v0n has joined #ruby
<shevy>
matti should become a ruby pr0nstar
marr has joined #ruby
huoxito has joined #ruby
<matti>
shevy: Can't do.
<shevy>
don't be shy :)
<matti>
shevy: Taken by apeiros already
<shevy>
he does not count
<shevy>
he was gone for like 8 weeks
<apeiros>
o0
Adr1an00 has quit [Ping timeout: 264 seconds]
<apeiros>
I'm a pr0nstar?
<apeiros>
I think people like wycats and radar are ruby pr0nstars. not me.
<shevy>
injekt was trying to fill the gap of knowledge on #ruby after apeiros' departure
mmitchell has quit [Remote host closed the connection]
<apeiros>
which departure?
<shevy>
you were totally gone!
<shevy>
you are probably back only for a few days, then you are gone again
<shevy>
just like RubyPanther
<RubyPanther>
I told you, I was never gone lol
<matti>
apeiros: See, shevy has missed you.
<apeiros>
I see
<apeiros>
shevy: I was on vacation
<apeiros>
while I organized internet, I didn't want to use it much.
<RubyPanther>
sorry I'm busy reading Prenda Law filings
<shevy>
matti well, you need to watch the activity pattern on #ruby and who is very prolific in answering when newbies ask questions, and apeiros is quite high on that list, so when he is gone, #ruby notices that
ariedler has quit [Remote host closed the connection]
<shevy>
what is a prenda law
<shevy>
sounds like panda law
<shevy>
hahahaha :D
zipace has joined #ruby
<Xeago>
there is a knowledge gap around 2-5AM GMT
<shevy>
yeah
<Xeago>
I've tried filling it a few times but failed miserable
<matti>
shevy: I am always here, but since I am not Go fanboy.
<shevy>
and late saturday it is very quiet here
<matti>
shevy: I don't partake.
<matti>
;d
<matti>
s/not/now/
gyre007 has joined #ruby
<shevy>
Xeago, you have a destroyed hand so you can't help
<Xeago>
I can type okay'ish
nmeum has joined #ruby
<RubyPanther>
A Prenda Law is a type of grue that lurks in the dark parts of torrent networks and lashes out at and through the courts
* Xeago
yearns for the day Go gets hot-code-swap
<apeiros>
speak recognition to the rescue
<apeiros>
"move zergling army to the north!"
<apeiros>
"no! not that far!"
<apeiros>
splergh
<Xeago>
or the eyeflicking system?
<Xeago>
wonder how good it works
<shevy>
RubyPanther your knowledge of such esoteric things scares me very much
<shevy>
I fault the internet for that
<shevy>
it brought to us all the worst parts of humanity
<matti>
No.
<RubyPanther>
Well, I've been reading groklaw since the first time they were mentioned on slashdot during the old SCO battles, so Prenda Law is mainstream entertainment to me
<shevy>
the dark matter of youtube (80% of the videos at least!)
<Hanmac>
shevy i make a big commit for my scripts, you can look over if you want
<shevy>
Hanmac I need to wake up in about 6 hours :(
<Xeago>
apeiros: what do you think of SCA so far?
<shevy>
I am just chilling myself slowly to sleep...
niklasb has joined #ruby
<Hanmac>
it was just a notification, you can look over tomorrow