eka has quit [Quit: My computer has gone to sleep. ZZZzzz…]
kireevco has quit [Quit: Leaving.]
<Authenticator>
When calling Open3.capture3(cmd) where cmd is ['p4','fstat',file1, file2], I get a SystemStackError when cmd.length > ~100_000... When I rescue the error and check caller it's never got anything in it, unlike when I rescue def x ; x ; end and caller is ~9500 entries long. What's going on?
kireevco has joined #ruby
banjara1 has joined #ruby
kireevco has quit [Remote host closed the connection]
<shevy>
sleepee \o/
kireevco has joined #ruby
kireevco has quit [Client Quit]
<^conner>
alex2, everything in Ruby is an object... even classes... so you may not really want to look at everything but try this in irb bjectSpace.each_object.each {|x| p x }
postmodern has quit [Quit: Leaving]
kireevco has joined #ruby
<sleepee>
thanks shevy. its exactly what i was looking for. its got links to the rdocs, which is perfect.
<shevy>
hehe
<^conner>
alex2, or ObjectSpace.each_object.each {|x| p x.class }
pwh has joined #ruby
banjara has quit [Ping timeout: 252 seconds]
<alex2>
^conner: Nice
toastynerd has quit [Ping timeout: 252 seconds]
<alex2>
^conner: there is no map :(
<^conner>
alex2, do you mean a perl style map? There is Hash#map
<^conner>
ObjectSpace.each_object returns an interator
<sleepee>
just gem installed pry. so far i'm liking the pretty colors.
<^conner>
your trying to call the #collect method on a class name
dodosan has joined #ruby
<^conner>
I doubt that class implements the #collect method
gigetoo has joined #ruby
<^conner>
alex2, your probably looking for ObjectSpace.each_object.collect { |object| object.class }.uniq
d34th4ck3r has joined #ruby
ddv has quit [Ping timeout: 245 seconds]
<^conner>
alex2, make sense?
<shevy>
sleepee colours can be enabled in irb too; gem install wirble; also have a look at awesome_print though I dont like that it has so many colours haha
djbkd has quit [Remote host closed the connection]
x1337807x has quit [Ping timeout: 240 seconds]
brandonjmckay has joined #ruby
redondos has quit [Excess Flood]
armyriad has quit [Ping timeout: 260 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
yubrew has quit [Ping timeout: 240 seconds]
redondos has joined #ruby
armyriad has joined #ruby
<sleepee>
good call. just looked at wirble's rdoc. tab-completion and save history can come in handy.
<alex2>
^conner: collect keywords, true|false, global variables $stdin, ARGV, etc.
_djbkd has joined #ruby
<timgauthier>
haha i've heard of that shevy
<iLeoable>
I'm just going to use rvm
<baweaver>
Anyone have luck getting pry-remote_em to work on a non-local ip?
<^conner>
alex2, I'm still not following... sorry
<iLeoable>
screw this...
<shevy>
iLeoable there can be many reasons for a segfault
<alex2>
^conner: :(
<toretore>
schifffahrt tsk tsk
<timgauthier>
shevy i'm reinventing the wheel
<iLeoable>
I've installed it not that long ago though. I uninstalled it and now it doesn't work
<toretore>
schiffahrt
<iLeoable>
Dreamhost comes with ruby 1.8 by default
zorak has joined #ruby
saarinen has quit [Quit: saarinen]
<shevy>
timgauthier yeah
<shevy>
iLeoable that is painful, we are all past 2.x now
<timgauthier>
shevy i am building the RSVP form for my wedding and i was going to use a service, but i'm not super happy with it. so i'm building it in html myself
<alex2>
^conner: i have to sleep
<alex2>
Have a good night
<shevy>
damn
<shevy>
wedding
<alex2>
^^
NukePuppy has joined #ruby
<timgauthier>
yea bro
<^conner>
alex2, goodnight
armyriad has quit [Ping timeout: 255 seconds]
<alex2>
:-)
<shevy>
it'll change you!
alex2 has quit [Quit: WeeChat 0.4.3]
armyriad has joined #ruby
<iLeoable>
I know right! All of the docs are outdated from Dreamhost
djbkd has quit [Ping timeout: 245 seconds]
luksaur has quit [Quit: home]
bmurt has joined #ruby
_djbkd has quit [Ping timeout: 264 seconds]
doodlehaus has joined #ruby
b00stfr3ak has quit [Ping timeout: 260 seconds]
<shevy>
timgauthier are you into rails?
Megtastique has joined #ruby
<timgauthier>
not overly, i did a project (front end) in it once
dhaivat has quit [Quit: dhaivat]
acalewin has joined #ruby
<timgauthier>
why shevy ?
zz_karupa is now known as karupa
dhaivat has joined #ruby
<shevy>
timgauthier dunno
<shevy>
it's still on my todo list to change my local cgi stuff into rails
djbkd has joined #ruby
<timgauthier>
sweet
endash has joined #ruby
diegoviola has joined #ruby
moritzschaefer has quit [Ping timeout: 276 seconds]
zorak has quit [Ping timeout: 240 seconds]
xanandu has quit [Ping timeout: 240 seconds]
lw has quit [Quit: s]
nanoyak has quit [Quit: Computer has gone to sleep.]
armyriad has quit [Ping timeout: 240 seconds]
SilverKey has joined #ruby
armyriad has joined #ruby
fgo has joined #ruby
gattuso has quit [Ping timeout: 260 seconds]
armyriad has quit [Remote host closed the connection]
alexju has joined #ruby
endash has quit [Client Quit]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gattuso has joined #ruby
<RubyPanther>
rails sucks, I recommend cgic
reset has quit [Ping timeout: 252 seconds]
<timgauthier>
write it in apple swift
djbkd has quit [Remote host closed the connection]
Newman_ has joined #ruby
<Newman_>
Is there no longer a #rubyonrails channel?
<wallerdev>
there is
<wallerdev>
its named #rubyonrails
brandonjmckay has joined #ruby
brandonjmckay has quit [Read error: Connection reset by peer]
<Newman_>
it says 0 users for me?
<wallerdev>
you need to identify to nickserv to join
fgo has quit [Ping timeout: 240 seconds]
x1337807x has joined #ruby
alexju has quit [Remote host closed the connection]
razrunelord has joined #ruby
tyfighter has quit [Quit: tyfighter]
<Newman_>
Ah ha! Thanks wallerdev, got it now :)
eka has joined #ruby
frogssgy is now known as frogsy
lemur has joined #ruby
x1337807x has quit [Read error: Connection reset by peer]
^conner has quit [Quit: Leaving]
x1337807x has joined #ruby
Gil has joined #ruby
dik_dak has joined #ruby
thepreacher has joined #ruby
Shidash has quit [Ping timeout: 240 seconds]
Zenigor has joined #ruby
doodlehaus has quit [Remote host closed the connection]
doodlehaus has joined #ruby
Zenigor has quit [Remote host closed the connection]
dhaivat has quit [Quit: dhaivat]
dhaivat has joined #ruby
jhulten has quit [Remote host closed the connection]
oo_ has joined #ruby
lemur has quit [Ping timeout: 252 seconds]
SilverKey has quit [Quit: Halted.]
charliesome has joined #ruby
razrunelord has quit [Remote host closed the connection]
Gil has quit [Ping timeout: 260 seconds]
razrunelord has joined #ruby
lethe has joined #ruby
shiggity_ has quit [Quit: shiggity_]
doodlehaus has quit [Ping timeout: 240 seconds]
moritzschaefer has joined #ruby
alexju has joined #ruby
zorak has joined #ruby
zkay11 has joined #ruby
pzula has joined #ruby
xanandu has joined #ruby
ner0x has joined #ruby
d34th4ck3r has quit [Quit: zzz]
mr_snowf1ake has joined #ruby
razrunelord has quit [Ping timeout: 245 seconds]
snath has quit [Ping timeout: 252 seconds]
doodlehaus has joined #ruby
superscott[8] has quit []
nfk has quit [Quit: yawn]
aspires has quit []
benlieb has joined #ruby
yubrew has joined #ruby
clickclack has joined #ruby
Shidash has joined #ruby
seanewest has left #ruby [#ruby]
anaeem1 has joined #ruby
mercwithamouth has joined #ruby
<Newman_>
Can I ask a rails question in here? Didn't receive a reply in the #ror channel
banjara has joined #ruby
dhaivat has quit [Quit: dhaivat]
thepreacher has quit [Quit: Leaving]
terrell_t has joined #ruby
sleepee has quit [Quit: Leaving]
yubrew has quit [Ping timeout: 252 seconds]
anaeem1 has quit [Ping timeout: 264 seconds]
dhaivat has joined #ruby
doodlehaus has quit [Remote host closed the connection]
Lucky__ has joined #ruby
banjara has quit [Ping timeout: 240 seconds]
terrellt has quit [Ping timeout: 240 seconds]
doodlehaus has joined #ruby
Lucky__ has quit [Client Quit]
<shevy>
Newman_ you can try but most people here won't know rails
pasties has joined #ruby
arrubin has joined #ruby
<Newman_>
Oh ok
terrell_t has quit [Ping timeout: 255 seconds]
<shevy>
so rails-specific questions here will probably go unanswered, you may have more luck with ruby-centric questions
<Newman_>
I've been trying to google my answer but not exactly sure what I should be searching for. Basically I have two scaffolds: players & messages. Players has a bunch of info (name, position, etc) - what is the best practice for being able to access this stuff in the messages view?
<shevy>
<shevy> avoiding class variables is always good
<ari-_-e>
shiggity_: preferable for what?
carlyle has quit [Read error: Connection reset by peer]
rhys has joined #ruby
<shevy>
hehe
timonv has joined #ruby
<shiggity_>
Ah ok so it doesn’t expose that var up the chain?
<shiggity_>
preferable for clean code, OO code
<ari-_-e>
shiggity_: what chain?
<shiggity_>
Looking at Shevy’s example
<ari-_-e>
shiggity_: it depends on what you want to do...
<shiggity_>
Yeah… I hear ya
<ari-_-e>
still not sure what chain you mean
St_Marx has joined #ruby
aspires has quit []
<shevy>
ari-_-e class variables leak into subclasses
shack4 has joined #ruby
<shevy>
and why am I always getting nick uppercased :(
<shiggity_>
i suck at using irc, its my fault :)
Boohbah has joined #ruby
<shack4>
anyone here program ruby on a mac?
<shiggity_>
<— this guy
tacos1de has joined #ruby
aspires has joined #ruby
oo_ has quit [Remote host closed the connection]
<shack4>
is there anything besides sublime that you use, prefereably free?
carlyle has joined #ruby
timonv has quit [Ping timeout: 260 seconds]
<shiggity_>
sublime is my preferred. textwrangler has its uses too.
<shack4>
is that free?
<shiggity_>
yeah
lw has quit [Quit: s]
banjara has joined #ruby
tectonic has quit []
<shevy>
shack4 I still use bluefish 1.0.7
<shevy>
it's hard to change
<gbchaosmaster>
Vim anyone?
<shevy>
when I was young
<shevy>
and innocent
carlyle has quit [Ping timeout: 255 seconds]
<shevy>
but it messed with my brain
<shevy>
I felt like a robot
<shevy>
:ggajkghGKEUHGO§5789151hjklg
<shevy>
oops
<shevy>
I accidentally cleared the xchat buffer for #ruby lol
mjsmith2 has quit [Remote host closed the connection]
shevy has left #ruby ["I'll be back ... maybe"]
yohanobs_ has joined #ruby
fgo has quit [Remote host closed the connection]
carlyle has joined #ruby
yohanobs__ has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
Gil has joined #ruby
yohanobs_ has quit [Ping timeout: 240 seconds]
<timgauthier>
haha
brunops has quit [Quit: leaving]
<timgauthier>
i hate atom.io because it still doesn't let me close tags in any way
GriffinHeart has joined #ruby
<timgauthier>
c'mon, textmate and sublime BOTH do it
crazymykl has joined #ruby
gorpon has quit [Ping timeout: 255 seconds]
shiggity_ has quit [Quit: shiggity_]
mikemac has quit [Quit: Konversation terminated!]
<pontiki>
EMACS SUCKERS
end_guy has joined #ruby
Kricir has joined #ruby
<pontiki>
but xcode is included on the mac
d34th4ck3r has quit [Quit: d34th4ck3r]
<pontiki>
it's not super horrible to code in, kind of like eclipse
dhaivat has joined #ruby
carlyle has joined #ruby
Gil has quit [Ping timeout: 264 seconds]
agent_white has quit [Quit: baibai]
carlyle has quit [Read error: Connection reset by peer]
d34th4ck3r has joined #ruby
zkay11 has quit [Quit: Leaving.]
kenneth has joined #ruby
GriffinHeart has quit [Ping timeout: 252 seconds]
carlyle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
toastynerd has quit [Remote host closed the connection]
kireevco has quit [Quit: Leaving.]
n_blownapart has joined #ruby
toastynerd has joined #ruby
tectonic has joined #ruby
brunops has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<n_blownapart>
pastie.org/9252177 sorry very odd these two methods don't return the last to be iterated over (the words 'name' and 'ago') how can that be?
carlyle has joined #ruby
d34th4ck3r has quit [Quit: zzz]
<pontiki>
yeah, it'd be great if you showed the output and what you were expecting
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e>
n_blownapart: you print before you add to the hash...
aspires has quit []
<pontiki>
you are printing transformed at the beginning
sski has quit [Remote host closed the connection]
brain_shim has quit [Ping timeout: 276 seconds]
<ari-_-e>
n_blownapart: also you're talking about printing, not returning
sambao21 has joined #ruby
<n_blownapart>
pontiki: hmm, why does it populate the hash except for the last iterated word? ari-_-e
<timgauthier>
pontiki the new update to xcode WILL show the output of code?
<timgauthier>
oh nm i misread
<ari-_-e>
n_blownapart: because you print before you add to the hash...
<pontiki>
n_blownapart: you haven't shon the hash at the end of either loop
carlyle has joined #ruby
<n_blownapart>
haven't what? pontiki
<pontiki>
shown
<pontiki>
sorry
<ari-_-e>
n_blownapart: all of this stuff happens in a set order
oo_ has joined #ruby
<ari-_-e>
all you need to do is look at your code and figure out what order things are happening in
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e>
there's no mystery or magic to it
ehc has joined #ruby
robbyoconnor has joined #ruby
<n_blownapart>
ari-_-e: could you elaborate? it seems the operation is stopped dead in its tracks. so it creates the hash and prints it except for the last element. why?
tectonic has quit [Ping timeout: 252 seconds]
<pontiki>
n_blownapart: it has NOT stopped
<pontiki>
it completes just fine
<ari-_-e>
n_blownapart: why do you think it stops?
<pontiki>
you just haven't printed the final value
<ari-_-e>
n_blownapart: look
carlyle has joined #ruby
<ari-_-e>
n_blownapart: do the loop in your head
<ari-_-e>
n_blownapart: and pay attention to what is happening when
fgo has joined #ruby
<ari-_-e>
this program is entirely deterministic
<ari-_-e>
the operations happen in a specific order
carlyle has quit [Read error: Connection reset by peer]
x1337807x has joined #ruby
<n_blownapart>
ari-_-e: sorry the way I do it in my head is most likely unfounded.
brunops has quit [Ping timeout: 252 seconds]
x1337807x has quit [Max SendQ exceeded]
<ari-_-e>
n_blownapart: well, go through it here
<n_blownapart>
I don't understand what you are asking. ^
<pontiki>
then step through it with a debugger
tectonic has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
x1337807x has joined #ruby
brunops has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<n_blownapart>
pontiki: I would love to know how to use pry. where would I put binding.pry ?
<pontiki>
right at the very top
<n_blownapart>
kay
<pontiki>
require 'pry'; binding.pry
carlyle has joined #ruby
<n_blownapart>
pontiki: one sec
<ari-_-e>
n_blownapart: you had this exact same problem a few days ago, if I remember correctly
<n_blownapart>
ari-_-e: well the block arguments sequence confused me but I have that straight now.
toastynerd has quit [Remote host closed the connection]
<ari-_-e>
you were having trouble with the order that things were happening in
carlyle has quit [Read error: Connection reset by peer]
<ari-_-e>
n_blownapart: tell me this:
<ari-_-e>
n_blownapart: if I set i = 0
<ari-_-e>
and then I print i
<ari-_-e>
and then I set i = 5
<ari-_-e>
what would be printed?
rezzack has joined #ruby
meatherly has joined #ruby
carlyle has joined #ruby
brain_shim has joined #ruby
<n_blownapart>
ari-_-e: 5
<ari-_-e>
n_blownapart: why?
<n_blownapart>
because the initial assignment is overwritten
carlyle has quit [Read error: Connection reset by peer]
<pontiki>
wwwwwwow
<ari-_-e>
pontiki: :-/
<ari-_-e>
n_blownapart: ok
<ari-_-e>
n_blownapart: I set i = 0
<ari-_-e>
n_blownapart: what is i?
tectonic has quit []
brain_shim has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
<n_blownapart>
i points to zero
<ari-_-e>
ok
<ari-_-e>
n_blownapart: now I print i
meatherly has quit [Ping timeout: 265 seconds]
<ari-_-e>
n_blownapart: what have I just printed?
duncannz has joined #ruby
lethjakman has joined #ruby
<n_blownapart>
the value of i, what was assigned to it.
<ari-_-e>
n_blownapart: which was...?
XenoWolf has quit [Ping timeout: 264 seconds]
<n_blownapart>
0
<ari-_-e>
n_blownapart: ok
XenoWolf has joined #ruby
<ari-_-e>
n_blownapart: now I set i = 5
<ari-_-e>
have I printed anything else?
<n_blownapart>
no
<ari-_-e>
right
tjr9898__ has joined #ruby
dhaivat has quit [Quit: dhaivat]
<ari-_-e>
things happen in a very specific order
<ari-_-e>
based on how you have written your code
<pontiki>
does the 0 that got printed change to a 5?
razrunelord has joined #ruby
<ari-_-e>
things that come later do not effect things that are happening now
sski has joined #ruby
anaeem1 has joined #ruby
carlyle has quit [Ping timeout: 255 seconds]
run_kmc has joined #ruby
run_kmc is now known as Guest37287
banjara has quit [Quit: Leaving.]
<n_blownapart>
I don't follow. why would 4 or 5 words receive the same treatment and not the last if each element of the array is 'iterated over' and returned in a hash.?
dhaivat has joined #ruby
<ari-_-e>
n_blownapart: how are you thinking that the output is produced?
neersighted has joined #ruby
<ari-_-e>
n_blownapart: what line produces the output that you see?
<n_blownapart>
ari-_-e: this would be guesswork but...
carlyle has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
razrunelord has quit [Ping timeout: 252 seconds]
<ari-_-e>
it shouldn't be guesswork
<n_blownapart>
in the first inject method, line 10 'transformed' returns the value of the block.
lethjakman has quit [Ping timeout: 240 seconds]
<ari-_-e>
n_blownapart: were you ever told what "puts" does?
aspires has joined #ruby
toastynerd has joined #ruby
<n_blownapart>
sorry ari-_-e wait that would be line 6. puts is print with a return of nil
<ari-_-e>
n_blownapart: ruby script do not automatically print anything
<n_blownapart>
yeah puts is what prints the line, but in the first method line 6 is necessary because in inject the return value must be there on line 6
<ari-_-e>
n_blownapart: only things that are explicitly printed are printed
razrunelord has joined #ruby
<ari-_-e>
n_blownapart: ok, what does the return value do?
toastynerd has quit [Read error: No route to host]
<ari-_-e>
n_blownapart: also, I'll ask again: what produces the output that you see?
toastynerd has joined #ruby
sski has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<n_blownapart>
ari-_-e: well, the return value gets you out of the block, and apparently inscribes little strange outputs somewhere in the top level
yfeldblum has quit [Ping timeout: 260 seconds]
<ari-_-e>
n_blownapart: what would you say the "puts" lines do?
sski has joined #ruby
oo_ has joined #ruby
badhatter has joined #ruby
badhatter has joined #ruby
__class__ has quit [Ping timeout: 252 seconds]
<n_blownapart>
it prints output but the actual return value is nil.
comma8 has quit [Quit: Leaving]
<ari-_-e>
n_blownapart: again, nothing is printed unless it is explicitly printed
<ari-_-e>
n_blownapart: tell me about return values
comma8 has joined #ruby
<ari-_-e>
n_blownapart: what happens to return values?
<ari-_-e>
do they get printed?
amargherio has quit [Remote host closed the connection]
<ari-_-e>
n_blownapart: why is it relevant that the return value of puts is nil?
<n_blownapart>
ari-_-e: let me think about thatj
arrubin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<n_blownapart>
nil is an object. so and object is always returned in ruby I believe
<n_blownapart>
an*
razrunelord has quit [Ping timeout: 240 seconds]
brain_shim has joined #ruby
<ari-_-e>
yes, there is always a return value, that's true
kireevco has joined #ruby
<ari-_-e>
but why is it relevant that puts returns nil?
<ari-_-e>
n_blownapart: you're saying that as if it makes the puts unimportant
rkazak has joined #ruby
lw has joined #ruby
subbyyy_ has joined #ruby
<DEA7TH>
c += {whichever's first element is smaller from a and b}.shift(1)
yubrew has joined #ruby
<DEA7TH>
that's what I want ideally
sski has quit [Ping timeout: 264 seconds]
oo_ has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
goleldar has joined #ruby
<n_blownapart>
because a print operation just gets it to the screen. no not unimportant, but the output is separate from the printing of the output...?
<ari-_-e>
n_blownapart: explain this separation to me
subbyyy has quit [Ping timeout: 240 seconds]
<pontiki>
DEA7TH: you could use a ternary operator
mjsmith2_ has joined #ruby
<pontiki>
c += a[0] < b[0] ? a.shift : b.shift
<n_blownapart>
the actual output could be sent elsewhere, the puts method merely puts it to the screen and its own calling returns nil.
<n_blownapart>
ari-_-e: you were asking me about the significance of puts returning nil.
mehlah has quit [Quit: Leaving...]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
ra4king has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
kireevco has joined #ruby
ra4king has joined #ruby
<ari-_-e>
argh
lw has quit [Quit: s]
newUser1234 has joined #ruby
ra4king has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<n_blownapart>
puts is merely for printing the value, but it doesn't have a distinct operation on the code like a bang ! operation or similar. ari-_-e
IcyDragon has quit [Quit: Space~~~]
ra4king has joined #ruby
sailias has joined #ruby
absolutezeroff has joined #ruby
tylersmith has quit [Remote host closed the connection]
sailias has quit [Read error: Connection reset by peer]
Slavox is now known as Slavox|AFK
ra4king has quit [Remote host closed the connection]
tylersmith has joined #ruby
ra4king has joined #ruby
<ari-_-e>
n_blownapart: what was the "actual" output that you were talking about?
diegovio1 is now known as diegoviola
oo_ has joined #ruby
rman is now known as rman_
shiggity_ has joined #ruby
<n_blownapart>
by actual I meant that in the block there are functions that alter the initial array of strings, that are the 'crux' of the program. print just reflects what the block is doing in terms of operations.
Cache_Money has quit [Quit: Cache_Money]
<n_blownapart>
ari-_-e: ^
bluOxigen has joined #ruby
Morkel has joined #ruby
anaeem1 has quit [Ping timeout: 252 seconds]
northfurr has joined #ruby
tylersmith has quit [Ping timeout: 260 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
rman_ is now known as ramblinpeck
SCommette has joined #ruby
anaeem1_ has joined #ruby
newUser1234 has joined #ruby
ehc has quit [Quit: ehc]
_justin has joined #ruby
<ari-_-e>
n_blownapart: I have to go
<n_blownapart>
ari-_-e: shit sorry I was trying ruby*panther tripped me up.
<ari-_-e>
you should go through the loop in your head and see which operations come before which other operations
<n_blownapart>
when I can visualize that I will be far along thanks very much ari-_-e really...
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ari-_-e>
n_blownapart: feel free to write it down
beneggett has joined #ruby
<n_blownapart>
many thanks ari-_-e you have patience -- much appreciated.
newUser1234 has quit [Read error: Connection reset by peer]
rkazak has quit [Quit: rkazak]
newUser1234 has joined #ruby
Kricir has joined #ruby
cuppscakes has quit [Ping timeout: 264 seconds]
<n_blownapart>
ari-_-e: yeah I will. pax
sski has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
aspires has joined #ruby
ari-_-e has quit [Quit: Leaving]
rurban_ has quit [Ping timeout: 240 seconds]
d34th4ck3r has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
Biohazard has quit [Ping timeout: 252 seconds]
oo__ has quit [Remote host closed the connection]
rurban_ has joined #ruby
eguim has quit [Ping timeout: 260 seconds]
Biohazard has joined #ruby
oo_ has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
lyanchih has joined #ruby
newUser1234 has joined #ruby
<shiggity_>
does it make sense to wrap array.delete(i) in a ‘if array.include?(i)’
<shiggity_>
Is that faster or not nesc/slower?
n_blownapart has quit [Remote host closed the connection]
kireevco has joined #ruby
shiggity_ has quit [Quit: shiggity_]
<ra4king>
HELL YEAH!
<ra4king>
I got my first ever Ruby CGI script running!
* ra4king
is happy
trhodes- has joined #ruby
meatherly has joined #ruby
trhodes_ has quit [Ping timeout: 264 seconds]
aspires has quit []
cuppscakes has joined #ruby
tylersmith has joined #ruby
yfeldblum has joined #ruby
sinkensabe has joined #ruby
<pontiki>
yay!
echevemaster has quit [Remote host closed the connection]
<pontiki>
what sort of CGI?
SCommette has quit [Quit: SCommette]
newUser1234 has quit [Read error: Connection reset by peer]
n_blownapart has joined #ruby
fgo has quit [Remote host closed the connection]
ccolorado has joined #ruby
meatherly has quit [Ping timeout: 260 seconds]
newUser1234 has joined #ruby
blz37 has joined #ruby
VinDoKi has quit [Remote host closed the connection]
timonv has joined #ruby
shiggity_ has joined #ruby
<n_blownapart>
pontiki hi if you're still on, thanks for the suggestion. I tried require 'pry' ; binding.pry . tomorrow's project. the color highlighting is very cool.
shiggity_ has left #ruby [#ruby]
jamto11 has joined #ruby
rkazak has joined #ruby
n_blownapart has quit [Remote host closed the connection]
tjr9898__ has quit [Remote host closed the connection]
tjr9898_ has joined #ruby
newUser1234 has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
phansch has joined #ruby
<DEA7TH>
What is the convention for indentation for a multi-line statement? for example
<DEA7TH>
bool ? x :
tjr9898__ has joined #ruby
jack_rabbit has quit [Ping timeout: 245 seconds]
<DEA7TH>
very_very_very_very_very_long_statement
<DEA7TH>
I left 2 spaces before the second line, not sure if that's conventional though
<Burgestrand>
DEA7TH: I wouldn’t go as far as say it’s a convention, but I see very very few ternary statements in Ruby overall.
fluve has joined #ruby
<Hanmac>
DEA7TH: i think for that a If <> \n <> \n else \n <> \n end is better
djbkd has joined #ruby
mary5030 has joined #ruby
goleldar has quit [Remote host closed the connection]
jack_rabbit has joined #ruby
<DEA7TH>
Even in the following code? if x.length <= 1 \n x \n else \n very_long_statement \n end
GriffinHeart has quit [Ping timeout: 255 seconds]
<Burgestrand>
Yes.
<DEA7TH>
ok, will do.
devdazed has quit [Ping timeout: 265 seconds]
JPascal has joined #ruby
<Burgestrand>
Keep in mind it could be personal bias. I’m not a fan of ternary, so it’s possible I simply avoid seeing them. :)
mjsmith2 has quit [Ping timeout: 240 seconds]
<DEA7TH>
still, if I want to do a multi-line statement - it doesn't have to be ternary operator, but anything with a high character count - how many spaces should I leave before the second line?
thomasxie has quit [Quit: Leaving.]
<DEA7TH>
Burgestrand: I didn't like the ternary either, I was on the boundary of removing it anyway
tjr9898_ has quit [Ping timeout: 276 seconds]
<Burgestrand>
DEA7TH: do you have an example of such a statement? Perhaps you could paste it on e.g. http://gist.github.com/
<pontiki>
2 space indent is part of the github ruby coding standards. many people follow them
devdazed has joined #ruby
sputnik13 has joined #ruby
pixie79 has quit []
mary5030 has quit [Ping timeout: 240 seconds]
dseitz has joined #ruby
Kricir has quit [Remote host closed the connection]
goleldar has joined #ruby
kies has quit [Ping timeout: 276 seconds]
<DEA7TH>
I included two examples: one with ternary and one without. Actually I think I like the ternary version better, now that the really long statement is split into multiple lines
<DEA7TH>
lines 14-16 - should I indent? I can put them all into a single line, but that'd take too much space and isn't very readable
penzur has joined #ruby
<DEA7TH>
but the indentation looks a bit ugly as well
<Burgestrand>
DEA7TH: I think I’d write it as your second example there. The ternary is indeed more dense, but in my opinion less clear.
<DEA7TH>
likewise for line 2 to 3
ner0x has quit [Remote host closed the connection]
sski has joined #ruby
ari-_-e has joined #ruby
<Burgestrand>
DEA7TH: I tend to indent additional e.g. .map {} on a new line, indented by 2 spaces to separate them from regular statements appearing on the next line.
<Burgestrand>
DEA7TH: just like you’ve done.
whyy has joined #ruby
MatthewsFace has quit [Ping timeout: 252 seconds]
<DEA7TH>
Burgestrand: so the second function seems already ok to you, no need to further refactor?
MatthewsFace has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<Burgestrand>
DEA7TH: yeah. The chance of misinterpreting that code is tiny.
<penzur>
hello
yfeldblum has joined #ruby
whyy has quit [Read error: Connection reset by peer]
<DEA7TH>
hmm ok, I'll adopt that indentation principle then. I thought of it initially, but it seemed a bit odd
newUser1_ has quit [Read error: Connection reset by peer]
whyy has joined #ruby
nm has joined #ruby
<Burgestrand>
I’m not a big fan of it either, but that’s mainly because of the stream processing-like code, and not because of the indentation. The other choice (for me) is having a really long line, which is worse. :)
lw has quit [Quit: s]
newUser1234 has joined #ruby
subraminion has joined #ruby
<DEA7TH>
Burgestrand: Would you also use 2 spaces if instead, the really long line was a list? e.g. [1, 2, 3, \n 4, 5]
<DEA7TH>
or any other construct which needs splitting separate two lines
<RubyPanther>
lxsameer: "Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder."
tylersmith has quit [Ping timeout: 252 seconds]
<RubyPanther>
' "Substantive modification" is defined as a change to the semantic content of the document, and excludes mere changes in format or typographical corrections.'
<lxsameer>
RubyPanther: which one it is belong to ?
<RubyPanther>
Unclear to me where in that translation falls
doev has joined #ruby
<RubyPanther>
lxsameer: That is the for Programming Ruby (pickaxe)
<lxsameer>
RubyPanther: as i ask couple of publishers translation is like redistributing and publishing book
Macaveli has joined #ruby
<RubyPanther>
Sure, but in this case you're allowed to republish, but not if there is "substantive" modifications
<RubyPanther>
Also you have to list all your changes
<ari-_-e>
also that edition of the pickaxe was written a rather long time ago and is for a rather old version of ruby
dc has joined #ruby
aneong has quit []
yubrew has joined #ruby
Macaveli has quit [Ping timeout: 252 seconds]
bigkevmcd has quit [Ping timeout: 252 seconds]
rghose1 has joined #ruby
bigkevmcd has joined #ruby
rkazak has left #ruby [#ruby]
<ccolorado>
Burgestrand: I see thanks
gbchaosmaster has quit [Ping timeout: 276 seconds]
<ccolorado>
I am trying to make a dynamic regular expresion , but I have been unable to use a variable inside it. https://eval.in/158086
yubrew has quit [Ping timeout: 252 seconds]
michael_lee has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
claymore has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
tectonic has joined #ruby
balazs has quit [Ping timeout: 264 seconds]
r0ok has quit [Quit: r0ok]
tacos1de has joined #ruby
<lethe>
ccolorado: try this - Regexp.new("^#{myregex}.*", 'i')
claymore has joined #ruby
bluOxigen has joined #ruby
<Burgestrand>
>> var = “Hello”; /^#{var}.*/i
<eval-in_>
Burgestrand => undefined local variable or method `“Hello”' for main:Object (NameError) ... (https://eval.in/158090)
<Burgestrand>
Hanmac: yeah, I noticed the weird quotes. OSX smart quotes weren't very smart.
Vivekananda has quit [Quit: Ex-Chat]
MatthewsFace has joined #ruby
kireevco has quit [Quit: Leaving.]
tessi has joined #ruby
mjsmith2 has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
<ccolorado>
thanks to everyone, I was stuck on that longer that i would like to admit
lemur has joined #ruby
kireevco has joined #ruby
<Hanmac>
Burgestrand: yeah OSX ... solving problems that you would not have without OSX ;P
alem0lars has quit [Quit: Going AFK...]
goleldar has quit [Remote host closed the connection]
diegoviola has joined #ruby
vifino has joined #ruby
northfurr has quit [Quit: northfurr]
alem0lars has joined #ruby
<Burgestrand>
Hanmac: I usually just turn this smarty-pants feature off. :)
jprovazn has joined #ruby
apeiros has joined #ruby
atraylen2 has quit [Ping timeout: 252 seconds]
mjsmith2 has quit [Ping timeout: 240 seconds]
yohanobs_ has quit [Remote host closed the connection]
ayaz has joined #ruby
andikr has joined #ruby
bal has quit [Quit: bal]
krandi has joined #ruby
newUser1_ has joined #ruby
djbkd has quit [Remote host closed the connection]
lemur has quit [Remote host closed the connection]
newUser1234 has quit [Ping timeout: 240 seconds]
bal has joined #ruby
alem0lars has quit [Quit: alem0lars]
sigurding has quit [Read error: Connection reset by peer]
relix has joined #ruby
Deele has joined #ruby
kyb3r_ has quit [Read error: Connection reset by peer]
newUser1_ has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
alem0lars has joined #ruby
klaut has quit [Remote host closed the connection]
MatthewsFace has quit [Quit: This computer has gone to sleep]
anaeem1_ has quit [Ping timeout: 252 seconds]
anaeem1_ has joined #ruby
benlieb has joined #ruby
phansch has quit [Ping timeout: 240 seconds]
phansch has joined #ruby
andikr has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
thepreacher has joined #ruby
noop has joined #ruby
noop has quit [Remote host closed the connection]
noop has joined #ruby
toastynerd has quit [Remote host closed the connection]
sigurding has joined #ruby
Kricir has joined #ruby
SCommette has joined #ruby
Gil has quit [Remote host closed the connection]
SCommette has quit [Client Quit]
phansch_ has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
phansch has quit [Ping timeout: 245 seconds]
newUser1234 has joined #ruby
Kricir has quit [Ping timeout: 276 seconds]
mijicd has joined #ruby
doev has quit [Quit: Verlassend]
ninegrid has quit [Ping timeout: 252 seconds]
kireevco has quit [Quit: Leaving.]
fabrice31 has joined #ruby
p8952 has joined #ruby
coderhs has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
DEA7TH has quit [Ping timeout: 252 seconds]
meatherly has joined #ruby
XenoWolf_ has joined #ruby
newUser1_ has joined #ruby
XenoWolf has quit [Ping timeout: 265 seconds]
_tpavel has joined #ruby
anarang has joined #ruby
kilk__ has joined #ruby
newUser1234 has quit [Ping timeout: 240 seconds]
tectonic has quit []
kireevco has joined #ruby
Xeago has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
meatherly has quit [Ping timeout: 264 seconds]
newUser1_ has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
newUser1234 has joined #ruby
Takle has joined #ruby
ninegrid has joined #ruby
jamto11 has joined #ruby
MatthewsFace has joined #ruby
thepreacher has quit [Quit: Leaving]
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
klaut has joined #ruby
rampert has joined #ruby
GriffinHeart has joined #ruby
jamto11 has quit [Ping timeout: 265 seconds]
newUser1234 has quit [Read error: Connection reset by peer]
newUser1234 has joined #ruby
oo_ has joined #ruby
GriffinHeart has quit [Ping timeout: 240 seconds]
yacks has joined #ruby
shredding has joined #ruby
akonny has joined #ruby
dumdedum has joined #ruby
toastynerd has joined #ruby
razrunelord has joined #ruby
Macaveli has joined #ruby
yacks has quit [Max SendQ exceeded]
spider-mario has joined #ruby
riotjones has joined #ruby
yacks has joined #ruby
d34th4ck3r has quit [Quit: zzz]
jackjackdrpr has joined #ruby
newUser1_ has joined #ruby
Takle has quit [Remote host closed the connection]
newUser1234 has quit [Read error: Connection reset by peer]
toastynerd has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
razrunelord has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
aspiers_ has joined #ruby
ninegrid has quit [Ping timeout: 240 seconds]
mjsmith2 has joined #ruby
ninegrid has joined #ruby
d34th4ck3r has joined #ruby
newUser1_ has quit [Read error: Connection reset by peer]
mjsmith2_ has joined #ruby
Doppp has quit [Quit: leaving]
newUser1234 has joined #ruby
Doppp has joined #ruby
wchun has quit [Quit: Leaving]
mjsmith2 has quit [Ping timeout: 240 seconds]
dANOKELOFF has joined #ruby
akonny has quit [Quit: akonny]
rdark has joined #ruby
mjsmith2_ has quit [Ping timeout: 240 seconds]
lyanchih has quit [Quit: lyanchih]
kireevco has quit [Quit: Leaving.]
Meatchicken has quit [Read error: Connection reset by peer]
lyanchih has joined #ruby
banister has joined #ruby
olivier_bK has joined #ruby
sski has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
Xeago has quit [Remote host closed the connection]
thepreacher has joined #ruby
Xeago has joined #ruby
phansch_ has quit [Quit: WeeChat 0.4.3]
bhaak has quit [Read error: Connection reset by peer]
hermanmunster has quit [Remote host closed the connection]
hermanmunster has joined #ruby
tjr9898__ has quit [Remote host closed the connection]
whyy has quit [Remote host closed the connection]
lemur has joined #ruby
tjr9898_ has joined #ruby
yacks has quit [Ping timeout: 252 seconds]
elaptics`away is now known as elaptics
LnL has quit [Read error: Connection reset by peer]
whyy has joined #ruby
kaspergrubbe has joined #ruby
mercerist has joined #ruby
Takle has joined #ruby
mikecmpbll has joined #ruby
nvrch has joined #ruby
kaspergr_ has joined #ruby
hermanmunster has quit [Ping timeout: 240 seconds]
Kricir has joined #ruby
ephemerian has joined #ruby
tessi has quit [Quit: Leaving]
lemur has quit [Ping timeout: 240 seconds]
tjr9898_ has quit [Ping timeout: 240 seconds]
whyy has quit [Ping timeout: 252 seconds]
xanandu has quit [Ping timeout: 276 seconds]
klaut has quit [Remote host closed the connection]
roolo has joined #ruby
tessi has joined #ruby
kaspergrubbe has quit [Ping timeout: 255 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
yacks has joined #ruby
bluenemo has quit [Quit: Verlassend]
Kricir has quit [Ping timeout: 240 seconds]
kaspergr_ has quit [Ping timeout: 240 seconds]
Takle has quit [Ping timeout: 255 seconds]
artmann_ has quit [Quit: No Ping reply in 180 seconds.]
obs has joined #ruby
thepreacher has quit [Quit: Leaving]
timonv has joined #ruby
rotor has quit [Ping timeout: 252 seconds]
kman has quit [Ping timeout: 255 seconds]
artmann has joined #ruby
yubrew has joined #ruby
sk87 has joined #ruby
kaspergrubbe has joined #ruby
Wolland has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
tesuji has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
orthos has joined #ruby
brunops has quit [Ping timeout: 240 seconds]
Takle has joined #ruby
Wolland has quit [Remote host closed the connection]
reactormonk has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 245 seconds]
lyanchih has quit [Quit: lyanchih]
lyanchih has joined #ruby
einarj has joined #ruby
reactormonk has joined #ruby
ylluminate has quit [Quit: Bye!]
Takle has quit [Remote host closed the connection]
rotor has joined #ruby
subraminion has quit [Quit: Computer has gone to sleep.]
Takle has joined #ruby
xcv has joined #ruby
hermanmunster has joined #ruby
buzzybron has joined #ruby
timonv has quit [Remote host closed the connection]
Guest54253 has quit [Changing host]
Guest54253 has joined #ruby
Guest54253 is now known as deepy
Rollabunna has joined #ruby
tvw has joined #ruby
jackjackdrpr has quit [Quit: Leaving.]
_justin has quit [Quit: _justin]
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
mercerist has quit [Quit: Computer has gone to sleep.]
toastynerd has joined #ruby
razrunelord has joined #ruby
kman has joined #ruby
claymore has quit [Ping timeout: 252 seconds]
Wolland has joined #ruby
benlieb has quit [Quit: benlieb]
Takle has quit [Remote host closed the connection]
Arkaniad has quit [Ping timeout: 252 seconds]
claymore has joined #ruby
alem0lars has quit [Quit: Going AFK...]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
toastynerd has quit [Ping timeout: 264 seconds]
Takle has joined #ruby
razrunelord has quit [Ping timeout: 276 seconds]
subraminion has joined #ruby
subraminion has quit [Remote host closed the connection]
mjsmith2 has joined #ruby
subraminion has joined #ruby
subraminion has quit [Remote host closed the connection]
fgo has quit [Remote host closed the connection]
subraminion has joined #ruby
marr has joined #ruby
sk87 has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
hd1 has joined #ruby
blueOxigen has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
mjsmith2 has quit [Ping timeout: 240 seconds]
bluOxigen has quit [Ping timeout: 240 seconds]
St_Marx has quit [Ping timeout: 272 seconds]
eguim has joined #ruby
newUser1234 has quit [Read error: Connection timed out]
benlieb has quit [Quit: benlieb]
AlexRussia has joined #ruby
DaniG2k has joined #ruby
mupkoo has joined #ruby
hd1 has left #ruby [#ruby]
iwat has joined #ruby
Arkaniad has joined #ruby
roolo has quit [Ping timeout: 240 seconds]
roolo has joined #ruby
alem0lars has joined #ruby
AlSquire has joined #ruby
lw has joined #ruby
Wolland has quit [Remote host closed the connection]
Wolland has joined #ruby
mupkoo has quit [Remote host closed the connection]
mupkoo has joined #ruby
yeticry has quit [Ping timeout: 245 seconds]
Wolland has quit [Ping timeout: 245 seconds]
nnu has joined #ruby
yeticry has joined #ruby
Kricir has joined #ruby
banjara has joined #ruby
_justin has joined #ruby
mupkoo has quit [Ping timeout: 240 seconds]
Takle has quit [Remote host closed the connection]
obs has quit [Remote host closed the connection]
Zai00 has joined #ruby
claymore has quit [Quit: Leaving]
keen_______ has joined #ruby
yubrew has joined #ruby
decoponio has joined #ruby
LekeFly has joined #ruby
sylver has joined #ruby
Kricir has quit [Ping timeout: 252 seconds]
klaut has joined #ruby
keen______ has quit [Ping timeout: 252 seconds]
LiohAu has joined #ruby
TwinkleHood has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
moritzschaefer has joined #ruby
ponga has joined #ruby
ponga has joined #ruby
ponga has quit [Changing host]
lw has quit [Quit: s]
fgo has joined #ruby
anaeem1_ has joined #ruby
sigurding has quit [Quit: sigurding]
akonny has joined #ruby
<sylver>
hello guys, I have a newbie problem with instance variables. I'm subclassing StandardError and adding a variable to store the error code in it with "attr_reader :code; @code = 500". But when I try to access this variable with err.code I'm getting a NoMethodError: undefined method `code'. Where am I wrong ?
andrewlio has joined #ruby
yubrew has quit [Ping timeout: 260 seconds]
anaeem1_ has quit [Remote host closed the connection]
<gizmore>
sylver: instance_variables are all private by default
<gizmore>
you can make dem visibile by:
<gizmore>
a) def code; @code; end
<gizmore>
or
<gizmore>
b) attr_reader :code
<canton7>
..which is what he said he did?
LiohAu has quit [Client Quit]
<sylver>
gizmore: yep, as I said, I use attr_reader in my code
anaeem1_ has joined #ruby
<canton7>
sylver, pastie?
<sylver>
gizmore: that's where I don't understand what's wrong
<gizmore>
sylver: maybe mixing obj and obj.class then?
JPascal has quit []
Shidash has quit [Ping timeout: 276 seconds]
anaeem1 has joined #ruby
anaeem1_ has quit [Read error: Connection reset by peer]
<gizmore>
simple said: a class is just an object, which features #new ... you maybe try to access your var within a "static" method (a method within the classobject)
DouweM has joined #ruby
<canton7>
sylver, pastie your code that's failing. otherwise we're just guessing
obs has joined #ruby
GriffinHeart has joined #ruby
lw has joined #ruby
<sylver>
well basically I'm trying something like that : http://pastie.org/9252733 (raising the error in begin for the example, original code is more complex and across several files)
ClarusCogitatio_ has quit [Ping timeout: 252 seconds]
Wolland has joined #ruby
<Hanmac>
sylver: line 3 is defines @code in the wrong instance
<gizmore>
sylver: yeah, as i said :) you are trying to access the ex.class.code from via ex.code
<gizmore>
the @code in your classobject is an instance var of the classobject, not the objects your classobject creates
ClarusCogitatio has joined #ruby
<gizmore>
try def initialize; @code = 500; end
d34th4ck3r has quit [Quit: zzz]
<gizmore>
initialize is called on .new
<sylver>
oh ok, I've misunderstand the documentation
<gizmore>
it took me some time to understand and then some more time to disobey class_variables with @@
<sylver>
so as the rescue create an instance of the error class, I must define my variable in the initialize method in order to access it ?
GriffinHeart has quit [Ping timeout: 252 seconds]
<gizmore>
you can create your instancevar anytime anywhere
<gizmore>
until then the reader would return nil
<Hanmac>
gizmore: use def initialize(*); @code = 500; end because of the parameters
fauzanqadri has joined #ruby
frosgy has joined #ruby
<gizmore>
* you can create your instancevar anytime anywhere inside an instance_method *
<sylver>
ok
<Hanmac>
gizmore: instance variables can only created "nearly" anywhere i mean yeah they can be created inside classes but for sample not in Fixnum
<gizmore>
using def initialize is probably not the best idea. It is only nice on classes that don´t inherit from other classes :)
<sylver>
in my case I only need to define it once, it never changes. Maybe I should do a constant instead ?
robbyoconnor has quit [Ping timeout: 240 seconds]
<gizmore>
Hanmac: class Fixnum; def foo; @haha = 4; end - does not work?
<daxroc>
Hanmac: I'm sure it's in plain ruby files too
<gizmore>
>> $("String").replace('a').to_sym
<eval-in_>
gizmore => /tmp/execpad-e1f384ac1804/source-e1f384ac1804:2: `$(' is not allowed as a global variable name ... (https://eval.in/158161)
<Hanmac>
daxroc: show us a sample please
gr33n7007h has joined #ruby
<sylver>
k, following your advices, here's a new one http://pastie.org/9252772 I can access the code variables outside but if I subclass my subclass,
mercerist has joined #ruby
<sylver>
I have the original variable value, and can't override it in the new subclass
jamto11 has quit [Ping timeout: 265 seconds]
<Hanmac>
sylver: you defined it in the class again
sigurding has joined #ruby
<sylver>
Hanmac: Since it's already defined in the parent class, how can I change its value ? I must do it in an initialized method in each subclass ?
frobrob has joined #ruby
<Hanmac>
yep otherwise you only define them in the class itself
duncannz has quit [Ping timeout: 265 seconds]
<Hanmac>
or use some kind of @code = class.instance_variable_get(:@code) inside the base class, then you can use your code in the sub classes
toastynerd has joined #ruby
phansch has joined #ruby
Trynemjoel has joined #ruby
p8952 has joined #ruby
lw has quit [Quit: s]
<daxroc>
Hanmac: never mind it was a string to be interpreted by an external application... I thought it was referencing some internal ruby library ...
<daxroc>
Appreciate it
toastynerd has quit [Ping timeout: 252 seconds]
<daxroc>
<- PEBCAC
<Hanmac>
AH ... could be erb or haml
<daxroc>
just one of those days cant even the the term right
mariappp has joined #ruby
mariappp has quit [Client Quit]
mehlah has joined #ruby
hgl has quit [Ping timeout: 255 seconds]
paolooo has joined #ruby
nfk has joined #ruby
oo_ has quit [Remote host closed the connection]
paolooo has quit [Client Quit]
hgl has joined #ruby
mercerist has quit [Quit: Computer has gone to sleep.]
RyanV has joined #ruby
oo_ has joined #ruby
sigurding has quit [Ping timeout: 276 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
mercerist has joined #ruby
<sylver>
many thanks for your help guys, it's now working
workmad3 has joined #ruby
lkba has joined #ruby
karupa is now known as zz_karupa
diegoviola has quit [Quit: WeeChat 0.4.3]
diegoviola has joined #ruby
penzur has quit [Quit: wadiwasi]
sk87 has joined #ruby
Morkel has quit [Quit: Morkel]
kyb3r_ has joined #ruby
charliesome has joined #ruby
Burgestrand has quit [Ping timeout: 252 seconds]
kilk__ has quit [Remote host closed the connection]
tanmay_ has joined #ruby
alem0lars has quit [Quit: Going AFK...]
Burgestrand has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
xcv has quit []
AlexRussia has joined #ruby
yubrew has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
dEPy has joined #ruby
Kricir has joined #ruby
vinleod has joined #ruby
fgo has quit [Remote host closed the connection]
Takle has joined #ruby
yubrew has quit [Ping timeout: 264 seconds]
Kricir has quit [Ping timeout: 260 seconds]
paolooo has joined #ruby
JPascal has joined #ruby
rghose1 has quit [Ping timeout: 252 seconds]
paolooo has quit [Client Quit]
anaeem___ has joined #ruby
incomplete has joined #ruby
incomplete has quit [Read error: Connection reset by peer]
Takle has quit [Ping timeout: 252 seconds]
movedx_ has joined #ruby
<movedx_>
Can you safely pop/delete elements from an array whilst looping over said array?
GriffinHeart has joined #ruby
anaeem1 has quit [Ping timeout: 255 seconds]
anaeem___ has quit [Read error: Connection reset by peer]
<Wolland>
what is "safely"
DouweM has quit [Quit: Leaving...]
<movedx_>
It can't be done at all in Python. Most languages can't handle it. Can Ruby?
chipotle has joined #ruby
meatherly has joined #ruby
<Wolland>
there are methods that will remove an item from array and return it, either from start/end of the array or by index
<Wolland>
pop, shift, delete_at, etc
mercwithamouth has joined #ruby
fabrice31 has quit [Remote host closed the connection]
<movedx_>
I just want to use delete(). I have a large array of items and I want to loop over it, find items that do not match a pattern, and remove them.
<matti>
movedx_: What's wrong with delete_if?
<Wolland>
you can use delete_if
<Wolland>
or keep_if
<Wolland>
or intersect in some cases
anaeem1 has joined #ruby
<movedx_>
Hmm.
<movedx_>
So many ways to do things.
subbyyy_ has quit [Ping timeout: 265 seconds]
<Wolland>
[1,2,3].delete_if {|x| x>2}
Takle has joined #ruby
moritzschaefer has quit [Ping timeout: 252 seconds]
meatherly has quit [Ping timeout: 264 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<movedx_>
Indeed.
<movedx_>
Thank you.
<Wolland>
np
<movedx_>
Ruby is wonderful due to its flexibility and powerful, built-in features; Ruby is frustrating due to its flexibility and built-in features ;)
dangerousdave has quit [Read error: Connection reset by peer]
KevinSjoberg has quit [Max SendQ exceeded]
razrunelord has quit [Ping timeout: 255 seconds]
dangerousdave has joined #ruby
moritzschaefer has quit [Ping timeout: 252 seconds]
shredding has quit [Ping timeout: 252 seconds]
yubrew has joined #ruby
shredding has joined #ruby
craigp has joined #ruby
learner has joined #ruby
OffTheRails has joined #ruby
newUser1234 has joined #ruby
yubrew has quit [Ping timeout: 255 seconds]
iwat has quit [Remote host closed the connection]
troulouliou_dev has quit [Remote host closed the connection]
trampi has quit [Quit: Bye]
trampi has joined #ruby
paulfm_ has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
paulfm has quit [Ping timeout: 240 seconds]
foooobear has joined #ruby
banjara has quit [Quit: Leaving.]
claymore has quit [Ping timeout: 264 seconds]
Fire-Dragon-DoL has joined #ruby
tier has joined #ruby
newUser1_ has joined #ruby
balazs has joined #ruby
Azulinho has joined #ruby
yfeldblum has joined #ruby
doev has quit [Ping timeout: 240 seconds]
northfurr has quit [Quit: northfurr]
claymore has joined #ruby
newUser1234 has quit [Ping timeout: 264 seconds]
hermanmunster has quit [Remote host closed the connection]
hermanmunster has joined #ruby
anaeem___ has quit [Remote host closed the connection]
pzula has quit [Ping timeout: 252 seconds]
alexju has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 264 seconds]
gregf has joined #ruby
banister has joined #ruby
zB0hs has joined #ruby
zB0hs has quit [Max SendQ exceeded]
Kricir has joined #ruby
hermanmunster has quit [Ping timeout: 240 seconds]
Kricir has quit [Read error: Connection reset by peer]
infinitone has joined #ruby
Takle has quit [Remote host closed the connection]
tier has quit [Remote host closed the connection]
Kricir has joined #ruby
JLT has joined #ruby
tkuchiki has joined #ruby
GriffinHeart has joined #ruby
momomomomo has joined #ruby
pwh has joined #ruby
dilated_dinosaur has joined #ruby
narendraj9 has joined #ruby
paulfm_ has quit [Read error: Connection reset by peer]
phutchins has joined #ruby
paulfm has joined #ruby
<JLT>
I'm relatively new to Ruby but if I had a hash of hashes which is dynamically populated, is it possible I can do h["a"]["b"]["c"] = "d" even if h["a"] did not exist, or would I have to do h["a"] = {} h["a"]["b"] = {} h["a"]["b"]["c"] = "d" ? I can't define the hashes separately as they may or may not exist... so if I have to do it the latter method, I would have to check if the keys exist before creating it as an empty hash.
<JLT>
but can I do it the former?w
mekajfire has quit [Ping timeout: 240 seconds]
CJNE has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
<JLT>
and maybe can I check if h["a"]["b"]["c"] exists before attempting to delete it?
GriffinHeart has quit [Ping timeout: 240 seconds]
<benzrf>
JLT: yes! you can do that!
<benzrf>
def dynhash
<benzrf>
Hash.new {|h, k| h[k] = dynhash}
<benzrf>
end
Takle has joined #ruby
<benzrf>
now make your hashes with dynhash ;-)
<benzrf>
any keys you access that don't exist will call that block and retry
<benzrf>
i.e., populate the key with a new dynhash
craigp has quit [Remote host closed the connection]
<benzrf>
JLT: oh wait, you aren't creating the original hash?
craigp has joined #ruby
<apeiros>
or without a def: Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }
craigp has quit [Read error: Connection reset by peer]
<JLT>
um... well that's al lvery confusing to me. What I currently do is: h = {} then later on in the code I will add things to that hash.
pwh has quit []
<DaniG2k>
someone had posted a line of code before
tier has joined #ruby
<DaniG2k>
that separated an array of integers
<DaniG2k>
into even and off
<DaniG2k>
*odd
root_empire has joined #ruby
<DaniG2k>
I thikn the code was using the partition method and took a symbol, :even?
<DaniG2k>
something like that
<JLT>
This is what I currently do in order to add (or update) a hash. http://pastebin.com/pDvVGsBJ of course that's all many lines of code if I simply only need line 8.
<DaniG2k>
does anyone remember seeing this in here?
tanmay_ has quit [Quit: No Ping reply in 180 seconds.]
<JLT>
I would have created an odd and even array, looped through the aray of numbers and performed a modulus of 2 to differentiate between even and odd.
ponga has quit [Ping timeout: 260 seconds]
<JLT>
but that's just plenty more code.
Hawk555 has joined #ruby
<DaniG2k>
JLT: that's not making use of Ruby's full beauty at all
<apeiros>
>> (1..10).partition { |value| value % 2 == 0 } # works too, JLT
<apeiros>
partition just expects a true/false return value and creates two arrays according to that
michael_lee has quit [Ping timeout: 264 seconds]
garndt has joined #ruby
thepreacher has joined #ruby
<DaniG2k>
apeiros: why does it need &:even? instead of just :even?
michaelchum has joined #ruby
<DaniG2k>
does & make it reference a method?
<banister>
DaniG2k kind of
<JLT>
Looks like & references the value?
<banister>
no, it calls to_proc on :even?
Hawk555 has quit [Client Quit]
<banister>
JLT DaniG2k google Symbol#to_proc
Hawk555 has joined #ruby
Xeago_ has quit [Remote host closed the connection]
wald0 has quit [Ping timeout: 265 seconds]
<JLT>
bar(&:foo) = bar{|x| x.foo} from what I've seen
wald0 has joined #ruby
dilated_dinosaur has quit [Ping timeout: 252 seconds]
ponga has joined #ruby
<DaniG2k>
so using a symbol is something like pointers in C ?
mercwithamouth has joined #ruby
<DaniG2k>
references a specific object in memory
hamakn has quit [Remote host closed the connection]
<crome>
JLT: no. its equal to bar.map { |x| x.foo }
<crome>
oh sorry
dangerou_ has joined #ruby
<crome>
I though you meant something else
<JLT>
lol
<JLT>
for what I want to do.. .fetch seems to work nicely.
<JLT>
mmm maybe
Takle has quit [Remote host closed the connection]
JPascal has joined #ruby
dangerousdave has quit [Ping timeout: 276 seconds]
jamto11 has joined #ruby
Kricir has quit [Remote host closed the connection]
FooBar123 has joined #ruby
troulouliou_dev has joined #ruby
<JLT>
mm ok maybe not.
toastynerd has joined #ruby
<apeiros>
DaniG2k, JLT: it does two things. a) it tells ruby to treat the argument as a block, b) if the argument is not a Proc already, it is converted by calling to_proc (as banister said)
paulfm has quit []
jamto11 has quit [Ping timeout: 252 seconds]
Ankhers has joined #ruby
zorak has quit [Ping timeout: 240 seconds]
<apeiros>
DaniG2k: a symbol is just a type of value. like integers and strings are a type of value.
cpruitt has joined #ruby
toastynerd has quit [Ping timeout: 252 seconds]
relix has quit [Read error: Connection reset by peer]
relix has joined #ruby
djcp has joined #ruby
paulfm has joined #ruby
alem0lars has quit [Quit: Going AFK...]
NukePuppy has joined #ruby
mjsmith2 has joined #ruby
Xeago has joined #ruby
JLT has quit [Quit: leaving]
duggiefresh has joined #ruby
jprovazn has quit [Quit: Leaving]
JasmeetQA has joined #ruby
<benzrf>
DaniG2k: a symbol is really just an auto-interned string
<benzrf>
which is also immutable
nnu has quit [Ping timeout: 276 seconds]
JPascal has quit [Ping timeout: 246 seconds]
foooobear has quit [Quit: Computer has gone to sleep.]
razrunelord has joined #ruby
yubrew has joined #ruby
<DaniG2k>
I wonder how Matz came up with this shiz
jprovazn has joined #ruby
<apeiros>
I don't think he was the one who came up with it
<apeiros>
exposing them like this to the programmer might be a novel idea, but not sure.
lxsameer has quit [Quit: Leaving]
LiohAu has joined #ruby
Takle has joined #ruby
razrunelord has quit [Ping timeout: 252 seconds]
himsin has quit [Quit: himsin]
yubrew has quit [Ping timeout: 252 seconds]
<benzrf>
le
fgo has quit [Remote host closed the connection]
<banister>
DaniG2k they come from lisp iirc
why_away has quit [Ping timeout: 240 seconds]
djcp has left #ruby ["WeeChat 0.4.3"]
meatherly has joined #ruby
zorak has joined #ruby
SCommette has joined #ruby
rghose1 has joined #ruby
<rghose1>
can sessions be managed with onniauth?
trampi has quit [Quit: Bye]
yakko has joined #ruby
mary5030 has joined #ruby
<benzrf>
rghose1: what
vpretzel is now known as vpretzel|1445
phoo1234567 has quit [Remote host closed the connection]
<rghose1>
um, omniauth provides callbacks for login right? we can add server tokens to be response as well. i was wondering if there is any callback for sessions
alexju has joined #ruby
gaboesquivel has joined #ruby
<rghose1>
if the rails app can check for the session
LadyRainicorn has joined #ruby
yakko_ has quit [Ping timeout: 255 seconds]
LadyRainicorn has quit [Client Quit]
frosgy has quit [Quit: Leaving]
yfeldblum has joined #ruby
alem0lars has joined #ruby
ehc has joined #ruby
<Hanmac>
rghose1: wouldnt #rubyonrails a better channel for that?
newUser1_ has quit [Remote host closed the connection]
<gaboesquivel>
hi I usually write JS and I'm stuck with attributes[:attribute] --> undefined method .... how can I get nil instead of error ?
<apeiros>
gaboesquivel: attributes itself is already nil?
orthos has quit [Quit: orthos]
<apeiros>
if so: attributes && attributes[:attribute]
yfeldblum has quit [Ping timeout: 240 seconds]
snath has quit [Ping timeout: 276 seconds]
phoo1234567 has joined #ruby
nnu has joined #ruby
tjr9898_ has quit [Remote host closed the connection]
<GeorgesLeYeti>
I want make a script to convert a srt to webvtt and there is only 1 big difference between theses 2 format.
<ari-_-e>
DaniG2k: you say literally ONE message before leaving
<ari-_-e>
*saw
<GeorgesLeYeti>
I need to convert every sentence like 00:00:00,000 to 00:00:00.000
vpretzel|1445 has quit [Ping timeout: 240 seconds]
<GeorgesLeYeti>
the coma is replaced by a point
Kotov has joined #ruby
failshell has joined #ruby
rayners has joined #ruby
sigurding has quit [Quit: sigurding]
end_guy has quit [Ping timeout: 272 seconds]
Boohbah has quit [Ping timeout: 272 seconds]
jonny_buu has joined #ruby
endash has joined #ruby
dmst has joined #ruby
Boohbah has joined #ruby
<ari-_-e>
gaboesquivel: yes, that is possible - you would use a Hash for that
<shevy>
DaniG2k did they finally overcome the python2 to python3 transition?
Kotov has quit [Killed (idoru (Spam is off topic on freenode.))]
dmst has quit []
SCommette has quit [Quit: SCommette]
tagrudev has quit [Remote host closed the connection]
TorpedoSkyline has joined #ruby
<gaboesquivel>
alright thanks
dmst has joined #ruby
newUser1234 has joined #ruby
Arkaniad has quit [Ping timeout: 264 seconds]
Shidash has joined #ruby
r_rios has joined #ruby
end_guy has joined #ruby
lw has joined #ruby
tessi is now known as tessi_zz
badhatter has quit [Ping timeout: 264 seconds]
zenojis has quit [Ping timeout: 240 seconds]
tessi_zz is now known as tessi
<ari-_-e>
gaboesquivel: but it should be noted that Javascript's behavior is decidedly less than ideal in this case - unless explicitly told to, languages should throw errors when trying to access something which doesn't exist
<ari-_-e>
unfortunately instance variables work this way in ruby, but oh well
amargherio has joined #ruby
sinkensabe has joined #ruby
sailias has joined #ruby
badhatter has joined #ruby
badhatter has quit [Changing host]
badhatter has joined #ruby
fauzanqadri has joined #ruby
mjsmith2 has quit [Remote host closed the connection]
<ari-_-e>
(as in they do not throw errors when accessing a nonexistent one)
<apeiros>
ari-_-e: indeed an IMO regrettable choice.
zenojis has joined #ruby
Lucky__ has joined #ruby
ffranz has joined #ruby
enebo has joined #ruby
fgo has joined #ruby
<apeiros>
banister: I also do like swifts idea of requiring nullable variables to be declared as such (I think I have seen this before swift too, though, but can't remember where)
<gaboesquivel>
ari-_-e I'm fetching data from an external API with ActiveResource, that's the object type
<gaboesquivel>
then trying to save data or update my db
<gaboesquivel>
but one attr is null
<gaboesquivel>
and I get that error, it is acceptable to be nil in my db
toastynerd has joined #ruby
jmurray has joined #ruby
<ari-_-e>
gaboesquivel: it sounds like the attribute doesn't exist at all
claymore has quit [Ping timeout: 240 seconds]
fgo_ has joined #ruby
yubrew has joined #ruby
<gaboesquivel>
thanks, I'll double check then
claymore has joined #ruby
gorpon has joined #ruby
<ari-_-e>
if attribute[:whatever] throws an error, :whatever does not exist in that object
blassin has joined #ruby
<blassin>
hello
<blassin>
need some help handling bytes
<blassin>
I now load a file with IO#binread
<blassin>
and that gets me a lot of \xNN entries in an array
fgo has quit [Ping timeout: 240 seconds]
<blassin>
how can I write a value in the array in the same form?
lw has quit [Ping timeout: 276 seconds]
apeiros has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
IceDragon has joined #ruby
<jxf>
blassin: there is a corresponding method, IO.binwrite
apeiros has joined #ruby
anaeem1 has joined #ruby
<jxf>
blassin: or do you mean that you just want to modify the array, not the file?
<blassin>
just the array, yes
<blassin>
it’s for an emulator project
toastynerd has quit [Ping timeout: 265 seconds]
fgo_ has quit [Ping timeout: 252 seconds]
<blassin>
just want to be able to “write” to memory addresses and maintain their format
beneggett has joined #ruby
jprovazn has quit [Quit: Leaving]
<ari-_-e>
\xNN is just the string literal syntax for a byte value...
feature_creep has quit [Ping timeout: 264 seconds]
stantona has joined #ruby
tjr9898_ has joined #ruby
jlast has quit [Remote host closed the connection]
GriffinHeart has quit [Ping timeout: 276 seconds]
jlast has joined #ruby
paulfm has quit []
bal has quit [Quit: bal]
tullyhansen has joined #ruby
stantona has quit [Read error: No route to host]
nvrch has quit [Ping timeout: 240 seconds]
aganov has quit [Remote host closed the connection]
stantona has joined #ruby
tanmay_ has quit [Ping timeout: 240 seconds]
kiri has quit [Quit: Leaving]
banisterone has joined #ruby
TwinkleHood has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toastynerd has joined #ruby
nvrch has joined #ruby
paulfm has joined #ruby
rm_ has joined #ruby
rm_ has quit [Remote host closed the connection]
rm_ has joined #ruby
jlast has quit [Ping timeout: 260 seconds]
jlast has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
qurve has joined #ruby
tullyhansen has quit [Quit: tullyhansen]
<qurve>
What is the best way to declare a method in ruby that takes a string or a block (that is expected to return a string) as an argument? Basically I want to be able to do: my_method("Text") or my_method { "Text" }
baroquebobcat has quit [Quit: baroquebobcat]
<qurve>
I'm writing a helper method to generate some HTML, in some cases the child content is simple text, in others it is more nested HTML.
<qurve>
Would it just be something along the lines of: def my_method(text = nil, &block) and deciding which one takes priority?
CJNE|away has quit [Ping timeout: 240 seconds]
<qurve>
(Only reason I don't like that style is because it is theoretically possible to pass both the argument and a block which is non-nonsensical)
fauzanqadri has quit [Ping timeout: 240 seconds]
dik_dak has joined #ruby
tier has quit [Remote host closed the connection]
claymore has quit [Ping timeout: 264 seconds]
lethe has quit [Remote host closed the connection]
Shidash has quit [Ping timeout: 240 seconds]
pzula has joined #ruby
jackneill has joined #ruby
zB0hs has joined #ruby
acrussell has left #ruby [#ruby]
claymore has joined #ruby
vpretzel_ is now known as vpretzel
sylver has joined #ruby
<benzrf>
qurve: raise an ArgumentError if that happens
<benzrf>
=)
<qurve>
Yep, that's what I will do.
danshult_ has joined #ruby
<qurve>
I was mostly just wondering if there was some way to declare it like def my_method(&block_or_value) ... and determine inside what was actually done, but that doesn't appear to be possible.
<benzrf>
i should write a lib for annotating methods with argument checking stuff
<jimbow>
would it be accurate to say that a method is a little program that performs a specific function and a library is a collection of different programs?
<LadyRainicorn>
eam: /\$foo$/
<LadyRainicorn>
jimbow: No.
<jimbow>
why not?
nvrch has quit [Quit: nvrch]
Vivekananda has joined #ruby
frem_ has joined #ruby
yfeldblum has joined #ruby
kaspergr_ has joined #ruby
<eam>
LadyRainicorn: great example, thanks
<LadyRainicorn>
Independent programs don't generally share state (with exceptions).
mikesplain has joined #ruby
benzrf|offline is now known as benzrf
fgo has quit [Ping timeout: 245 seconds]
<eam>
LadyRainicorn: re: /\$foo$/ -- that's different than PCRE
<eam>
that's why I wonder if it's a bug
<LadyRainicorn>
oh huh
tectonic has joined #ruby
sylver has quit [Ping timeout: 264 seconds]
<LadyRainicorn>
I doubt it, /$foo$/ does match things.
<jhass>
I don't understand at all what that should be doing
<wldcordeiro>
Basically there's some repetitive code where I'm checking for some value and if it's there I want to call the super method
duggiefresh has joined #ruby
<jhass>
use define_method
phlx has joined #ruby
phlx is now known as the_f0ster
treehug8_ has joined #ruby
<jhass>
[:a, :b, :c].each do |method_name| define_method(method_name) {|param| super if param }; end is what I'd try, no idea if it actually works
wallerdev has joined #ruby
sinkensabe has joined #ruby
Takle has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
duggiefresh has quit [Client Quit]
GeoLeYeti is now known as GeorgesLeYeti
tectonic has quit []
treehug88 has quit [Ping timeout: 240 seconds]
tier has joined #ruby
treehug88 has joined #ruby
sailias has joined #ruby
tvw has joined #ruby
phansch has joined #ruby
krandi has quit [Remote host closed the connection]
treehug8_ has quit [Ping timeout: 252 seconds]
pwh has quit []
dhaivat has joined #ruby
Takle has joined #ruby
tier has quit [Ping timeout: 240 seconds]
jhulten has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
dik_dak has quit [Quit: Leaving]
tier has joined #ruby
tvw has quit []
pzula has quit [Ping timeout: 252 seconds]
saarinen has joined #ruby
momomomomo has joined #ruby
milkohol has joined #ruby
yakko has quit [Read error: Connection reset by peer]
dmst has quit []
sputnik13 has joined #ruby
sptx00 has joined #ruby
yakko has joined #ruby
jhulten has joined #ruby
Xeago has quit [Ping timeout: 276 seconds]
sputnik13 has quit [Client Quit]
Spami has joined #ruby
m8 has joined #ruby
sinkensabe has quit [Remote host closed the connection]
Gil has joined #ruby
mattstratton has joined #ruby
cdelo has joined #ruby
milkohol has quit [Client Quit]
sylver has joined #ruby
milkohol has joined #ruby
mattstratton has quit [Client Quit]
mattstratton has joined #ruby
alvaro_o has joined #ruby
nanoyak has joined #ruby
NinoScript has quit [Ping timeout: 255 seconds]
vpretzel has joined #ruby
stantona has joined #ruby
momomomomo has quit [Quit: momomomomo]
sheperson has quit [Ping timeout: 245 seconds]
james_d_h has joined #ruby
Zai00 has quit [Quit: Zai00]
<shevy>
hmm
andrewjanssen has joined #ruby
<shevy>
is there a simple way to re-attach a method from a .rb file (which has only this method and nothing else) to arbitrary namespace?
chipotle has quit [Quit: cya]
nanoyak has quit [Client Quit]
<shevy>
my current workaround is to define it in a module, that has the same name as that method
coreypurcell_ has left #ruby [#ruby]
mengu has quit [Remote host closed the connection]
<shevy>
so: module Foobar; def foobar
banjara has joined #ruby
<shevy>
I'd love to be able to omit the module namespace and freely re-attach that method at runtime to any other module or class
GeorgesLeYeti has quit [Ping timeout: 264 seconds]
einarj has quit [Remote host closed the connection]
sheperson has joined #ruby
mehlah has quit [Quit: Leaving...]
alem0lars has quit [Quit: Going AFK...]
sylver has quit [Ping timeout: 276 seconds]
aneong has left #ruby [#ruby]
mocfive has joined #ruby
newUser1234 has quit [Ping timeout: 255 seconds]
brunops has joined #ruby
danshultz has joined #ruby
tectonic has joined #ruby
timfoo has joined #ruby
NinoScript has joined #ruby
djbkd has quit [Remote host closed the connection]
meatherly has quit []
SCommette has quit [Quit: SCommette]
Takle has quit [Remote host closed the connection]
go|dfish has quit [Ping timeout: 260 seconds]
tylersmith has joined #ruby
rm_ has joined #ruby
mikecmpbll has joined #ruby
carraroj has joined #ruby
fayimora has quit [Quit: Connection closed for inactivity]
dhaivat has quit [Quit: dhaivat]
go|dfish has joined #ruby
dhaivat has joined #ruby
b00stfr3ak has quit [Read error: Connection reset by peer]
cj____ has joined #ruby
nanoyak has joined #ruby
mehlah has joined #ruby
<the_f0ster>
ruby is pass by value right? (even though the value is a reference to a copied obj?)
<jhass>
no
cj____ has quit [Client Quit]
<centrx>
"pass by value where the value is a reference" is the same as "pass by reference"
djbkd has joined #ruby
<centrx>
or perhaps it is meaningless
aspires has quit []
aspires has joined #ruby
dhaivat has quit [Client Quit]
phantasm66 has quit [Quit: *poof*]
creativeembassy has joined #ruby
<the_f0ster>
centrx: well not if it is a copy, then its still pass by value
<jhass>
it's not
<jhass>
the answer is just no
<the_f0ster>
that's what I read.. it's pass by value but the value is a reference to a different object?
<jhass>
it's pass by reference. period
<centrx>
passed objects are not copied
<the_f0ster>
unless it is referencing the actual original object, and not a copy
<the_f0ster>
okay
mary5030_ has joined #ruby
b00stfr3ak has joined #ruby
<Sou|cutter>
shevy: I don't understand - a method outside a namespace is still defined on Object right?
mupkoo has joined #ruby
i_s has joined #ruby
pzula has joined #ruby
mary5030 has quit [Ping timeout: 240 seconds]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CJNE|away has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
yfeldblum has joined #ruby
testcore has joined #ruby
rm_ has quit [Remote host closed the connection]
mupkoo has quit [Remote host closed the connection]
danshultz has quit [Read error: Connection reset by peer]
rm_ has joined #ruby
sambao21 has joined #ruby
mupkoo has joined #ruby
mary5030_ has quit [Remote host closed the connection]
danshultz has joined #ruby
mrsolo has joined #ruby
rdark has quit [Quit: leaving]
mary5030 has joined #ruby
akonny has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
CJNE|away has quit [Ping timeout: 245 seconds]
<wallerdev>
that feel when you forget to --no-ri --no-rdoc
mikecmpbll has joined #ruby
sambao21 has quit [Client Quit]
benzrf is now known as benzrf|offline
sigurding has quit [Read error: Connection reset by peer]
sigurding has joined #ruby
rm_ has quit [Ping timeout: 252 seconds]
mupkoo has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
Takle has joined #ruby
alem0lars has joined #ruby
supa_ has quit [Quit: leaving]
jvns has joined #ruby
roolo has quit [Quit: Leaving...]
rm_ has joined #ruby
klaas_ is now known as klaas
<jvns>
is there an easy way to hack Ruby so that this code runs instead of throwing "ArgumentError: invalid date"? DateTime.strptime("0229233236", "%m%d%H%M%S")
SCommette has joined #ruby
<jvns>
basically I'd like to convince Ruby that the current year is 2012
blackmesa has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
lw has quit [Ping timeout: 240 seconds]
badhatter has quit [Ping timeout: 264 seconds]
<centrx>
jvns, One way would be to just add 2012 to the string and then parse it as though it had been there all along
andrewjanssen has joined #ruby
<jvns>
so I can't change the code
<centrx>
I am not sure what you are trying to do
aspires has quit []
<jvns>
I'm working with some... legacy code
mengu__ has joined #ruby
<jvns>
that I'd like to get to work without changing it
badhatter has joined #ruby
wati`` has joined #ruby
<centrx>
You could monkey patch DateTime.strptime
akonny has quit [Quit: akonny]
<jvns>
yes!
mengu has quit [Ping timeout: 240 seconds]
<centrx>
class DateTime; def strptime; do_stuff; super; end; end
NinoScript has quit [Ping timeout: 240 seconds]
<jvns>
excellent plan
<jvns>
(well, terrible plan, but I'll try it)
<centrx>
Monkey patch is a great plan for monkeying around
banisterone has quit [Read error: Connection reset by peer]
rm_ has quit [Ping timeout: 265 seconds]
banisterone has joined #ruby
sigurding has quit [Quit: sigurding]
coderhs has quit [Ping timeout: 265 seconds]
lw has joined #ruby
NinoScript has joined #ruby
<shevy>
Sou|cutter yeah, it defaults to Object
<jvns>
centrx: thanks =D
spider-mario has joined #ruby
<Sou|cutter>
shevy: so you can't just pull it off of Object instead of the Module?
sambao21 has joined #ruby
<Sou|cutter>
TBH I feel like it's better to attach to a module anyway, but I assume you have your reasons
cj___ has joined #ruby
aspires has joined #ruby
TorpedoSkyline has joined #ruby
combusean has joined #ruby
<shevy>
hmm
<shevy>
when we use method(), the resulting method will not reside in any namespace?
djbkd has quit [Remote host closed the connection]
redondo has joined #ruby
tier has joined #ruby
anything-at-all has joined #ruby
razrunelord has quit [Ping timeout: 255 seconds]
Shidash has joined #ruby
djbkd has joined #ruby
mary5030_ has quit [Remote host closed the connection]
subbyyy_ has joined #ruby
mary5030 has joined #ruby
Kricir has quit [Remote host closed the connection]
sheperson has quit [Ping timeout: 240 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
tris has quit [Quit: Leaving]
shvelo has joined #ruby
sheperson has joined #ruby
hughlander has joined #ruby
sleepee has joined #ruby
orthos has quit [Quit: orthos]
tier has quit [Remote host closed the connection]
frem_ has joined #ruby
kirun has joined #ruby
meatherly has joined #ruby
hughlander has quit [Client Quit]
hughlander has joined #ruby
tier has joined #ruby
ffranz has quit [Quit: Leaving]
chipotle has quit [Quit: cya]
ffranz has joined #ruby
spinagon has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rippa has joined #ruby
wallerdev has quit [Ping timeout: 240 seconds]
jrhe has quit [Quit: Connection closed for inactivity]
meatherly has quit [Client Quit]
sigurding has quit [Quit: sigurding]
djbkd has quit [Remote host closed the connection]
benzrf is now known as benzrf|offline
lw has quit [Ping timeout: 264 seconds]
wallerdev has joined #ruby
echevemaster has joined #ruby
rezzack has joined #ruby
<AntelopeSalad>
what's the least painful way to search for a string within a string and if it's found then return the matched string
toastynerd has quit [Remote host closed the connection]
maximski has quit []
troyready has quit [Ping timeout: 265 seconds]
<AntelopeSalad>
.include? only returns a boolean and i think with .index i'd have to do some math with the length of the search term to determine when to start/stop
<apeiros>
AntelopeSalad: you've seen it working before. so clearly you do something wrong. if you want better error analysis, provide actually useful information.
sheperson has joined #ruby
<centrx>
graft, It's short for String#slice
<graft>
I was also shocked to find out that you can index into integers to get bit positions the other day...
Zenigor has quit [Remote host closed the connection]
anything-at-all has quit [Quit: anything-at-all]
aspires has quit []
hd1 has joined #ruby
Ankhers has quit [Remote host closed the connection]
* hd1
just fixed a compilation bug in ruby 2.1 on freebsd
danijoo_ has quit [Read error: Connection reset by peer]
<hd1>
fixed in that got around and it seems to have worked
<hd1>
anyone interested, pm me
danijoo has joined #ruby
hd1 has left #ruby [#ruby]
aspires has joined #ruby
Morkel has quit [Quit: Morkel]
WishBoy has joined #ruby
<shevy>
show the bug here man
<shevy>
you are like the last unicorn
<shevy>
the last freebsd user on #ruby
<jhass>
well
<jhass>
he immediately left
mark_locklear has quit [Ping timeout: 240 seconds]
<shevy>
lol
mehlah_ has joined #ruby
mehlah has quit [Read error: Connection reset by peer]
<shevy>
what's with those shadow IRC people
alem0lars has quit [Quit: alem0lars]
TorpedoSkyline has quit [Ping timeout: 240 seconds]
LnL7 has joined #ruby
diegoviola has joined #ruby
aspires has quit [Client Quit]
Shidash has quit [Ping timeout: 252 seconds]
LnL has quit [Read error: Connection reset by peer]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TorpedoSkyline has joined #ruby
Kricir_ has quit [Remote host closed the connection]
jmurray has joined #ruby
sailias has quit [Quit: Leaving.]
aspires has joined #ruby
tectonic has joined #ruby
gaboesquivel has quit [Remote host closed the connection]
freezey has joined #ruby
SBoolean has quit [Remote host closed the connection]
jhulten has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
jhulten has joined #ruby
hughlander has quit [Ping timeout: 252 seconds]
yetanotherdave has quit [Client Quit]
yetanotherdave has joined #ruby
redg has quit [Remote host closed the connection]
amargherio has quit [Write error: Broken pipe]
baroquebobcat has quit [Quit: baroquebobcat]
kireevco has joined #ruby
bmurt has quit []
freerobby has quit [Quit: Leaving.]
aspires has quit [Read error: Connection reset by peer]
zorak has quit [Ping timeout: 252 seconds]
jespada has quit [Quit: Leaving]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jprovazn has quit [Ping timeout: 252 seconds]
aspires has joined #ruby
baroquebobcat has joined #ruby
djbkd has quit [Remote host closed the connection]
zorak has joined #ruby
tier has quit []
Zai00 has joined #ruby
x1337807x has joined #ruby
relix has joined #ruby
jan1337z has quit [Quit: System is going down.]
combusean has quit [Ping timeout: 265 seconds]
creativeembassy has quit [Quit: FO SHO]
danshult_ has quit [Remote host closed the connection]
nemesit|znc has quit [Ping timeout: 252 seconds]
oz` has joined #ruby
djbkd has joined #ruby
dc has quit [Remote host closed the connection]
danshultz has joined #ruby
oz has quit [Read error: Connection reset by peer]
oz` is now known as oz
dwts has quit [Ping timeout: 252 seconds]
nevans has quit [Ping timeout: 252 seconds]
akonny has quit [Quit: akonny]
nevans has joined #ruby
KobraKao has joined #ruby
deavid has quit [Read error: Connection reset by peer]
deavid has joined #ruby
dwts has joined #ruby
MrSamuel has joined #ruby
gogiel_ has quit [Ping timeout: 240 seconds]
dblessing has quit [Quit: dblessing]
sptx00 has quit [Ping timeout: 272 seconds]
andrewjanssen has quit [Quit: Leaving...]
gogiel has joined #ruby
nemesit|znc has joined #ruby
aspires has quit []
sambao21 has joined #ruby
aspires has joined #ruby
frem_ has quit [Ping timeout: 245 seconds]
kirun has quit [Remote host closed the connection]
jonahR has joined #ruby
M-Technic is now known as Moo
Moo is now known as M-Technic
sptx00 has joined #ruby
ldnunes has quit [Quit: Leaving]
danshultz has quit [Ping timeout: 276 seconds]
St_Marx has quit [Quit: Ex-Chat]
jhulten_ has joined #ruby
andrewjanssen has joined #ruby
Zai00 has quit [Quit: Zai00]
aspires has quit [Client Quit]
thalweg has joined #ruby
mattt__ has joined #ruby
mattt__ has left #ruby [#ruby]
Sep1 has joined #ruby
St_Marx has joined #ruby
phansch has quit [Quit: WeeChat 0.4.3]
St_Marx has quit [Remote host closed the connection]
St_Marx has joined #ruby
freerobby has joined #ruby
jhulten has quit [Ping timeout: 260 seconds]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
andrewjanssen has quit [Quit: Leaving...]
andrewjanssen has joined #ruby
cj___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc has joined #ruby
Kaedenn1 has joined #ruby
<Kaedenn1>
I'm dealing with customer support where we have a customer with a custom ruby script.
<Kaedenn1>
I don't know ruby.
<Kaedenn1>
The script invokes system() within a sub, within a for loop. If the system() call fails with 1, will that affect the exit status of the script? If so, how?
<ari-_-e>
Kaedenn1: cool story
<Kaedenn1>
The system() call is the last line in the sub.
orthos has joined #ruby
<ari-_-e>
"sub"?
fgo has joined #ruby
<Kaedenn1>
For NDA reasons I can't post the script anywhere.
doodlehaus has quit [Remote host closed the connection]
<Kaedenn1>
Oh, sorry, a function. "def foo() end" thing. I'm mixing my terms.
doodlehaus has joined #ruby
<ari-_-e>
no, calling system does not effect the calling processes
<ari-_-e>
proces
<ari-_-e>
process
dc has quit [Remote host closed the connection]
<ari-_-e>
grr
alexju has quit [Remote host closed the connection]
<yxhuvud>
well, depends on if the calling process actually look for how it went
<Kaedenn1>
Okay. Without an explicit statement to terminate the program with an error code (i.e. "exit()" or so), how can a script exit with 1?
<yxhuvud>
it can crash
<Kaedenn1>
Lastly, the wrapper that invokes the script (an in-house piece of code that just does a fork-exec in C++) ignores the stdout and stderr of the spawned process. Is there a way in ruby to reassign stdout and stderr such that puts and friends can go to a file?
yakko has quit []
<Kaedenn1>
I've expressed my frustration to a co-worker about this, and apparently he has no desire to change it.
nerium has joined #ruby
soulcake has quit [Ping timeout: 260 seconds]
<segfalt>
c++ wrapper around ruby, solid.
mary5030_ has joined #ruby
<nerium>
Is there a way to deploy using capistrano wtihout using gitub?
<Kaedenn1>
Not a wrapper around ruby; we have hooks for executing arbitrary programs before and after our process runs.
<Kaedenn1>
A customer has decided to write said arbitrary program in ruby.
fgo has quit [Ping timeout: 252 seconds]
<segfalt>
but yes, $stdout.reopen('filename here')
<segfalt>
same with $stderr
<segfalt>
Kaedenn1: ^^
<Kaedenn1>
Will that affect processes spawned with system()?
Kricir has joined #ruby
doodlehaus has quit [Ping timeout: 240 seconds]
<segfalt>
I want to say yes, but I'm like 90% confident.
freggles has quit [Remote host closed the connection]
<Kaedenn1>
That's encouraging enough for me.
<segfalt>
Kaedenn1: just tested it, it does.
<Kaedenn1>
Thank you!
<segfalt>
np :)
<segfalt>
uh
<segfalt>
unix?
<segfalt>
or similar, I hope. Who knows on Windows.
<Kaedenn1>
Yes. Some sort of *nix
<segfalt>
ok
<segfalt>
:)
baroquebobcat has quit [Quit: baroquebobcat]
dc has joined #ruby
mary5030_ has quit [Remote host closed the connection]
jheg has quit [Ping timeout: 245 seconds]
cmhobbs has joined #ruby
<Kaedenn1>
Will $stdout.reopen truncate or otherwise modify the file I point it at, or will it open it O_APPEND ?
baroquebobcat has joined #ruby
kireevco has quit [Quit: Leaving.]
andrewjanssen has quit [Quit: Leaving...]
mary5030 has quit [Ping timeout: 240 seconds]
sailias has joined #ruby
dc has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
mary5030 has joined #ruby
<segfalt>
Kaedenn1: Docs say it can take (path, mode_str), so I assume $stdout.reopen('path', 'a') would append.
kireevco has joined #ruby
<segfalt>
Alternatively it can take an IO, so you could fp = File.open('file', 'a') ; $stdout.reopen(fp)
Kricir has quit [Ping timeout: 245 seconds]
soulcake has joined #ruby
dc has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
Kricir has joined #ruby
aspires has joined #ruby
<Kaedenn1>
segfalt: thank you much. I'm working with support on diagnosing the problems of the script. I wish I could just paste it somewhere but I can't because it's customer data.
jhass is now known as jhass|off
aspires has quit [Client Quit]
ixti has quit [Read error: Connection reset by peer]
<segfalt>
Kaedenn1: no problem, been there before :)
treehug88 has quit []
timonv has joined #ruby
mary5030_ has joined #ruby
<Kaedenn1>
How do I do something like: fp = File.open('/var/log/ZettaMirror/script-YYYY-MM-DD.log', 'a') where the YYYY, MM, and DD are strftime outputs?
mary5030 has quit [Read error: Connection reset by peer]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
use strftime?
<Kaedenn1>
I don't know ruby. I'm trying to give something that support can just paste to the customer.
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
timonv has quit [Ping timeout: 245 seconds]
jottr has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
agent_white has quit [Client Quit]
frem_ has joined #ruby
agent_white has joined #ruby
mary5030_ has quit [Ping timeout: 252 seconds]
maestrojed has joined #ruby
chipotle has quit [Quit: cya]
andrewjanssen has joined #ruby
x1337807x has joined #ruby
Notte has quit []
nanoyak has quit [Quit: Computer has gone to sleep.]
sack_lunch has joined #ruby
<sack_lunch>
hello all
djbkd has quit [Remote host closed the connection]
Fire-Dragon-DoL has joined #ruby
frem_ has quit [Ping timeout: 240 seconds]
<Kaedenn1>
toretore: thank you!
MrSamuel has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
pdtpatr11k has joined #ruby
aspires has joined #ruby
<vosloco>
Has anybody seen this error? I am using the rest-client gem. "OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version"
kilk__ has quit [Ping timeout: 245 seconds]
pdtpatr11k has quit [Client Quit]
NukePuppy has joined #ruby
aspires has quit [Client Quit]
coffeina has joined #ruby
lw has quit [Quit: s]
nanoyak has joined #ruby
aspires has joined #ruby
jmurray has joined #ruby
ccolorado has left #ruby [#ruby]
jlast_ has quit [Remote host closed the connection]
jlast has joined #ruby
aspires has quit [Client Quit]
nfk has quit [Quit: yawn]
MrSamuel has joined #ruby
devdazed has quit [Read error: Connection reset by peer]
mocfive has quit [Remote host closed the connection]
devdazed has joined #ruby
bean has quit [Quit: bean]
mijicd has joined #ruby
jhulten_ has quit [Remote host closed the connection]
jlast has quit [Ping timeout: 265 seconds]
michaelchum has quit [Quit: Connection closed for inactivity]
NukePuppy has quit [Ping timeout: 240 seconds]
JokerDoomWork has joined #ruby
OffTheRails has quit [Ping timeout: 240 seconds]
dc has quit [Remote host closed the connection]
aspires has joined #ruby
Rollabunna has joined #ruby
tectonic has quit []
Azulinho has joined #ruby
gaboesquivel has joined #ruby
Sep1 has quit [Quit: Leaving.]
dc has joined #ruby
Squarepy has quit [Quit: Leaving]
timgauthier has joined #ruby
milkohol has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
fgo has joined #ruby
dc has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
Rollabunna has quit [Ping timeout: 260 seconds]
dhaivat has quit [Quit: dhaivat]
gaboesquivel has quit [Ping timeout: 264 seconds]
Nahra has quit [Remote host closed the connection]
Nahra has joined #ruby
djbkd has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
dangerou_ has quit [Ping timeout: 276 seconds]
dc has joined #ruby
mikesplain has quit [Ping timeout: 255 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dc has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 252 seconds]
GriffinHeart has quit [Ping timeout: 240 seconds]
rayners has quit [Remote host closed the connection]
sepp2k has joined #ruby
spider-mario has quit [Remote host closed the connection]
dseitz has joined #ruby
redondos has quit [Excess Flood]
jhulten has joined #ruby
dc has joined #ruby
KobraKao has quit [Ping timeout: 264 seconds]
cmhobbs has quit [Remote host closed the connection]
failshel_ has joined #ruby
arrubin has quit []
redondos has joined #ruby
redondos has quit [Changing host]
redondos has joined #ruby
enebo has quit [Quit: enebo]
tectonic has joined #ruby
ixti has joined #ruby
ghr has quit [Ping timeout: 255 seconds]
hamakn has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 245 seconds]
hamakn has joined #ruby
freerobby has joined #ruby
<shevy>
dumdedum
arrubin has joined #ruby
failshell has quit [Ping timeout: 255 seconds]
sputnik13 has joined #ruby
failshel_ has quit [Ping timeout: 265 seconds]
charliesome has joined #ruby
claymore has quit [Quit: Leaving]
anaeem1 has quit [Remote host closed the connection]
ner0x has joined #ruby
linuxnewb2 has joined #ruby
freezey has quit []
<timgauthier>
shevy!!
<timgauthier>
i'm really more of a BMW guy
nateberkopec has quit [Quit: Leaving...]
combusean has joined #ruby
<shevy>
bavaria is nice
nateberkopec has joined #ruby
<shevy>
they should separate from rest of germany really
<timgauthier>
yes
<timgauthier>
yes they should
<timgauthier>
like at the bottom of the ocean
<shevy>
hehe
infinitone has quit [Ping timeout: 255 seconds]
<shevy>
well they are famous for a few things... BMW ... beer ... hmm silly clothes and silly beards
<shevy>
"26th International Alpine Beard Competition"
fgo has joined #ruby
<shevy>
look at the food storage they hold in their beards
<shevy>
timgauthier I can't seem to will myself to want to learn rails :(
<timgauthier>
then don't
<timgauthier>
learn python ;)
dc has quit [Remote host closed the connection]
<shevy>
well
vpretzel|1445 has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
<shevy>
I need a main language
<shevy>
it could be ruby or it could be python
<shevy>
but both kinda overlap slightly
<timgauthier>
ya
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yetanotherdave>
How about MIPS assembly
<shevy>
do you really want me to replace ruby with python thusly!!!
freerobby has quit [Quit: Leaving.]
<shevy>
don't think that is very useful yeltzooo
nateberkopec has quit [Client Quit]
bmurt has joined #ruby
orthos has quit [Quit: orthos]
krz has joined #ruby
<timgauthier>
rails wasn't that hard when i tried to get it
<shevy>
possibly
fgo has quit [Ping timeout: 255 seconds]
<shevy>
but it seems so awfully boring :(
<timgauthier>
yes for you maybe ;)
<banister>
shevy learn swift
<timgauthier>
apple swift
<timgauthier>
to be specific
<banister>
timgauthier rails is boring IMO too
joelteon has joined #ruby
<timgauthier>
yes it is
gr33n7007h has joined #ruby
<timgauthier>
i guess
Arkaniad has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benzrf>
camping looks kinda fun
garndt has quit [Quit: Connection closed for inactivity]
Azulinho has quit [Ping timeout: 245 seconds]
<shevy>
timgauthier well
<timgauthier>
camping IS fun
<shevy>
timgauthier if I could transition all of my local knowledge into something better then that would be very useful
<shevy>
*knowledge base
<timgauthier>
yeah Apple swift is supposidly Objective C without hte C
<shevy>
it's a plethora of .cgi .rb .md and what not ... a few sqlite standalone files... hmm... a minor postgresql component for taxonomy data from organisms...
Spami has quit [Quit: This computer has gone to sleep]
<benzrf>
timgauthier: it looks like a more conservative version of scala to mehlah_
<benzrf>
*to me
SevenWolf has joined #ruby
lethjakman has quit [Quit: WeeChat 0.4.3]
enebo has joined #ruby
<Kaedenn1>
Say a ruby script contains a syntax error or some other error causing the script to terminate abnormally. What exit code would be returned to the calling process?
pwh has quit []
toastynerd has quit [Remote host closed the connection]
<Kaedenn1>
Does it depend on the specific kind of syntax/semantic error?
andrewjanssen has joined #ruby
VinDoKi has quit [Remote host closed the connection]
<kenichi>
`Hash === obj` or `obj.is_a? Hash`
<kenichi>
?
lukec has joined #ruby
enebo has quit [Client Quit]
<shevy>
Kaedenn1 should be all but 0
<Kaedenn1>
shevy: I don't know what that means
<shevy>
from within a .rb file it could be obtained via $?.exitstatus
<shevy>
well
<shevy>
you somehow need to capture it right?
<Kaedenn1>
We're doing it via Linux native code, the C apis
<shevy>
as in, however you run the script, you'll get back a value
<Kaedenn1>
fork(), exec() which just so happens to be a ruby script, then wait() or waitpid()
dc has joined #ruby
coffeina has quit [Quit: Wychodzi]
SCommette has quit [Quit: SCommette]
kireevco has quit [Read error: Connection reset by peer]
klaut has quit [Remote host closed the connection]
kireevco has joined #ruby
mary5030 has quit [Remote host closed the connection]
Kricir has quit [Remote host closed the connection]
<MrSamuel>
Kaedenn1: the error code by default is 1
<MrSamuel>
Kaedenn1: but anything non-zero should be considered an error
<Kaedenn1>
MrSamuel: *THAT* solves our problem! Thank you! The script is exiting with 1 and we don't know why.
<Kaedenn1>
It only exits with 1 when we run it through our product. When he runs it by hand it exits normally.
x1337807x has joined #ruby
mary5030 has joined #ruby
<MrSamuel>
if ruby is dying because of an error it would normally print a backtrace
<Kaedenn1>
There's no call to exit() or Kernel::exit() anywhere. We don't capture the stderr of the spawned process.
<Kaedenn1>
So I told customer support to try the $stderr.reopen trick.
bhaak has quit [Ping timeout: 240 seconds]
mattstratton has joined #ruby
zB0hs has joined #ruby
<MrSamuel>
Kaedenn1: sometimes in that case I just hardcode
moted has joined #ruby
<MrSamuel>
STDERR.reopen(“/tmp/error.log”) at the top of the script
<MrSamuel>
or something like that
<MrSamuel>
it is usually better thought to have a good logging solution/error capture