justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
ryanf_ has quit [Ping timeout: 255 seconds]
kain_ has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
Hakon has joined #ruby-lang
<arooni-mobile>
must i declare all instance vars within initialize or can i declare them on the fly too
jtoy has joined #ruby-lang
<Spaceghostc2c>
arooni-mobile: You don't 'need' to declare them ahead of time.
<Spaceghostc2c>
ruby is dynamic.
<Erlkoenig>
variables just start to exist when you first assign to them
<erikh>
that said, do the people who read your code a favor and try to declare them in your initializer.
Hakon has quit [Client Quit]
<erikh>
just because you can doesn't mean you should.
<arooni-mobile>
got it thanks
<Spaceghostc2c>
erikh: Meh, that works for lots of stuff, and definitely do when you can, but it shouldn't be a 'rule'.
Madis_ has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0/20120830123745]]
gsav has joined #ruby-lang
alexkira has quit [Remote host closed the connection]
rue|w has quit [Ping timeout: 246 seconds]
rue|w has joined #ruby-lang
marc3000 has joined #ruby-lang
marc3000 has left #ruby-lang [#ruby-lang]
Aaaarg has joined #ruby-lang
Aaaarg has quit [Excess Flood]
rue_XIW has joined #ruby-lang
<arooni-mobile>
if i have>>>> "Tagged - Gregory Garcia" and i want to extract out the name.... but the name might be arbitrarily large... the first part is always the same. would i do name = string[8,999]
ryanlecompte has quit [Remote host closed the connection]
A124 has quit [Read error: No route to host]
arooni-mobile has joined #ruby-lang
KA_ has joined #ruby-lang
rue|w has quit [Ping timeout: 246 seconds]
nariyal has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 245 seconds]
A124 has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
thebastl has joined #ruby-lang
mytrile has joined #ruby-lang
probst has joined #ruby-lang
KA_ has quit [Quit: KA_]
KA_ has joined #ruby-lang
rue|w has joined #ruby-lang
KA_ has quit [Quit: KA_]
kain_ is now known as kain
artOfWar has quit [Remote host closed the connection]
<mars777>
Can somebody please review my Ruby code and see if it is correct in solving a Ruby Coding Challenge. I would appreciate it.
<mars777>
If you have a moment please write to me. Thanks
rue|w has quit [Read error: Connection reset by peer]
rue_XIW has joined #ruby-lang
JohnBat26 has joined #ruby-lang
<burgestrand>
mars777: you’re likely to get far more reviewers if you paste your code online and shove the link in here.
slaytanic has quit [Read error: Connection reset by peer]
slaytanic has joined #ruby-lang
<burgestrand>
mars777: by requiring your helpers to message you you’ve increased the threshold of helping you significantly.
<Spaceghostc2c>
burgestrand: I was just about to send out a carrier pidgeon with a message for him. :(
<burgestrand>
Was considering a drift bottle.
<mars777>
Oh ok thanks
<burgestrand>
Interestingly, Swedish has a word for that: flaskpost.
yats has joined #ruby-lang
dhruvasagar has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
vlad_starkov has joined #ruby-lang
setmeaway has joined #ruby-lang
setmeaway has quit [Read error: Connection reset by peer]
mtkd has quit [Read error: Operation timed out]
mtkd has joined #ruby-lang
datanoise has joined #ruby-lang
setmeaway has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
runeb- has joined #ruby-lang
runeb- is now known as runeb
vlad_starkov has quit [Read error: Connection reset by peer]
Carnage\ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
yats has quit [Read error: No route to host]
zmack has joined #ruby-lang
rippa has joined #ruby-lang
vmoravec has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby-lang
<rue>
Yes, pulloposti.
<rue>
Message-in-a-bottle is a little less rolly-off-the-tongue
solars has joined #ruby-lang
artOfWar has joined #ruby-lang
artOfWar has quit [Ping timeout: 255 seconds]
rolfb has joined #ruby-lang
icooba has quit [Ping timeout: 255 seconds]
sepp2k has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
Criztian has joined #ruby-lang
ljsdfc has joined #ruby-lang
icooba has joined #ruby-lang
chendo_ has joined #ruby-lang
cdt has joined #ruby-lang
cdt has quit [Remote host closed the connection]
Bosox20051 has quit [Quit: Leaving]
Hakon has joined #ruby-lang
benanne has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
undersc0re97 has quit [Ping timeout: 246 seconds]
chendo_ has quit [Quit: Leaving...]
Criztian has joined #ruby-lang
vesan has quit [Read error: Connection reset by peer]
akamike has joined #ruby-lang
ryanf has quit [Quit: leaving]
cantonic has quit [Quit: cantonic]
undersc0re97 has joined #ruby-lang
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby-lang
cantonic has joined #ruby-lang
vesan has joined #ruby-lang
robotmay has joined #ruby-lang
rippa has quit [Ping timeout: 248 seconds]
cantonic has quit [Quit: cantonic]
cantonic has joined #ruby-lang
d3vic3 has joined #ruby-lang
cantonic has quit [Client Quit]
nariyal has quit [Quit: Computer has gone to sleep.]
dr_bob has joined #ruby-lang
Madis_ has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
Hakon has quit [Quit: Leaving...]
abletony84 has joined #ruby-lang
dr_bob has quit [Quit: Tune in next week when you'll hear Dr. Bob say...]
<abletony84>
Hey, trying to show <h3>Category <span>1234</span></h3> with this helper, although Category should link to that category if allow_posting == true..
<abletony84>
http://pastie.org/4890194 doesn't feel entirely right plus it has some duplicate code - anybody have any suggestions how to fix it?
cantonic has joined #ruby-lang
nariyal has joined #ruby-lang
runeb has quit [Remote host closed the connection]
runeb has joined #ruby-lang
Hakon has joined #ruby-lang
mars777 has left #ruby-lang [#ruby-lang]
workmad3 has joined #ruby-lang
probst has quit [Quit: probst]
sush24 has joined #ruby-lang
GarethAdams has joined #ruby-lang
datanoise has joined #ruby-lang
sush24 has quit [Client Quit]
sush24 has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 245 seconds]
beiter has joined #ruby-lang
yats has joined #ruby-lang
robotmay_ has joined #ruby-lang
robotmay has quit [Ping timeout: 245 seconds]
robotmay_ has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
robotmay has joined #ruby-lang
postmodern has quit [Quit: Leaving]
cantonic_ has joined #ruby-lang
probst has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
yats has quit [Ping timeout: 245 seconds]
jarib has quit [Excess Flood]
cantonic has quit [Ping timeout: 255 seconds]
cantonic_ is now known as cantonic
adambeynon has joined #ruby-lang
jarib has joined #ruby-lang
runeb has quit [Remote host closed the connection]
runeb has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
runeb has quit [Ping timeout: 245 seconds]
probst has quit [Quit: probst]
runeb has joined #ruby-lang
yats has joined #ruby-lang
toretore has joined #ruby-lang
banaan has joined #ruby-lang
benanne has quit [Ping timeout: 260 seconds]
GarethAdams|Work has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
GarethAdams has quit [Remote host closed the connection]
x0F_ is now known as x0F
Hakon has joined #ruby-lang
yats has quit [Ping timeout: 244 seconds]
probst has joined #ruby-lang
kain has quit [Quit: exit]
vlad_starkov has joined #ruby-lang
kain has joined #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
Guedes_out is now known as Guedes
d3vin has joined #ruby-lang
piyush has quit [Ping timeout: 245 seconds]
yats has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 260 seconds]
robotmay has quit [Read error: Connection reset by peer]
robotmay_ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
d3vin has left #ruby-lang [#ruby-lang]
robotmay_ has quit [Read error: Connection reset by peer]
robotmay has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
sush24 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
heftig has quit [Quit: leaving]
piyush has joined #ruby-lang
robotmay_ has joined #ruby-lang
robotmay has quit [Ping timeout: 245 seconds]
lele|w has quit [Ping timeout: 272 seconds]
robotmay has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
lele|w has joined #ruby-lang
robotmay_ has quit [Ping timeout: 246 seconds]
josh^ has quit [Ping timeout: 245 seconds]
goshakkk has joined #ruby-lang
josh^ has joined #ruby-lang
tooky has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
nariyal has quit [Quit: Computer has gone to sleep.]
sush24 has quit [Ping timeout: 260 seconds]
zz_chrismcg is now known as chrismcg
sush24 has joined #ruby-lang
josh^ has quit [Ping timeout: 245 seconds]
Carnage\ has quit []
probst has quit [Quit: probst]
nariyal has joined #ruby-lang
josh^ has joined #ruby-lang
runeb has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
runeb has joined #ruby-lang
GarethAdams|Work has quit [Quit: Leaving...]
Carnage\ has joined #ruby-lang
cantonic has joined #ruby-lang
mr_dynamix has joined #ruby-lang
runeb has quit [Ping timeout: 245 seconds]
datanoise has joined #ruby-lang
cdt has joined #ruby-lang
heftig has joined #ruby-lang
mwjcomputing has joined #ruby-lang
beiter has quit [Ping timeout: 246 seconds]
nariyal has quit [Quit: Computer has gone to sleep.]
arkiver has joined #ruby-lang
nariyal has joined #ruby-lang
josh^ has quit [Ping timeout: 245 seconds]
LanceHaig has joined #ruby-lang
felixc has joined #ruby-lang
josh^ has joined #ruby-lang
jamo has joined #ruby-lang
vlad_starkov has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
m3nd3s has joined #ruby-lang
jamo has quit [Ping timeout: 256 seconds]
cantonic has quit [Quit: cantonic]
vlad_starkov has quit [Remote host closed the connection]
nariyal has quit [Quit: Computer has gone to sleep.]
cantonic has joined #ruby-lang
brunocoelho has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
NOKAH has joined #ruby-lang
Hakon has quit [Read error: Connection reset by peer]
carloslopes has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 245 seconds]
yats has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby-lang
yats has joined #ruby-lang
runeb has joined #ruby-lang
<andrewvos>
Can anyone see anything particularly bad about this? `ruby_method_name = method[:name].gsub(/([A-Z])/) { "_" + $1.downcase }`
<heftig>
andrewvos should be (:name)?
<heftig>
uh
<heftig>
what's "method"?
<heftig>
is it the "method" method, or a hash?
nariyal has joined #ruby-lang
krz has quit [Quit: krz]
jperry2_ has joined #ruby-lang
<andrewvos>
heftig: It's a hash sorry. I was referring to the way I'm converting method names from methodName to method_name.
<andrewvos>
This is all I was asking about `.gsub(/([A-Z])/) { "_" + $1.downcase }`
<andrewvos>
Wondering if I'm missing any edge cases
sockmonk has joined #ruby-lang
probst has joined #ruby-lang
<heftig>
i'd use "methodName".gsub(/[A-Z]/) { |cap| "_" + cap.downcase } instead of the globals
<andrewvos>
heftig: Ahh yes. Forgot about that param in the gsub block.
<andrewvos>
Probably more readable
<andrewvos>
Thanks
fbernier has joined #ruby-lang
<heftig>
andrewvos: hmm, the activesupport underscorer seems to convert SSLError to ssl_error
<TTilus>
dum-di-dum, whats the deal behind def foo; else puts 'asdf'; end _not_ being a syntax error?
<TTilus>
rue: sting made it roll of the tongue pretty smoothly
arooni-mobile has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
gsav has joined #ruby-lang
t0n1 has joined #ruby-lang
felixc has quit [Quit: Leaving.]
krohrbaugh has quit [Read error: Operation timed out]
<andrewvos>
haha yeah
tallship has joined #ruby-lang
snk has joined #ruby-lang
Criztian has joined #ruby-lang
Madis has joined #ruby-lang
t0n1 has left #ruby-lang [#ruby-lang]
Fretta has joined #ruby-lang
Jay_Levitt has quit [Quit: Jay_Levitt]
|Vargas| has quit [Quit: ...]
probst has joined #ruby-lang
<andrewvos>
Classic quote from #java "<pseudonymous> I'm just a student and while I'd like to get this done right, I'm not nearly wealthy enough to pick up a profiler (nor do I like java enough to invest like that)"
<burgestrand>
andrewvos: yes, if you include a copy of the apache license in your gem
<andrewvos>
burgestrand: By include a copy, you mean just next to the jar file?
<andrewvos>
burgestrand: As in, not licensing my app with Apache 2.0?
<burgestrand>
andrewvos: yeah, no need to license your app as apache 2.0, you just need to make sure any user of your gem retains a copy of the license somehow
probst has quit [Client Quit]
<andrewvos>
Okay
<burgestrand>
redistribution without modification is the only thing the apache license got right
<andrewvos>
So they don't have to see the license then?
<burgestrand>
andrewvos: no, you just need to make sure the users of your gem (or rather, the jar) receive a copy of the license. Oh, I also forgot: if there is a NOTICE file distributed with the jar it must be available too.
<burgestrand>
At least the license is kind of small, unlike the GPL licenses :p
<andrewvos>
Heh :)
jamjam777 has joined #ruby-lang
<burgestrand>
andrewvos: if in doubt, you could always ask the original author(s) of the jar and ask them about it. It’s unlikely they know themselves why they even have Apache 2.0 (apart from it being a known license), but it can’t hurt.
runeb has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 245 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
Theueip has quit [Read error: Connection reset by peer]
<andrewvos>
Thanks, I might just do that. For now I'm just teling users of my gem to install it somewhere.
Theueip has joined #ruby-lang
piyush has quit [Ping timeout: 252 seconds]
KA_ has quit [Quit: KA_]
polaco has quit [Remote host closed the connection]
<workmad3>
andrewvos: you also need to make sure that the licence of your gem is compatible with the jar's licence
<workmad3>
andrewvos: which is why that's important ;)
<andrewvos>
Hm
jtoy has joined #ruby-lang
<workmad3>
andrewvos: if you tried to distribute your gem as GPL, for example, then that applies to the entire distribution
<andrewvos>
Ok fair enough
<andrewvos>
I think keeping the tool as an external dependency is probably the best bet for now
<andrewvos>
then
<workmad3>
yeah
<workmad3>
although having a way to install it via your gem would be nice and easy :)
aflynn has joined #ruby-lang
Theueip has quit [Quit: Bye!]
<andrewvos>
Yeah true
<andrewvos>
I will do that actually
<workmad3>
and avoids a lot of licencing issues (which typically apply to the exact distribution)
<andrewvos>
Automatically install it on first run perhaps
<matti>
workmad3: ;]
enebo has joined #ruby-lang
<workmad3>
it's why something like bundler is nice, IMO... you don't distribute all the various gems, you simply provide a mechanism by which the user can build their own completed app (which could easily be non-distributable because it contains incompatible licences)
GarethAdams has quit [Quit: Leaving...]
<workmad3>
andrewvos: the other option - you could wrap the .jar up into a suitable gem container, release that under the apache2 licence with suitable credit given to the original authors
<workmad3>
andrewvos: and then simply declare that as a gem dependency ;)
<andrewvos>
hahah that's not a bad idea :)
<workmad3>
no idea what you'd need to do for that though... I've not wrapped any jars up as gems
mrsolo has quit [Quit: This computer has gone to sleep]
mrsolo has joined #ruby-lang
thillux has quit [Ping timeout: 244 seconds]
gregmore_ has joined #ruby-lang
gregmoreno has quit [Ping timeout: 245 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
guns has quit [Quit: guns]
elux has quit [Quit: Bye!]
mwjcomputing has quit [Quit: Leaving]
tenderlove has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
probst has quit [Quit: probst]
qpingu has joined #ruby-lang
<naquad>
i need to loop through all possibilities of boolean matrix 4x4, can i somehow generate it with ruby? i've tried [[[true, false] * 4] * 4].combinations(4).to_a - but that didn't help :(
<naquad>
*combination
<rue>
Permutations?
<naquad>
rue, did work out :(
<naquad>
*didn't
sush24 has joined #ruby-lang
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
s0ber_ has joined #ruby-lang
<heftig>
naquad: [true,false].repeated_permutation(16).map { |x| x.each_slice(4).to_a }.each { |x| p x }
<heftig>
naquad: [true,false].repeated_permutation(4).to_a.repeated_permutation(4).each { |x| p x }
<heftig>
both work
<heftig>
the latter is probably better
<naquad>
heftig, thank you!
Austin__ has quit [Quit: Leaving.]
s0ber has quit [Ping timeout: 260 seconds]
s0ber_ is now known as s0ber
alexkira has quit [Remote host closed the connection]
gsav has quit [Ping timeout: 260 seconds]
sgonyea has joined #ruby-lang
Carnage\ has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
zmack has quit [Ping timeout: 252 seconds]
tenderlove has joined #ruby-lang
mantono has quit [Remote host closed the connection]
havenn has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
alvaro_o_ has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
Austin__ has joined #ruby-lang
fletch has joined #ruby-lang
justinseiter has quit [Ping timeout: 252 seconds]
r1s1ng-ph03n1x has joined #ruby-lang
fletch has quit [Client Quit]
fletch_ has joined #ruby-lang
alvaro_o has quit [Ping timeout: 260 seconds]
willdrew has joined #ruby-lang
willdrew has quit [Remote host closed the connection]
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
jperry2_ has quit [Quit: jperry2_]
mpan has joined #ruby-lang
gsav has joined #ruby-lang
havenn has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
bfreeman has quit [Quit: bfreeman]
sush24 has quit [Quit: This computer has gone to sleep]
nariyal has quit [Ping timeout: 240 seconds]
scampbell has quit [Quit: Ex-Chat]
gregmore_ has quit [Remote host closed the connection]
nariyal has joined #ruby-lang
bfreeman has joined #ruby-lang
sailias has quit [Quit: Leaving.]
mpan has quit [Ping timeout: 246 seconds]
CarlB_the_great has joined #ruby-lang
alvaro_o_ has quit [Quit: Ex-Chat]
mars777 has left #ruby-lang [#ruby-lang]
Austin__ has quit [Quit: Leaving.]
My_Hearing has joined #ruby-lang
CarlB_the_great has quit [Remote host closed the connection]
CarlB_the_great has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]