<r0bgleeson>
i fixed it, thanks, it seems to suggest constant reassignment because I call IRB.setup(nil) twice, i have no idea why the trace includes that file
bjh13_ has joined #ruby-lang
dm78 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
nihils has quit [Quit: Leaving...]
<r0bgleeson>
centrx: if you open irb(on 1.9 or 2.1), then say IRB.setup(nil) do you get constant reassignments from that file?
<centrx>
Yes, "already initialized constant"
<centrx>
I am on 2.0
<r0bgleeson>
but from that file?
<r0bgleeson>
e2mmap.rb?
<centrx>
Yes
<r0bgleeson>
ok
<r0bgleeson>
cool
<r0bgleeson>
thx
cannie has quit [Remote host closed the connection]
sepp2k1 has quit [Read error: Connection reset by peer]
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
clamstar has joined #ruby-lang
clamstar has quit [Remote host closed the connection]
cannie has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 250 seconds]
retro|cz has quit [Ping timeout: 250 seconds]
mykoweb has joined #ruby-lang
elliotec has quit [Remote host closed the connection]
saarinen has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
saarinen has quit [Client Quit]
yfeldblum has quit [Remote host closed the connection]
<Senjai>
Hello all
elliotec has joined #ruby-lang
mbj has quit [Quit: leaving]
elliotec has quit [Remote host closed the connection]
jtw has joined #ruby-lang
cannie has joined #ruby-lang
Xuisce has left #ruby-lang ["Leaving..."]
bzalasky has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby-lang
postmodern has quit [Quit: Leaving]
RobertBirnie has joined #ruby-lang
makoto_ has joined #ruby-lang
tkuchiki has quit [Ping timeout: 260 seconds]
makoto_ has quit [Ping timeout: 260 seconds]
<Lewix>
hello Senjai
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Barrin6 has joined #ruby-lang
Coincidental has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
Cakey has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
dm78 has quit [Remote host closed the connection]
dm78 has joined #ruby-lang
ender|dktm has quit [Ping timeout: 252 seconds]
hahuang65 has joined #ruby-lang
bzalasky has joined #ruby-lang
dm78 has quit [Ping timeout: 252 seconds]
Cakey has quit [Ping timeout: 252 seconds]
mistym has quit [Ping timeout: 245 seconds]
yfeldblum has joined #ruby-lang
agarie has quit [Quit: Leaving...]
yfeldblum has quit [Ping timeout: 245 seconds]
Lewix has quit [Remote host closed the connection]
cannie has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
lsegal has joined #ruby-lang
broconne has quit [Quit: Leaving.]
RobertBirnie has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
d4rkr4i has joined #ruby-lang
asahi has joined #ruby-lang
<asahi>
I'm drawing a blank on a regex. I'm trying to capture the variable number in "n\t\n\nLength: \n35.5'\n\n Beam:\n" so far I have /Length:.*(\d)'.*Beam:/
<centrx>
(\d*\.\d*)
Asher has quit [Read error: Connection reset by peer]
Asher has joined #ruby-lang
<asahi>
centrx: that's not working
<asahi>
it's only capturing ".5"
<centrx>
Okay, the .* before it is greedy, change to \s* so it only gets the whitespace
<centrx>
Do you expect any numbers like Length: \n35'
<centrx>
without the decimal
<asahi>
yes i do
<asahi>
and the \s doesn't seem to be matching the whitespace characters
<asahi>
i wonder if I'm better off removing the whitespace characters before doing the regex
broconne has joined #ruby-lang
<centrx>
asahi, nah
<centrx>
asahi, You either need to explicitly add the "\n" as a character in the Regex
broconne1 has joined #ruby-lang
makoto_ has joined #ruby-lang
<centrx>
asahi, Or specify that is is a multiline Regex, by adding the m option after the closing slash /
<centrx>
/m
<asahi>
I see. got it
<asahi>
centrx: thanks
<centrx>
You are welcome!
broconne1 has quit [Client Quit]
broconne has quit [Ping timeout: 250 seconds]
feinbergscott has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr22 has quit [Remote host closed the connection]
makoto_ has quit [Ping timeout: 248 seconds]
ben_____2 has quit [Ping timeout: 250 seconds]
mistym has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
ben_____2 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
RobertBirnie has joined #ruby-lang
bzalasky has joined #ruby-lang
<asahi>
is there a prettier way of writing year = year[1] unless year.nil?
<centrx>
That is the usual way
<centrx>
You can use year.second if you are using Rails or ActiveSupport
<asahi>
got it. thanks!
<centrx>
You can use year.try(:second) if you are using Rails or ActiveSupport, but this is a less explicit way
<centrx>
The unless year.nil? explicitly states the expected logic, so I would stick with that
snsei has joined #ruby-lang
havenwood has joined #ruby-lang
cannie has joined #ruby-lang
cannie has quit [Read error: Connection reset by peer]
ecnalyr has quit [Remote host closed the connection]
cannie has joined #ruby-lang
ecnalyr has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cannie has quit [Ping timeout: 246 seconds]
Lewix has joined #ruby-lang
ecnalyr has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
<Senjai>
asahi: Don't use second lol.
<Senjai>
asahi: Don't use Array#forty_two either
RobertBirnie has joined #ruby-lang
<Senjai>
asahi: If your using activesupport/rails its better to do something like year = year.presence[1]
<epitron>
array.find_by_number(:forty_two)
<Senjai>
err
<Senjai>
year = year[1] if year.present?
<Senjai>
or just if year
<epitron>
.try is nice, but it's awkward for arrays
<epitron>
year.try(:[], 1)
<epitron>
the "if present" one is much more readable
<epitron>
"year && year[1]" is another common one
<epitron>
(for understandability, you should also name that variable "years", since it's a collection of years)
mucker has joined #ruby-lang
<epitron>
year = years[1] if years.present?
Asher has quit [Ping timeout: 245 seconds]
<asahi>
i like that one
<asahi>
thanks
<epitron>
enjoy!
cannie has joined #ruby-lang
feinbergscott has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elliotec has joined #ruby-lang
snsei_ has joined #ruby-lang
mucker has quit [Ping timeout: 272 seconds]
snsei has quit [Ping timeout: 265 seconds]
Asher has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jtw has quit []
RobertBirnie has joined #ruby-lang
makoto has joined #ruby-lang
makoto is now known as Guest45489
snsei_ has quit [Remote host closed the connection]
asahi has quit [Quit: Leaving.]
RobertBirnie has quit [Client Quit]
Guest45489 has quit [Ping timeout: 245 seconds]
cannie_ has joined #ruby-lang
cannie has quit [Ping timeout: 272 seconds]
cannie has joined #ruby-lang
cannie_ has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
rippa has joined #ruby-lang
imperator has joined #ruby-lang
mistym has quit [Remote host closed the connection]
stonerfish has joined #ruby-lang
mistym has joined #ruby-lang
rahul_j has joined #ruby-lang
Coincidental has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
yuko7 has joined #ruby-lang
Asher has quit [Ping timeout: 245 seconds]
snsei has joined #ruby-lang
panpainter has quit [Quit: panpainter]
centrx is now known as xcentr
xcentr is now known as Xcentr
d4rkr4i has quit [Quit: Leaving.]
artm has joined #ruby-lang
Xcentr is now known as centrx
mykoweb has quit [Remote host closed the connection]
rahul_j has quit [Quit: rahul_j]
panpainter has joined #ruby-lang
RobertBirnie has joined #ruby-lang
Asher has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
nichtdiebohne has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has quit [Ping timeout: 245 seconds]
hahuang65 has quit [Ping timeout: 265 seconds]
d4rkr4i has joined #ruby-lang
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
mistym has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
makoto has joined #ruby-lang
makoto is now known as Guest90204
jonahR has quit [Quit: jonahR]
Guest90204 has quit [Ping timeout: 250 seconds]
|jemc| has quit [Ping timeout: 245 seconds]
imperator has quit [Ping timeout: 245 seconds]
ikrima has joined #ruby-lang
vlad_starkov has joined #ruby-lang
RoxasShadowRS has joined #ruby-lang
mistym has joined #ruby-lang
<yorickpeterse>
morning
<centrx>
night
centrx has quit [Quit: Leaving]
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
ben_____2 has quit [Ping timeout: 248 seconds]
snsei has quit [Remote host closed the connection]
ben______ has joined #ruby-lang
Coincidental has quit [Remote host closed the connection]
joelroa has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
snsei has joined #ruby-lang
nichtdiebohne has quit [Quit: Leaving...]
hahuang65 has joined #ruby-lang
snsei has quit [Remote host closed the connection]
dik_dak has quit [Quit: Leaving]
joelroa has quit [Quit: Computer has gone to sleep.]
hahuang65 has quit [Ping timeout: 272 seconds]
makoto has joined #ruby-lang
makoto is now known as Guest96455
Guest96455 has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
hahuang65 has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
cannie_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
cannie has quit [Ping timeout: 245 seconds]
amclain has quit [Quit: Leaving]
elliotec has quit [Remote host closed the connection]
Lewix has quit [Remote host closed the connection]
sferik has quit [Ping timeout: 252 seconds]
yuko7 has quit [Ping timeout: 245 seconds]
vondruch has joined #ruby-lang
d4rkr4i has quit [Ping timeout: 245 seconds]
dotrb has quit [Ping timeout: 245 seconds]
kalehv has joined #ruby-lang
lavana has quit [Ping timeout: 245 seconds]
cnivolle has quit [Remote host closed the connection]
rolfb has joined #ruby-lang
marr has joined #ruby-lang
retro|cz has quit [Ping timeout: 245 seconds]
dorei has joined #ruby-lang
matp has quit [Quit: ZZZzzz…]
matp has joined #ruby-lang
nichtdiebohne has quit [Quit: Leaving...]
vondruch has quit [Quit: Ex-Chat]
vlad_starkov has quit [Remote host closed the connection]
rahul_j has joined #ruby-lang
mbj has joined #ruby-lang
yfeldblum has joined #ruby-lang
wallerdev has joined #ruby-lang
nichtdiebohne has joined #ruby-lang
bougyman has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 245 seconds]
bougyman has joined #ruby-lang
Guest84287 has quit [Remote host closed the connection]
relix has joined #ruby-lang
tonni_ has quit [Remote host closed the connection]
purezen has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<purezen>
Hi guys! I am a beginner with Ruby.. I introduced myself with the language firstly, but following Micheal Hartl's tutorial for Rails.. Then, after some experimenting with Sinatra, Rack and such stuff like making gems , by following tutorials.. I went ahead to read why's Poingnant Guide to Ruby (though barring the last chapter)..
<purezen>
Here now, I was hoping for someone to provide me with some guidance.. as to how I shall take myself forward.. and sharpen my Ruby skills..
feinbergscott has joined #ruby-lang
Caius has quit [Ping timeout: 260 seconds]
<purezen>
Hopefully, I want to start making some OSS contributions in time. Thanks :)
vlad_starkov has quit [Remote host closed the connection]
panpainter has joined #ruby-lang
Caius has joined #ruby-lang
dwknoxy has quit [Quit: Computer has gone to sleep.]
ben_____1 has quit [Ping timeout: 245 seconds]
Markvilla has joined #ruby-lang
mykoweb has joined #ruby-lang
purezen has quit [Ping timeout: 245 seconds]
kalehv has quit [Ping timeout: 265 seconds]
purezen has joined #ruby-lang
purezen has quit [Ping timeout: 245 seconds]
makoto has joined #ruby-lang
makoto is now known as Guest49597
snsei has joined #ruby-lang
kalehv has joined #ruby-lang
Guest49597 has quit [Ping timeout: 250 seconds]
wallerdev has quit [Quit: wallerdev]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
feinbergscott has quit [Ping timeout: 245 seconds]
feinbergscott has joined #ruby-lang
yfeldblum has joined #ruby-lang
tbuehlmann has joined #ruby-lang
spuk has joined #ruby-lang
pabloh has joined #ruby-lang
yfeldblum has quit [Ping timeout: 260 seconds]
EngierkO has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sferik has joined #ruby-lang
feinbergscott has quit [Remote host closed the connection]
feinbergscott has joined #ruby-lang
pabloh has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
feinbergscott has quit [Ping timeout: 245 seconds]
bzalasky has joined #ruby-lang
d4rkr4i has joined #ruby-lang
lavana has joined #ruby-lang
tkuchiki_ has quit [Remote host closed the connection]
mbj has left #ruby-lang [#ruby-lang]
arBmind has quit [Quit: Leaving.]
Markvilla has quit [Quit: Computer has gone to sleep.]
arBmind has joined #ruby-lang
wallerdev has joined #ruby-lang
arBmind has quit [Client Quit]
lavana has quit [Ping timeout: 260 seconds]
certainty has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
symm- has joined #ruby-lang
kalehv has quit [Remote host closed the connection]
houhoulis has joined #ruby-lang
<d4rkr4i>
I wish to substitute a line like "foo->temp->tick //foo->temp" to "foo.temp.tick //foo->temp"
ben______ has joined #ruby-lang
<d4rkr4i>
i.,e after a comment (//) I dont' want to make any substitution for (->) to (.)
<d4rkr4i>
can't make it work with my negative lookbehind regex
<badeball>
d4rkr4i: you would at least have to you lookahead, as you want to match something that is followed by something. anyways, I don't feel like regexp is the best choice. here a different approach: split("//").tap { |l| l.first.gsub!("->", ".") }.join("//")