apeiros changed the topic of #ruby-lang to: Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste code on https://gist.github.com
nertzy2 has quit [Quit: This computer has gone to sleep]
ascarter has joined #ruby-lang
slawrenc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iliketurtles has quit [Remote host closed the connection]
iamninja has quit [Read error: Connection reset by peer]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iamninja has joined #ruby-lang
kfpratt has joined #ruby-lang
io_syl has quit []
niemcu has quit [Remote host closed the connection]
DivineEntity has quit [Ping timeout: 240 seconds]
DivineEntity has joined #ruby-lang
fujimura_ has joined #ruby-lang
ascarter has joined #ruby-lang
ta has joined #ruby-lang
<mustmodify> OK! More fun with YAML. Maybe someone can explain this foolish to me. https://gist.github.com/mustmodify/9686d10f48a1578ac95e
fujimura_ has quit [Ping timeout: 252 seconds]
<mustmodify> strange[0..120] results in the "literal" format I want. But strange[0..100].to_yaml results in the "inline" format... no white space... why? WHY WHY WHY?
atomical has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<womble> Because YAML.
<mustmodify> it works for the following indexes: [104, 105, 106, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 140, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, 157, 158, 159, 161, 162, 164, 165, 166, 167, 168, 169, 171, 172, 173, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 192, 193, 194, 195, 196, 197, 199, 200, 202, 203, 204
nertzy2 has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sepp2k has quit [Quit: Leaving.]
djbkd has quit [Remote host closed the connection]
<mustmodify> 219 is a space. 220 is the third \n...
djbkd has joined #ruby-lang
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]
marr has quit [Ping timeout: 255 seconds]
Fooster has quit [Ping timeout: 252 seconds]
slumos has joined #ruby-lang
gwendall has joined #ruby-lang
tenderlove has joined #ruby-lang
kuroro has joined #ruby-lang
kuroro2 has joined #ruby-lang
kuroro2 has left #ruby-lang [#ruby-lang]
tenderlove has quit [Remote host closed the connection]
kfpratt has quit [Remote host closed the connection]
gwendall has quit [Ping timeout: 272 seconds]
PocketJosh has quit [Remote host closed the connection]
PocketJosh has joined #ruby-lang
nertzy2 has quit [Quit: This computer has gone to sleep]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta has quit [Read error: Connection reset by peer]
j0n3 has quit [Read error: Connection reset by peer]
kuroro2 has joined #ruby-lang
djbkd has quit [Quit: My people need me...]
BanzaiJoe has joined #ruby-lang
kuroro has quit [Ping timeout: 246 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
kuroro2 has quit [Ping timeout: 240 seconds]
b_hoffman has joined #ruby-lang
ascarter has joined #ruby-lang
hal_9000__ has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
hal_9000_ has quit [Ping timeout: 272 seconds]
seank_ has quit [Remote host closed the connection]
seank_ has joined #ruby-lang
charliesome has joined #ruby-lang
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BanzaiJoe has quit [Ping timeout: 244 seconds]
hal_9000_ has joined #ruby-lang
hal_9000__ has quit [Ping timeout: 256 seconds]
gwendall has joined #ruby-lang
tkuchiki has joined #ruby-lang
bruno- has quit [Ping timeout: 244 seconds]
datanois1 has joined #ruby-lang
hal_9000__ has joined #ruby-lang
hal_9000_ has quit [Ping timeout: 258 seconds]
amclain has joined #ruby-lang
io_syl has joined #ruby-lang
fujimura has joined #ruby-lang
ryba has quit [Ping timeout: 265 seconds]
fujimura has quit [Ping timeout: 256 seconds]
wallerdev has joined #ruby-lang
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
baweaver has quit [Read error: Connection reset by peer]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ruby-lang
baweaver has joined #ruby-lang
BanzaiJoe has joined #ruby-lang
shinnya has quit [Ping timeout: 255 seconds]
cornerma1 has joined #ruby-lang
benlovell has quit [Ping timeout: 272 seconds]
haraoka has joined #ruby-lang
baweaver has quit [Ping timeout: 264 seconds]
PocketJosh has quit [Ping timeout: 240 seconds]
kfpratt has joined #ruby-lang
cornerman has quit [Ping timeout: 244 seconds]
cornerma1 is now known as cornerman
b_hoffman has quit [Quit: b_hoffman]
PocketJosh has joined #ruby-lang
stardiviner has joined #ruby-lang
PocketJosh has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
fujimura has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
fujimura has joined #ruby-lang
duderonomy has joined #ruby-lang
gambl0re has joined #ruby-lang
gambl0re has quit [Client Quit]
gambl0re has joined #ruby-lang
gambl0re has quit [Client Quit]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wallerdev has quit [Quit: wallerdev]
gwendall has quit [Remote host closed the connection]
GPrime has joined #ruby-lang
gwendall has joined #ruby-lang
ledestin has joined #ruby-lang
houhoulis has quit [Remote host closed the connection]
gwendall has quit [Ping timeout: 272 seconds]
bruno- has joined #ruby-lang
kfpratt has quit [Ping timeout: 258 seconds]
bruno- has quit [Ping timeout: 240 seconds]
drefined has joined #ruby-lang
charliesome has quit [Quit: zzz]
wallerdev has joined #ruby-lang
charliesome has joined #ruby-lang
tenderlove has joined #ruby-lang
drefined has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lele has quit [Ping timeout: 272 seconds]
tenderlove has quit [Ping timeout: 265 seconds]
djbkd has joined #ruby-lang
nertzy2 has joined #ruby-lang
dorei has quit []
datanoise has joined #ruby-lang
PocketJosh has joined #ruby-lang
datanois1 has quit [Quit: leaving]
houhoulis has joined #ruby-lang
znz_jp has quit [Quit: kill -QUIT $$]
PocketJosh has quit [Ping timeout: 245 seconds]
kfpratt has joined #ruby-lang
znz_jp has joined #ruby-lang
centrx has quit [Quit: Shutting down, Please wait...]
nertzy2 has quit [Quit: This computer has gone to sleep]
symm- has quit [Quit: Leaving...]
PocketJosh has joined #ruby-lang
symm- has joined #ruby-lang
Hofnerd has joined #ruby-lang
bruno- has joined #ruby-lang
Hofnerd has quit [Client Quit]
mcclurmc has joined #ruby-lang
gwendall has joined #ruby-lang
bruno- has quit [Ping timeout: 272 seconds]
gwendall has quit [Ping timeout: 272 seconds]
fujimura has quit [Remote host closed the connection]
nertzy2 has joined #ruby-lang
joaomdmoura has joined #ruby-lang
t_ has joined #ruby-lang
gix has quit [Ping timeout: 256 seconds]
David_H__ has joined #ruby-lang
datanois1 has joined #ruby-lang
joaomdmoura has quit [Ping timeout: 244 seconds]
datanois1 has quit [Client Quit]
datanois1 has joined #ruby-lang
gix has joined #ruby-lang
David_H_Smith has quit [Ping timeout: 264 seconds]
pikos has quit [Remote host closed the connection]
kfpratt has quit [Remote host closed the connection]
nertzy2 has quit [Quit: This computer has gone to sleep]
drefined has joined #ruby-lang
revath has joined #ruby-lang
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby-lang
datanois1 has quit [Quit: leaving]
drefined has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PocketJosh has quit [Read error: Connection reset by peer]
Nimf has joined #ruby-lang
datanois1 has joined #ruby-lang
djbkd has quit [Quit: My people need me...]
nertzy2 has joined #ruby-lang
PocketJosh has joined #ruby-lang
datanoise has quit []
datanois1 has quit [Quit: WeeChat 1.1.1]
datanoise has joined #ruby-lang
charliesome has quit [Quit: zzz]
PocketJosh has quit [Ping timeout: 255 seconds]
PocketJosh has joined #ruby-lang
haraoka has quit [Ping timeout: 245 seconds]
bruno- has joined #ruby-lang
datanoise has quit [Quit: WeeChat 1.1.1]
rawrmonstar has joined #ruby-lang
bruno- has quit [Ping timeout: 244 seconds]
jbomo has joined #ruby-lang
tenderlove has joined #ruby-lang
jbomo has left #ruby-lang [#ruby-lang]
joaomdmoura has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
datanoise has joined #ruby-lang
micmus has quit [Quit: Leaving]
revath has quit [Ping timeout: 264 seconds]
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fujimura has joined #ruby-lang
hal_9000_ has joined #ruby-lang
riotjones has joined #ruby-lang
riotjones has quit [Read error: Connection reset by peer]
riotjones has joined #ruby-lang
benlovell has joined #ruby-lang
hal_9000__ has quit [Ping timeout: 258 seconds]
datanoise has quit [Quit: WeeChat 1.1.1]
datanoise has joined #ruby-lang
datanoise has joined #ruby-lang
haraoka has joined #ruby-lang
caseypatrickdris has quit [Remote host closed the connection]
tautvydas has joined #ruby-lang
riotjones has quit [Ping timeout: 265 seconds]
benlovell has quit [Ping timeout: 264 seconds]
David_H_Smith has joined #ruby-lang
rawrmonstar has left #ruby-lang ["Textual IRC Client: www.textualapp.com"]
michaeldeol has joined #ruby-lang
David_H__ has quit [Ping timeout: 245 seconds]
Missphoenix has quit [Quit: Leaving]
TheMoonMaster has quit [Ping timeout: 272 seconds]
slumos has left #ruby-lang [#ruby-lang]
gianlucadv has joined #ruby-lang
Miphix has joined #ruby-lang
io_syl has quit []
ur5us has quit [Remote host closed the connection]
BanzaiJoe has quit [Ping timeout: 264 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
revath has joined #ruby-lang
charliesome has joined #ruby-lang
|jemc| has quit [Ping timeout: 264 seconds]
bruno- has joined #ruby-lang
mikecmpbll has quit [Quit: ciao.]
skade has joined #ruby-lang
bruno- has quit [Ping timeout: 276 seconds]
rippa has joined #ruby-lang
houhoulis has quit [Remote host closed the connection]
|jemc| has joined #ruby-lang
VinnyBoy has quit [Read error: Connection reset by peer]
pikos has joined #ruby-lang
djbkd has joined #ruby-lang
pikos has quit [Ping timeout: 244 seconds]
io_syl has joined #ruby-lang
revath has quit [Ping timeout: 258 seconds]
symm- has quit [Ping timeout: 265 seconds]
PocketJosh has quit [Ping timeout: 252 seconds]
revath has joined #ruby-lang
LBo has quit [Ping timeout: 258 seconds]
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_ht has joined #ruby-lang
riotjones has joined #ruby-lang
jas02 has joined #ruby-lang
PocketJosh has joined #ruby-lang
LBo has joined #ruby-lang
revath has quit [Ping timeout: 256 seconds]
ascarter has joined #ruby-lang
revath has joined #ruby-lang
gambl0re has joined #ruby-lang
chinmay_dd has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]
revath1 has joined #ruby-lang
revath has quit [Ping timeout: 250 seconds]
tenderlove has joined #ruby-lang
amclain has quit [Quit: Leaving]
tenderlove has quit [Ping timeout: 250 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has joined #ruby-lang
michael_mbp has quit [Excess Flood]
djellemah has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby-lang
bruno- has quit [Ping timeout: 264 seconds]
stan has joined #ruby-lang
<RickHull> ljarvis: since pry depends on slop 3, can it not be used in projects with slop 4?
skade has quit [Quit: Computer has gone to sleep.]
arBmind has joined #ruby-lang
rbowlby_ has quit [Remote host closed the connection]
woodruffw has quit [Quit: And then he took off.]
woodruffw has joined #ruby-lang
ec2-user_ has quit [*.net *.split]
woodruffw has quit [Client Quit]
woodruffw has joined #ruby-lang
PocketJosh has quit []
datanoise has quit [Ping timeout: 258 seconds]
joaomdmoura has joined #ruby-lang
sarkyniin has joined #ruby-lang
nertzy has joined #ruby-lang
solars has joined #ruby-lang
nertzy2 has quit [Ping timeout: 265 seconds]
sarkyniin has quit [Ping timeout: 256 seconds]
datanoise has joined #ruby-lang
ryba has joined #ruby-lang
datanoise has quit [Ping timeout: 240 seconds]
myork80 has joined #ruby-lang
myork80 has quit [Client Quit]
loveablelobster has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
loveablelobster has left #ruby-lang [#ruby-lang]
loveablelobster has joined #ruby-lang
loveablelobster has quit [Client Quit]
<ljarvis> RickHull: no unfortunately not
loveablelobster has joined #ruby-lang
loveablelobster has quit [Client Quit]
kerunaru has joined #ruby-lang
loveablelobster has joined #ruby-lang
Miphix has quit [Ping timeout: 252 seconds]
<RickHull> i'm imagining a pull request... :)
benlovell has joined #ruby-lang
ec2-user_ has joined #ruby-lang
benlovell has quit [Ping timeout: 244 seconds]
io_syl has quit []
dhjondoh has joined #ruby-lang
gwendall has joined #ruby-lang
pikos has joined #ruby-lang
<ljarvis> RickHull: to pry?
<ljarvis> they won't accept one because slop depends on Ruby 2
<RickHull> yeah, oh
<RickHull> i guess the plugins are the bigger issue
<ljarvis> even if slop supported 1.9, pry would need quite a lot of work to support the new syntax
skade has joined #ruby-lang
<RickHull> with 1.9 EOL anyway, is there any point to supporting it?
<RickHull> i'd suggest like a forked gem for 1.9 support if necessary
zenspider has quit [Quit: bye]
zenspider has joined #ruby-lang
<RickHull> e.g. pry-legacy or whatever
pikos has quit [Ping timeout: 258 seconds]
<ljarvis> I can't see pry removing it any time soon. Too many people would complain. There's talks about moving some bits and pieces into a separate pry-cli
Mau has joined #ruby-lang
<ljarvis> or pry-lib or something
<ljarvis> shrug
<RickHull> i guess there's lots of rails apps in the wild on 1.9 or something? i lagged behind on 1.8.7 for a long time, but that was because 1.9 broke a lot of 1.8 code
<RickHull> 2.0 doesn't really break much for 1.9 code, right?
<zenspider> RickHull: no, and it's actually better w/ 1.8 as well (encodings are more realistic)
<ljarvis> ^
<ljarvis> I don't actually know what slop uses that isn't on 1.9, I just wrote and tested it specifically for 2
<ljarvis> maybe named params
<RickHull> i'm a fan of __dir__ :)
<RickHull> i dropped support for 1.9 in a gem just for that xD
<ljarvis> isn't that just File.dirname(__FILE__)
<RickHull> yep
<ljarvis> :/
<ljarvis> also why is it lowercase
nedp has joined #ruby-lang
<RickHull> dunno, but File.dirname(__FILE__) always bugged me as hackish
<RickHull> admittedly a silly concern
|jemc| has quit [Ping timeout: 258 seconds]
<zenspider> where's my __dir__dir__ ?
<apeiros> I want __abs_dir__
<RickHull> zenspider: i didn't totally follow your comment. you're saying no, 2.0 doesn't break much 1.9 code? and that it's easier to go from 1.8 to 2.0 than 1.8 to 1.9?
<ljarvis> lol
<apeiros> hm… odd… where and when did I get a relative path out of __dir__?
<RickHull> irb(main):001:0> __dir__ #=> "."
<apeiros> well, in irb it's not really a wonder
<ljarvis> >> __dir__
<eval-in> ljarvis => "/tmp/execpad-a3c1cb2893e3" (https://eval.in/368559)
<zenspider> RickHull: syntactiallly there's very little difference between 1.9 and 2.0, esp backwards compatibility wise. (not true for 1.9 -> 1.8)
<ljarvis> oh it is abs?
<zenspider> RickHull: and yes, I found it easier to do 1.8 -> 2.0
<RickHull> gotcha, just making sure :)
<zenspider> I still had to do encoding changes, but they were REASONABLE
<zenspider> I'm biased tho... I view 1.9 as our angsty teenage years and they should be forgotten that they ever happened
elia has joined #ruby-lang
<ljarvis> tbh parts of 1.8 were glorious
<apeiros> all upgrades from 1.9 were piece of cake
<RickHull> now that 1.9 is EOL, i just have trouble caring about people using it
<apeiros> only 1.8 to 1.9 caused troubles. and even those were mostly trivial.
arBmind has quit [Quit: Leaving.]
<apeiros> hardest issues were unrelated to 1.8->1.9 change. mostly things like "old gem not 1.9 compatible, new gem which is compatible changes API"
ryba has quit [Ping timeout: 264 seconds]
<RickHull> I had trouble with the 1.9 transition for a large codebase
leat1 has joined #ruby-lang
<RickHull> mostly it was hard to justify the time and effort for the situation at the time. i got started and never finished and then left the company
<RickHull> we were on svn too, so branching was a pain
<apeiros> ouch
<ljarvis> ah svn
<zenspider> apeiros: wow. we experienced very different transitions. :)
<RickHull> large codebase for me was like 50kLOC IIRC, 3:1 scripts:libs
<apeiros> rails 2 to rails 3 cause us much much more trouble.
<RickHull> and I was dedicated to the idea of a complete transition without bugs
<RickHull> whereas i probably should have bit the bullet and did 80% transition
<RickHull> and then squash the 20%
<apeiros> i.e. ruby 1.8 to 1.9 for a large codebase was ~2-3 days. rails 2-3 was ~2 weeks.
<RickHull> the biggest headache for me was the String#[] change
<apeiros> large codebase is >100kLOC today. not sure how much it was back then.
<apeiros> hard to count since we've split the code into dozens of gems & engines
benlovell has joined #ruby-lang
<RickHull> anyone use aws-sdk v2?
<RickHull> nvm, found what I was looking for
<RickHull> all they have is API reference docs
arBmind has joined #ruby-lang
flak has joined #ruby-lang
charliesome has quit [Quit: zzz]
flak is now known as Guest44683
Mau has quit [Quit: Textual IRC Client: www.textualapp.com]
datanoise has joined #ruby-lang
ArchRogem has joined #ruby-lang
rippa has quit [Ping timeout: 255 seconds]
ledestin has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
k3asd` has joined #ruby-lang
ta has joined #ruby-lang
kr3ssh has joined #ruby-lang
ryba has joined #ruby-lang
ta has quit [Remote host closed the connection]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has joined #ruby-lang
centrx has joined #ruby-lang
dhjondoh has quit [Quit: dhjondoh]
bruno- has quit [Ping timeout: 252 seconds]
marr has joined #ruby-lang
lele has joined #ruby-lang
pikos has joined #ruby-lang
ledestin has joined #ruby-lang
datanoise has quit [Ping timeout: 264 seconds]
LBo has quit [Ping timeout: 258 seconds]
LBo has joined #ruby-lang
benlovell has quit [Ping timeout: 258 seconds]
benlovell has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]
kr3ssh has quit [Ping timeout: 256 seconds]
RickHull has left #ruby-lang [#ruby-lang]
bruno- has joined #ruby-lang
sandelius has joined #ruby-lang
bruno- has quit [Ping timeout: 265 seconds]
leat1 has quit [Ping timeout: 250 seconds]
axwel has joined #ruby-lang
kr3ssh has joined #ruby-lang
tautvydas has quit [Remote host closed the connection]
kr3ssh has quit [Ping timeout: 256 seconds]
pwnz0r has joined #ruby-lang
leat1 has joined #ruby-lang
joaomdmoura has joined #ruby-lang
dhjondoh has joined #ruby-lang
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby-lang
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby-lang
haraoka has quit [Ping timeout: 265 seconds]
joaomdmoura has quit [Remote host closed the connection]
rbowlby has joined #ruby-lang
benlovell has quit [Ping timeout: 246 seconds]
rbowlby has quit [Client Quit]
revath1 has quit [Quit: Leaving.]
revath has joined #ruby-lang
kr3ssh has joined #ruby-lang
intinig has joined #ruby-lang
benlovell has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
hagabaka has quit [Read error: Connection reset by peer]
tak1n has quit [Ping timeout: 250 seconds]
sandelius has joined #ruby-lang
hagabaka has joined #ruby-lang
tak1n has joined #ruby-lang
chinmay_dd has quit []
kr3ssh has quit [Ping timeout: 265 seconds]
skade has quit [Quit: Computer has gone to sleep.]
bruno- has joined #ruby-lang
Pathfinder has joined #ruby-lang
joaomdmoura has joined #ruby-lang
bruno- has quit [Ping timeout: 264 seconds]
kr3ssh has joined #ruby-lang
joaomdmoura has quit [Ping timeout: 250 seconds]
pwnz0r has quit [Remote host closed the connection]
pwnz0r has joined #ruby-lang
leat1 has quit [Ping timeout: 264 seconds]
kr3ssh has quit [Ping timeout: 272 seconds]
k3asd` has quit [Remote host closed the connection]
pwnz0r has quit [Ping timeout: 265 seconds]
kr3ssh has joined #ruby-lang
leat1 has joined #ruby-lang
bruno- has joined #ruby-lang
stamina has joined #ruby-lang
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest44683 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
leat1 has quit [Ping timeout: 244 seconds]
Forgetful_Lion has quit [Remote host closed the connection]
Pathfinder has quit [Ping timeout: 264 seconds]
dhjondoh has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 244 seconds]
kr3ssh has quit [Ping timeout: 256 seconds]
centrx has quit [Quit: Shutting down, Please wait...]
sankaber has joined #ruby-lang
datanoise has joined #ruby-lang
fujimura has joined #ruby-lang
Pathfinder has joined #ruby-lang
fujimura has quit [Ping timeout: 245 seconds]
postmodern has quit [Quit: Leaving]
Fooster has joined #ruby-lang
datanoise has quit [Ping timeout: 265 seconds]
kr3ssh has joined #ruby-lang
dhjondoh has joined #ruby-lang
dhjondoh has quit [Client Quit]
benlovell has quit [Ping timeout: 272 seconds]
ldnunes has joined #ruby-lang
kr3ssh has quit [Ping timeout: 264 seconds]
loveablelobster has left #ruby-lang ["Textual IRC Client: www.textualapp.com"]
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kr3ssh has joined #ruby-lang
skade has joined #ruby-lang
<darix> i still think binding.pry is one of the best ways to learn about a new library
mistym has quit [Ping timeout: 256 seconds]
mistym- has joined #ruby-lang
benlovell has joined #ruby-lang
b_hoffman has joined #ruby-lang
AugustoCesar has quit [Quit: Leaving.]
Nimf has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 272 seconds]
kr3ssh has quit [Ping timeout: 256 seconds]
ta has joined #ruby-lang
kerunaru has joined #ruby-lang
pikos has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
akrgn has joined #ruby-lang
banister has quit [Read error: Connection reset by peer]
indrajeet has joined #ruby-lang
indrajeet has left #ruby-lang [#ruby-lang]
alestuber has joined #ruby-lang
banister has joined #ruby-lang
atomical has joined #ruby-lang
akrgn has quit []
indrajeet has joined #ruby-lang
<indrajeet> hii
<_ht> hiii?
<indrajeet> Why use kernel ?
joaomdmoura has joined #ruby-lang
kr3ssh has joined #ruby-lang
<_ht> As in, why has Ruby a kernel module, or why should I use the kernel module in my code?
sarkyniin has joined #ruby-lang
<indrajeet> SystemConstant.where(autoload: true).each do |constant| Kernel.const_set(constant.name, constant.value) end
<indrajeet> Is this correct?
<ljarvis> that is an awful idea
dorei has joined #ruby-lang
[k- has joined #ruby-lang
Pathfinder has quit [Ping timeout: 244 seconds]
<_ht> Isn't const_set part of Module?
<_ht> But what are you trying to accomplish?
<indrajeet> i dont know what exactly kernel do?
<ljarvis> it's a module that contains methods
<indrajeet> okey
<ljarvis> the module is mixed in to Object
datanoise has joined #ruby-lang
<indrajeet> i want to use constants in initializer to autoload constants
<ljarvis> why?
<indrajeet> i m getting constants from Model systemcostants
<ljarvis> why?
<indrajeet> i need to load when it initalize
<ljarvis> why?
<indrajeet> can i use eval for this ?
Caius has quit [Ping timeout: 276 seconds]
<indrajeet> eval(costant.name ="+' constant.value'+")
<[k-> you shouldn't use eval!
<indrajeet> so kernel is fine naa
<indrajeet> actually i dont have depth knowledge about ruby
datanoise has quit [Ping timeout: 252 seconds]
<indrajeet> some suggest to join this
<indrajeet> thanks jarvis
Caius has joined #ruby-lang
<_ht> Indrajeet: why do you want to add the constants to the Kernel? You could add them to your own classes with ClassName.const_set(...,...)
<ljarvis> or just don't dynamically set constants from the database
<ljarvis> it's a terrible idea
<[k-> could use the ENV to store environment variables
ruby-lang165 has joined #ruby-lang
ascarter has joined #ruby-lang
imperator has joined #ruby-lang
ruby-lang165 has quit [Client Quit]
houhoulis has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
<ljarvis> they're not environmental variables if they're loaded like that
ascarter has joined #ruby-lang
<[k-> he is trying to make them global so...
<ljarvis> yeah I see that, but there are better ideas than adding them to ENV. Like using a global constant Hash or just having lookups on SystemConstant
<indrajeet> actully i want to use constants globally
<ljarvis> I would just have a Config class which fetches values
<indrajeet> in my app
<ljarvis> Indrajeet: why do you need constants?
<indrajeet> as per the requirement
<ljarvis> lol
<indrajeet> hahahh
<ljarvis> so you don't know why?
<_ht> And how constant should they be? (in principle with const_set you can change any constant ...
<ljarvis> what's wrong with just something like https://gist.github.com/leejarvis/51016bf0f922a784a0ea
<indrajeet> i'll check
<indrajeet> i have model in that model SystemConstant, i have added constant name value and autoload field
<ljarvis> why?
riotjones has quit [Quit: Leaving...]
<ljarvis> you could even eager load it if you need to (you dont need to) https://gist.github.com/leejarvis/51016bf0f922a784a0ea
airdisa has joined #ruby-lang
<indrajeet> and created rake task to add costant name in table
<ljarvis> well I tried
joaomdmoura has quit [Remote host closed the connection]
<indrajeet> I need load load these constants when server start
<ljarvis> no you don't
<indrajeet> i dont want to call query to get constats every time
<ljarvis> my second example loads them into memory to avoid lookup queries
<indrajeet> thats why i used above code
<indrajeet> Once it inialize then i use constant to my whole app
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
k3asd` has joined #ruby-lang
jbwiv has quit [Ping timeout: 265 seconds]
stef204 has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
<indrajeet> if autoload field true then it initalize contants
pikos has joined #ruby-lang
stef204 has quit [Client Quit]
joaomdmoura has joined #ruby-lang
whippythellama has quit [Quit: whippythellama]
GPrime has joined #ruby-lang
kerunaru has quit [Quit: Textual IRC Client: www.textualapp.com]
<ljarvis> Indrajeet: I can't think of a worse way to do what you're doing
<ljarvis> it's a bad idea from every direction
tkuchiki has joined #ruby-lang
<indrajeet> plz help me out i m little bit confused
sgambino has joined #ruby-lang
<ljarvis> I'm trying and I gave you some examples
<indrajeet> okey thanks
LBo has quit [Read error: Connection reset by peer]
io_syl has joined #ruby-lang
charliesome has joined #ruby-lang
LBo has joined #ruby-lang
centrx has joined #ruby-lang
iamninja has quit [Read error: Connection reset by peer]
pikos has quit [Remote host closed the connection]
iamninja has joined #ruby-lang
jbwiv has joined #ruby-lang
dhjondoh has joined #ruby-lang
k3asd`_ has joined #ruby-lang
dhjondoh has quit [Client Quit]
kfpratt has joined #ruby-lang
leat1 has joined #ruby-lang
k3asd` has quit [Ping timeout: 255 seconds]
pikos has joined #ruby-lang
malconis has joined #ruby-lang
malconis has quit [Remote host closed the connection]
malconis has joined #ruby-lang
gambl0re has quit [Ping timeout: 252 seconds]
chinmay_dd has joined #ruby-lang
scheda has joined #ruby-lang
kinjimao has joined #ruby-lang
alestuber has quit [Ping timeout: 252 seconds]
<kinjimao> hey everybody :) Any idea on how to implement the `& 0xFF` syntax in Ruby 2?
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwaldrip has joined #ruby-lang
alestuber has joined #ruby-lang
<centrx> kinjimao, You mean "\xFF" ?
centrx has quit [Quit: Shutting down, Please wait...]
imperator has quit [Quit: This computer has gone to sleep]
melter has joined #ruby-lang
imperator has joined #ruby-lang
<kinjimao> maybe, I need to implement this syntax from php: `a = ""; b = 1234; a .= chr(b & 0xFF);`
<kinjimao> I tried with a proc, which seems to work
ldnunes has quit [Quit: Leaving]
<kinjimao> i get a symilar value
<kinjimao> #<Proc:0x00000000934d60@(irb):18>
dzejrou has joined #ruby-lang
datanoise has joined #ruby-lang
<kinjimao> which might be what I'm looking for, what do you think?
alestuber has quit [Ping timeout: 240 seconds]
joaomdmoura has quit [Remote host closed the connection]
<kinjimao> how do i extrapolate the value without regexp? :D
<jhass> >> (1234 & 0xFF).chr
<eval-in> jhass => "\xD2" (https://eval.in/368683)
<jhass> ?
<kinjimao> jhass would you be so gentle to explain me the first and the last part of your syntax?
ascarter has joined #ruby-lang
<kinjimao> what ar >>> and .chr?
<jhass> >> is just sending to the eval both here
<eval-in> jhass => undefined local variable or method `here' for main:Object (NameError) ... (https://eval.in/368684)
hinbody has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
<jhass> chr is Integer#chr, check the docs
<kinjimao> I tried this in ruby
<kinjimao> `a = 'pippo'; b = Proc.new { a & 0xFF }`
<jhass> doubt there's a String#&
<kinjimao> and I get the value up there
<kinjimao> #<Proc:0x00000000fde6c0@(irb):35>
<jhass> yes, and..?
<jhass> you make a Proc, so you get a Proc instance
<kinjimao> so apparntly I get a memory address
<jhass> what's surprising about that?
<jhass> no, that's just the inspect
<jhass> >> proc { }.inspect
<eval-in> jhass => "#<Proc:0x415885e0@/tmp/execpad-74f8319fbd36/source-74f8319fbd36:2>" (https://eval.in/368685)
<kinjimao> I see
alestuber has joined #ruby-lang
<kinjimao> so how do I get the last 8 bits?
<kinjimao> in this case, how do I get the last 8 bits of a?
ttilley has quit [Quit: Leaving...]
<kinjimao> lol I see also that using >> at the beginning of the sentence exec ruby code
<kinjimao> >> puts 'hey!'
<eval-in> kinjimao => hey! ... (https://eval.in/368690)
<kinjimao> lol
<kinjimao> great room
<jhass> with Integer#&
<kinjimao> now I see what you meant before
<apeiros> >> a = ""; b = 1234; a += (b & 0xFF).chr; a
<eval-in> apeiros => "\xD2" (https://eval.in/368693)
<apeiros> literal translation of your example
jgpawletko has joined #ruby-lang
<apeiros> not necessarily idiomatic
<kinjimao> ok ok I got it
<kinjimao> thanks so much guys
alestuber has quit [Ping timeout: 252 seconds]
<jhass> oh, it's on Fixnum
<apeiros> jhass: I wish there was String#^
<jhass> apeiros: it'd work on the bytes or?
<apeiros> jhass: yes. it's slow. my custom implementation uses unpack("N") + last bytes
<apeiros> N*
<apeiros> a native implementation could read the cpu native length of bytes
alestuber has joined #ruby-lang
<apeiros> i.e. usually 8 bytes
<apeiros> and you could probably even vectorize it
<kinjimao> I see that I can also do
<jhass> you must do that a lot :P
<kinjimao> >> (1234 >> 8 & 0xFF)
<eval-in> kinjimao => 4 (https://eval.in/368696)
<kinjimao> >> (1234 >> 16 & 0xFF)
<eval-in> kinjimao => 0 (https://eval.in/368697)
<kinjimao> and so on
<kinjimao> actually is for a friend who is making a san andreas server
<kinjimao> never used it before :D
stamina has quit [Quit: WeeChat 1.2]
<jhass> kinjimao: sounds like Array#pack and String#unpack might of interest
<kinjimao> forgot to put .chr at the end but well, that's the logic
<kinjimao> will give a look, thanks
<mustmodify> OK! More fun with YAML. Maybe someone can explain this foolish to me. https://gist.github.com/mustmodify/9686d10f48a1578ac95e -- strange[0..120] results in the "literal" format I want. But strange[0..100].to_yaml results in the "inline" format... no white space... why? WHY WHY WHY?
cornerma1 has joined #ruby-lang
cornerman has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
<maloik> not quite sure but it might have something to do with the part of the string ending in a space or not
k3asd`_ has quit [Ping timeout: 256 seconds]
michael_mbp has quit [Excess Flood]
<jhass> I found ya2yaml to yield more consistent and "prettier" results, though it's really really slow
datanoise has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
michael_mbp has joined #ruby-lang
benlovell has quit [Ping timeout: 258 seconds]
benlovell has joined #ruby-lang
whippythellama has joined #ruby-lang
symm- has joined #ruby-lang
revath has quit [Ping timeout: 264 seconds]
benlovell has quit [Ping timeout: 245 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gambl0re has joined #ruby-lang
fluchtreflex has quit [Quit: ZNC - http://znc.in]
[k- has quit [Quit: Lingo: www.lingoirc.com]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby-lang
skade has quit [Ping timeout: 265 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kinjimao has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
joaomdmoura has joined #ruby-lang
joaomdmoura has quit [Remote host closed the connection]
k3asd` has joined #ruby-lang
intinig has quit [Remote host closed the connection]
GPrime has joined #ruby-lang
indrajeet has quit [Quit: Page closed]
banister has joined #ruby-lang
JakFrist has quit [Quit: Textual IRC Client: www.textualapp.com]
JakFrist has joined #ruby-lang
jbwiv has left #ruby-lang [#ruby-lang]
chouhoulis has joined #ruby-lang
joaomdmoura has joined #ruby-lang
marr123 has joined #ruby-lang
marr has quit [Ping timeout: 258 seconds]
alestuber has quit [Remote host closed the connection]
segy has quit [Quit: ZNC - http://znc.in]
dzejrou has quit [Remote host closed the connection]
segy has joined #ruby-lang
airdisa has quit []
<mustmodify> jhass: I'll check it out.
ldnunes has joined #ruby-lang
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
houhoulis has quit [Remote host closed the connection]
alestuber has joined #ruby-lang
GPrime has quit [Quit: Textual IRC Client: www.textualapp.com]
charliesome has quit [Quit: zzz]
jas02 has quit [Quit: jas02]
arBmind has joined #ruby-lang
lnr has quit [Ping timeout: 272 seconds]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
arBmind has quit [Client Quit]
charliesome has joined #ruby-lang
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
charliesome has quit [Client Quit]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
JakFrist has joined #ruby-lang
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
lnr has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
nedp has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
chinmay_dd has quit [Remote host closed the connection]
chinmay_dd has joined #ruby-lang
ascarter has joined #ruby-lang
lnr has quit [Ping timeout: 255 seconds]
ascarter has quit [Max SendQ exceeded]
lnr has joined #ruby-lang
tkuchiki has quit [Ping timeout: 256 seconds]
lnr was kicked from #ruby-lang by imperator [lnr]
ascarter has joined #ruby-lang
j4cknewt has joined #ruby-lang
leat1 has quit [Ping timeout: 256 seconds]
chinmay_dd has quit [Remote host closed the connection]
Fooster has quit [Ping timeout: 265 seconds]
j4cknewt_ has joined #ruby-lang
banister has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
j4cknewt has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby-lang
alestuber has quit [Read error: Connection reset by peer]
arBmind has joined #ruby-lang
alestuber has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
marr123 is now known as marr
ttilley has joined #ruby-lang
arBmind has quit [Read error: Connection timed out]
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
arBmind has joined #ruby-lang
arBmind has quit [Client Quit]
g0bl1n has joined #ruby-lang
g0bl1n has joined #ruby-lang
aphova_ has quit [Quit: Connection closed for inactivity]
melter has quit [Quit: Client exiting]
BanzaiJoe has joined #ruby-lang
melter has joined #ruby-lang
symm- has joined #ruby-lang
rcvalle has joined #ruby-lang
j4cknewt_ has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby-lang
VinnyBoy has joined #ruby-lang
ArchRogem has quit [Read error: Connection reset by peer]
|jemc| has joined #ruby-lang
kfpratt has joined #ruby-lang
skade has joined #ruby-lang
slawrence00 has joined #ruby-lang
alestuber has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
mustmodify has left #ruby-lang [#ruby-lang]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atomical has joined #ruby-lang
imperator2 has joined #ruby-lang
tekacs has quit [Quit: Disappearing... *poof*]
tekacs has joined #ruby-lang
j4cknewt_ has joined #ruby-lang
djbkd has quit [Ping timeout: 265 seconds]
j4cknewt has quit [Read error: Connection reset by peer]
arBmind has joined #ruby-lang
seank_ has quit [Remote host closed the connection]
revath has joined #ruby-lang
seank_ has joined #ruby-lang
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Fooster has joined #ruby-lang
pikos has quit [Remote host closed the connection]
arBmind has quit [Quit: Leaving.]
ascarter has joined #ruby-lang
lele is now known as Guest24
<ljarvis> heh
atomical has joined #ruby-lang
caseypatrickdris has joined #ruby-lang
djbkd has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
elia has quit [Quit: Computer has gone to sleep.]
atomical has quit [Ping timeout: 248 seconds]
chinmay_dd has joined #ruby-lang
rippa has joined #ruby-lang
pikos has joined #ruby-lang
j4cknewt has joined #ruby-lang
caseypatrickdris has quit [Read error: Connection reset by peer]
caseypatrickdris has joined #ruby-lang
caseypat_ has joined #ruby-lang
j4cknewt_ has quit [Ping timeout: 265 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arBmind has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
stan has quit [Ping timeout: 265 seconds]
caseypatrickdris has quit [Ping timeout: 265 seconds]
kfpratt has joined #ruby-lang
solars has quit [Ping timeout: 276 seconds]
caseypat_ has quit [Read error: Connection reset by peer]
ebouchut has quit [Quit: Connection closed for inactivity]
caseypatrickdris has joined #ruby-lang
<sarkyniin> Hey, this is my code
<sarkyniin> however, heroku gives me this error:
<sarkyniin> app/vendor/bundle/ruby/2.2.0/gems/require_all-1.3.2/lib/require_all.rb:109:in `require': /app/plugins/pick-plugin.rb:28: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
<sarkyniin> can't I use do .. end with times?
k3asd`_ has joined #ruby-lang
<jhass> sarkyniin: what's the end on line 26 for?
<imperator2> sarkyniin, looks like you have a stray "end" at line 26
<imperator2> ^^
<sarkyniin> oh
<sarkyniin> I guess I do. derp
<sarkyniin> sorry
<jhass> yw
<imperator2> for one-liners i tend to use {} instead of do-end
<imperator2> helps avoid such issues :)
hiFriends has joined #ruby-lang
<jhass> at least you properly indent, so it's just a matter of wiring end on the same level as an error into your brain ;)
kr3ssh has quit [Ping timeout: 252 seconds]
<hiFriends> any random capistrano gurus in here that know how to force the failure of a cap task. Ive tried exit 1 and sh(false) but its not working. thanks.
<jhass> I mostly weirich's rule regarding do/end vs { / }
<sarkyniin> yeah
<jhass> hiFriends: no idea, but how about raise?
<sarkyniin> actually the do / end was because I expected it to be longer than 1 line
<sarkyniin> and then I forgot to prettify it
k3asd` has quit [Ping timeout: 272 seconds]
<jhass> sarkyniin: I'm the type that'd keep do / end there, see https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc for the rationale ;)
chinmay_dd has quit []
<hiFriends> jhass: let me try that thanks. Im not actually good a ruby either :|
michaeldeol has joined #ruby-lang
michaeldeol has quit [Remote host closed the connection]
leat1 has joined #ruby-lang
shinnya has joined #ruby-lang
caseypatrickdris has quit [Read error: Connection reset by peer]
caseypatrickdris has joined #ruby-lang
<hiFriends> jhass: thanks! does exactly what I wanted
<hiFriends> appreciate the help :D
heftig has quit [Remote host closed the connection]
hiFriends has quit [Quit: Page closed]
errinlarsen has joined #ruby-lang
<sarkyniin> is there a way to remove an object once in an array not knowing its index?
heftig has joined #ruby-lang
<sarkyniin> for example, if I have a [foo, bar, foo] array
iliketurtles has joined #ruby-lang
<sarkyniin> I'd like to be able to only remove one foo
<sarkyniin> doing [foo, bar, foo] - [foo] removes both mentions of foo
michaeldeol has joined #ruby-lang
<errinlarsen> Check out Array#delete and Array#delete_if: http://ruby-doc.org/core-2.2.0/Array.html#method-i-delete
ascarter has joined #ruby-lang
ascarter has quit [Client Quit]
<errinlarsen> oh … sorry … to delete one you’d need to specify which one. You could search for the first one (e.g. `ary.delete_at(ary.index(foo))`) and delete it by index
b_hoffman has quit [Quit: b_hoffman]
wallerdev has joined #ruby-lang
<sarkyniin> errinlarsen: thanks
caseypatrickdris has quit [Read error: Connection reset by peer]
<sarkyniin> irb(main):010:0> array = ['hello', 'hello', 'how', 'are', 'you']
<sarkyniin> => ["hello", "hello", "how", "are", "you"]
<sarkyniin> irb(main):011:0> array.index('hello')
<sarkyniin> => 0
<sarkyniin> errinlarsen: not working as intended
caseypatrickdris has joined #ruby-lang
RobertBirnie has joined #ruby-lang
<errinlarsen> sarkyniin: with that “hello” example, which element were you hoping to delete?
<sarkyniin> errinlarsen: first 'hello'
<sarkyniin> or any element really
<sarkyniin> since I'm using array.sample
<sarkyniin> basically I'm iterating over an array x number of times
<sarkyniin> so I can pick x elements from that array
<errinlarsen> so, `index_to_delete = array.index(‘hello’)` and then `array.delete(index_to_delete)` … not working for you?
<sarkyniin> wait you can use sample(x)
<sarkyniin> yeah my problem is solved I guess
iliketurtles has quit [Quit: Textual IRC Client: www.textualapp.com]
k3asd`_ has quit [Ping timeout: 252 seconds]
<errinlarsen> zenspider: I was hoping to ask a question re: WinRb/Viewpoint ...
pikos has quit [Remote host closed the connection]
sarkyniin has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
j0n3 has joined #ruby-lang
benlovell has quit [Ping timeout: 276 seconds]
tibig has joined #ruby-lang
alestuber has joined #ruby-lang
melter has quit [Ping timeout: 256 seconds]
io_syl has quit []
mistym- is now known as mistym
mistym has quit [Changing host]
mistym has joined #ruby-lang
melter has joined #ruby-lang
errinlarsen has left #ruby-lang [#ruby-lang]
errinlarsen has joined #ruby-lang
errinlarsen has left #ruby-lang [#ruby-lang]
errinlarsen has joined #ruby-lang
errinlarsen has quit [Quit: errinlarsen]
Guest24 is now known as lele
errinlarsen has joined #ruby-lang
b_hoffman has joined #ruby-lang
pikos has joined #ruby-lang
errinlarsen is now known as irkenInvader
irkenInvader has quit [Quit: irkenInvader]
errinlarsen has joined #ruby-lang
axwel has quit [Quit: Lost terminal]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
errinlarsen is now known as irkenInvader
irkenInvader is now known as errinlarsen
skade has quit [Quit: Computer has gone to sleep.]
alphemy has joined #ruby-lang
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby-lang
hahuang65 has joined #ruby-lang
io_syl has joined #ruby-lang
caseypatrickdris has quit [Read error: Connection reset by peer]
caseypatrickdris has joined #ruby-lang
benlovell has joined #ruby-lang
pikos has quit [Remote host closed the connection]
pikos has joined #ruby-lang
michaeldeol has joined #ruby-lang
shinnya has quit [Ping timeout: 246 seconds]
pikos has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 256 seconds]
stan has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby-lang
kr3ssh has joined #ruby-lang
howdoicomputer_ has joined #ruby-lang
skade has quit [Client Quit]
postmodern has joined #ruby-lang
bin7me has joined #ruby-lang
caseypatrickdris has quit [Read error: Connection reset by peer]
skade has joined #ruby-lang
caseypatrickdris has joined #ruby-lang
GBrawl has joined #ruby-lang
Miphix has joined #ruby-lang
DLSteve has joined #ruby-lang
benlovell has joined #ruby-lang
<jhass> drbrain: mind a pm?
skade has quit [Client Quit]
<drbrain> jhass: nope
baweaver has joined #ruby-lang
benlovell has quit [Ping timeout: 255 seconds]
io_syl has quit []
ryba has quit [Ping timeout: 245 seconds]
skade has joined #ruby-lang
<scheda> What's the preferred way to handle ARGV in Ruby? I'm looking at the OptionParser gem right now, but it looks like I don't have the ability to easily create a hash of the commands without some tests on what the individual args are.
<scheda> Basically, I'm wanting to make sure that I can appropriately handle the arguments regardless of the order they're used in.
<imperator2> oi, lots of opinions, and depends on what you want to do
<scheda> I'm putting together a little script that'll create an alias entry for me
<scheda> so, usage would be something like
baweaver has quit [Remote host closed the connection]
<imperator2> i wrote my own lib - getopt - that may do what you want
<scheda> script.rb -c "touch file.rb" -n "create_file"
<scheda> this?
<imperator2> yep
<scheda> excellent, thank you
<scheda> I'll check this out
<imperator2> several others out there on rubygems if that doen't suit you
caseypatrickdris has quit [Remote host closed the connection]
<scheda> Actually this looks pretty good. It looks like I can very easily grab the arguments I want
<jhass> isn't that in stdlib?
caseypatrickdris has joined #ruby-lang
caseypatrickdris has quit [Remote host closed the connection]
<jhass> ah, the stdlib one is named getoptlong :D
<imperator2> that thing sucks
errinlarsen has quit [Quit: errinlarsen]
<scheda> haha
alestuber has quit [Ping timeout: 250 seconds]
<imperator2> that's why i wrote getopt in the first place
errinlarsen has joined #ruby-lang
<scheda> Looks easy enough. So in Getopt::Std.getopts() Before the : is arguments and after is booleans?
gwendall has quit [Remote host closed the connection]
howdoicomputer_ has quit [Quit: howdoicomputer_]
<imperator2> yep
<scheda> easy peasy. thanks!
baweaver has joined #ruby-lang
benlovell has joined #ruby-lang
kr3ssh has quit [Ping timeout: 240 seconds]
j0n3 has quit [Read error: Connection reset by peer]
datanoise has quit [Ping timeout: 264 seconds]
j0n3 has joined #ruby-lang
hagabaka has quit [Ping timeout: 264 seconds]
tak1n has quit [Ping timeout: 244 seconds]
tak1n has joined #ruby-lang
<scheda> oh sweet
<scheda> thanks
kadoppe has quit [Ping timeout: 264 seconds]
benlovell has quit [Ping timeout: 264 seconds]
<apeiros> drbrain: re https://github.com/ruby/www.ruby-lang.org/pull/1039 - mind a pm?
kadoppe has joined #ruby-lang
benlovell has joined #ruby-lang
alestuber has joined #ruby-lang
atomical has joined #ruby-lang
kr3ssh has joined #ruby-lang
benlovell has quit [Ping timeout: 258 seconds]
tenderlove has joined #ruby-lang
j4cknewt_ has joined #ruby-lang
lele is now known as Guest24
b_hoffman has quit [Quit: b_hoffman]
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #ruby-lang
j4cknewt has quit [Ping timeout: 265 seconds]
gwendall has joined #ruby-lang
michaeldeol has joined #ruby-lang
pwnz0r has joined #ruby-lang
shinnya has joined #ruby-lang
GBrawl has quit [Quit: (null)]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fluchtreflex has joined #ruby-lang
fluchtreflex has joined #ruby-lang
Ilyes512 has joined #ruby-lang
benlovell has joined #ruby-lang
atomical has joined #ruby-lang
<drbrain> apeiros: nope
wallerdev has quit [Quit: wallerdev]
hakunin has joined #ruby-lang
benlovell has quit [Ping timeout: 272 seconds]
gix has quit [Ping timeout: 245 seconds]
baweaver has quit [Remote host closed the connection]
gix has joined #ruby-lang
fusillicode has quit [Quit: Leaving.]
<errinlarsen> What’s the right place to send a newby rubyest? I’m hanging out in rom-rb/rom’s Gitter channel and helped someone troubleshoot a conflict on the dev maching (was running RVM and rbenv), but I feel like I should have sent her somewhere more appropriate to ask for help. This room?
<errinlarsen> (rubiest? ruby-er? what do we call ourselves?!)
fusillicode has joined #ruby-lang
<alphemy> Hi, I am learning ruby language. Can some one help me in writing this for loop http://dpaste.com/25H2T3E (in python) to ruby?
<errinlarsen> (rubyist?)
<alxndr> errinlarsen: i think Learn Ruby the Hard Way is nice (it's not really hard). for questions, this is a pretty good place
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
caseypatrickdris has joined #ruby-lang
<errinlarsen> alphemy: I’m not usually a fan of writing code FOR you, but I’ll help you with YOUR solution! What have you tried?
<alphemy> I don't know how to write this kind of for loop in ruby? is there any zip function in ruby?
baweaver has joined #ruby-lang
<scheda> lol
<errinlarsen> Ruby prefers iterators over for loops. For example, `%w[a b c d].each { |c| puts c }`
sandelius has joined #ruby-lang
<alphemy> errinlarsen: zip create a pair and then 'i' takes values from 0...8 and keyword takes elements of keywords(Hash) that's what the loop which is written in python does. Is there a convient way to write the same logic in ruby?
skade has quit [Ping timeout: 272 seconds]
<baweaver> >> p 'test'
<eval-in> baweaver => "test" ... (https://eval.in/368846)
<baweaver> good good
caseypatrickdris has quit [Ping timeout: 264 seconds]
<baweaver> >> (1..10).zip('a'..'j')
<eval-in> baweaver => [[1, "a"], [2, "b"], [3, "c"], [4, "d"], [5, "e"], [6, "f"], [7, "g"], [8, "h"], [9, "i"], [10, "j"]] (https://eval.in/368847)
<baweaver> >> (1..10).zip('a'..'j').to_h
<eval-in> baweaver => {1=>"a", 2=>"b", 3=>"c", 4=>"d", 5=>"e", 6=>"f", 7=>"g", 8=>"h", 9=>"i", 10=>"j"} (https://eval.in/368848)
havenwood has joined #ruby-lang
<baweaver> alphemy: So what exactly is the code in python to do what you're wanting?
<alphemy> baweaver: here http://dpaste.com/25H2T3E
skade has joined #ruby-lang
fusillicode has quit [Quit: Leaving.]
datanoise has joined #ruby-lang
<baweaver> Yeah, pretty much just that with zip then, tag a to_h onto it
fusillicode has joined #ruby-lang
caseypatrickdris has joined #ruby-lang
atomical has joined #ruby-lang
gamename has joined #ruby-lang
<baweaver> >> keywords = %w(foo bar baz bing bash fizz buzz bat); keywords.zip(8..0).to_h
caseypatrickdris has quit [Read error: Connection reset by peer]
<eval-in> baweaver => {"foo"=>nil, "bar"=>nil, "baz"=>nil, "bing"=>nil, "bash"=>nil, "fizz"=>nil, "buzz"=>nil, "bat"=>nil} (https://eval.in/368850)
<baweaver> >> keywords = %w(foo bar baz bing bash fizz buzz bat); keywords.zip(0..8).to_h
<eval-in> baweaver => {"foo"=>0, "bar"=>1, "baz"=>2, "bing"=>3, "bash"=>4, "fizz"=>5, "buzz"=>6, "bat"=>7} (https://eval.in/368851)
caseypatrickdris has joined #ruby-lang
<baweaver> >> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip(0..8.reverse).to_h
<eval-in> baweaver => undefined method `reverse' for 8:Fixnum (NoMethodError) ... (https://eval.in/368852)
<baweaver> >> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip((0..8).reverse).to_h
<eval-in> baweaver => undefined method `reverse' for 0..8:Range (NoMethodError) ... (https://eval.in/368853)
Fragus has quit [Quit: Connection closed for inactivity]
<baweaver> >> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip((1..8).to_a.reverse).to_h
<eval-in> baweaver => {"foo"=>8, "bar"=>7, "baz"=>6, "bing"=>5, "bash"=>4, "fizz"=>3, "buzz"=>2, "bat"=>1} (https://eval.in/368854)
<baweaver> alphemy: something like that
<baweaver> though that looks like you should be using list comprehensions in python for that anyways.
<alphemy> yes.
<errinlarsen> I would do this: `keywords.each_with_index.with_object({}) { |(keyword, index), hsh| hsh[keyword] = index }`
<errinlarsen> … but I always overlook Array#zip with these kinds of things
<baweaver> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.zip
<baweaver> >> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.zip
<eval-in> baweaver => [[["foo", 0]], [["bar", 1]], [["baz", 2]], [["bing", 3]], [["bash", 4]], [["fizz", 5]], [["buzz", 6]], [["bat", 7]]] (https://eval.in/368860)
<baweaver> >> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.to_h
<eval-in> baweaver => {"foo"=>0, "bar"=>1, "baz"=>2, "bing"=>3, "bash"=>4, "fizz"=>5, "buzz"=>6, "bat"=>7} (https://eval.in/368861)
<errinlarsen> … yup, and you can wrap that in `Hash()`, I think
<errinlarsen> … oh, or call #to_h, hehe
g0bl1n has quit [Ping timeout: 255 seconds]
kr3ssh has quit [Ping timeout: 250 seconds]
<baweaver> Assuming you're using 2.x+
* baweaver dislikes using Hash[] for things
ArchRogem has joined #ruby-lang
<alphemy> here http://dpaste.com/13JP6EG can you helping me in reaching my expected solution as I mentioned at link?
<alphemy> I think other way round works a.zip((0...8))
<errinlarsen> well, this works: `(0...8).zip(a).delete_if { |e| e[1].nil? }`, but I feel like there’s a better way.
<baweaver> a.each_with_index.to_h.reject { |k,v| v.nil? }
<baweaver> what happens when there are 9 or 10 or even 100 elements?
<alphemy> in my case max element is 8
<baweaver> and why is your desired output like that?
<alphemy> I am parsing a file
<baweaver> yeah, but that's kinda an odd data structure to make
<baweaver> it'd help if you showed us an example of the actual file and the desired results
<baweaver> otherwise we're guessing blind
revath has quit [Ping timeout: 245 seconds]
VinnyBoy has quit [Read error: Connection reset by peer]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
errinlarsen has quit [Quit: errinlarsen]
VinnyBoy has joined #ruby-lang
errinlarsen has joined #ruby-lang
[spoiler] has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby-lang
revath has joined #ruby-lang
michaeldeol has quit [Ping timeout: 256 seconds]
djbkd has quit [Remote host closed the connection]
michaeldeol has joined #ruby-lang
atomical has joined #ruby-lang
datanoise has quit [Ping timeout: 264 seconds]
b_hoffman has joined #ruby-lang
baweaver has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
hahuang65 has quit [Quit: WeeChat 1.1.1]
duderonomy has quit [Ping timeout: 256 seconds]
kr3ssh has joined #ruby-lang
errinlarsen has quit [Quit: errinlarsen]
baweaver has joined #ruby-lang
baweaver has quit [Remote host closed the connection]
errinlarsen has joined #ruby-lang
hahuang65 has joined #ruby-lang
revath has quit [Ping timeout: 264 seconds]
<ljarvis> alphemy: ((0...8).first(a.size)).zip(a)
Guest24 is now known as lele
<ljarvis> you want to ensure both sides are equal, so make them equal before you zip them
<ljarvis> so you could just do, `0..a.size` or w/e
leat1 has quit [Ping timeout: 256 seconds]
<ljarvis> >> a = {one: 1, two: 2}; a.size.times.zip(a)
<eval-in> ljarvis => [[0, [:one, 1]], [1, [:two, 2]]] (https://eval.in/368884)
Fooster has quit [Remote host closed the connection]
[spoiler] has joined #ruby-lang
gambl0re has quit [Ping timeout: 240 seconds]
gamename has quit []
gianlucadv has quit [Ping timeout: 264 seconds]
k3asd` has joined #ruby-lang
baweaver has joined #ruby-lang
yalue has quit [Quit: return 0;]
<alphemy> hi, can anyone tell me why I am getting error as 'warning: mismatched indentations at 'end' with 'if' at 52' here http://ideone.com/blLRXW but I am unable to figure out the mistake in identation
<ljarvis> alphemy: you have a mix of tabs and spaces
alphemy has quit [Ping timeout: 246 seconds]
<ljarvis> heh
j4cknewt has joined #ruby-lang
kr3ssh has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby-lang
alphemy has joined #ruby-lang
<alphemy> hi, can anyone tell me why I am getting error as 'warning: mismatched indentations at 'end' with 'if' at 52' here http://ideone.com/blLRXW but I am unable to figure out the mistake in identation
<ljarvis> alphemy: you have a mix of tabs and spaces
<_ht> deja vu
<ljarvis> at least I only had to press up
<alphemy> ljarvis: where?
<ljarvis> alphemy: line 52
<ljarvis> alphemy: here's how I could tell: http://cl.ly/0U0D331x1p2m
j4cknewt_ has quit [Ping timeout: 256 seconds]
<ljarvis> so yeah, use a better editor
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
errinlarsen has quit [Quit: errinlarsen]
_ht has quit [Quit: Konversation terminated!]
scheda has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Apomelasma has joined #ruby-lang
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ttilley has quit [Disconnected by services]
Apomelasma has quit [Client Quit]
<alphemy> ljarvis: I can't see that video it's blocked. I don't know how to fix this problem
ttilley has joined #ruby-lang
<alphemy> I can't see extra spaces
baweaver has quit [Remote host closed the connection]
<ljarvis> alphemy: delete all of the characters on line 52, because there are spaces near the beginning of the line
<ljarvis> then throw your text editor in the trash because it's shit
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
<alphemy> ljarvis: which editor are you using?
<ljarvis> alphemy: I use vim
<alphemy> can you correct it and paste it somewhere here ideone.com
joaomdmoura has quit [Remote host closed the connection]
<ljarvis> alphemy: here's a version of your code with sane indentation https://gist.github.com/leejarvis/3761848b224b48eea4a5
<darix> that reminds me ... time to update the neovim package
joaomdmoura has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
joaomdmoura has quit [Ping timeout: 252 seconds]
<alphemy> one more doubt, here - http://dpaste.com/0RBYAC9
<alphemy> sort function can be used.
gwendall has quit [Remote host closed the connection]
<alphemy> but is there any parameter which tells how to sort
<ljarvis> alphemy: just an idea, but you can really clean up a lot of that logic: https://gist.github.com/leejarvis/b80f0adbede993d6cf1d (missing code but has the idea)
<alphemy> moreover it should be in reverse order
sarkyniin has joined #ruby-lang
<ljarvis> alphemy: use sort_by or check out the Enumerable mixin
gamename has joined #ruby-lang
<darix> alphemy: listofpagethingies.sort {|a,b| a.pageid <=> b.pageid }
<ljarvis> oops i meant Comparable mixin
<ljarvis> which does what darix said
<darix> ljarvis: sort_by better than sort with block?
<ljarvis> not really but shorter
ldnunes has quit [Quit: Leaving]
<alphemy> what about revere order
<ljarvis> or just implement <=> on the obj and include Comparable
<ljarvis> for the wins
<alphemy> I mean in decreasing order
<ljarvis> well you sort it, then .reverse it
<darix> ljarvis: easier
<darix> alphemy: listofpagethingies.sort {|a,b| b.pageid <=> a.pageid }
<darix> notice something?
<ljarvis> :)
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby-lang
zendrix has joined #ruby-lang
alestuber has quit [Ping timeout: 250 seconds]
alestuber has joined #ruby-lang
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby-lang
<zenspider> listofpagethingies.sort_by { |p| -p.pageid }
fluchtreflex has quit [Read error: Connection reset by peer]
j4cknewt has quit [Read error: Connection reset by peer]
pwnz0r has quit [Remote host closed the connection]
j4cknewt has joined #ruby-lang
tenderlove has quit [Ping timeout: 245 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kstuart has quit [Quit: WeeChat 1.1.1]
tenderlove has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ttilley has quit [Quit: Leaving...]
benlovell has joined #ruby-lang
benlovell has quit [Ping timeout: 246 seconds]
DLSteve has quit [Quit: Leaving]
caseypat_ has joined #ruby-lang
imperator2 has quit [Quit: Valete!]
whippythellama has quit [Quit: whippythellama]
wallerdev has quit [Quit: wallerdev]
j4cknewt has quit [Remote host closed the connection]
caseypatrickdris has quit [Ping timeout: 256 seconds]
j4cknewt has joined #ruby-lang
caseypat_ has quit [Read error: Connection reset by peer]
caseypatrickdris has joined #ruby-lang
j4cknewt_ has joined #ruby-lang
datanois1 has joined #ruby-lang
zendrix has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 256 seconds]
j4cknewt has quit [Ping timeout: 265 seconds]
alestuber has quit [Remote host closed the connection]
datanois1 has quit [Ping timeout: 272 seconds]
arBmind1 has joined #ruby-lang
arBmind has quit [Ping timeout: 246 seconds]
zendrix has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
k3asd` has quit [Ping timeout: 244 seconds]
kr3ssh has joined #ruby-lang
baweaver has quit [Remote host closed the connection]
hinbody has quit [Quit: leaving]
gwendall has joined #ruby-lang
bin7me has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby-lang
wallerdev has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
arBmind has joined #ruby-lang
arBmind1 has quit [Ping timeout: 264 seconds]
caseypatrickdris has quit [Remote host closed the connection]
baweaver has joined #ruby-lang
datanois1 has joined #ruby-lang
car has joined #ruby-lang
rcvalle has quit [Quit: rcvalle]
slawrence00 has quit [Quit: Textual IRC Client: www.textualapp.com]
havenwood has quit [Ping timeout: 252 seconds]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwaldrip has quit [Quit: Lingo: www.lingoirc.com]
Forgetful_Lion has joined #ruby-lang
<alphemy> darix: listofpagethingies.sort {|a,b| b.pageid <=> a.pageid } do work but incase of equality I want the initial order to be preserved. How to do that?
<darix> alphemy: no idea
BanzaiJoe has quit [Ping timeout: 264 seconds]
<zenspider> alphemy: well... think about it. <=> returns 0 if equal, -1 if LHS < RHS, and 1 if LHS > RHS.
<alphemy> zenspider: so? how to do it?
<apeiros> alphemy: you return -1 on equality
<apeiros> indicating that LHS < RHS, so it stays on the LHS
<zenspider> alphemy: *sigh*
<zenspider> so much for thinking about it...
<apeiros> zenspider: is sort guaranteed to yield LHS as first argument? I actually never verified that…
<apeiros> (docs don't say)
<zenspider> I'm currently a bit fuzzy brained (nose deep in ruby_parser)... but I thought sort was stable and sort_by not
<apeiros> afaik sort is not guaranteed to be stable. it depends on qsort being stable. which in turn is not guaranteed to be.
<zenspider> some minor googling says you are correct sir
<zenspider> 8thlight has a nice blog entry on it
kr3ssh has quit [Ping timeout: 245 seconds]
poikon has quit [Ping timeout: 276 seconds]
<alphemy> I am new to ruby can you help me in making that sort stable?
avdi has quit [Ping timeout: 272 seconds]
zzak has quit [Ping timeout: 276 seconds]
j4cknewt_ has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby-lang
zzak has joined #ruby-lang
poikon has joined #ruby-lang
<jhass> not very efficient, but map.with_index.sort_by {|page, i| [page.pageid, i] } should work
avdi has joined #ruby-lang
<jhass> (.map(&:last))
<jhass> eh, &:first
havenwood has joined #ruby-lang
rubyaw has joined #ruby-lang
houhoulis has joined #ruby-lang
RobertBirnie has quit [Quit: Textual IRC Client: www.textualapp.com]
chouhoulis has joined #ruby-lang
<baweaver> Oh hey, avdi is on. Been a while since I've seen him on IRC.
shadowvengence22 has joined #ruby-lang
houhoulis has quit [Ping timeout: 265 seconds]
sarkyniin has quit [Remote host closed the connection]
<avdi> You rang?
<baweaver> Ah just saying hi, rare to see you on.
<avdi> I'm always here. Not always paying attention :-)
<baweaver> Ha, fair enough. How are Tapas going?
<avdi> Deliciously
* baweaver needs to catch up on them
<avdi> I need to catch up too. I wonder what I'm talking about lately?
kfpratt has quit [Remote host closed the connection]
<baweaver> Admittedly I found it amusing seeing Avdi, Head Chef at Ruby Tapas in R4 test prescriptions
kfpratt has joined #ruby-lang
kfpratt has quit [Remote host closed the connection]
<avdi> Today I did some research about shunting logging into a low priority thread, think I'll write that episode tomorrow
<baweaver> If nothing else, Enumerable is a safe bet for a lot of content
<avdi> Hahaha yeah, don't tell anyone my secret for when I'm pressed for time
<baweaver> Could always have some fun around TCO as well for compiler flags
<avdi> People dig those eps though. It's one thing to know a methos exists, another to see it applied.
<avdi> Haha, yeah, that one I'm saving for a rainy day
<baweaver> Yeah, getting a good handle on reduce can make for a lot of power
<baweaver> If you want to really have fun you can play at monads with them too
<baweaver> collection.reduce({acc: 0, last: 5}) { |state, i| ...
<baweaver> though that does nightmares to GC after a while
<baweaver> Enumerator is a bit of fun too
<baweaver> >> p2s = Enumerator.new do |y| x=2; loop do y<<x; x = x << 1; end end; p2s.first(5)
<eval-in> baweaver => [2, 4, 8, 16, 32] (https://eval.in/368946)
zendrix has quit [Remote host closed the connection]
zendrix has joined #ruby-lang
ArchRogem has quit [Quit: Textual IRC Client: www.textualapp.com]
zendrix has quit [Ping timeout: 252 seconds]
benlovell has joined #ruby-lang
wallerdev has quit [Ping timeout: 246 seconds]