00:00
nertzy2 has quit [Quit: This computer has gone to sleep]
00:01
ascarter has joined #ruby-lang
00:07
slawrenc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:09
iliketurtles has quit [Remote host closed the connection]
00:10
iamninja has quit [Read error: Connection reset by peer]
00:11
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:11
iamninja has joined #ruby-lang
00:11
kfpratt has joined #ruby-lang
00:13
niemcu has quit [Remote host closed the connection]
00:13
DivineEntity has quit [Ping timeout: 240 seconds]
00:14
DivineEntity has joined #ruby-lang
00:15
fujimura_ has joined #ruby-lang
00:18
ascarter has joined #ruby-lang
00:18
ta has joined #ruby-lang
00:20
fujimura_ has quit [Ping timeout: 252 seconds]
00:21
<
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?
00:24
atomical has joined #ruby-lang
00:24
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:25
<
womble >
Because YAML.
00:28
<
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
00:28
nertzy2 has joined #ruby-lang
00:28
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:28
sepp2k has quit [Quit: Leaving.]
00:30
djbkd has quit [Remote host closed the connection]
00:31
<
mustmodify >
219 is a space. 220 is the third \n...
00:32
djbkd has joined #ruby-lang
00:33
djbkd has quit [Read error: Connection reset by peer]
00:33
djbkd has joined #ruby-lang
00:38
joaomdmoura has quit [Remote host closed the connection]
00:40
marr has quit [Ping timeout: 255 seconds]
00:45
Fooster has quit [Ping timeout: 252 seconds]
00:49
slumos has joined #ruby-lang
00:52
gwendall has joined #ruby-lang
00:54
tenderlove has joined #ruby-lang
00:55
kuroro has joined #ruby-lang
00:55
kuroro2 has joined #ruby-lang
00:55
kuroro2 has left #ruby-lang [#ruby-lang]
00:56
tenderlove has quit [Remote host closed the connection]
00:56
kfpratt has quit [Remote host closed the connection]
00:57
gwendall has quit [Ping timeout: 272 seconds]
00:58
PocketJosh has quit [Remote host closed the connection]
00:59
PocketJosh has joined #ruby-lang
01:02
nertzy2 has quit [Quit: This computer has gone to sleep]
01:02
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
01:07
ta has quit [Read error: Connection reset by peer]
01:07
j0n3 has quit [Read error: Connection reset by peer]
01:09
kuroro2 has joined #ruby-lang
01:10
djbkd has quit [Quit: My people need me...]
01:10
BanzaiJoe has joined #ruby-lang
01:11
kuroro has quit [Ping timeout: 246 seconds]
01:12
hahuang65 has quit [Ping timeout: 240 seconds]
01:14
kuroro2 has quit [Ping timeout: 240 seconds]
01:14
b_hoffman has joined #ruby-lang
01:15
ascarter has joined #ruby-lang
01:15
hal_9000__ has joined #ruby-lang
01:16
wallerdev has quit [Quit: wallerdev]
01:17
hal_9000_ has quit [Ping timeout: 272 seconds]
01:18
seank_ has quit [Remote host closed the connection]
01:19
seank_ has joined #ruby-lang
01:19
charliesome has joined #ruby-lang
01:21
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
01:23
BanzaiJoe has quit [Ping timeout: 244 seconds]
01:23
hal_9000_ has joined #ruby-lang
01:24
hal_9000__ has quit [Ping timeout: 256 seconds]
01:24
gwendall has joined #ruby-lang
01:25
tkuchiki has joined #ruby-lang
01:26
bruno- has quit [Ping timeout: 244 seconds]
01:27
datanois1 has joined #ruby-lang
01:28
hal_9000__ has joined #ruby-lang
01:29
hal_9000_ has quit [Ping timeout: 258 seconds]
01:29
amclain has joined #ruby-lang
01:30
io_syl has joined #ruby-lang
01:31
fujimura has joined #ruby-lang
01:32
ryba has quit [Ping timeout: 265 seconds]
01:36
fujimura has quit [Ping timeout: 256 seconds]
01:45
wallerdev has joined #ruby-lang
01:46
mcclurmc has quit [Remote host closed the connection]
01:48
mcclurmc has joined #ruby-lang
01:49
j4cknewt has quit [Remote host closed the connection]
01:50
benlovell has joined #ruby-lang
01:51
baweaver has quit [Read error: Connection reset by peer]
01:51
mcclurmc has quit [Remote host closed the connection]
01:52
mcclurmc has joined #ruby-lang
01:52
baweaver has joined #ruby-lang
01:52
BanzaiJoe has joined #ruby-lang
01:52
shinnya has quit [Ping timeout: 255 seconds]
01:55
cornerma1 has joined #ruby-lang
01:55
benlovell has quit [Ping timeout: 272 seconds]
01:55
haraoka has joined #ruby-lang
01:56
baweaver has quit [Ping timeout: 264 seconds]
01:57
PocketJosh has quit [Ping timeout: 240 seconds]
01:57
kfpratt has joined #ruby-lang
01:58
cornerman has quit [Ping timeout: 244 seconds]
01:58
cornerma1 is now known as cornerman
01:58
b_hoffman has quit [Quit: b_hoffman]
01:59
PocketJosh has joined #ruby-lang
01:59
stardiviner has joined #ruby-lang
02:01
PocketJosh has quit [Remote host closed the connection]
02:02
mcclurmc has quit [Remote host closed the connection]
02:03
fujimura has joined #ruby-lang
02:03
fujimura has quit [Remote host closed the connection]
02:04
fujimura has joined #ruby-lang
02:04
duderonomy has joined #ruby-lang
02:05
gambl0re has joined #ruby-lang
02:06
gambl0re has quit [Client Quit]
02:06
gambl0re has joined #ruby-lang
02:07
gambl0re has quit [Client Quit]
02:07
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
02:07
wallerdev has quit [Quit: wallerdev]
02:16
gwendall has quit [Remote host closed the connection]
02:16
GPrime has joined #ruby-lang
02:16
gwendall has joined #ruby-lang
02:19
ledestin has joined #ruby-lang
02:20
houhoulis has quit [Remote host closed the connection]
02:21
gwendall has quit [Ping timeout: 272 seconds]
02:22
bruno- has joined #ruby-lang
02:24
kfpratt has quit [Ping timeout: 258 seconds]
02:27
bruno- has quit [Ping timeout: 240 seconds]
02:30
drefined has joined #ruby-lang
02:36
charliesome has quit [Quit: zzz]
02:39
wallerdev has joined #ruby-lang
02:39
charliesome has joined #ruby-lang
02:40
tenderlove has joined #ruby-lang
02:41
drefined has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:43
lele has quit [Ping timeout: 272 seconds]
02:45
tenderlove has quit [Ping timeout: 265 seconds]
02:58
djbkd has joined #ruby-lang
02:59
nertzy2 has joined #ruby-lang
03:04
datanoise has joined #ruby-lang
03:06
PocketJosh has joined #ruby-lang
03:07
datanois1 has quit [Quit: leaving]
03:07
houhoulis has joined #ruby-lang
03:10
znz_jp has quit [Quit: kill -QUIT $$]
03:11
PocketJosh has quit [Ping timeout: 245 seconds]
03:12
kfpratt has joined #ruby-lang
03:12
znz_jp has joined #ruby-lang
03:13
centrx has quit [Quit: Shutting down, Please wait...]
03:16
nertzy2 has quit [Quit: This computer has gone to sleep]
03:18
symm- has quit [Quit: Leaving...]
03:19
PocketJosh has joined #ruby-lang
03:19
symm- has joined #ruby-lang
03:23
Hofnerd has joined #ruby-lang
03:23
bruno- has joined #ruby-lang
03:23
Hofnerd has quit [Client Quit]
03:25
mcclurmc has joined #ruby-lang
03:27
gwendall has joined #ruby-lang
03:29
bruno- has quit [Ping timeout: 272 seconds]
03:32
gwendall has quit [Ping timeout: 272 seconds]
03:36
fujimura has quit [Remote host closed the connection]
03:37
nertzy2 has joined #ruby-lang
03:39
joaomdmoura has joined #ruby-lang
03:42
t_ has joined #ruby-lang
03:42
gix has quit [Ping timeout: 256 seconds]
03:43
David_H__ has joined #ruby-lang
03:43
datanois1 has joined #ruby-lang
03:44
joaomdmoura has quit [Ping timeout: 244 seconds]
03:44
datanois1 has quit [Client Quit]
03:44
datanois1 has joined #ruby-lang
03:46
gix has joined #ruby-lang
03:47
David_H_Smith has quit [Ping timeout: 264 seconds]
03:54
pikos has quit [Remote host closed the connection]
03:55
kfpratt has quit [Remote host closed the connection]
03:58
nertzy2 has quit [Quit: This computer has gone to sleep]
04:00
drefined has joined #ruby-lang
04:01
revath has joined #ruby-lang
04:04
michael_mbp has quit [Excess Flood]
04:06
michael_mbp has joined #ruby-lang
04:06
datanois1 has quit [Quit: leaving]
04:09
drefined has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
04:10
PocketJosh has quit [Read error: Connection reset by peer]
04:11
Nimf has joined #ruby-lang
04:11
datanois1 has joined #ruby-lang
04:12
djbkd has quit [Quit: My people need me...]
04:13
nertzy2 has joined #ruby-lang
04:14
PocketJosh has joined #ruby-lang
04:16
datanoise has quit []
04:17
datanois1 has quit [Quit: WeeChat 1.1.1]
04:17
datanoise has joined #ruby-lang
04:17
charliesome has quit [Quit: zzz]
04:18
PocketJosh has quit [Ping timeout: 255 seconds]
04:20
PocketJosh has joined #ruby-lang
04:20
haraoka has quit [Ping timeout: 245 seconds]
04:24
bruno- has joined #ruby-lang
04:26
datanoise has quit [Quit: WeeChat 1.1.1]
04:29
rawrmonstar has joined #ruby-lang
04:29
bruno- has quit [Ping timeout: 244 seconds]
04:29
jbomo has joined #ruby-lang
04:29
tenderlove has joined #ruby-lang
04:29
jbomo has left #ruby-lang [#ruby-lang]
04:32
joaomdmoura has joined #ruby-lang
04:34
tenderlove has quit [Ping timeout: 256 seconds]
04:34
datanoise has joined #ruby-lang
04:37
micmus has quit [Quit: Leaving]
04:43
revath has quit [Ping timeout: 264 seconds]
04:45
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
04:46
fujimura has joined #ruby-lang
04:48
hal_9000_ has joined #ruby-lang
04:49
riotjones has joined #ruby-lang
04:50
riotjones has quit [Read error: Connection reset by peer]
04:50
riotjones has joined #ruby-lang
04:50
benlovell has joined #ruby-lang
04:50
hal_9000__ has quit [Ping timeout: 258 seconds]
04:50
datanoise has quit [Quit: WeeChat 1.1.1]
04:50
datanoise has joined #ruby-lang
04:51
datanoise has joined #ruby-lang
04:53
haraoka has joined #ruby-lang
04:53
caseypatrickdris has quit [Remote host closed the connection]
04:54
tautvydas has joined #ruby-lang
04:55
riotjones has quit [Ping timeout: 265 seconds]
04:55
benlovell has quit [Ping timeout: 264 seconds]
04:59
David_H_Smith has joined #ruby-lang
05:01
michaeldeol has joined #ruby-lang
05:02
David_H__ has quit [Ping timeout: 245 seconds]
05:04
Missphoenix has quit [Quit: Leaving]
05:07
TheMoonMaster has quit [Ping timeout: 272 seconds]
05:08
slumos has left #ruby-lang [#ruby-lang]
05:08
gianlucadv has joined #ruby-lang
05:11
Miphix has joined #ruby-lang
05:15
ur5us has quit [Remote host closed the connection]
05:15
BanzaiJoe has quit [Ping timeout: 264 seconds]
05:16
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
05:21
revath has joined #ruby-lang
05:24
charliesome has joined #ruby-lang
05:25
|jemc| has quit [Ping timeout: 264 seconds]
05:25
bruno- has joined #ruby-lang
05:30
mikecmpbll has quit [Quit: ciao.]
05:30
skade has joined #ruby-lang
05:31
bruno- has quit [Ping timeout: 276 seconds]
05:33
rippa has joined #ruby-lang
05:33
houhoulis has quit [Remote host closed the connection]
05:35
|jemc| has joined #ruby-lang
05:40
VinnyBoy has quit [Read error: Connection reset by peer]
05:43
pikos has joined #ruby-lang
05:45
djbkd has joined #ruby-lang
05:48
pikos has quit [Ping timeout: 244 seconds]
05:49
io_syl has joined #ruby-lang
05:51
revath has quit [Ping timeout: 258 seconds]
05:52
symm- has quit [Ping timeout: 265 seconds]
05:52
PocketJosh has quit [Ping timeout: 252 seconds]
05:53
revath has joined #ruby-lang
05:54
LBo has quit [Ping timeout: 258 seconds]
05:59
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
06:03
_ht has joined #ruby-lang
06:04
riotjones has joined #ruby-lang
06:05
jas02 has joined #ruby-lang
06:05
PocketJosh has joined #ruby-lang
06:07
LBo has joined #ruby-lang
06:08
revath has quit [Ping timeout: 256 seconds]
06:09
ascarter has joined #ruby-lang
06:09
revath has joined #ruby-lang
06:13
gambl0re has joined #ruby-lang
06:14
chinmay_dd has joined #ruby-lang
06:14
joaomdmoura has quit [Remote host closed the connection]
06:16
revath1 has joined #ruby-lang
06:18
revath has quit [Ping timeout: 250 seconds]
06:18
tenderlove has joined #ruby-lang
06:22
amclain has quit [Quit: Leaving]
06:22
tenderlove has quit [Ping timeout: 250 seconds]
06:22
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
06:26
bruno- has joined #ruby-lang
06:27
michael_mbp has quit [Excess Flood]
06:27
djellemah has quit [Read error: Connection reset by peer]
06:28
michael_mbp has joined #ruby-lang
06:31
bruno- has quit [Ping timeout: 264 seconds]
06:31
stan has joined #ruby-lang
06:31
<
RickHull >
ljarvis: since pry depends on slop 3, can it not be used in projects with slop 4?
06:34
skade has quit [Quit: Computer has gone to sleep.]
06:34
arBmind has joined #ruby-lang
06:34
rbowlby_ has quit [Remote host closed the connection]
06:37
woodruffw has quit [Quit: And then he took off.]
06:38
woodruffw has joined #ruby-lang
06:38
ec2-user_ has quit [*.net *.split]
06:39
woodruffw has quit [Client Quit]
06:39
woodruffw has joined #ruby-lang
06:44
PocketJosh has quit []
06:53
datanoise has quit [Ping timeout: 258 seconds]
06:54
joaomdmoura has joined #ruby-lang
06:55
sarkyniin has joined #ruby-lang
06:58
nertzy has joined #ruby-lang
06:58
solars has joined #ruby-lang
06:59
nertzy2 has quit [Ping timeout: 265 seconds]
06:59
sarkyniin has quit [Ping timeout: 256 seconds]
07:00
datanoise has joined #ruby-lang
07:02
ryba has joined #ruby-lang
07:04
datanoise has quit [Ping timeout: 240 seconds]
07:05
myork80 has joined #ruby-lang
07:06
myork80 has quit [Client Quit]
07:07
loveablelobster has joined #ruby-lang
07:08
wallerdev has quit [Quit: wallerdev]
07:09
loveablelobster has left #ruby-lang [#ruby-lang]
07:09
loveablelobster has joined #ruby-lang
07:11
loveablelobster has quit [Client Quit]
07:11
<
ljarvis >
RickHull: no unfortunately not
07:11
loveablelobster has joined #ruby-lang
07:12
loveablelobster has quit [Client Quit]
07:12
kerunaru has joined #ruby-lang
07:13
loveablelobster has joined #ruby-lang
07:14
Miphix has quit [Ping timeout: 252 seconds]
07:16
<
RickHull >
i'm imagining a pull request... :)
07:17
benlovell has joined #ruby-lang
07:18
ec2-user_ has joined #ruby-lang
07:22
benlovell has quit [Ping timeout: 244 seconds]
07:30
dhjondoh has joined #ruby-lang
07:30
gwendall has joined #ruby-lang
07:32
pikos has joined #ruby-lang
07:32
<
ljarvis >
RickHull: to pry?
07:32
<
ljarvis >
they won't accept one because slop depends on Ruby 2
07:32
<
RickHull >
yeah, oh
07:34
<
RickHull >
i guess the plugins are the bigger issue
07:34
<
ljarvis >
even if slop supported 1.9, pry would need quite a lot of work to support the new syntax
07:34
skade has joined #ruby-lang
07:35
<
RickHull >
with 1.9 EOL anyway, is there any point to supporting it?
07:35
<
RickHull >
i'd suggest like a forked gem for 1.9 support if necessary
07:35
zenspider has quit [Quit: bye]
07:35
zenspider has joined #ruby-lang
07:35
<
RickHull >
e.g. pry-legacy or whatever
07:36
pikos has quit [Ping timeout: 258 seconds]
07:37
<
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
07:37
Mau has joined #ruby-lang
07:37
<
ljarvis >
or pry-lib or something
07:38
<
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
07:38
<
RickHull >
2.0 doesn't really break much for 1.9 code, right?
07:38
<
zenspider >
RickHull: no, and it's actually better w/ 1.8 as well (encodings are more realistic)
07:40
<
ljarvis >
I don't actually know what slop uses that isn't on 1.9, I just wrote and tested it specifically for 2
07:40
<
ljarvis >
maybe named params
07:40
<
RickHull >
i'm a fan of
__dir__ :)
07:40
<
RickHull >
i dropped support for 1.9 in a gem just for that xD
07:40
<
ljarvis >
isn't that just File.dirname(__FILE__)
07:41
<
ljarvis >
also why is it lowercase
07:41
nedp has joined #ruby-lang
07:41
<
RickHull >
dunno, but File.dirname(__FILE__) always bugged me as hackish
07:42
<
RickHull >
admittedly a silly concern
07:42
|jemc| has quit [Ping timeout: 258 seconds]
07:42
<
zenspider >
where's my
__dir__dir__ ?
07:43
<
apeiros >
I want
__abs_dir__
07:43
<
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?
07:44
<
apeiros >
hm… odd… where and when did I get a relative path out of __dir__?
07:44
<
RickHull >
irb(main):001:0>
__dir__ #=> "."
07:44
<
apeiros >
well, in irb it's not really a wonder
07:44
<
ljarvis >
>>
__dir__
07:45
<
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)
07:45
<
ljarvis >
oh it is abs?
07:45
<
zenspider >
RickHull: and yes, I found it easier to do 1.8 -> 2.0
07:45
<
RickHull >
gotcha, just making sure :)
07:45
<
zenspider >
I still had to do encoding changes, but they were REASONABLE
07:46
<
zenspider >
I'm biased tho... I view 1.9 as our angsty teenage years and they should be forgotten that they ever happened
07:46
elia has joined #ruby-lang
07:46
<
ljarvis >
tbh parts of 1.8 were glorious
07:46
<
apeiros >
all upgrades from 1.9 were piece of cake
07:47
<
RickHull >
now that 1.9 is EOL, i just have trouble caring about people using it
07:47
<
apeiros >
only 1.8 to 1.9 caused troubles. and even those were mostly trivial.
07:47
arBmind has quit [Quit: Leaving.]
07:47
<
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"
07:49
ryba has quit [Ping timeout: 264 seconds]
07:49
<
RickHull >
I had trouble with the 1.9 transition for a large codebase
07:49
leat1 has joined #ruby-lang
07:49
<
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
07:50
<
RickHull >
we were on svn too, so branching was a pain
07:51
<
zenspider >
apeiros: wow. we experienced very different transitions. :)
07:52
<
RickHull >
large codebase for me was like 50kLOC IIRC, 3:1 scripts:libs
07:52
<
apeiros >
rails 2 to rails 3 cause us much much more trouble.
07:52
<
RickHull >
and I was dedicated to the idea of a complete transition without bugs
07:52
<
RickHull >
whereas i probably should have bit the bullet and did 80% transition
07:52
<
RickHull >
and then squash the 20%
07:52
<
apeiros >
i.e. ruby 1.8 to 1.9 for a large codebase was ~2-3 days. rails 2-3 was ~2 weeks.
07:54
<
RickHull >
the biggest headache for me was the String#[] change
07:54
<
apeiros >
large codebase is >100kLOC today. not sure how much it was back then.
07:54
<
apeiros >
hard to count since we've split the code into dozens of gems & engines
07:56
benlovell has joined #ruby-lang
07:58
<
RickHull >
anyone use aws-sdk v2?
08:00
<
RickHull >
nvm, found what I was looking for
08:00
<
RickHull >
all they have is API reference docs
08:01
arBmind has joined #ruby-lang
08:04
flak has joined #ruby-lang
08:05
charliesome has quit [Quit: zzz]
08:05
flak is now known as Guest44683
08:06
datanoise has joined #ruby-lang
08:07
ArchRogem has joined #ruby-lang
08:07
rippa has quit [Ping timeout: 255 seconds]
08:11
ledestin has quit [Ping timeout: 240 seconds]
08:12
djbkd has quit [Remote host closed the connection]
08:12
k3asd` has joined #ruby-lang
08:15
ta has joined #ruby-lang
08:15
kr3ssh has joined #ruby-lang
08:23
ryba has joined #ruby-lang
08:24
ta has quit [Remote host closed the connection]
08:26
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
08:27
bruno- has joined #ruby-lang
08:30
centrx has joined #ruby-lang
08:31
dhjondoh has quit [Quit: dhjondoh]
08:32
bruno- has quit [Ping timeout: 252 seconds]
08:35
marr has joined #ruby-lang
08:37
lele has joined #ruby-lang
08:37
pikos has joined #ruby-lang
08:44
ledestin has joined #ruby-lang
08:47
datanoise has quit [Ping timeout: 264 seconds]
08:57
LBo has quit [Ping timeout: 258 seconds]
09:03
LBo has joined #ruby-lang
09:05
benlovell has quit [Ping timeout: 258 seconds]
09:13
benlovell has joined #ruby-lang
09:18
joaomdmoura has quit [Remote host closed the connection]
09:22
kr3ssh has quit [Ping timeout: 256 seconds]
09:22
RickHull has left #ruby-lang [#ruby-lang]
09:28
bruno- has joined #ruby-lang
09:29
sandelius has joined #ruby-lang
09:33
bruno- has quit [Ping timeout: 265 seconds]
09:33
leat1 has quit [Ping timeout: 250 seconds]
09:33
axwel has joined #ruby-lang
09:34
kr3ssh has joined #ruby-lang
09:34
tautvydas has quit [Remote host closed the connection]
09:38
kr3ssh has quit [Ping timeout: 256 seconds]
09:40
pwnz0r has joined #ruby-lang
09:41
leat1 has joined #ruby-lang
09:46
joaomdmoura has joined #ruby-lang
09:48
dhjondoh has joined #ruby-lang
09:55
iamninja has quit [Read error: Connection reset by peer]
09:55
iamninja has joined #ruby-lang
09:56
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
10:00
leat1 has quit [Remote host closed the connection]
10:01
leat1 has joined #ruby-lang
10:04
haraoka has quit [Ping timeout: 265 seconds]
10:04
joaomdmoura has quit [Remote host closed the connection]
10:07
rbowlby has joined #ruby-lang
10:07
benlovell has quit [Ping timeout: 246 seconds]
10:08
rbowlby has quit [Client Quit]
10:14
revath1 has quit [Quit: Leaving.]
10:15
revath has joined #ruby-lang
10:16
kr3ssh has joined #ruby-lang
10:18
intinig has joined #ruby-lang
10:18
benlovell has joined #ruby-lang
10:19
fujimura has quit [Remote host closed the connection]
10:21
hagabaka has quit [Read error: Connection reset by peer]
10:21
tak1n has quit [Ping timeout: 250 seconds]
10:21
sandelius has joined #ruby-lang
10:21
hagabaka has joined #ruby-lang
10:22
tak1n has joined #ruby-lang
10:22
chinmay_dd has quit []
10:28
kr3ssh has quit [Ping timeout: 265 seconds]
10:28
skade has quit [Quit: Computer has gone to sleep.]
10:29
bruno- has joined #ruby-lang
10:29
Pathfinder has joined #ruby-lang
10:31
joaomdmoura has joined #ruby-lang
10:34
bruno- has quit [Ping timeout: 264 seconds]
10:34
kr3ssh has joined #ruby-lang
10:36
joaomdmoura has quit [Ping timeout: 250 seconds]
10:42
pwnz0r has quit [Remote host closed the connection]
10:42
pwnz0r has joined #ruby-lang
10:45
leat1 has quit [Ping timeout: 264 seconds]
10:46
kr3ssh has quit [Ping timeout: 272 seconds]
10:47
k3asd` has quit [Remote host closed the connection]
10:47
pwnz0r has quit [Ping timeout: 265 seconds]
10:48
kr3ssh has joined #ruby-lang
10:51
leat1 has joined #ruby-lang
10:56
bruno- has joined #ruby-lang
11:00
stamina has joined #ruby-lang
11:07
Guest44683 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
11:10
leat1 has quit [Ping timeout: 244 seconds]
11:13
Forgetful_Lion has quit [Remote host closed the connection]
11:16
Pathfinder has quit [Ping timeout: 264 seconds]
11:17
dhjondoh has quit [Remote host closed the connection]
11:21
tkuchiki has quit [Ping timeout: 244 seconds]
11:25
kr3ssh has quit [Ping timeout: 256 seconds]
11:27
centrx has quit [Quit: Shutting down, Please wait...]
11:28
sankaber has joined #ruby-lang
11:30
datanoise has joined #ruby-lang
11:30
fujimura has joined #ruby-lang
11:34
Pathfinder has joined #ruby-lang
11:35
fujimura has quit [Ping timeout: 245 seconds]
11:35
postmodern has quit [Quit: Leaving]
11:35
Fooster has joined #ruby-lang
11:36
datanoise has quit [Ping timeout: 265 seconds]
11:37
kr3ssh has joined #ruby-lang
11:43
dhjondoh has joined #ruby-lang
11:44
dhjondoh has quit [Client Quit]
11:45
benlovell has quit [Ping timeout: 272 seconds]
11:45
ldnunes has joined #ruby-lang
11:46
kr3ssh has quit [Ping timeout: 264 seconds]
11:48
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
11:48
kr3ssh has joined #ruby-lang
11:52
skade has joined #ruby-lang
12:02
<
darix >
i still think binding.pry is one of the best ways to learn about a new library
12:03
mistym has quit [Ping timeout: 256 seconds]
12:03
mistym- has joined #ruby-lang
12:05
benlovell has joined #ruby-lang
12:06
b_hoffman has joined #ruby-lang
12:10
AugustoCesar has quit [Quit: Leaving.]
12:10
Nimf has quit [Read error: Connection reset by peer]
12:10
benlovell has quit [Ping timeout: 272 seconds]
12:11
kr3ssh has quit [Ping timeout: 256 seconds]
12:12
ta has joined #ruby-lang
12:12
kerunaru has joined #ruby-lang
12:14
pikos has quit [Remote host closed the connection]
12:21
benlovell has joined #ruby-lang
12:22
akrgn has joined #ruby-lang
12:22
banister has quit [Read error: Connection reset by peer]
12:23
indrajeet has joined #ruby-lang
12:24
indrajeet has left #ruby-lang [#ruby-lang]
12:24
alestuber has joined #ruby-lang
12:25
banister has joined #ruby-lang
12:25
atomical has joined #ruby-lang
12:26
indrajeet has joined #ruby-lang
12:27
<
indrajeet >
Why use kernel ?
12:27
joaomdmoura has joined #ruby-lang
12:28
kr3ssh has joined #ruby-lang
12:28
<
_ht >
As in, why has Ruby a kernel module, or why should I use the kernel module in my code?
12:29
sarkyniin has joined #ruby-lang
12:30
<
indrajeet >
SystemConstant.where(autoload: true).each do |constant| Kernel.const_set(constant.name, constant.value) end
12:30
<
indrajeet >
Is this correct?
12:30
<
ljarvis >
that is an awful idea
12:31
dorei has joined #ruby-lang
12:31
[k- has joined #ruby-lang
12:31
Pathfinder has quit [Ping timeout: 244 seconds]
12:31
<
_ht >
Isn't const_set part of Module?
12:31
<
_ht >
But what are you trying to accomplish?
12:31
<
indrajeet >
i dont know what exactly kernel do?
12:32
<
ljarvis >
it's a module that contains methods
12:32
<
ljarvis >
the module is mixed in to Object
12:32
datanoise has joined #ruby-lang
12:32
<
indrajeet >
i want to use constants in initializer to autoload constants
12:33
<
indrajeet >
i m getting constants from Model systemcostants
12:34
<
indrajeet >
i need to load when it initalize
12:34
<
indrajeet >
can i use eval for this ?
12:34
Caius has quit [Ping timeout: 276 seconds]
12:36
<
indrajeet >
eval(costant.name ="+' constant.value'+")
12:36
<
[k- >
you shouldn't use eval!
12:36
<
indrajeet >
so kernel is fine naa
12:37
<
indrajeet >
actually i dont have depth knowledge about ruby
12:37
datanoise has quit [Ping timeout: 252 seconds]
12:37
<
indrajeet >
some suggest to join this
12:38
<
indrajeet >
thanks jarvis
12:39
Caius has joined #ruby-lang
12:42
<
_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(...,...)
12:43
<
ljarvis >
or just don't dynamically set constants from the database
12:43
<
ljarvis >
it's a terrible idea
12:44
<
[k- >
could use the ENV to store environment variables
12:44
ruby-lang165 has joined #ruby-lang
12:44
ascarter has joined #ruby-lang
12:44
imperator has joined #ruby-lang
12:45
ruby-lang165 has quit [Client Quit]
12:45
houhoulis has joined #ruby-lang
12:45
ascarter has quit [Max SendQ exceeded]
12:45
<
ljarvis >
they're not environmental variables if they're loaded like that
12:46
ascarter has joined #ruby-lang
12:46
<
[k- >
he is trying to make them global so...
12:47
<
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
12:47
<
indrajeet >
actully i want to use constants globally
12:47
<
ljarvis >
I would just have a Config class which fetches values
12:47
<
indrajeet >
in my app
12:47
<
ljarvis >
Indrajeet: why do you need constants?
12:48
<
indrajeet >
as per the requirement
12:48
<
ljarvis >
so you don't know why?
12:48
<
_ht >
And how constant should they be? (in principle with const_set you can change any constant ...
12:49
<
indrajeet >
i'll check
12:51
<
indrajeet >
i have model in that model SystemConstant, i have added constant name value and autoload field
12:52
riotjones has quit [Quit: Leaving...]
12:52
airdisa has joined #ruby-lang
12:52
<
indrajeet >
and created rake task to add costant name in table
12:53
<
ljarvis >
well I tried
12:53
joaomdmoura has quit [Remote host closed the connection]
12:53
<
indrajeet >
I need load load these constants when server start
12:54
<
ljarvis >
no you don't
12:54
<
indrajeet >
i dont want to call query to get constats every time
12:54
<
ljarvis >
my second example loads them into memory to avoid lookup queries
12:55
<
indrajeet >
thats why i used above code
12:55
<
indrajeet >
Once it inialize then i use constant to my whole app
12:55
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
12:56
k3asd` has joined #ruby-lang
12:56
jbwiv has quit [Ping timeout: 265 seconds]
12:56
stef204 has joined #ruby-lang
12:58
arBmind has quit [Quit: Leaving.]
12:58
<
indrajeet >
if autoload field true then it initalize contants
12:59
pikos has joined #ruby-lang
12:59
stef204 has quit [Client Quit]
12:59
joaomdmoura has joined #ruby-lang
13:00
whippythellama has quit [Quit: whippythellama]
13:00
GPrime has joined #ruby-lang
13:01
<
ljarvis >
Indrajeet: I can't think of a worse way to do what you're doing
13:01
<
ljarvis >
it's a bad idea from every direction
13:01
tkuchiki has joined #ruby-lang
13:01
<
indrajeet >
plz help me out i m little bit confused
13:01
sgambino has joined #ruby-lang
13:01
<
ljarvis >
I'm trying and I gave you some examples
13:02
<
indrajeet >
okey thanks
13:02
LBo has quit [Read error: Connection reset by peer]
13:04
io_syl has joined #ruby-lang
13:06
charliesome has joined #ruby-lang
13:06
LBo has joined #ruby-lang
13:10
centrx has joined #ruby-lang
13:10
iamninja has quit [Read error: Connection reset by peer]
13:10
pikos has quit [Remote host closed the connection]
13:10
iamninja has joined #ruby-lang
13:11
jbwiv has joined #ruby-lang
13:11
dhjondoh has joined #ruby-lang
13:12
k3asd`_ has joined #ruby-lang
13:13
dhjondoh has quit [Client Quit]
13:15
kfpratt has joined #ruby-lang
13:15
leat1 has joined #ruby-lang
13:15
k3asd` has quit [Ping timeout: 255 seconds]
13:16
pikos has joined #ruby-lang
13:17
malconis has joined #ruby-lang
13:17
malconis has quit [Remote host closed the connection]
13:18
malconis has joined #ruby-lang
13:20
gambl0re has quit [Ping timeout: 252 seconds]
13:27
chinmay_dd has joined #ruby-lang
13:29
scheda has joined #ruby-lang
13:29
kinjimao has joined #ruby-lang
13:30
alestuber has quit [Ping timeout: 252 seconds]
13:30
<
kinjimao >
hey everybody :) Any idea on how to implement the `& 0xFF` syntax in Ruby 2?
13:30
GPrime has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
13:30
jwaldrip has joined #ruby-lang
13:30
alestuber has joined #ruby-lang
13:31
<
centrx >
kinjimao, You mean "\xFF" ?
13:31
centrx has quit [Quit: Shutting down, Please wait...]
13:32
imperator has quit [Quit: This computer has gone to sleep]
13:32
melter has joined #ruby-lang
13:32
imperator has joined #ruby-lang
13:33
<
kinjimao >
maybe, I need to implement this syntax from php: `a = ""; b = 1234; a .= chr(b & 0xFF);`
13:33
<
kinjimao >
I tried with a proc, which seems to work
13:33
ldnunes has quit [Quit: Leaving]
13:33
<
kinjimao >
i get a symilar value
13:34
<
kinjimao >
#<Proc:0x00000000934d60@(irb):18>
13:34
dzejrou has joined #ruby-lang
13:34
datanoise has joined #ruby-lang
13:34
<
kinjimao >
which might be what I'm looking for, what do you think?
13:34
alestuber has quit [Ping timeout: 240 seconds]
13:37
joaomdmoura has quit [Remote host closed the connection]
13:37
<
kinjimao >
how do i extrapolate the value without regexp? :D
13:38
<
jhass >
>> (1234 & 0xFF).chr
13:39
<
kinjimao >
jhass would you be so gentle to explain me the first and the last part of your syntax?
13:39
ascarter has joined #ruby-lang
13:39
<
kinjimao >
what ar >>> and .chr?
13:39
<
jhass >
>> is just sending to the eval both here
13:39
hinbody has joined #ruby-lang
13:39
datanoise has quit [Ping timeout: 252 seconds]
13:40
<
jhass >
chr is Integer#chr, check the docs
13:40
<
kinjimao >
I tried this in ruby
13:40
<
kinjimao >
`a = 'pippo'; b = Proc.new { a & 0xFF }`
13:41
<
jhass >
doubt there's a String#&
13:41
<
kinjimao >
and I get the value up there
13:41
<
kinjimao >
#<Proc:0x00000000fde6c0@(irb):35>
13:41
<
jhass >
yes, and..?
13:41
<
jhass >
you make a Proc, so you get a Proc instance
13:41
<
kinjimao >
so apparntly I get a memory address
13:41
<
jhass >
what's surprising about that?
13:41
<
jhass >
no, that's just the inspect
13:41
<
jhass >
>> proc { }.inspect
13:42
alestuber has joined #ruby-lang
13:43
<
kinjimao >
so how do I get the last 8 bits?
13:43
<
kinjimao >
in this case, how do I get the last 8 bits of a?
13:43
ttilley has quit [Quit: Leaving...]
13:44
<
kinjimao >
lol I see also that using >> at the beginning of the sentence exec ruby code
13:45
<
kinjimao >
>> puts 'hey!'
13:45
<
kinjimao >
great room
13:45
<
jhass >
with Integer#&
13:46
<
kinjimao >
now I see what you meant before
13:46
<
apeiros >
>> a = ""; b = 1234; a += (b & 0xFF).chr; a
13:46
<
apeiros >
literal translation of your example
13:46
jgpawletko has joined #ruby-lang
13:46
<
apeiros >
not necessarily idiomatic
13:46
<
kinjimao >
ok ok I got it
13:47
<
kinjimao >
thanks so much guys
13:47
alestuber has quit [Ping timeout: 252 seconds]
13:47
<
jhass >
oh, it's on Fixnum
13:47
<
apeiros >
jhass: I wish there was String#^
13:47
<
jhass >
apeiros: it'd work on the bytes or?
13:48
<
apeiros >
jhass: yes. it's slow. my custom implementation uses unpack("N") + last bytes
13:48
<
apeiros >
a native implementation could read the cpu native length of bytes
13:48
alestuber has joined #ruby-lang
13:48
<
apeiros >
i.e. usually 8 bytes
13:48
<
apeiros >
and you could probably even vectorize it
13:49
<
kinjimao >
I see that I can also do
13:50
<
jhass >
you must do that a lot :P
13:50
<
kinjimao >
>> (1234 >> 8 & 0xFF)
13:50
<
kinjimao >
>> (1234 >> 16 & 0xFF)
13:50
<
kinjimao >
and so on
13:50
<
kinjimao >
actually is for a friend who is making a san andreas server
13:51
<
kinjimao >
never used it before :D
13:51
stamina has quit [Quit: WeeChat 1.2]
13:52
<
jhass >
kinjimao: sounds like Array#pack and String#unpack might of interest
13:52
<
kinjimao >
forgot to put .chr at the end but well, that's the logic
13:52
<
kinjimao >
will give a look, thanks
13:56
<
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?
13:57
cornerma1 has joined #ruby-lang
14:00
cornerman has quit [Ping timeout: 264 seconds]
14:00
cornerma1 is now known as cornerman
14:03
<
maloik >
not quite sure but it might have something to do with the part of the string ending in a space or not
14:03
k3asd`_ has quit [Ping timeout: 256 seconds]
14:04
michael_mbp has quit [Excess Flood]
14:04
<
jhass >
I found ya2yaml to yield more consistent and "prettier" results, though it's really really slow
14:04
datanoise has joined #ruby-lang
14:05
kfpratt has quit [Remote host closed the connection]
14:07
michael_mbp has joined #ruby-lang
14:14
benlovell has quit [Ping timeout: 258 seconds]
14:15
benlovell has joined #ruby-lang
14:15
whippythellama has joined #ruby-lang
14:16
symm- has joined #ruby-lang
14:17
revath has quit [Ping timeout: 264 seconds]
14:20
benlovell has quit [Ping timeout: 245 seconds]
14:21
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
14:22
gambl0re has joined #ruby-lang
14:24
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
14:25
JakFrist has joined #ruby-lang
14:27
skade has quit [Ping timeout: 265 seconds]
14:28
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:30
joaomdmoura has joined #ruby-lang
14:30
joaomdmoura has quit [Remote host closed the connection]
14:30
k3asd` has joined #ruby-lang
14:32
intinig has quit [Remote host closed the connection]
14:32
GPrime has joined #ruby-lang
14:33
indrajeet has quit [Quit: Page closed]
14:33
banister has joined #ruby-lang
14:34
JakFrist has joined #ruby-lang
14:35
jbwiv has left #ruby-lang [#ruby-lang]
14:36
chouhoulis has joined #ruby-lang
14:37
joaomdmoura has joined #ruby-lang
14:38
marr123 has joined #ruby-lang
14:38
marr has quit [Ping timeout: 258 seconds]
14:39
alestuber has quit [Remote host closed the connection]
14:41
dzejrou has quit [Remote host closed the connection]
14:42
segy has joined #ruby-lang
14:42
airdisa has quit []
14:43
<
mustmodify >
jhass: I'll check it out.
14:44
ldnunes has joined #ruby-lang
14:45
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
14:45
houhoulis has quit [Remote host closed the connection]
14:45
alestuber has joined #ruby-lang
14:46
charliesome has quit [Quit: zzz]
14:48
jas02 has quit [Quit: jas02]
14:48
arBmind has joined #ruby-lang
14:48
lnr has quit [Ping timeout: 272 seconds]
14:48
lnr has joined #ruby-lang
14:48
lnr has quit [Max SendQ exceeded]
14:49
lnr has joined #ruby-lang
14:49
lnr has quit [Max SendQ exceeded]
14:49
lnr has joined #ruby-lang
14:49
lnr has quit [Max SendQ exceeded]
14:49
arBmind has quit [Client Quit]
14:49
charliesome has joined #ruby-lang
14:49
lnr has joined #ruby-lang
14:49
lnr has quit [Max SendQ exceeded]
14:49
charliesome has quit [Client Quit]
14:50
lnr has joined #ruby-lang
14:50
lnr has quit [Max SendQ exceeded]
14:50
lnr has joined #ruby-lang
14:50
lnr has quit [Max SendQ exceeded]
14:50
lnr has joined #ruby-lang
14:50
lnr has quit [Max SendQ exceeded]
14:51
lnr has joined #ruby-lang
14:51
lnr has quit [Max SendQ exceeded]
14:51
lnr has joined #ruby-lang
14:51
lnr has quit [Max SendQ exceeded]
14:51
JakFrist has joined #ruby-lang
14:51
lnr has joined #ruby-lang
14:51
lnr has quit [Max SendQ exceeded]
14:52
lnr has joined #ruby-lang
14:52
lnr has quit [Max SendQ exceeded]
14:52
lnr has joined #ruby-lang
14:52
lnr has quit [Max SendQ exceeded]
14:52
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:52
lnr has joined #ruby-lang
14:52
lnr has quit [Max SendQ exceeded]
14:53
lnr has joined #ruby-lang
14:53
lnr has quit [Max SendQ exceeded]
14:53
lnr has joined #ruby-lang
14:53
lnr has quit [Max SendQ exceeded]
14:53
lnr has joined #ruby-lang
14:53
lnr has quit [Max SendQ exceeded]
14:54
lnr has joined #ruby-lang
14:54
lnr has quit [Max SendQ exceeded]
14:54
lnr has joined #ruby-lang
14:54
lnr has quit [Max SendQ exceeded]
14:54
lnr has joined #ruby-lang
14:54
lnr has quit [Max SendQ exceeded]
14:55
lnr has joined #ruby-lang
14:55
lnr has quit [Max SendQ exceeded]
14:55
lnr has joined #ruby-lang
14:55
tkuchiki has quit [Remote host closed the connection]
14:55
nedp has quit [Remote host closed the connection]
14:56
tkuchiki has joined #ruby-lang
14:57
chinmay_dd has quit [Remote host closed the connection]
14:58
chinmay_dd has joined #ruby-lang
14:59
ascarter has joined #ruby-lang
15:00
lnr has quit [Ping timeout: 255 seconds]
15:00
ascarter has quit [Max SendQ exceeded]
15:00
lnr has joined #ruby-lang
15:00
tkuchiki has quit [Ping timeout: 256 seconds]
15:00
lnr was kicked from #ruby-lang by imperator [lnr]
15:00
ascarter has joined #ruby-lang
15:02
j4cknewt has joined #ruby-lang
15:02
leat1 has quit [Ping timeout: 256 seconds]
15:05
chinmay_dd has quit [Remote host closed the connection]
15:06
Fooster has quit [Ping timeout: 265 seconds]
15:08
j4cknewt_ has joined #ruby-lang
15:09
banister has joined #ruby-lang
15:09
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
15:10
j4cknewt has quit [Read error: Connection reset by peer]
15:13
michaeldeol has joined #ruby-lang
15:14
alestuber has quit [Read error: Connection reset by peer]
15:15
arBmind has joined #ruby-lang
15:18
alestuber has joined #ruby-lang
15:21
symm- has quit [Ping timeout: 240 seconds]
15:22
marr123 is now known as marr
15:27
ttilley has joined #ruby-lang
15:27
arBmind has quit [Read error: Connection timed out]
15:27
ttilley has quit [Changing host]
15:27
ttilley has joined #ruby-lang
15:27
arBmind has joined #ruby-lang
15:29
arBmind has quit [Client Quit]
15:30
g0bl1n has joined #ruby-lang
15:30
g0bl1n has joined #ruby-lang
15:32
aphova_ has quit [Quit: Connection closed for inactivity]
15:33
melter has quit [Quit: Client exiting]
15:33
BanzaiJoe has joined #ruby-lang
15:35
melter has joined #ruby-lang
15:36
symm- has joined #ruby-lang
15:36
rcvalle has joined #ruby-lang
15:37
j4cknewt_ has quit [Read error: Connection reset by peer]
15:38
j4cknewt has joined #ruby-lang
15:41
VinnyBoy has joined #ruby-lang
15:41
ArchRogem has quit [Read error: Connection reset by peer]
15:42
|jemc| has joined #ruby-lang
15:42
kfpratt has joined #ruby-lang
15:43
skade has joined #ruby-lang
15:44
slawrence00 has joined #ruby-lang
15:45
alestuber has quit [Remote host closed the connection]
15:47
djbkd has joined #ruby-lang
15:48
mustmodify has left #ruby-lang [#ruby-lang]
15:49
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:49
atomical has joined #ruby-lang
15:49
imperator2 has joined #ruby-lang
15:49
tekacs has quit [Quit: Disappearing... *poof*]
15:49
tekacs has joined #ruby-lang
15:51
j4cknewt_ has joined #ruby-lang
15:52
djbkd has quit [Ping timeout: 265 seconds]
15:52
j4cknewt has quit [Read error: Connection reset by peer]
15:53
arBmind has joined #ruby-lang
15:55
seank_ has quit [Remote host closed the connection]
15:55
revath has joined #ruby-lang
15:55
seank_ has joined #ruby-lang
15:55
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:58
Fooster has joined #ruby-lang
16:01
pikos has quit [Remote host closed the connection]
16:01
arBmind has quit [Quit: Leaving.]
16:06
ascarter has joined #ruby-lang
16:11
lele is now known as Guest24
16:15
atomical has joined #ruby-lang
16:15
caseypatrickdris has joined #ruby-lang
16:15
djbkd has joined #ruby-lang
16:17
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:19
elia has quit [Quit: Computer has gone to sleep.]
16:19
atomical has quit [Ping timeout: 248 seconds]
16:20
chinmay_dd has joined #ruby-lang
16:20
rippa has joined #ruby-lang
16:21
pikos has joined #ruby-lang
16:21
j4cknewt has joined #ruby-lang
16:22
caseypatrickdris has quit [Read error: Connection reset by peer]
16:23
caseypatrickdris has joined #ruby-lang
16:24
caseypat_ has joined #ruby-lang
16:25
j4cknewt_ has quit [Ping timeout: 265 seconds]
16:25
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:26
arBmind has joined #ruby-lang
16:28
kfpratt has quit [Remote host closed the connection]
16:28
stan has quit [Ping timeout: 265 seconds]
16:28
caseypatrickdris has quit [Ping timeout: 265 seconds]
16:29
kfpratt has joined #ruby-lang
16:29
solars has quit [Ping timeout: 276 seconds]
16:33
caseypat_ has quit [Read error: Connection reset by peer]
16:33
ebouchut has quit [Quit: Connection closed for inactivity]
16:33
caseypatrickdris has joined #ruby-lang
16:36
<
sarkyniin >
Hey, this is my code
16:37
<
sarkyniin >
however, heroku gives me this error:
16:37
<
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)
16:37
<
sarkyniin >
can't I use do .. end with times?
16:39
k3asd`_ has joined #ruby-lang
16:39
<
jhass >
sarkyniin: what's the end on line 26 for?
16:39
<
imperator2 >
sarkyniin, looks like you have a stray "end" at line 26
16:40
<
sarkyniin >
I guess I do. derp
16:40
<
imperator2 >
for one-liners i tend to use {} instead of do-end
16:40
<
imperator2 >
helps avoid such issues :)
16:41
hiFriends has joined #ruby-lang
16:41
<
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 ;)
16:41
kr3ssh has quit [Ping timeout: 252 seconds]
16:41
<
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.
16:41
<
jhass >
I mostly weirich's rule regarding do/end vs { / }
16:42
<
jhass >
hiFriends: no idea, but how about raise?
16:42
<
sarkyniin >
actually the do / end was because I expected it to be longer than 1 line
16:42
<
sarkyniin >
and then I forgot to prettify it
16:42
k3asd` has quit [Ping timeout: 272 seconds]
16:43
chinmay_dd has quit []
16:44
<
hiFriends >
jhass: let me try that thanks. Im not actually good a ruby either :|
16:44
michaeldeol has joined #ruby-lang
16:45
michaeldeol has quit [Remote host closed the connection]
16:46
leat1 has joined #ruby-lang
16:47
shinnya has joined #ruby-lang
16:48
caseypatrickdris has quit [Read error: Connection reset by peer]
16:49
caseypatrickdris has joined #ruby-lang
16:50
<
hiFriends >
jhass: thanks! does exactly what I wanted
16:50
<
hiFriends >
appreciate the help :D
16:52
heftig has quit [Remote host closed the connection]
16:54
hiFriends has quit [Quit: Page closed]
16:56
errinlarsen has joined #ruby-lang
16:56
<
sarkyniin >
is there a way to remove an object once in an array not knowing its index?
16:56
heftig has joined #ruby-lang
16:56
<
sarkyniin >
for example, if I have a [foo, bar, foo] array
16:56
iliketurtles has joined #ruby-lang
16:56
<
sarkyniin >
I'd like to be able to only remove one foo
16:57
<
sarkyniin >
doing [foo, bar, foo] - [foo] removes both mentions of foo
16:57
michaeldeol has joined #ruby-lang
16:58
ascarter has joined #ruby-lang
16:58
ascarter has quit [Client Quit]
17:00
<
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
17:00
b_hoffman has quit [Quit: b_hoffman]
17:01
wallerdev has joined #ruby-lang
17:01
<
sarkyniin >
errinlarsen: thanks
17:03
caseypatrickdris has quit [Read error: Connection reset by peer]
17:03
<
sarkyniin >
irb(main):010:0> array = ['hello', 'hello', 'how', 'are', 'you']
17:03
<
sarkyniin >
=> ["hello", "hello", "how", "are", "you"]
17:03
<
sarkyniin >
irb(main):011:0> array.index('hello')
17:03
<
sarkyniin >
errinlarsen: not working as intended
17:04
caseypatrickdris has joined #ruby-lang
17:04
RobertBirnie has joined #ruby-lang
17:04
<
errinlarsen >
sarkyniin: with that “hello” example, which element were you hoping to delete?
17:04
<
sarkyniin >
errinlarsen: first 'hello'
17:05
<
sarkyniin >
or any element really
17:05
<
sarkyniin >
since I'm using array.sample
17:05
<
sarkyniin >
basically I'm iterating over an array x number of times
17:05
<
sarkyniin >
so I can pick x elements from that array
17:05
<
errinlarsen >
so, `index_to_delete = array.index(‘hello’)` and then `array.delete(index_to_delete)` … not working for you?
17:05
<
sarkyniin >
wait you can use sample(x)
17:05
<
sarkyniin >
yeah my problem is solved I guess
17:05
k3asd`_ has quit [Ping timeout: 252 seconds]
17:06
<
errinlarsen >
zenspider: I was hoping to ask a question re: WinRb/Viewpoint ...
17:08
pikos has quit [Remote host closed the connection]
17:09
sarkyniin has quit [Remote host closed the connection]
17:10
benlovell has joined #ruby-lang
17:10
j0n3 has joined #ruby-lang
17:15
benlovell has quit [Ping timeout: 276 seconds]
17:16
tibig has joined #ruby-lang
17:18
alestuber has joined #ruby-lang
17:20
melter has quit [Ping timeout: 256 seconds]
17:23
mistym- is now known as mistym
17:23
mistym has quit [Changing host]
17:23
mistym has joined #ruby-lang
17:26
melter has joined #ruby-lang
17:28
errinlarsen has left #ruby-lang [#ruby-lang]
17:28
errinlarsen has joined #ruby-lang
17:29
errinlarsen has left #ruby-lang [#ruby-lang]
17:29
errinlarsen has joined #ruby-lang
17:30
errinlarsen has quit [Quit: errinlarsen]
17:31
Guest24 is now known as lele
17:34
errinlarsen has joined #ruby-lang
17:35
b_hoffman has joined #ruby-lang
17:38
pikos has joined #ruby-lang
17:38
errinlarsen is now known as irkenInvader
17:40
irkenInvader has quit [Quit: irkenInvader]
17:40
errinlarsen has joined #ruby-lang
17:41
axwel has quit [Quit: Lost terminal]
17:45
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
17:46
errinlarsen is now known as irkenInvader
17:47
irkenInvader is now known as errinlarsen
17:48
skade has quit [Quit: Computer has gone to sleep.]
17:48
alphemy has joined #ruby-lang
17:51
j4cknewt has quit [Read error: Connection reset by peer]
17:51
j4cknewt has joined #ruby-lang
17:55
hahuang65 has joined #ruby-lang
17:56
io_syl has joined #ruby-lang
17:59
caseypatrickdris has quit [Read error: Connection reset by peer]
18:00
caseypatrickdris has joined #ruby-lang
18:00
benlovell has joined #ruby-lang
18:00
pikos has quit [Remote host closed the connection]
18:01
pikos has joined #ruby-lang
18:01
michaeldeol has joined #ruby-lang
18:01
shinnya has quit [Ping timeout: 246 seconds]
18:01
pikos has quit [Remote host closed the connection]
18:04
benlovell has quit [Ping timeout: 256 seconds]
18:06
stan has joined #ruby-lang
18:10
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
18:12
skade has joined #ruby-lang
18:12
kr3ssh has joined #ruby-lang
18:14
howdoicomputer_ has joined #ruby-lang
18:16
skade has quit [Client Quit]
18:16
postmodern has joined #ruby-lang
18:18
bin7me has joined #ruby-lang
18:18
caseypatrickdris has quit [Read error: Connection reset by peer]
18:18
skade has joined #ruby-lang
18:19
caseypatrickdris has joined #ruby-lang
18:20
GBrawl has joined #ruby-lang
18:20
Miphix has joined #ruby-lang
18:21
DLSteve has joined #ruby-lang
18:21
benlovell has joined #ruby-lang
18:21
<
jhass >
drbrain: mind a pm?
18:22
skade has quit [Client Quit]
18:22
<
drbrain >
jhass: nope
18:24
baweaver has joined #ruby-lang
18:26
benlovell has quit [Ping timeout: 255 seconds]
18:27
ryba has quit [Ping timeout: 245 seconds]
18:29
skade has joined #ruby-lang
18:31
<
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.
18:32
<
scheda >
Basically, I'm wanting to make sure that I can appropriately handle the arguments regardless of the order they're used in.
18:32
<
imperator2 >
oi, lots of opinions, and depends on what you want to do
18:32
<
scheda >
I'm putting together a little script that'll create an alias entry for me
18:32
<
scheda >
so, usage would be something like
18:33
baweaver has quit [Remote host closed the connection]
18:33
<
imperator2 >
i wrote my own lib - getopt - that may do what you want
18:33
<
scheda >
script.rb -c "touch file.rb" -n "create_file"
18:34
<
scheda >
excellent, thank you
18:34
<
scheda >
I'll check this out
18:34
<
imperator2 >
several others out there on rubygems if that doen't suit you
18:35
caseypatrickdris has quit [Remote host closed the connection]
18:35
<
scheda >
Actually this looks pretty good. It looks like I can very easily grab the arguments I want
18:35
<
jhass >
isn't that in stdlib?
18:35
caseypatrickdris has joined #ruby-lang
18:35
caseypatrickdris has quit [Remote host closed the connection]
18:36
<
jhass >
ah, the stdlib one is named getoptlong :D
18:36
<
imperator2 >
that thing sucks
18:37
errinlarsen has quit [Quit: errinlarsen]
18:38
alestuber has quit [Ping timeout: 250 seconds]
18:39
<
imperator2 >
that's why i wrote getopt in the first place
18:40
errinlarsen has joined #ruby-lang
18:41
<
scheda >
Looks easy enough. So in Getopt::Std.getopts() Before the : is arguments and after is booleans?
18:42
gwendall has quit [Remote host closed the connection]
18:42
howdoicomputer_ has quit [Quit: howdoicomputer_]
18:44
<
scheda >
easy peasy. thanks!
18:44
baweaver has joined #ruby-lang
18:46
benlovell has joined #ruby-lang
18:46
kr3ssh has quit [Ping timeout: 240 seconds]
18:47
j0n3 has quit [Read error: Connection reset by peer]
18:47
datanoise has quit [Ping timeout: 264 seconds]
18:48
j0n3 has joined #ruby-lang
18:48
hagabaka has quit [Ping timeout: 264 seconds]
18:48
tak1n has quit [Ping timeout: 244 seconds]
18:49
tak1n has joined #ruby-lang
18:50
kadoppe has quit [Ping timeout: 264 seconds]
18:51
benlovell has quit [Ping timeout: 264 seconds]
18:51
kadoppe has joined #ruby-lang
18:52
benlovell has joined #ruby-lang
18:54
alestuber has joined #ruby-lang
18:54
atomical has joined #ruby-lang
18:55
kr3ssh has joined #ruby-lang
18:56
benlovell has quit [Ping timeout: 258 seconds]
19:01
tenderlove has joined #ruby-lang
19:07
j4cknewt_ has joined #ruby-lang
19:08
lele is now known as Guest24
19:09
b_hoffman has quit [Quit: b_hoffman]
19:09
skade has quit [Quit: Computer has gone to sleep.]
19:10
skade has joined #ruby-lang
19:10
j4cknewt has quit [Ping timeout: 265 seconds]
19:11
gwendall has joined #ruby-lang
19:12
michaeldeol has joined #ruby-lang
19:12
pwnz0r has joined #ruby-lang
19:13
shinnya has joined #ruby-lang
19:14
GBrawl has quit [Quit: (null)]
19:19
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:21
fluchtreflex has joined #ruby-lang
19:21
fluchtreflex has joined #ruby-lang
19:21
Ilyes512 has joined #ruby-lang
19:22
benlovell has joined #ruby-lang
19:24
atomical has joined #ruby-lang
19:24
<
drbrain >
apeiros: nope
19:25
wallerdev has quit [Quit: wallerdev]
19:26
hakunin has joined #ruby-lang
19:27
benlovell has quit [Ping timeout: 272 seconds]
19:28
gix has quit [Ping timeout: 245 seconds]
19:30
baweaver has quit [Remote host closed the connection]
19:32
gix has joined #ruby-lang
19:34
fusillicode has quit [Quit: Leaving.]
19:34
<
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?
19:34
<
errinlarsen >
(rubiest? ruby-er? what do we call ourselves?!)
19:35
fusillicode has joined #ruby-lang
19:35
<
errinlarsen >
(rubyist?)
19:35
<
alxndr >
errinlarsen: i think Learn Ruby the Hard Way is nice (it's not really hard). for questions, this is a pretty good place
19:36
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:36
caseypatrickdris has joined #ruby-lang
19:37
<
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?
19:38
<
alphemy >
I don't know how to write this kind of for loop in ruby? is there any zip function in ruby?
19:38
baweaver has joined #ruby-lang
19:40
<
errinlarsen >
Ruby prefers iterators over for loops. For example, `%w[a b c d].each { |c| puts c }`
19:40
sandelius has joined #ruby-lang
19:41
<
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?
19:41
skade has quit [Ping timeout: 272 seconds]
19:41
<
baweaver >
>> p 'test'
19:41
<
baweaver >
good good
19:41
caseypatrickdris has quit [Ping timeout: 264 seconds]
19:42
<
baweaver >
>> (1..10).zip('a'..'j')
19:42
<
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)
19:42
<
baweaver >
>> (1..10).zip('a'..'j').to_h
19:42
havenwood has joined #ruby-lang
19:43
<
baweaver >
alphemy: So what exactly is the code in python to do what you're wanting?
19:43
skade has joined #ruby-lang
19:44
fusillicode has quit [Quit: Leaving.]
19:44
datanoise has joined #ruby-lang
19:44
<
baweaver >
Yeah, pretty much just that with zip then, tag a to_h onto it
19:44
fusillicode has joined #ruby-lang
19:44
caseypatrickdris has joined #ruby-lang
19:44
atomical has joined #ruby-lang
19:45
gamename has joined #ruby-lang
19:45
<
baweaver >
>> keywords = %w(foo bar baz bing bash fizz buzz bat); keywords.zip(8..0).to_h
19:45
caseypatrickdris has quit [Read error: Connection reset by peer]
19:45
<
eval-in >
baweaver => {"foo"=>nil, "bar"=>nil, "baz"=>nil, "bing"=>nil, "bash"=>nil, "fizz"=>nil, "buzz"=>nil, "bat"=>nil} (
https://eval.in/368850)
19:45
<
baweaver >
>> keywords = %w(foo bar baz bing bash fizz buzz bat); keywords.zip(0..8).to_h
19:46
caseypatrickdris has joined #ruby-lang
19:46
<
baweaver >
>> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip(0..8.reverse).to_h
19:46
<
baweaver >
>> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip((0..8).reverse).to_h
19:46
Fragus has quit [Quit: Connection closed for inactivity]
19:46
<
baweaver >
>> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).zip((1..8).to_a.reverse).to_h
19:48
<
baweaver >
alphemy: something like that
19:48
<
baweaver >
though that looks like you should be using list comprehensions in python for that anyways.
19:50
<
errinlarsen >
I would do this: `keywords.each_with_index.with_object({}) { |(keyword, index), hsh| hsh[keyword] = index }`
19:50
<
errinlarsen >
… but I always overlook Array#zip with these kinds of things
19:51
<
baweaver >
keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.zip
19:51
<
baweaver >
>> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.zip
19:51
<
eval-in >
baweaver => [[["foo", 0]], [["bar", 1]], [["baz", 2]], [["bing", 3]], [["bash", 4]], [["fizz", 5]], [["buzz", 6]], [["bat", 7]]] (
https://eval.in/368860)
19:51
<
baweaver >
>> keywords = %w(Foo bar Baz bing Bash fizz buzz bat); keywords.map(&:downcase).each_with_index.to_h
19:52
<
errinlarsen >
… yup, and you can wrap that in `Hash()`, I think
19:52
<
errinlarsen >
… oh, or call #to_h, hehe
19:52
g0bl1n has quit [Ping timeout: 255 seconds]
19:52
kr3ssh has quit [Ping timeout: 250 seconds]
19:52
<
baweaver >
Assuming you're using 2.x+
19:52
* baweaver
dislikes using Hash[] for things
19:53
ArchRogem has joined #ruby-lang
20:00
<
alphemy >
I think other way round works a.zip((0...8))
20:00
<
errinlarsen >
well, this works: `(0...8).zip(a).delete_if { |e| e[1].nil? }`, but I feel like there’s a better way.
20:00
<
baweaver >
a.each_with_index.to_h.reject { |k,v| v.nil? }
20:01
<
baweaver >
what happens when there are 9 or 10 or even 100 elements?
20:01
<
alphemy >
in my case max element is 8
20:01
<
baweaver >
and why is your desired output like that?
20:02
<
alphemy >
I am parsing a file
20:02
<
baweaver >
yeah, but that's kinda an odd data structure to make
20:02
<
baweaver >
it'd help if you showed us an example of the actual file and the desired results
20:05
<
baweaver >
otherwise we're guessing blind
20:06
revath has quit [Ping timeout: 245 seconds]
20:06
VinnyBoy has quit [Read error: Connection reset by peer]
20:09
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:10
errinlarsen has quit [Quit: errinlarsen]
20:10
VinnyBoy has joined #ruby-lang
20:11
errinlarsen has joined #ruby-lang
20:13
[spoiler] has quit [Ping timeout: 272 seconds]
20:15
wallerdev has joined #ruby-lang
20:15
revath has joined #ruby-lang
20:16
michaeldeol has quit [Ping timeout: 256 seconds]
20:16
djbkd has quit [Remote host closed the connection]
20:17
michaeldeol has joined #ruby-lang
20:20
atomical has joined #ruby-lang
20:24
datanoise has quit [Ping timeout: 264 seconds]
20:24
b_hoffman has joined #ruby-lang
20:24
baweaver has quit [Remote host closed the connection]
20:25
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:26
hahuang65 has quit [Quit: WeeChat 1.1.1]
20:27
duderonomy has quit [Ping timeout: 256 seconds]
20:28
kr3ssh has joined #ruby-lang
20:29
errinlarsen has quit [Quit: errinlarsen]
20:31
baweaver has joined #ruby-lang
20:31
baweaver has quit [Remote host closed the connection]
20:32
errinlarsen has joined #ruby-lang
20:32
hahuang65 has joined #ruby-lang
20:34
revath has quit [Ping timeout: 264 seconds]
20:35
<
ljarvis >
alphemy: ((0...8).first(a.size)).zip(a)
20:36
Guest24 is now known as lele
20:36
<
ljarvis >
you want to ensure both sides are equal, so make them equal before you zip them
20:37
<
ljarvis >
so you could just do, `0..a.size` or w/e
20:37
leat1 has quit [Ping timeout: 256 seconds]
20:38
<
ljarvis >
>> a = {one: 1, two: 2}; a.size.times.zip(a)
20:38
Fooster has quit [Remote host closed the connection]
20:40
[spoiler] has joined #ruby-lang
20:40
gambl0re has quit [Ping timeout: 240 seconds]
20:41
gamename has quit []
20:41
gianlucadv has quit [Ping timeout: 264 seconds]
20:42
k3asd` has joined #ruby-lang
20:43
baweaver has joined #ruby-lang
20:43
yalue has quit [Quit: return 0;]
20:45
<
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
20:48
<
ljarvis >
alphemy: you have a mix of tabs and spaces
20:50
alphemy has quit [Ping timeout: 246 seconds]
20:51
j4cknewt has joined #ruby-lang
20:52
kr3ssh has quit [Ping timeout: 264 seconds]
20:52
djbkd has joined #ruby-lang
20:52
alphemy has joined #ruby-lang
20:52
<
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
20:53
<
ljarvis >
alphemy: you have a mix of tabs and spaces
20:53
<
ljarvis >
at least I only had to press up
20:53
<
alphemy >
ljarvis: where?
20:53
<
ljarvis >
alphemy: line 52
20:54
j4cknewt_ has quit [Ping timeout: 256 seconds]
20:55
<
ljarvis >
so yeah, use a better editor
20:55
djbkd has quit [Remote host closed the connection]
20:55
djbkd has joined #ruby-lang
20:57
errinlarsen has quit [Quit: errinlarsen]
20:58
_ht has quit [Quit: Konversation terminated!]
20:58
Apomelasma has joined #ruby-lang
20:59
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:59
ttilley has quit [Disconnected by services]
20:59
Apomelasma has quit [Client Quit]
21:00
<
alphemy >
ljarvis: I can't see that video it's blocked. I don't know how to fix this problem
21:00
ttilley has joined #ruby-lang
21:00
<
alphemy >
I can't see extra spaces
21:00
baweaver has quit [Remote host closed the connection]
21:00
<
ljarvis >
alphemy: delete all of the characters on line 52, because there are spaces near the beginning of the line
21:00
<
ljarvis >
then throw your text editor in the trash because it's shit
21:00
ttilley has quit [Changing host]
21:00
ttilley has joined #ruby-lang
21:03
<
alphemy >
ljarvis: which editor are you using?
21:03
<
ljarvis >
alphemy: I use vim
21:04
<
alphemy >
can you correct it and paste it somewhere here ideone.com
21:04
joaomdmoura has quit [Remote host closed the connection]
21:04
<
darix >
that reminds me ... time to update the neovim package
21:05
joaomdmoura has joined #ruby-lang
21:09
b_hoffman has quit [Quit: b_hoffman]
21:10
joaomdmoura has quit [Ping timeout: 252 seconds]
21:13
<
alphemy >
sort function can be used.
21:13
gwendall has quit [Remote host closed the connection]
21:14
<
alphemy >
but is there any parameter which tells how to sort
21:14
<
alphemy >
moreover it should be in reverse order
21:14
sarkyniin has joined #ruby-lang
21:14
<
ljarvis >
alphemy: use sort_by or check out the Enumerable mixin
21:14
gamename has joined #ruby-lang
21:15
<
darix >
alphemy: listofpagethingies.sort {|a,b| a.pageid <=> b.pageid }
21:15
<
ljarvis >
oops i meant Comparable mixin
21:15
<
ljarvis >
which does what darix said
21:15
<
darix >
ljarvis: sort_by better than sort with block?
21:15
<
ljarvis >
not really but shorter
21:15
ldnunes has quit [Quit: Leaving]
21:16
<
alphemy >
what about revere order
21:16
<
ljarvis >
or just implement <=> on the obj and include Comparable
21:16
<
ljarvis >
for the wins
21:16
<
alphemy >
I mean in decreasing order
21:16
<
ljarvis >
well you sort it, then .reverse it
21:17
<
darix >
ljarvis: easier
21:17
<
darix >
alphemy: listofpagethingies.sort {|a,b| b.pageid <=> a.pageid }
21:17
<
darix >
notice something?
21:18
iamninja has quit [Read error: Connection reset by peer]
21:19
iamninja has joined #ruby-lang
21:21
zendrix has joined #ruby-lang
21:23
alestuber has quit [Ping timeout: 250 seconds]
21:33
alestuber has joined #ruby-lang
21:35
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:35
baweaver has joined #ruby-lang
21:35
<
zenspider >
listofpagethingies.sort_by { |p| -p.pageid }
21:36
fluchtreflex has quit [Read error: Connection reset by peer]
21:36
j4cknewt has quit [Read error: Connection reset by peer]
21:37
pwnz0r has quit [Remote host closed the connection]
21:38
j4cknewt has joined #ruby-lang
21:42
tenderlove has quit [Ping timeout: 245 seconds]
21:42
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:43
kstuart has quit [Quit: WeeChat 1.1.1]
21:44
tenderlove has joined #ruby-lang
21:47
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:47
ttilley has quit [Quit: Leaving...]
21:49
benlovell has joined #ruby-lang
21:54
benlovell has quit [Ping timeout: 246 seconds]
21:55
DLSteve has quit [Quit: Leaving]
21:59
caseypat_ has joined #ruby-lang
22:01
imperator2 has quit [Quit: Valete!]
22:01
whippythellama has quit [Quit: whippythellama]
22:01
wallerdev has quit [Quit: wallerdev]
22:02
j4cknewt has quit [Remote host closed the connection]
22:02
caseypatrickdris has quit [Ping timeout: 256 seconds]
22:03
j4cknewt has joined #ruby-lang
22:05
caseypat_ has quit [Read error: Connection reset by peer]
22:05
caseypatrickdris has joined #ruby-lang
22:08
j4cknewt_ has joined #ruby-lang
22:09
datanois1 has joined #ruby-lang
22:11
zendrix has quit [Remote host closed the connection]
22:11
chouhoulis has quit [Ping timeout: 256 seconds]
22:12
j4cknewt has quit [Ping timeout: 265 seconds]
22:12
alestuber has quit [Remote host closed the connection]
22:14
datanois1 has quit [Ping timeout: 272 seconds]
22:15
arBmind1 has joined #ruby-lang
22:16
arBmind has quit [Ping timeout: 246 seconds]
22:17
zendrix has joined #ruby-lang
22:19
skade has quit [Quit: Computer has gone to sleep.]
22:19
k3asd` has quit [Ping timeout: 244 seconds]
22:20
kr3ssh has joined #ruby-lang
22:24
baweaver has quit [Remote host closed the connection]
22:24
hinbody has quit [Quit: leaving]
22:24
gwendall has joined #ruby-lang
22:25
bin7me has quit [Read error: Connection reset by peer]
22:26
gambl0re has joined #ruby-lang
22:27
wallerdev has joined #ruby-lang
22:29
gwendall has quit [Ping timeout: 272 seconds]
22:35
arBmind has joined #ruby-lang
22:35
arBmind1 has quit [Ping timeout: 264 seconds]
22:35
caseypatrickdris has quit [Remote host closed the connection]
22:39
baweaver has joined #ruby-lang
22:41
datanois1 has joined #ruby-lang
22:46
car has joined #ruby-lang
22:48
rcvalle has quit [Quit: rcvalle]
22:52
havenwood has quit [Ping timeout: 252 seconds]
22:52
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:59
Forgetful_Lion has joined #ruby-lang
23:02
<
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?
23:02
<
darix >
alphemy: no idea
23:07
BanzaiJoe has quit [Ping timeout: 264 seconds]
23:07
<
zenspider >
alphemy: well... think about it. <=> returns 0 if equal, -1 if LHS < RHS, and 1 if LHS > RHS.
23:11
<
alphemy >
zenspider: so? how to do it?
23:11
<
apeiros >
alphemy: you return -1 on equality
23:11
<
apeiros >
indicating that LHS < RHS, so it stays on the LHS
23:12
<
zenspider >
alphemy:
*sigh*
23:12
<
zenspider >
so much for thinking about it...
23:12
<
apeiros >
zenspider: is sort guaranteed to yield LHS as first argument? I actually never verified that…
23:13
<
apeiros >
(docs don't say)
23:13
<
zenspider >
I'm currently a bit fuzzy brained (nose deep in ruby_parser)... but I thought sort was stable and sort_by not
23:14
<
apeiros >
afaik sort is not guaranteed to be stable. it depends on qsort being stable. which in turn is not guaranteed to be.
23:15
<
zenspider >
some minor googling says you are correct sir
23:15
<
zenspider >
8thlight has a nice blog entry on it
23:18
kr3ssh has quit [Ping timeout: 245 seconds]
23:21
poikon has quit [Ping timeout: 276 seconds]
23:22
<
alphemy >
I am new to ruby can you help me in making that sort stable?
23:22
avdi has quit [Ping timeout: 272 seconds]
23:22
zzak has quit [Ping timeout: 276 seconds]
23:23
j4cknewt_ has quit [Read error: Connection reset by peer]
23:24
j4cknewt has joined #ruby-lang
23:25
zzak has joined #ruby-lang
23:25
poikon has joined #ruby-lang
23:26
<
jhass >
not very efficient, but map.with_index.sort_by {|page, i| [page.pageid, i] } should work
23:26
avdi has joined #ruby-lang
23:26
<
jhass >
(.map(&:last))
23:27
<
jhass >
eh, &:first
23:27
havenwood has joined #ruby-lang
23:27
rubyaw has joined #ruby-lang
23:28
houhoulis has joined #ruby-lang
23:29
chouhoulis has joined #ruby-lang
23:29
<
baweaver >
Oh hey, avdi is on. Been a while since I've seen him on IRC.
23:31
shadowvengence22 has joined #ruby-lang
23:33
houhoulis has quit [Ping timeout: 265 seconds]
23:34
sarkyniin has quit [Remote host closed the connection]
23:36
<
baweaver >
Ah just saying hi, rare to see you on.
23:36
<
avdi >
I'm always here. Not always paying attention :-)
23:36
<
baweaver >
Ha, fair enough. How are Tapas going?
23:37
* baweaver
needs to catch up on them
23:37
<
avdi >
I need to catch up too. I wonder what I'm talking about lately?
23:37
kfpratt has quit [Remote host closed the connection]
23:37
<
baweaver >
Admittedly I found it amusing seeing Avdi, Head Chef at Ruby Tapas in R4 test prescriptions
23:37
kfpratt has joined #ruby-lang
23:38
kfpratt has quit [Remote host closed the connection]
23:38
<
avdi >
Today I did some research about shunting logging into a low priority thread, think I'll write that episode tomorrow
23:39
<
baweaver >
If nothing else, Enumerable is a safe bet for a lot of content
23:39
<
avdi >
Hahaha yeah, don't tell anyone my secret for when I'm pressed for time
23:40
<
baweaver >
Could always have some fun around TCO as well for compiler flags
23:40
<
avdi >
People dig those eps though. It's one thing to know a methos exists, another to see it applied.
23:41
<
avdi >
Haha, yeah, that one I'm saving for a rainy day
23:41
<
baweaver >
Yeah, getting a good handle on reduce can make for a lot of power
23:41
<
baweaver >
If you want to really have fun you can play at monads with them too
23:42
<
baweaver >
collection.reduce({acc: 0, last: 5}) { |state, i| ...
23:42
<
baweaver >
though that does nightmares to GC after a while
23:43
<
baweaver >
Enumerator is a bit of fun too
23:44
<
baweaver >
>> p2s = Enumerator.new do |y| x=2; loop do y<<x; x = x << 1; end end; p2s.first(5)
23:46
zendrix has quit [Remote host closed the connection]
23:47
zendrix has joined #ruby-lang
23:57
zendrix has quit [Ping timeout: 252 seconds]
23:58
benlovell has joined #ruby-lang
23:59
wallerdev has quit [Ping timeout: 246 seconds]