<Burgestrand>
I guess magic is too strong a word, but I wouldn't call it common knowledge that case uses `===`, even though it probably should be :d
<Burgestrand>
Principle of least surprise tends to be `if … elsif … elsif … elsif … end`
justinfaler has joined #ruby
<yohji>
Burgestrand: smart solution to refer the variabile in the case!
bkxd has joined #ruby
<Burgestrand>
yohji :)
bkxd has quit [Ping timeout: 264 seconds]
alfiemax_ has quit [Ping timeout: 268 seconds]
k0mpa has joined #ruby
<leitz>
And for my next trick...
segy has joined #ruby
<leitz>
Hmm... let me think on this. I think i know the answer but it's not speaking up. Trying to write a test in the same directory as the code but it's not loading.
alfiemax has joined #ruby
roshanavand has joined #ruby
nowhereman_ has joined #ruby
<leitz>
To "require" something, does it have to be a class? Can it just be a library with methods?
<Burgestrand>
leitz you only ever require files
<Burgestrand>
leitz the file can contain whatever you like
nowhere_man has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: leaving]
qba73 has quit [Remote host closed the connection]
<Burgestrand>
leitz if you don't make the path explicitly relative or absolute, ruby will search in an array of directories listed in `$LOAD_PATH` for the file you attempt to require, and if it can't find it will give you the error you see there
<leitz>
Burgestrand, yup, thanks!
<leitz>
For some reason I though LOAD_PATH assumed ".".
KeyJoo has joined #ruby
guille-moe has quit [Remote host closed the connection]
guille-moe has joined #ruby
milardovich has joined #ruby
<Burgestrand>
leitz it used to, back in 1.9 (I believe)
<Burgestrand>
leitz it was considered a security risk and taken out
rabajaj has joined #ruby
nadir has joined #ruby
<leitz>
Ah, I started with 1.8.7 and just recently moved to 2.x.
rahul_bajaj has quit [Ping timeout: 265 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
cgfbee has quit [Ping timeout: 260 seconds]
nertzy has quit [Ping timeout: 276 seconds]
eam has quit [Ping timeout: 256 seconds]
eam has joined #ruby
chussenot has joined #ruby
yohji has joined #ruby
guille-moe has joined #ruby
rwb has quit [Ping timeout: 240 seconds]
knight33 has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jottr_ has quit [Ping timeout: 264 seconds]
cgfbee has joined #ruby
Ltem has joined #ruby
minimalism has quit [Quit: minimalism]
vichib has joined #ruby
shinnya has joined #ruby
hutch34 has joined #ruby
jottr_ has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
justinfaler has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
justinfaler has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
faces has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 246 seconds]
guille-moe has quit [Ping timeout: 260 seconds]
guille-moe has joined #ruby
apparition has quit [Quit: Bye]
roshanavand has left #ruby [#ruby]
belmoussaoui has joined #ruby
bmurt has joined #ruby
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
Puffball has joined #ruby
jottr_ has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
synthroid has joined #ruby
dionysus69 has joined #ruby
Cavallari has quit [Quit: Cavallari]
cdg has joined #ruby
govg has quit [Ping timeout: 240 seconds]
jottr_ has joined #ruby
bronson has joined #ruby
justinfaler has quit [Ping timeout: 268 seconds]
rwb has joined #ruby
John_Ivan has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
qba73 has quit [Remote host closed the connection]
govg has joined #ruby
qba73 has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cgfbee has quit [Ping timeout: 240 seconds]
justinfaler has joined #ruby
jottr_ has quit [Ping timeout: 246 seconds]
DLSteve has joined #ruby
cgfbee has joined #ruby
jottr_ has joined #ruby
Toggi3 has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bijan_ has joined #ruby
<bijan_>
Hi, anyone knows how I can build up a nested hash in ruby and add arbitrary nested keys in a loop? the end result shall be a json with nested elements
<bijan_>
?
<bijan_>
Ah solved... I just use active support deep_merge
byte512_ has joined #ruby
byte512 has quit [Ping timeout: 248 seconds]
Toggi3 has quit [Ping timeout: 268 seconds]
jottr_ has quit [Ping timeout: 248 seconds]
Toggi3 has joined #ruby
justinfaler has quit [Ping timeout: 264 seconds]
sanscoeur has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
jottr_ has joined #ruby
cschneid has joined #ruby
chichou has quit [Ping timeout: 246 seconds]
halt has joined #ruby
halt is now known as Guest86910
chichou has joined #ruby
sanscoeur has quit [Ping timeout: 256 seconds]
jottr_ has quit [Ping timeout: 246 seconds]
justinfaler has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
Ltem has quit [Quit: bbl]
jokke has quit [Quit: WeeChat 2.0.1]
Burgestrand has quit [Quit: Closing time!]
rippa has joined #ruby
xuyuheng has joined #ruby
sundhell is now known as sundhell_away
chussenot has quit [Quit: chussenot]
Guest7174 is now known as RougeR
RougeR has quit [Changing host]
RougeR has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
vichib has quit [Remote host closed the connection]
Rapture has joined #ruby
chussenot has joined #ruby
rrutkowski has joined #ruby
rrutkowski has quit [Remote host closed the connection]
roshanavand has joined #ruby
ren0v0_ has joined #ruby
knight33 has joined #ruby
justinfaler has quit [Ping timeout: 246 seconds]
rrutkowski has joined #ruby
knight33 has quit [Max SendQ exceeded]
ren0v0 has quit [Ping timeout: 240 seconds]
rrutkowski has left #ruby [#ruby]
chichou has quit [Quit: WeeChat 2.0.1]
chichou has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
rrutkowski has joined #ruby
Psybur_ has joined #ruby
LastWhisper____ has joined #ruby
justinfaler has joined #ruby
k0mpa has quit [Remote host closed the connection]
rabajaj has quit [Remote host closed the connection]
yohji has quit [Ping timeout: 256 seconds]
chichou has quit [Quit: WeeChat 2.0.1]
theunraveler has joined #ruby
itmerc[m] has quit [*.net *.split]
Bilge has quit [*.net *.split]
KevinMGranger has quit [*.net *.split]
snapcase has quit [*.net *.split]
charles81_ has quit [*.net *.split]
rann has quit [*.net *.split]
Diabolik has quit [*.net *.split]
craysiii has quit [*.net *.split]
lipoqil has quit [*.net *.split]
kaia has quit [*.net *.split]
manveru has quit [*.net *.split]
dukedave has quit [*.net *.split]
caw__ has quit [*.net *.split]
Giphy[m] has quit [*.net *.split]
nyuszika7h has quit [*.net *.split]
sonOfRa has quit [*.net *.split]
brodul has quit [*.net *.split]
Tony-St4rk has quit [*.net *.split]
Hanma[m] has quit [*.net *.split]
twe4ked has quit [*.net *.split]
velu_aon[m] has quit [*.net *.split]
h43z has quit [*.net *.split]
sparr has quit [*.net *.split]
Kilo`byte has quit [*.net *.split]
href has quit [*.net *.split]
peteretep has quit [*.net *.split]
pizzaops has quit [*.net *.split]
wsmoak has quit [*.net *.split]
micalexander has quit [*.net *.split]
jimeh has quit [*.net *.split]
doesntbyte has quit [*.net *.split]
iamdevnul has quit [*.net *.split]
timmow has quit [*.net *.split]
klaas has quit [*.net *.split]
RushPL has quit [*.net *.split]
aurelien has quit [*.net *.split]
brodul has joined #ruby
Kilo`byt- has joined #ruby
href has joined #ruby
sonOfRa has joined #ruby
Bilge has joined #ruby
iamdevnul has joined #ruby
timmow has joined #ruby
h43z has joined #ruby
twe4ked has joined #ruby
peteretep has joined #ruby
aurelien has joined #ruby
jimeh has joined #ruby
doesntbyte has joined #ruby
wsmoak has joined #ruby
h43z is now known as Guest22845
pizzaops has joined #ruby
micalexander has joined #ruby
Diabolik has joined #ruby
goatish has quit [Quit: Hibernating]
kaia has joined #ruby
Tony-St4rk has joined #ruby
rann has joined #ruby
lipoqil has joined #ruby
charles81_ has joined #ruby
sparr has joined #ruby
craysiii has joined #ruby
RushPL has joined #ruby
dukedave has joined #ruby
caw__ has joined #ruby
manveru has joined #ruby
nyuszika7h has joined #ruby
jinie has quit [Ping timeout: 260 seconds]
ReinH has quit [Ping timeout: 260 seconds]
bokayio has quit [Ping timeout: 240 seconds]
wolfshappen has quit [Ping timeout: 240 seconds]
ReinH has joined #ruby
Ltem has joined #ruby
Hanma[m] has joined #ruby
selim has quit [Ping timeout: 260 seconds]
Psybur has joined #ruby
oleo has joined #ruby
velu_aon[m] has joined #ruby
bokayio has joined #ruby
selim has joined #ruby
jinie has joined #ruby
itmerc[m] has joined #ruby
KevinMGranger has joined #ruby
Guest22845 is now known as rich
rich has quit [Changing host]
rich has joined #ruby
Giphy[m] has joined #ruby
Psybur_ has quit [Ping timeout: 246 seconds]
wolfshappen has joined #ruby
ogurk has quit [Ping timeout: 260 seconds]
rich is now known as h43z
joast has quit [Quit: Leaving.]
yohji has joined #ruby
yohji has quit [Remote host closed the connection]
joast has joined #ruby
h43z has left #ruby ["WeeChat 1.6"]
yohji has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
goatish has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
mark_66 has quit [Remote host closed the connection]
bijan_ is now known as bijan_awaaaay
trautwein has quit [Ping timeout: 246 seconds]
<za1b1tsu>
x.map { |x| load_data(x) } is there somehow I can make this prettier?
<adaedra>
no
conta has quit [Ping timeout: 240 seconds]
<za1b1tsu>
:'( ok
bijan_awaaaay has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<adaedra>
The alternative would be `x.map(&method(:load_data))`, but that's not better
synthroid has quit [Remote host closed the connection]
<havenwood>
za1b1tsu: you could ditch the parens ;-P
<za1b1tsu>
yeah..you are right, but nice to know about &method
<za1b1tsu>
havenwood :)
bronson has joined #ruby
<havenwood>
za1b1tsu: Yeah, it's handy from time to time. I usually use &public_method unless it's private - even though it's more verbose.
<ruby[bot]>
havenwood: # => method `puts' for class `#<Class:#<Object:0x41819340>>' is private (NameError) ...check link for more (https://eval.in/940079)
nowhere_man has joined #ruby
<havenwood>
za1b1tsu: e.g. ^
bronson has quit [Ping timeout: 260 seconds]
nowhereman_ has quit [Ping timeout: 240 seconds]
<za1b1tsu>
havenwood: interesting, thank you
TomyWork has quit [Ping timeout: 240 seconds]
zipace has joined #ruby
bijan_ has joined #ruby
justinfaler has joined #ruby
sepp2k has joined #ruby
cschneid has joined #ruby
cschneid has quit [Client Quit]
chussenot has quit [Quit: chussenot]
Toggi3 has quit [Ping timeout: 260 seconds]
cdg_ has joined #ruby
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
Toggi3 has joined #ruby
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jeffreylevesque has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
andikr has quit [Remote host closed the connection]
dwickern has joined #ruby
troys has joined #ruby
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rrutkowski has quit [Quit: rrutkowski]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
gil_ has quit [Ping timeout: 255 seconds]
FrostCandy has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
<FrostCandy>
Confusing. Does .nil? catch mysql NULL, ruby nil, and mysql '' as true?
nofxx has quit [Remote host closed the connection]
justinfaler has quit [Ping timeout: 260 seconds]
gil_ has joined #ruby
<FrostCandy>
Prgramming is hard, when I grow up I want to be a non-essential governmental worker. :)
TomyLobo has joined #ruby
<apeiros>
FrostCandy: that depends on whatever you use to connect to your db. but usually, database drivers translate NULL to nil
dinfuehr has quit [Ping timeout: 264 seconds]
<FrostCandy>
apeiros: would a empty string be nil too?
<apeiros>
no. why would it?
camonz has joined #ruby
<apeiros>
but again, depends on your db & db driver. oracle f.ex. usually doesn't store empty strings but instead turns it to NULL (which in turn is usually represented as nil in ruby)
<FrostCandy>
it shouldn't, so to check for nil or empty do i need to check 2 things or is there a idomatic way of checking this in ruby
armyriad has quit [Quit: Leaving]
desperek has joined #ruby
dinfuehr has joined #ruby
<apeiros>
with plain ruby, two checks. with rails, you can potentially use .blank?
<apeiros>
though note that " " is blank too
<FrostCandy>
Ah ok, so testing is the best thing to do here as it could be diff dependign on dirvers
tomphp has joined #ruby
<FrostCandy>
ok thanks apeiros
qba73 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
tomphp has quit [Client Quit]
mtkd has quit [Ping timeout: 240 seconds]
qba73 has joined #ruby
Psybur has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Client Quit]
justinfaler has joined #ruby
alfiemax has joined #ruby
dionysus69 has joined #ruby
Psybur has joined #ruby
mtkd has joined #ruby
armyriad has joined #ruby
cadillac_ has quit [Ping timeout: 248 seconds]
nofxx has joined #ruby
Dimik has joined #ruby
rrutkowski has joined #ruby
guacamole has joined #ruby
jamesaxl has joined #ruby
guacamole has quit [Client Quit]
[Butch] has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
cadillac_ has joined #ruby
Burgestrand has joined #ruby
anisha has joined #ruby
ledestin has joined #ruby
aufi has quit [Quit: Leaving]
brucebag has quit [Quit: brucebag nipped out]
goatish has quit [Ping timeout: 246 seconds]
Burgestrand has quit [Quit: Closing time!]
al2o3-cr has joined #ruby
yohji has quit [Quit: Leaving]
yohji has joined #ruby
yohji has quit [Remote host closed the connection]
_yohji_ has joined #ruby
milardovich has joined #ruby
_yohji_ has quit [Remote host closed the connection]
_yohji_ has joined #ruby
jeffreylevesque has quit [Ping timeout: 260 seconds]
_yohji_ has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justinfaler has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
theunraveler has quit []
jtdoncas_ has joined #ruby
Serpent7776 has quit [Quit: Leaving]
justinfaler has joined #ruby
troys is now known as troys_
cdg_ has quit [Remote host closed the connection]
milardovich has joined #ruby
qba73 has quit []
nowhere_man has quit [Ping timeout: 260 seconds]
darkhanb has joined #ruby
nertzy has joined #ruby
troys_ is now known as troys
tvw has quit [Remote host closed the connection]
milardovich has quit [Ping timeout: 240 seconds]
sanscoeur has joined #ruby
sanscoeur has quit [Remote host closed the connection]
sanscoeur has joined #ruby
cdg has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.9]
workmad3 has joined #ruby
orbyt_ has joined #ruby
catphish has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
audy has joined #ruby
workmad3 has joined #ruby
Beams has quit [Quit: .]
jtdoncas_ has quit [Ping timeout: 264 seconds]
rrutkowski has quit [Quit: rrutkowski]
bronson has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 256 seconds]
huyderman has quit [Read error: Connection reset by peer]
imode has joined #ruby
konsolebox has quit [Ping timeout: 246 seconds]
cdg_ has joined #ruby
claudiuinberlin has joined #ruby
<craysiii>
I'm attempting to learn RSpec, and having trouble writing a certain test. I'm trying to determine whether a Module has been extended in a Class instance during initialization. Seems like I can't use #ancestors, as it's an instance and not the class itself. Any other ideas?
cdg has quit [Ping timeout: 246 seconds]
<apeiros>
your phrasing is confusing. you mean you want to test whether `Foo.extend Bar` has been used? if so, `Foo.is_a?(Bar)`
<craysiii>
Sorry, let me give you an example on Gist
<craysiii>
good questions to ask myself, the previous gem I wrote I kinda hacked a solution together like this, trying to organize this one better, but beforehand trying to force myself to learn RSpec and more intricacies of ruby
<craysiii>
i appreciate the response :)
<apeiros>
ok. if you *always* extend instances with TradingPairAPI, then that code is terrible and `class REST; include TradingPairAPI; …` would be much better.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tlaxkit has quit [Quit: Saliendo...]
DTZUZU has joined #ruby
milardovich has joined #ruby
c0ncealed has quit [Remote host closed the connection]
anisha has quit [Quit: This computer has gone to sleep]
<vrotsok>
Good evening every1... i just installed ruby on windows 7 and when i try install Rails by typing on cmd 'gem install rails' it outputs an error about nokogiri 1.8.1..... can any1 help ?
vrotsok_ has joined #ruby
<craysiii>
vrotsok did you install the DevKit?
<adaedra>
Easy solution: Don't Ruby under Windows.
<vrotsok>
how do i do that ?
<vrotsok_>
..
<craysiii>
its documented on the RubyInstaller website. I agree with adaedra though, run ruby in a VM or on WSL
<adaedra>
Ruby under Windows is just not worth it. You'll have trouble with gem compilations and other funky things.
<vrotsok>
i just wanted to take a taste of RubyMine of intellij and i dont have enough space on HD so daaaaaaaarn
<craysiii>
rubymine is nice in my opinion
<adaedra>
it is, a bit heavy though
<vrotsok_>
on github wikipage of devkit says that from 2.4 version of ruby they use 'msys2' which i've already installed
<vrotsok_>
should i still install the devkit ?
shorberg has quit [Quit: shorberg]
<craysiii>
apieros if you aren't busy or don't mind can I PM you and explain?
<apeiros>
?tabnick craysiii
<ruby[bot]>
craysiii: pro-tip - use tab completion for nicks. avoids typos in nicks.
<apeiros>
you an pm me, but I usually don't give ruby help in pms
* apeiros
thinks apieros is API eros, god of the erotic APIs
* craysiii
bows
<adaedra>
Please, this is a SFW channel.
<apeiros>
he's not here though. I'm apeiros :-p
GremL1N3 has quit [Ping timeout: 264 seconds]
eckhardt has joined #ruby
jeffreylevesque has joined #ruby
vichib has joined #ruby
vichib has quit [Read error: Connection reset by peer]
<banisterfiend>
it seems so obvious yet i haven't seen something, it's also super-easy to do
<Yxhuvud>
diff lcs and related?
PaulCapestany has quit [Ping timeout: 248 seconds]
alfiemax has quit [Remote host closed the connection]
<banisterfiend>
Yxhuvud what's ics
alfiemax has joined #ruby
<banisterfiend>
oh no, this is just a git diff that i've sent through a syntax highlighter lol
<banisterfiend>
it works similar to github diffs, it just highlights the lines that begin with +
kies has quit [Ping timeout: 264 seconds]
aonemd has joined #ruby
<banisterfiend>
but it detects multiple languages even in the same diff, so it correclty syntax hihglights C, Ruby, javascript code, etc even if they appear in the same diff
<banisterfiend>
nothing impressive but i've found it useful
* Yxhuvud
just use diff-mode
<apeiros>
banisterfiend: I'm not aware of something which does that, no. only projects which do either (diff or syntax highlight)
PaulCape_ has quit [Ping timeout: 268 seconds]
<apeiros>
banisterfiend: would be really nice if git diff would support pluggable highlighters
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kies has joined #ruby
<banisterfiend>
yea
<banisterfiend>
i had to strip all colors and then recolor things manually
kies has quit [Remote host closed the connection]
<apeiros>
well, at least the color stripping is easy :D
<apeiros>
and unnecessary I think? at least I thought there was an option to have colorless diff?
vrotsok_ has quit [Quit: Page closed]
aonemd has quit [Ping timeout: 256 seconds]
aonemd_ has joined #ruby
<banisterfiend>
well the colors are stripped automatically cos i pipe it :D
<banisterfiend>
i just go: git diff | diff_higlight
<banisterfiend>
that does it
cdg_ has quit [Remote host closed the connection]
vrotsok has quit [Ping timeout: 260 seconds]
<banisterfiend>
git detects it's not writing to a tty so it strips colors by itself\
hxegon has quit [Remote host closed the connection]
aonemd has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
<banisterfiend>
\
aonemd has quit [Client Quit]
alfiemax has quit [Read error: Connection reset by peer]
<apeiros>
you know you have to continue that statement
<adaedra>
nah, you can't close my ) before you close apeiros's :-(
eckhardt has joined #ruby
<apeiros>
soooo close
PaulCapestany has joined #ruby
aonemd has quit [Ping timeout: 248 seconds]
ur5us has joined #ruby
<craysiii>
im a failure :( ):
<adaedra>
nooooo
<baweaver>
People in this channel speak in a Lisp I see
<apeiros>
we cherish these weapons from a more civilized age
alfiemax has quit [Ping timeout: 268 seconds]
aonemd has joined #ruby
<baweaver>
Only in Lisp can you be a Pyramid Schemer and a Racketeer and still get some Clojure afterwards
aonemd has quit [Client Quit]
ur5us has quit [Ping timeout: 268 seconds]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
zapata has quit [Read error: Connection reset by peer]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
catphish has joined #ruby
<catphish>
i'm not really looking for assistance, but i want to moan, i've spent all afternoon trying to work out why under some specific circumstance (that i've yet to identify) both unicorn and thin are terminating my http responses part-way through a chunk
<catphish>
it's maddening :)
<apeiros>
catphish: had something similar. in our case the proxy timed out.
<apeiros>
(yes, very long request, not due to our side)
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sauvin has quit [Ping timeout: 240 seconds]
<baweaver>
How much would people be interested in a book detailing some more advanced Ruby and black magicks?
<adaedra>
Since it's Ruby, shouldn't it be red magicks?
zapata has joined #ruby
amatas_ has quit [Quit: amatas_]
<catphish>
apeiros: yeah, looking into various places it could be a timeout, but i don't think that's what's happening this time
<catphish>
i think i will try to print everything that's yielded to rack into timestamped files to i can make a reproducible copy of the problem
orbyt_ has joined #ruby
bmurt has joined #ruby
<catphish>
i'll have my rack app log everything it yields to timestamped files and see if i can make a reproducible test case :)
Ltem has quit [Quit: Leaving]
<banisterfiend>
catphish does strace yield any insights?
conta has joined #ruby
PaulCapestany has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
keyjoo_ has joined #ruby
<catphish>
banisterfiend: i haven't checked, there'd be too much to know where to look
<banisterfiend>
not necessarily
<banisterfiend>
also you can filter the system calls
<catphish>
i also kinda already know what's happening on the outside of the app (it closes a tcp socket unexpectedly)
<catphish>
maybe strace might indicate what happens immediately before
<banisterfiend>
yea :)
<banisterfiend>
if you're on osx it's called 'dtruss' btw
<banisterfiend>
or dtrace if you wanna get jiggy
KeyJoo has quit [Ping timeout: 276 seconds]
<catphish>
anyway, hopefully i can reproduce it in a more controller manner (ie not depending on the rest of my production application and infrastructure)
<catphish>
*controlled
moei has joined #ruby
<catphish>
it's all linux :)
guille-moe has quit [Ping timeout: 240 seconds]
<catphish>
one of those nice bugs that only happens for one particular request from one particular customer :)
ta_ has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has quit [Ping timeout: 268 seconds]
<zenspider>
if you used proper indentation, you'd see it better
<zenspider>
it even says "expecting keyword_end"... that's your hint of what to look for
<wwalker>
then why is the exact same code accepted by ruby.
<zenspider>
it isn't the exact same. read your gist againt
<wwalker>
but it says that while I'm entering the lines. I've done nothing to tell irb I'm at the end of input
<adaedra>
irb will try to interpret once you've closed all the blocks
<adaedra>
you see the nesting level, it's the last number in the prompt
<wwalker>
which I have not yet done
<adaedra>
it doesn't seem to increment the nesting level at the b_c.each line tho
<wwalker>
right, before it throws an error I should have the opportunity to type in the last end
<adaedra>
but it throws the error thinking you're done because it thinks you closed as many blocks as you opened
<adaedra>
not sure why tho
<adaedra>
try without the `do` at `for`?
<zenspider>
yup... that's it. unfortunately
<zenspider>
this is just gross code to begin with... and I don't understand coding at the def level by copy/pasting into irb
Psybur_ has joined #ruby
<adaedra>
tested, effectively irb chokes on it while pry has no problem with it
<zenspider>
either use an editor with proper irb support, or use load
plexigras has quit [Ping timeout: 268 seconds]
<zenspider>
or just code using tests and then you need not use irb at all. I only use irb for exploratory fragments
<wwalker>
the question is why irb is puking. its an intern's code, it just happens to break irb
<zenspider>
the question was answered. I'm going beyond that
alfiemax has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
<zenspider>
at first glance, this looks like this is (a.chars & b.chars).size
darix has quit [Quit: may the packets be with you...]
<wwalker>
:-)
<zenspider>
it shouldn't manipulate the input (t_a.insert). it shouldn't use indexing. it shouldn't use for. it shouldn't use ...
<wwalker>
as I said, intern.
<zenspider>
then your intern should be pairing and not writing code in a vacuum
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wwalker>
true
cagmz_ has joined #ruby
Raffy has quit [Changing host]
Raffy has joined #ruby
<zenspider>
the short answer is: irb doesn't have a "real" ruby parser and it gets tripped up on edge cases. File a bug with this example (you can probably pair it down to just the def + for) at bugs.ruby-lang.rog
ahrs has quit [Remote host closed the connection]
<zenspider>
org. sorry
cagmz has quit [Ping timeout: 260 seconds]
<zenspider>
most ppl don't use for, so this was probably overlooked
<wwalker>
good point
PaulCape_ has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
ahrs has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
<wwalker>
thanks
wilbert has joined #ruby
darix- has joined #ruby
darix- is now known as darix
bijan_ has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
mtkd has quit [Ping timeout: 268 seconds]
<zenspider>
how would you write `doit`?
<zenspider>
assert_equal %w[b b a a a b b], doit(%w[b b a a a b b a b])
<zenspider>
assert_equal %w[ a a a b b], doit(%w[ a a a b b a b])
Kestrel-029 has quit [Ping timeout: 252 seconds]
mtkd has joined #ruby
keyjoo_ has quit [Quit: Good luck! Have a nice Day!]