00:01
<
zenspider >
return data.keys, data.values OR return data.to_a.transpose
00:03
<
ari-_-e >
won't somebody please think of the implicit returns!
00:07
frobrob has joined #ruby-lang
00:09
ddv has quit [Ping timeout: 245 seconds]
00:15
ddv has joined #ruby-lang
00:15
jsullivandigs has quit [Ping timeout: 264 seconds]
00:15
ur5us has quit [Remote host closed the connection]
00:18
marr has quit [Ping timeout: 240 seconds]
00:19
nathanstitt has quit [Quit: I growing sleepy]
00:20
yubrew has joined #ruby-lang
00:24
yubrew has quit [Ping timeout: 240 seconds]
00:24
brianpWins has joined #ruby-lang
00:24
x0f has quit [Ping timeout: 255 seconds]
00:25
shinnya has quit [Ping timeout: 252 seconds]
00:26
x0f has joined #ruby-lang
00:26
frobrob has quit [Ping timeout: 245 seconds]
00:27
shinnya has joined #ruby-lang
00:38
<
zenspider >
if he wasn't a complete newb, maybe
00:38
x0f has quit [Ping timeout: 264 seconds]
00:39
x0f has joined #ruby-lang
00:39
<
ari-_-e >
WON'T SOMEBODY THINK OF THE NEWBS
00:45
shinnya has quit [Ping timeout: 252 seconds]
00:50
mikecmpbll has quit [Quit: i've nodded off.]
00:53
doitjay has quit [Quit: Leaving]
00:58
x0f has quit [Ping timeout: 240 seconds]
01:00
ta has joined #ruby-lang
01:02
ta_ has quit [Ping timeout: 252 seconds]
01:02
sepp2k has quit [Read error: Connection reset by peer]
01:03
x0f has joined #ruby-lang
01:09
yugui_zzz is now known as yugui
01:13
rue has joined #ruby-lang
01:14
yubrew has joined #ruby-lang
01:14
toastynerd has quit [Remote host closed the connection]
01:18
yubrew has quit [Ping timeout: 240 seconds]
01:22
x0f has quit [Ping timeout: 265 seconds]
01:23
x0f has joined #ruby-lang
01:24
frzng has quit [Quit: frzng]
01:27
ur5us has joined #ruby-lang
01:32
ur5us has quit [Ping timeout: 260 seconds]
01:34
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
01:36
mykoweb has joined #ruby-lang
01:40
Burgestrand has quit [Quit: Burgestrand]
01:43
yugui is now known as yugui_zzz
01:43
centrx has joined #ruby-lang
01:44
mykoweb has quit [Remote host closed the connection]
01:44
mykoweb has joined #ruby-lang
01:46
centrx has quit [Client Quit]
01:46
lianj has quit [Ping timeout: 252 seconds]
01:47
floyd2_ has quit [Ping timeout: 252 seconds]
01:49
mykoweb has quit [Ping timeout: 255 seconds]
01:52
lianj has joined #ruby-lang
01:52
floyd2 has joined #ruby-lang
02:00
diegoviola has joined #ruby-lang
02:01
x0f has quit [Ping timeout: 252 seconds]
02:02
x0f has joined #ruby-lang
02:03
diegoviola has quit [Changing host]
02:03
diegoviola has joined #ruby-lang
02:08
yubrew has joined #ruby-lang
02:08
jxie_ has quit [Ping timeout: 240 seconds]
02:08
mistym has joined #ruby-lang
02:09
x0f has quit [Ping timeout: 240 seconds]
02:09
taylorrf has joined #ruby-lang
02:10
x0f has joined #ruby-lang
02:10
jxie has joined #ruby-lang
02:12
yubrew has quit [Ping timeout: 264 seconds]
02:13
dexter_ has joined #ruby-lang
02:14
Miphix has joined #ruby-lang
02:15
arBmind has joined #ruby-lang
02:15
toastynerd has joined #ruby-lang
02:19
Coincidental has quit [Remote host closed the connection]
02:19
toastynerd has quit [Ping timeout: 245 seconds]
02:22
havenwood has joined #ruby-lang
02:24
dingus_khan has joined #ruby-lang
02:26
gix has quit [Ping timeout: 255 seconds]
02:29
arBmind has quit [Quit: Leaving.]
02:30
gix has joined #ruby-lang
02:30
tylersmith has quit [Remote host closed the connection]
02:32
dingus_khan has quit [Remote host closed the connection]
02:33
tkuchiki has joined #ruby-lang
02:36
brianpWins has quit [Quit: brianpWins]
02:36
charliesome has joined #ruby-lang
02:42
alexju has joined #ruby-lang
02:49
nathanstitt has joined #ruby-lang
02:53
x0f has quit [Ping timeout: 265 seconds]
02:54
x0f has joined #ruby-lang
02:55
momomomomo has quit [Quit: momomomomo]
02:57
toastynerd has joined #ruby-lang
02:57
mehlah has quit [Quit: Leaving...]
03:00
diegoviola has quit [Remote host closed the connection]
03:02
toastynerd has quit [Ping timeout: 240 seconds]
03:02
yubrew has joined #ruby-lang
03:04
x0f has quit [Ping timeout: 255 seconds]
03:04
yugui_zzz is now known as yugui
03:04
x0f has joined #ruby-lang
03:05
yugui is now known as yugui_zzz
03:07
yubrew has quit [Ping timeout: 264 seconds]
03:13
shinnya has joined #ruby-lang
03:15
dingus_khan has joined #ruby-lang
03:18
dexter_ has quit [Ping timeout: 245 seconds]
03:21
taylorrf has quit []
03:22
stayarrr has joined #ruby-lang
03:24
dingus_khan has quit [Remote host closed the connection]
03:29
brianpWins has joined #ruby-lang
03:30
x0f has quit [Ping timeout: 245 seconds]
03:31
x0f has joined #ruby-lang
03:38
jxie has quit [Ping timeout: 255 seconds]
03:38
x0f has quit [Ping timeout: 265 seconds]
03:39
x0f has joined #ruby-lang
03:39
doitjay has joined #ruby-lang
03:40
jxie has joined #ruby-lang
03:48
x0f has quit [Ping timeout: 260 seconds]
03:48
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
03:49
x0f has joined #ruby-lang
03:50
djbkd has quit [Remote host closed the connection]
03:51
tylersmith has joined #ruby-lang
03:54
doitjay has quit [Ping timeout: 240 seconds]
03:54
ur5us has joined #ruby-lang
03:56
yubrew has joined #ruby-lang
03:58
toastynerd has joined #ruby-lang
04:01
yubrew has quit [Ping timeout: 260 seconds]
04:03
toastynerd has quit [Ping timeout: 260 seconds]
04:05
dexter_ has joined #ruby-lang
04:26
x0f has quit [Ping timeout: 240 seconds]
04:27
lsegal` has joined #ruby-lang
04:30
lsegal has quit [Write error: Connection reset by peer]
04:30
nathanstitt has quit [Quit: I growing sleepy]
04:32
x0f has joined #ruby-lang
04:39
sheperson has joined #ruby-lang
04:39
sheperson has quit [Client Quit]
04:39
lolmaus has quit [Excess Flood]
04:39
PSU_Boss has quit [Excess Flood]
04:39
lolmaus has joined #ruby-lang
04:40
PSU_Boss has joined #ruby-lang
04:40
PSU_Boss has joined #ruby-lang
04:40
PSU_Boss has quit [Changing host]
04:40
diegoviola has joined #ruby-lang
04:42
toastynerd has joined #ruby-lang
04:43
yugui_zzz is now known as yugui
04:48
toastynerd has quit [Remote host closed the connection]
04:49
noob101 has joined #ruby-lang
04:50
<
noob101 >
Hello. I am new to this channel.
04:50
starbucks has quit [Read error: Connection reset by peer]
04:51
yubrew has joined #ruby-lang
04:51
starbucks has joined #ruby-lang
04:53
dexter_ has quit [Ping timeout: 255 seconds]
04:55
yubrew has quit [Ping timeout: 240 seconds]
04:56
closer has quit [Ping timeout: 245 seconds]
04:56
yugui is now known as yugui_zzz
04:56
yugui_zzz is now known as yugui
04:57
yugui is now known as yugui_zzz
04:58
closer has joined #ruby-lang
04:58
alexju has quit [Remote host closed the connection]
05:00
starbucks has quit [Remote host closed the connection]
05:02
yugui_zzz is now known as yugui
05:02
dexter_ has joined #ruby-lang
05:04
wallerdev has joined #ruby-lang
05:07
<
Senjai >
noob101: hi
05:13
toastynerd has joined #ruby-lang
05:14
toastynerd has quit [Remote host closed the connection]
05:20
_JokerDoom has quit [Read error: Connection reset by peer]
05:24
alexju has joined #ruby-lang
05:25
JokerDoom has joined #ruby-lang
05:33
pixelhandler has joined #ruby-lang
05:33
x0f has quit [Ping timeout: 252 seconds]
05:35
x0f has joined #ruby-lang
05:36
sheperson has joined #ruby-lang
05:44
yugui is now known as yugui_zzz
05:44
yubrew has joined #ruby-lang
05:46
pixelhandler has left #ruby-lang [#ruby-lang]
05:46
<
noob101 >
Senjai: Hello
05:49
yubrew has quit [Ping timeout: 255 seconds]
05:52
<
zenspider >
well that's exciting
05:52
toastynerd has joined #ruby-lang
05:57
mistym has quit [Remote host closed the connection]
06:01
yugui_zzz is now known as yugui
06:01
yugui is now known as yugui_zzz
06:01
yugui_zzz is now known as yugui
06:07
tbuehlmann has joined #ruby-lang
06:12
yugui is now known as yugui_zzz
06:12
dexter_ has quit [Ping timeout: 260 seconds]
06:24
ur5us has quit [Remote host closed the connection]
06:29
dexter_ has joined #ruby-lang
06:38
_ht has joined #ruby-lang
06:38
mistym has joined #ruby-lang
06:39
yubrew has joined #ruby-lang
06:39
houhoulis has quit [Remote host closed the connection]
06:40
dexter_ has quit [Ping timeout: 240 seconds]
06:43
GaelanAintAround has quit [Ping timeout: 276 seconds]
06:43
yubrew has quit [Ping timeout: 240 seconds]
06:43
zz_dlu has quit [Ping timeout: 260 seconds]
06:47
zz_dlu has joined #ruby-lang
06:49
GaelanAintAround has joined #ruby-lang
06:51
relix has joined #ruby-lang
06:53
toastynerd has quit []
06:57
dexter_ has joined #ruby-lang
07:06
Raycaster has joined #ruby-lang
07:08
Raycaster has quit [Client Quit]
07:15
phansch has joined #ruby-lang
07:16
symm- has quit [Ping timeout: 260 seconds]
07:18
dexter_ has quit [Ping timeout: 264 seconds]
07:19
wallerdev has quit [Quit: wallerdev]
07:26
yatish27 has joined #ruby-lang
07:33
yubrew has joined #ruby-lang
07:34
ur5us has joined #ruby-lang
07:35
djbkd has joined #ruby-lang
07:37
yubrew has quit [Ping timeout: 240 seconds]
07:39
ur5us has quit [Ping timeout: 264 seconds]
07:40
djbkd has quit [Ping timeout: 252 seconds]
07:44
BucOder has joined #ruby-lang
07:51
mistym has quit [Remote host closed the connection]
07:51
rippa has joined #ruby-lang
07:51
mistym has joined #ruby-lang
08:05
diegoviola has quit [Quit: WeeChat 0.4.3]
08:05
alexju has quit [Remote host closed the connection]
08:08
tylersmith has quit [Remote host closed the connection]
08:09
tylersmith has joined #ruby-lang
08:11
sarkyniin has joined #ruby-lang
08:13
tylersmith has quit [Ping timeout: 240 seconds]
08:27
yubrew has joined #ruby-lang
08:28
Atttwww has quit [Ping timeout: 252 seconds]
08:31
yubrew has quit [Ping timeout: 240 seconds]
08:37
djbkd has joined #ruby-lang
08:41
sheperson has quit [Read error: No route to host]
08:41
djbkd has quit [Ping timeout: 252 seconds]
08:47
BucOder has quit [Quit: Computer has gone to sleep.]
08:48
x0f has quit [Ping timeout: 265 seconds]
08:49
x0f has joined #ruby-lang
08:53
mistym has quit [Remote host closed the connection]
09:02
ledestin has quit [Quit: ledestin]
09:05
yatish27 has quit [Ping timeout: 240 seconds]
09:05
mistym has joined #ruby-lang
09:10
stamina has joined #ruby-lang
09:16
yatish27 has joined #ruby-lang
09:20
mistym has quit [Remote host closed the connection]
09:20
frosgy has joined #ruby-lang
09:21
yubrew has joined #ruby-lang
09:22
mistym has joined #ruby-lang
09:23
tbuehlmann has quit [Remote host closed the connection]
09:23
frogssgy has quit [Ping timeout: 240 seconds]
09:23
junkmechanic_ has quit [Ping timeout: 264 seconds]
09:26
yubrew has quit [Ping timeout: 252 seconds]
09:31
mikecmpbll has joined #ruby-lang
09:39
jhass|off is now known as jhass
09:39
VTLob has joined #ruby-lang
09:40
mistym has quit [Remote host closed the connection]
10:00
sheperson has joined #ruby-lang
10:02
mikecmpbll has quit [Quit: i've nodded off.]
10:03
mikecmpbll has joined #ruby-lang
10:07
lsegal` has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
10:15
yubrew has joined #ruby-lang
10:20
yubrew has quit [Ping timeout: 252 seconds]
10:26
x0f has quit [Ping timeout: 264 seconds]
10:27
x0f has joined #ruby-lang
10:37
yatish27 has quit [Remote host closed the connection]
10:38
djbkd has joined #ruby-lang
10:42
djbkd has quit [Ping timeout: 264 seconds]
10:46
sheperson has quit [Ping timeout: 260 seconds]
10:47
sheperson has joined #ruby-lang
10:51
sarkyniin has quit [Quit: Quitte]
10:54
stamina has quit [Ping timeout: 252 seconds]
10:57
sheperson has quit [Ping timeout: 252 seconds]
10:58
sheperson has joined #ruby-lang
11:01
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:09
yubrew has joined #ruby-lang
11:14
yubrew has quit [Ping timeout: 240 seconds]
11:24
cnivolle has joined #ruby-lang
11:39
djbkd has joined #ruby-lang
11:44
frzng has joined #ruby-lang
11:44
djbkd has quit [Ping timeout: 276 seconds]
11:46
stamina has joined #ruby-lang
12:00
arBmind has joined #ruby-lang
12:04
yubrew has joined #ruby-lang
12:05
sepp2k has joined #ruby-lang
12:06
GBrawl has joined #ruby-lang
12:08
BucOder has joined #ruby-lang
12:08
yubrew has quit [Ping timeout: 252 seconds]
12:12
havenwood has quit [Remote host closed the connection]
12:13
havenwood has joined #ruby-lang
12:13
arBmind has quit [Quit: Leaving.]
12:15
x0f has quit [Ping timeout: 260 seconds]
12:15
x0f has joined #ruby-lang
12:16
ikrima has joined #ruby-lang
12:18
havenwood has quit [Ping timeout: 272 seconds]
12:19
shinnya has quit [Ping timeout: 252 seconds]
12:20
matp has quit [Remote host closed the connection]
12:20
x0f has quit [Ping timeout: 276 seconds]
12:24
shinnya has joined #ruby-lang
12:25
x0f has joined #ruby-lang
12:25
mikecmpbll has quit [Quit: i've nodded off.]
12:26
banister has joined #ruby-lang
12:27
matp has joined #ruby-lang
12:28
phansch has quit [Quit: WeeChat 0.4.3]
12:30
havenwood has joined #ruby-lang
12:30
frzng has quit [Quit: frzng]
12:31
stamina has quit [Ping timeout: 252 seconds]
12:33
cnivolle has quit []
12:35
x0f has quit [Ping timeout: 264 seconds]
12:36
x0f has joined #ruby-lang
12:37
thomasxie has joined #ruby-lang
12:38
mehlah has joined #ruby-lang
12:42
nofxx has joined #ruby-lang
12:47
Cakey has joined #ruby-lang
12:47
Miphix has quit [Read error: Connection reset by peer]
12:47
yfeldblu_ has quit [Remote host closed the connection]
12:47
Miphix has joined #ruby-lang
12:50
stamina has joined #ruby-lang
12:54
Miphix has quit [Quit: Leaving]
12:58
yubrew has joined #ruby-lang
12:59
sheperson has quit [Ping timeout: 252 seconds]
13:00
sheperson has joined #ruby-lang
13:02
yubrew has quit [Ping timeout: 276 seconds]
13:03
frzng has joined #ruby-lang
13:07
Miphix has joined #ruby-lang
13:08
Cakey has quit [Ping timeout: 252 seconds]
13:12
sheperson has quit [Ping timeout: 255 seconds]
13:13
sheperson has joined #ruby-lang
13:16
sheperson has quit [Client Quit]
13:18
yfeldblum has joined #ruby-lang
13:23
yfeldblum has quit [Ping timeout: 264 seconds]
13:36
GBrawl has quit [Quit: Computer has gone to sleep.]
13:37
BucOder has quit [Quit: Computer has gone to sleep.]
13:41
devgiant has joined #ruby-lang
13:43
lds has joined #ruby-lang
13:43
thomasxie has quit [Quit: Leaving.]
13:43
GBrawl has joined #ruby-lang
13:43
stamina has quit [Ping timeout: 252 seconds]
13:44
junkmechanic_ has joined #ruby-lang
13:46
BucOder has joined #ruby-lang
13:48
thomasxie has joined #ruby-lang
13:52
yubrew has joined #ruby-lang
13:56
devgiant has quit [Quit: Leaving]
13:56
yubrew has quit [Ping timeout: 252 seconds]
13:58
x0f has quit [Ping timeout: 245 seconds]
13:58
yatish27 has joined #ruby-lang
13:58
nofxx has quit [Ping timeout: 245 seconds]
13:59
x0f has joined #ruby-lang
14:00
bahar has joined #ruby-lang
14:01
bahar has quit [Changing host]
14:01
bahar has joined #ruby-lang
14:04
Rickmasta has quit [Ping timeout: 276 seconds]
14:05
Miphix has quit [Quit: Leaving]
14:06
x0f has quit [Ping timeout: 252 seconds]
14:06
x0f has joined #ruby-lang
14:11
wm3|away has joined #ruby-lang
14:12
Miphix has joined #ruby-lang
14:14
GBrawl_ has joined #ruby-lang
14:14
yfeldblum has joined #ruby-lang
14:14
Rickmasta has joined #ruby-lang
14:15
nofxx has joined #ruby-lang
14:15
Miphix has quit [Client Quit]
14:15
chris123456789 has joined #ruby-lang
14:16
GBrawl has quit [Ping timeout: 265 seconds]
14:19
yfeldblum has quit [Ping timeout: 260 seconds]
14:20
havenwood has quit [Remote host closed the connection]
14:22
havenwood has joined #ruby-lang
14:22
thomasxie has quit [Quit: Leaving.]
14:22
momomomomo has joined #ruby-lang
14:28
thomasxie has joined #ruby-lang
14:29
thomasxie has quit [Remote host closed the connection]
14:30
ari-_-e has quit [Ping timeout: 252 seconds]
14:30
yatish27 has quit [Remote host closed the connection]
14:31
yatish27 has joined #ruby-lang
14:31
ari-_-e has joined #ruby-lang
14:32
frzng has quit [Quit: frzng]
14:33
Miphix has joined #ruby-lang
14:35
yatish27 has quit [Ping timeout: 252 seconds]
14:40
yatish27 has joined #ruby-lang
14:41
djbkd has joined #ruby-lang
14:45
djbkd has quit [Ping timeout: 240 seconds]
14:46
frzng has joined #ruby-lang
14:46
yubrew has joined #ruby-lang
14:49
yatish27 has quit [Remote host closed the connection]
14:50
yubrew has quit [Ping timeout: 240 seconds]
14:51
cored has joined #ruby-lang
14:51
cored has quit [Changing host]
14:51
cored has joined #ruby-lang
14:51
BucOder has quit [Quit: Computer has gone to sleep.]
14:54
nertzy has joined #ruby-lang
14:58
chris123456789 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
14:58
gjaldon has joined #ruby-lang
15:01
<
gjaldon >
hi there. does anyone here have an idea on what's a good os project to read and maybe contribute to to learn about socket programming?
15:01
olivererxleben has joined #ruby-lang
15:03
yatish27 has joined #ruby-lang
15:03
stayarrr has quit [Ping timeout: 276 seconds]
15:05
yatish27 has quit [Remote host closed the connection]
15:05
yatish27 has joined #ruby-lang
15:08
yatish27_ has joined #ruby-lang
15:08
yfeldblum has joined #ruby-lang
15:09
wm3|away has quit [Ping timeout: 265 seconds]
15:09
yatish27 has quit [Read error: Connection reset by peer]
15:13
yfeldblum has quit [Ping timeout: 240 seconds]
15:18
shinnya has quit [Ping timeout: 252 seconds]
15:20
frzng has quit [Quit: frzng]
15:24
mikecmpbll has joined #ruby-lang
15:25
starbucks has joined #ruby-lang
15:25
Mon_Ouie has quit [Ping timeout: 265 seconds]
15:30
benlovell has joined #ruby-lang
15:34
gjaldon has quit []
15:35
doitjay has joined #ruby-lang
15:37
roelof has joined #ruby-lang
15:37
<
roelof >
any news on the ruby talk ML . the spam seems to be stopped
15:40
yubrew has joined #ruby-lang
15:42
djbkd has joined #ruby-lang
15:43
vlad_starkov has joined #ruby-lang
15:45
yubrew has quit [Ping timeout: 255 seconds]
15:45
<
havenwood >
roelof: `('a'..'z').each do |letter|` or `'a'.upto('z') do |letter|`
15:45
<
roelof >
havenwood: oke, and the if then is good or can I better make a ternary of it ?
15:46
djbkd has quit [Ping timeout: 252 seconds]
15:47
yatish27_ has quit [Remote host closed the connection]
15:48
yatish27 has joined #ruby-lang
15:48
<
havenwood >
roelof: block arg needs starting and ending pipe `|letter|`
15:49
yatish27 has quit [Read error: Connection reset by peer]
15:49
yatish27_ has joined #ruby-lang
15:50
<
havenwood >
roelof: you really want to have `answer` be a String full of 1s and 0s? no need to downcase `letter` since you know it's already downcased
15:51
<
havenwood >
oh, you actually do, heh
15:51
<
havenwood >
roelof: you can write `answer += "1"` instead of `answer = answer + "1"`
15:52
<
roelof >
havenwood: I did change it but still got this annoying error message
15:54
<
havenwood >
>> a = 'coffee'; 'a'.upto('z').map { |letter| a.downcase.include?(letter) ? '1' : '0' }.join
15:55
<
havenwood >
roelof: looks like that ^ gives expected output
15:57
<
roelof >
that one passes also here It seems there is a difference between map and each
15:58
<
havenwood >
roelof: i just used #map instead of assigning a variable to a String and then populating the String while iterating with #each
15:59
<
roelof >
oke, in the first you used each to iterate and it fails here.
15:59
<
roelof >
havenwood: sometimes ruby is wierd
16:01
<
havenwood >
roelof: instead of `alphabet = ''; ('a'..'z').each { |char| alphabet << char.something }; alphabet` you can `('a'..'z').map { |char| char.something }.join`
16:02
<
roelof >
thanks, I still have to figure out when to use each and when to use map
16:02
yfeldblum has joined #ruby-lang
16:02
<
roelof >
As a beginner I found this confusing
16:06
yfeldblum has quit [Ping timeout: 245 seconds]
16:09
wallerdev has joined #ruby-lang
16:10
benlovell has quit [Ping timeout: 276 seconds]
16:11
nertzy has quit [Quit: This computer has gone to sleep]
16:19
xcesariox has joined #ruby-lang
16:21
<
Spaceghostc2c >
roelof: #each is for doing something to something enumberable, most often it returns the last thing evaluated in the loop. map is for returning a collection of the last things evaluated in the same kind of loop as seen in #each.
16:22
Johz has joined #ruby-lang
16:22
<
roelof >
Spaceghostc2c: thanks for the explanation
16:24
ascarter has joined #ruby-lang
16:26
<
roelof >
another question : if I have two time instances and I want to know the difference why can I do end_time - begin_time ?
16:27
<
roelof >
According to the time manual it schould be possible
16:27
havenwood has quit [Ping timeout: 272 seconds]
16:27
havenn has joined #ruby-lang
16:32
<
roelof >
it good. I tried another time and it works.
16:32
roelof has quit [Quit: Page closed]
16:38
doitjay has quit [Quit: Leaving]
16:42
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:48
Atttwww has joined #ruby-lang
16:50
mustmodify has joined #ruby-lang
16:50
mykoweb has joined #ruby-lang
16:50
<
mustmodify >
I'm implementing a middleware stack based on Rack. I'm struggling with a yield-context issue. I'm boiled my problem down to this gist... can someone explain to me why the context inside the 'middleware' block on lines 31 to 33 is X.new rather than MiddlewareBuilder.new?
https://gist.github.com/mustmodify/49de9eebec34e85e7720
16:52
<
jhass >
because a blocks scope is defined by where it's defined, not where it's executed
16:53
<
jhass >
if you want to change the scope a block is executed in, pass it to instance_exec/instance_eval/class_eval
16:53
<
Spaceghostc2c >
Well, I think you can also change the binding, yeah?
16:53
<
mustmodify >
so if I want a DSL, I have to use something like middleware do |builder| ?
16:54
<
jhass >
yielding builder is one approach, instance_eval'ing the block is another
16:54
<
jhass >
I've seen both almost equally in the wild, maybe a slight tendency towards yielding self
16:56
<
mustmodify >
jhass: Hm... I hadn't seen instance_exec before. I think I prefer not to pass in a builder... not sure why but it seems cleaner. Though actually I guess it might be really confusing to a new dev.
16:56
<
mustmodify >
But then this whole thing would baffle a new dev, so that may be moot.
16:56
yfeldblum has joined #ruby-lang
16:57
<
Spaceghostc2c >
jhass: I've also seen changing the actual binding.
16:57
<
mustmodify >
Spaceghostc2c: tell me about that.
16:58
<
jhass >
changing the binding is only useful if you have no direct access to the target scope
16:58
<
jhass >
(which you do)
17:01
<
Spaceghostc2c >
jhass: I mean, we are talking about some fun tools to do some good metabrogramming.
17:01
yfeldblum has quit [Ping timeout: 240 seconds]
17:06
yatish27_ has quit [Remote host closed the connection]
17:06
<
mustmodify >
jhass: ok, NOW tell me why it isn't working. :) class MiddlewareBuilder def use( middleware, *args ) middleware_stack << lambda {|next_app| middleware.new( next_app, *args ) } end def middleware_stack @use ||= [] end end class Interface def self.middleware MiddlewareBuilder.new.instance_eval( yield ) end end class X < Interface middleware do use( lambda {} ) end end
17:07
yatish27 has joined #ruby-lang
17:07
<
jhass >
because that's not how you use instance_eval
17:07
<
mustmodify >
oh well uh ...
17:07
frzng has joined #ruby-lang
17:07
<
mustmodify >
I guess that's a good reason.
17:07
sleepee has joined #ruby-lang
17:07
<
jhass >
def self.middleware(&block); MiddlewareBuilder.new.instance_eval(&block); end;
17:08
<
jhass >
or ... MiddlewareBuilder.new(&block) ... def initialize(&block); instance_eval(&block); end;
17:08
mykoweb has quit [Remote host closed the connection]
17:09
mykoweb has joined #ruby-lang
17:10
<
mustmodify >
Hm... I always thought using &block.call and yield were basically the same.
17:10
<
mustmodify >
But I see that it works the way you suggest.
17:10
<
mustmodify >
jhass: thanks very much.
17:10
<
jhass >
&block in a method definition captures the implicit block argument and converts it into a Proc object
17:11
<
jhass >
&block in a method call converts a Proc object to a block and passes it to the method
17:11
yatish27 has quit [Ping timeout: 260 seconds]
17:13
mykoweb has quit [Ping timeout: 276 seconds]
17:14
starbucks has quit [Remote host closed the connection]
17:16
symm- has joined #ruby-lang
17:17
<
mustmodify >
jhass: ok I see that it works the way you suggest. I'm curious though... I've updated my gist. Why doesn't it work now? Interface doesn't even get a look at &block, it gets passed through, and yet the context is still wrong.
17:18
<
mustmodify >
jhass: more for my own understanding than anything. I'm using what you suggested in my code.
17:18
<
jhass >
because yield doesn't change the context of the block
17:19
<
mustmodify >
Ah, so the block comes packaged with its context?
17:19
<
mustmodify >
ie it's not
_just_ the code. It's the code and its original context.
17:24
houhoulis has joined #ruby-lang
17:28
<
mustmodify >
ok one final question, this one is easy. This app will receive messages from various medical labs. The middleware will do preprocessing... journalize, changing some bits of the message, etc. What pattern is that? Service or Strategy? Or something else?
17:28
yubrew has joined #ruby-lang
17:31
<
mustmodify >
I put it under app/strategies and as long as I'm consistent I realize it doesn't matter. But I just thought it would be nice to get another opinion. :)
17:31
konr_ has quit [Quit: Connection closed for inactivity]
17:32
doitjay has joined #ruby-lang
17:33
mikecmpbll has quit [Quit: i've nodded off.]
17:33
yubrew has quit [Ping timeout: 276 seconds]
17:34
wm3|away has joined #ruby-lang
17:35
<
Spaceghostc2c >
mustmodify: Will there be more than one strategies in use with the same collaborators?
17:36
<
Spaceghostc2c >
Otherwise, I'd aim for a service. It's a nice general pattern for encapsulating some kind of verby behaviour.
17:36
nofxx has quit [Ping timeout: 240 seconds]
17:37
robbyoconnor has quit [Excess Flood]
17:37
robbyoconnor has joined #ruby-lang
17:42
phansch has joined #ruby-lang
17:42
wallerdev has quit [Quit: wallerdev]
17:44
BucOder has joined #ruby-lang
17:45
sepp2k has quit [Read error: Connection reset by peer]
17:46
wm3|away has quit [Ping timeout: 276 seconds]
17:47
sepp2k has joined #ruby-lang
17:47
marr has joined #ruby-lang
17:50
tkuchiki has quit [Ping timeout: 240 seconds]
17:51
yfeldblum has joined #ruby-lang
17:52
lewix has joined #ruby-lang
17:54
BucOder has quit [Quit: Computer has gone to sleep.]
17:55
yfeldblum has quit [Ping timeout: 260 seconds]
17:57
BucOder has joined #ruby-lang
17:58
yfeldblum has joined #ruby-lang
18:01
lewix has quit [Remote host closed the connection]
18:07
GBrawl has joined #ruby-lang
18:14
wallerdev has joined #ruby-lang
18:15
danijoo has joined #ruby-lang
18:18
lewix has joined #ruby-lang
18:21
lewix has quit [Client Quit]
18:21
lewix has joined #ruby-lang
18:21
lewix has quit [Changing host]
18:21
lewix has joined #ruby-lang
18:23
yubrew has joined #ruby-lang
18:26
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:26
iliketurtles has joined #ruby-lang
18:27
yubrew has quit [Ping timeout: 240 seconds]
18:27
mykoweb has joined #ruby-lang
18:29
Mon_Ouie has joined #ruby-lang
18:32
mykoweb has quit [Remote host closed the connection]
18:38
mistym has joined #ruby-lang
18:38
chris123456789 has joined #ruby-lang
18:41
mistym has quit [Remote host closed the connection]
18:47
sleepee has quit [Ping timeout: 252 seconds]
18:50
mistym has joined #ruby-lang
18:51
relix has joined #ruby-lang
18:52
<
mustmodify >
jhass, Spaceghostc2c: well thanks again, that was a big help.
18:56
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
19:09
doitjay has quit [Quit: Leaving]
19:14
_ht has quit [Remote host closed the connection]
19:14
mikecmpbll has joined #ruby-lang
19:15
starbucks has joined #ruby-lang
19:16
symm- has quit [Ping timeout: 265 seconds]
19:20
olivererxleben has quit [Quit: Leaving...]
19:21
starbucks has quit [Quit: Leaving...]
19:29
amclain has joined #ruby-lang
19:30
charliesome has joined #ruby-lang
19:35
wm3|away has joined #ruby-lang
19:40
Cakey has joined #ruby-lang
19:46
iliketurtles has quit [Quit: zzzzz…..]
19:50
aef has quit [Remote host closed the connection]
19:51
Cakey has quit [Ping timeout: 260 seconds]
19:53
starbucks has joined #ruby-lang
19:57
sepp2k1 has joined #ruby-lang
19:57
sepp2k has quit [Ping timeout: 255 seconds]
19:59
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:02
wm3|away has quit [Ping timeout: 252 seconds]
20:05
heftig has quit [Quit: Quitting]
20:06
darkswordchris has joined #ruby-lang
20:07
<
darkswordchris >
Hello. I am using ruby 1.8.7 and when I attempt to include ruby.h in c++, I get the error "syntax error : missing ';' before identifier 'pipe_exec'" on the line "extern rb_pid_t pipe_exec(const char *, int, FILE **, FILE **);"
20:07
<
jhass >
ruby 1.8.7 is out of support, please update
20:08
<
darkswordchris >
Ok, I also have 2.0.0, it gives the same error.
20:12
dingus_khan has joined #ruby-lang
20:12
<
darkswordchris >
No one knows?
20:15
dingus_khan has quit [Remote host closed the connection]
20:21
nitr has joined #ruby-lang
20:21
<
dvorak >
did you put extern "C" { } around the include?
20:25
nitr has quit [Client Quit]
20:25
nitr has joined #ruby-lang
20:28
heftig has joined #ruby-lang
20:34
nitr has quit [Remote host closed the connection]
20:36
x0f has quit [Ping timeout: 252 seconds]
20:36
<
darkswordchris >
Sorry, was away. I did not dvorak
20:37
x0f has joined #ruby-lang
20:38
<
darkswordchris >
no difference
20:40
<
darkswordchris >
If I go to the line and hover over it, it tells me pid_t is undefined
20:41
tylersmith has joined #ruby-lang
20:42
nitr_ has joined #ruby-lang
20:44
vikfroberg has joined #ruby-lang
20:44
skade has joined #ruby-lang
20:45
taylorrf has joined #ruby-lang
20:45
vikfroberg has left #ruby-lang [#ruby-lang]
20:46
stayarrr has joined #ruby-lang
20:46
nitr_ is now known as Nitr_
20:47
<
darkswordchris >
in my config.h, I have #define rb_pid_t pid_t, but pid_t is undefined.
20:47
VTLob has quit [Quit: VTLob]
20:49
tylersmith has quit [Read error: Connection reset by peer]
20:50
tylersmith has joined #ruby-lang
20:54
vikfroberg has joined #ruby-lang
20:54
Nitr_ is now known as Nitr
20:54
vikfroberg has left #ruby-lang [#ruby-lang]
20:55
cored_ has joined #ruby-lang
20:56
lsegal has joined #ruby-lang
20:57
cored has quit [Ping timeout: 264 seconds]
20:59
Nitr has joined #ruby-lang
21:00
cored has joined #ruby-lang
21:00
cored_ has quit [Ping timeout: 260 seconds]
21:00
cored has quit [Changing host]
21:00
cored has joined #ruby-lang
21:04
Nitr is now known as Nitr_
21:05
yubrew has joined #ruby-lang
21:05
Nitr_ is now known as nitr_aka_anty
21:09
yubrew has quit [Ping timeout: 240 seconds]
21:13
arooni-mobile has joined #ruby-lang
21:14
Johz has quit [Ping timeout: 265 seconds]
21:15
BucOder has quit [Quit: Computer has gone to sleep.]
21:17
mykoweb has joined #ruby-lang
21:19
apeiros has quit [Remote host closed the connection]
21:20
frogssgy has joined #ruby-lang
21:20
mykoweb has quit [Remote host closed the connection]
21:21
mykoweb has joined #ruby-lang
21:21
apeiros has joined #ruby-lang
21:23
symm- has joined #ruby-lang
21:23
mykoweb_ has joined #ruby-lang
21:24
ikrima has quit [Ping timeout: 240 seconds]
21:24
frosgy has quit [Ping timeout: 264 seconds]
21:25
diegoviola has joined #ruby-lang
21:25
mykoweb has quit [Ping timeout: 252 seconds]
21:25
mykoweb_ has quit [Remote host closed the connection]
21:26
mykoweb has joined #ruby-lang
21:27
benlovell has joined #ruby-lang
21:27
stayarrr has quit [Quit: Leaving...]
21:28
stayarrr has joined #ruby-lang
21:30
mykoweb_ has joined #ruby-lang
21:30
mykoweb has quit [Read error: Connection reset by peer]
21:31
mykoweb_ has quit [Remote host closed the connection]
21:31
mykoweb has joined #ruby-lang
21:31
mykoweb has quit [Read error: Connection reset by peer]
21:32
mykoweb has joined #ruby-lang
21:33
stayarrr has quit [Ping timeout: 245 seconds]
21:36
mykoweb has quit [Remote host closed the connection]
21:36
mykoweb has joined #ruby-lang
21:41
mykoweb has quit [Ping timeout: 260 seconds]
21:41
x0f has quit [Ping timeout: 240 seconds]
21:42
cstrahan has joined #ruby-lang
21:42
mykoweb has joined #ruby-lang
21:43
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:43
mistym has quit [Remote host closed the connection]
21:45
tylersmi_ has joined #ruby-lang
21:46
tylersmith has quit [Ping timeout: 240 seconds]
21:47
x0f has joined #ruby-lang
21:48
phansch has quit [Quit: WeeChat 0.4.3]
21:49
mykoweb has quit [Ping timeout: 255 seconds]
21:51
doitjay has joined #ruby-lang
21:52
shinnya has joined #ruby-lang
21:57
x0f has quit [Ping timeout: 245 seconds]
21:58
mykoweb has joined #ruby-lang
21:59
x0f has joined #ruby-lang
21:59
benlovell has quit [Quit: leaving]
21:59
mykoweb has quit [Remote host closed the connection]
21:59
mykoweb has joined #ruby-lang
22:02
diegoviola has quit [Quit: WeeChat 0.4.3]
22:05
mykoweb has quit [Ping timeout: 276 seconds]
22:08
dik_dak has joined #ruby-lang
22:09
mykoweb has joined #ruby-lang
22:12
mykoweb_ has joined #ruby-lang
22:15
AncientAmateur has joined #ruby-lang
22:16
mykoweb_ has quit [Read error: Connection reset by peer]
22:16
nitr_aka_anty has quit [Remote host closed the connection]
22:16
nitr_aka_anty has joined #ruby-lang
22:17
mykoweb has quit [Ping timeout: 264 seconds]
22:17
ur5us has joined #ruby-lang
22:17
AncientAmateur has quit [Remote host closed the connection]
22:20
rickyrickyrice has joined #ruby-lang
22:21
nitr_aka_anty has quit [Ping timeout: 252 seconds]
22:21
apeiros has quit [Ping timeout: 276 seconds]
22:22
yfeldblum has quit [Read error: Connection reset by peer]
22:24
rickyrickyrice has quit [Client Quit]
22:26
jhass is now known as jhass|off
22:26
Olipro has quit [*.net *.split]
22:30
yfeldblum has joined #ruby-lang
22:37
starbuck_ has joined #ruby-lang
22:39
Olipro has joined #ruby-lang
22:40
starbucks has quit [Ping timeout: 240 seconds]
22:48
banister has joined #ruby-lang
22:49
zastern has quit [Ping timeout: 252 seconds]
22:49
starbuck_ has quit [Remote host closed the connection]
22:49
zastern has joined #ruby-lang
22:51
starbucks has joined #ruby-lang
22:53
yubrew has joined #ruby-lang
22:54
dik_dak has quit [Quit: Leaving]
22:54
doitjay has quit [Read error: Connection reset by peer]
22:58
yubrew has quit [Ping timeout: 260 seconds]
23:01
JokerDoom has quit [Ping timeout: 252 seconds]
23:02
x0f has quit [Ping timeout: 252 seconds]
23:03
x0f has joined #ruby-lang
23:08
x0f has quit [Ping timeout: 252 seconds]
23:08
cstrahan has quit [Ping timeout: 252 seconds]
23:09
x0f has joined #ruby-lang
23:16
starbucks has quit [Remote host closed the connection]
23:19
havenn is now known as havenwood
23:20
zenojis has quit [Ping timeout: 240 seconds]
23:21
skade has quit [Quit: Computer has gone to sleep.]
23:24
zenojis has joined #ruby-lang
23:31
diegoviola has joined #ruby-lang
23:38
taylorrf has quit [Remote host closed the connection]
23:43
cstrahan has joined #ruby-lang
23:45
ur5us has quit [Remote host closed the connection]
23:45
ur5us has joined #ruby-lang
23:49
x0f has quit [Ping timeout: 240 seconds]
23:50
ur5us has quit [Ping timeout: 264 seconds]
23:54
miqui has joined #ruby-lang
23:55
x0f has joined #ruby-lang
23:55
danijoo has quit [Read error: Connection reset by peer]
23:56
rue has quit [Remote host closed the connection]
23:56
danijoo has joined #ruby-lang
23:58
starbucks has joined #ruby-lang