00:00
mikecmpbll has quit [Ping timeout: 264 seconds]
00:02
vintik has quit [Remote host closed the connection]
00:04
Technodrome has quit [Quit: Technodrome]
00:06
symm- has joined #ruby-lang
00:07
sepp2k1 has joined #ruby-lang
00:07
sepp2k has quit [Ping timeout: 264 seconds]
00:09
yfeldblum has quit [Remote host closed the connection]
00:10
yfeldblum has joined #ruby-lang
00:10
sharpmachine has quit [Remote host closed the connection]
00:13
jkprg has joined #ruby-lang
00:13
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:14
jarto has joined #ruby-lang
00:15
tkuchiki has joined #ruby-lang
00:15
Cakey has quit [Ping timeout: 255 seconds]
00:15
jsullivandigs has quit [Remote host closed the connection]
00:16
rubynewbie has quit []
00:17
jarto has quit [Client Quit]
00:17
jkprg has quit [Ping timeout: 245 seconds]
00:22
hgl__ has joined #ruby-lang
00:28
vincent has joined #ruby-lang
00:28
vincent is now known as Guest40788
00:29
hgl__ has quit [Remote host closed the connection]
00:29
hgl__ has joined #ruby-lang
00:30
weems|mac has joined #ruby-lang
00:31
ap4y has quit [Ping timeout: 245 seconds]
00:32
jsullivandigs has joined #ruby-lang
00:35
ruby-lang367 has joined #ruby-lang
00:35
<
ruby-lang367 >
Hi, is there a shorter way to read from stdin then gets?
00:35
<
ruby-lang367 >
I'm doing a code golf thing XD
00:36
<
toretore >
i'm sure you could use some hideous perlism
00:36
<
toretore >
do a ruby -h
00:36
<
toretore >
and look at the options
00:37
Guest40788 has quit [Ping timeout: 264 seconds]
00:40
mykoweb has quit [Remote host closed the connection]
00:40
bartoindahouse has joined #ruby-lang
00:40
mykoweb has joined #ruby-lang
00:41
godd2 has joined #ruby-lang
00:42
Technodrome has joined #ruby-lang
00:43
<
eam >
if by horrible you mean awesome
00:44
monees has joined #ruby-lang
00:44
bartoindahouse has quit [Ping timeout: 250 seconds]
00:44
mykoweb has quit [Ping timeout: 240 seconds]
00:46
ap4y has joined #ruby-lang
00:47
bartoindahouse has joined #ruby-lang
00:48
mykoweb has joined #ruby-lang
00:50
hahuang65 has quit [Ping timeout: 245 seconds]
00:51
bartoindahouse has quit [Ping timeout: 240 seconds]
00:51
brianpWins has quit [Quit: brianpWins]
00:51
tkuchiki has quit [Remote host closed the connection]
00:52
monees has quit [Ping timeout: 245 seconds]
00:52
mykoweb has quit [Remote host closed the connection]
00:54
Mon_Ouie has quit [Ping timeout: 256 seconds]
00:54
strmpnk has joined #ruby-lang
00:56
vintik has joined #ruby-lang
01:00
mistym has quit [Remote host closed the connection]
01:05
vincent has joined #ruby-lang
01:06
vincent is now known as Guest58559
01:07
bruno- has joined #ruby-lang
01:08
D9 has joined #ruby-lang
01:10
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
01:12
bruno- has quit [Ping timeout: 260 seconds]
01:14
mistym has joined #ruby-lang
01:15
banisterfiend has quit [Quit: Computer has gone to sleep.]
01:18
Guest58559 has quit [Ping timeout: 245 seconds]
01:19
spastorino has quit [Quit: Connection closed for inactivity]
01:22
tkuchiki has joined #ruby-lang
01:23
saarinen has quit [Quit: saarinen]
01:25
sarkyniin has quit [Quit: Quitte]
01:32
zzak__ has quit [Ping timeout: 240 seconds]
01:33
EvilJStoker has quit [Ping timeout: 240 seconds]
01:33
zzak__ has joined #ruby-lang
01:34
ruby-lang367 has quit [Quit: Page closed]
01:35
EvilJStoker has joined #ruby-lang
01:37
yfeldblu_ has joined #ruby-lang
01:38
yfeldblu_ has quit [Remote host closed the connection]
01:38
yfeldblu_ has joined #ruby-lang
01:40
mistym has quit [Quit: Leaving...]
01:40
yfeldblum has quit [Ping timeout: 240 seconds]
01:41
shinnya has quit [Ping timeout: 272 seconds]
01:41
havenwood has joined #ruby-lang
01:46
jgpawletko has joined #ruby-lang
01:47
bartoindahouse has joined #ruby-lang
01:51
homeless_ has joined #ruby-lang
01:51
<
homeless_ >
can someone explain what does .insect do
01:51
<
homeless_ >
I mean inspect
01:52
mykoweb has joined #ruby-lang
01:53
symm- has quit [Read error: Connection reset by peer]
01:54
symm- has joined #ruby-lang
01:54
<
godd2 >
From the docs: Returns a string containing a human-readable representation of an object.
01:56
bartoindahouse has quit [Ping timeout: 245 seconds]
01:56
<
godd2 >
a couple of differences from to_s is that inspect will by default show instance variables and their contents, and another is that to_s is called implicitly when interpolating strings like "#{some_object}"
01:57
jchao_ has joined #ruby-lang
01:57
<
jchao_ >
Hi all, can someone explain what “<<“ does?
01:59
davispuh has quit [Read error: Connection reset by peer]
01:59
<
godd2 >
jchao_ for an array?
02:00
<
jchao_ >
yeah for an array
02:00
<
jchao_ >
is it to push to the array?
02:00
<
godd2 >
yes, it will append the specified object to the specified array
02:01
jkprg has joined #ruby-lang
02:01
<
jchao_ >
ah ok great. Thanks godd2
02:01
<
godd2 >
be careful, if you append an array to an array, it will insert the whole array into the other. so like [1,2] << [3] will become [1,2,[3]]
02:01
<
homeless_ >
<godd2> still i get same output if i used [1,2,3].to_s and [1,2,3].inspect
02:02
<
homeless_ >
>> "[1,2,3]"
02:02
<
godd2 >
homeless_ that's because those methods have been specially written for the array class
02:02
jchao_ has quit [Quit: jchao_]
02:02
<
godd2 >
if you make a new class, my description would hold
02:03
<
godd2 >
>> class Dog; end; Dog.new.inspect
02:05
jkprg has quit [Ping timeout: 250 seconds]
02:06
<
homeless_ >
I am still unclear about inspect
02:06
<
homeless_ >
i got the defination
02:06
<
homeless_ >
inspect method, which returns a string with a literal representation of the object it’s called on:
02:06
wallerdev has quit [Quit: wallerdev]
02:06
<
homeless_ >
what is this literal representation
02:06
<
zenspider >
homeless_: what's up?
02:07
<
homeless_ >
just learning rails zenspider
02:07
<
homeless_ >
and got stuck with .inspect
02:07
<
godd2 >
well, "#<Dog:0x41425b58>" is the literal representation of the new Dog object I made.
02:08
<
homeless_ >
so # is the literal representation of dog class you made
02:08
<
godd2 >
the term 'literal representation' is not a special one
02:08
<
godd2 >
they're just trying to say that it spits out a string showing what the object is
02:09
<
zenspider >
I wouldn't call that a literal representation, since you can't use it to create one
02:09
<
zenspider >
inspect == programmer's output. to_s == regular output.
02:09
<
zenspider >
that's all
02:09
<
homeless_ >
class Dog; end; Dog.new.inspect outputs "#" --> i got this one
02:10
<
homeless_ >
but why [1,2,3].inspect output is "[1,2,3]"
02:10
<
zenspider >
because that's how it is implemented
02:10
<
homeless_ >
shouldn't it something like <00##>
02:10
<
godd2 >
the inspect method on an Array has been rewritten so it doesn't do that
02:10
<
zenspider >
homeless_: it could... but it isn't.
02:11
<
zenspider >
same reason why "woot".inspect outputs something stringy like
02:11
<
zenspider >
because it is more helpful to see the content, than the object_id
02:11
<
zenspider >
Object#inspect is generic. There are specializations under Object that are better suited
02:11
<
zenspider >
override inspect in class Dog to make it more useful to you
02:12
<
zenspider >
this isn't an inconsistency. #inspect is meant for programmer eyeballs.
02:12
<
homeless_ >
oo finally getting sense of it
02:12
xybre has quit [Ping timeout: 260 seconds]
02:12
<
homeless_ >
big thanks to zenspider and godd2
02:13
<
zenspider >
frankly, I prefer smalltalk in this regard. their custom is for their inspect to output smalltalk code this would literally eval back into the same thing.
02:13
<
zenspider >
we fucked up. it should have been "Dog.new(...)" or whatever to recreate that dog
02:18
brianpWins has joined #ruby-lang
02:19
diegoviola has joined #ruby-lang
02:19
Technodrome has quit [Quit: Technodrome]
02:19
<
godd2 >
that's what an inspect method for array might look like if it wasn't overridden
02:20
<
godd2 >
copy it into irb to give it a whirl
02:23
Cakey has joined #ruby-lang
02:27
vintik has quit [Remote host closed the connection]
02:27
vincent has joined #ruby-lang
02:27
vincent is now known as Guest22257
02:28
vintik has joined #ruby-lang
02:28
Cakey has quit [Ping timeout: 255 seconds]
02:30
hgl__ has quit [Read error: Connection reset by peer]
02:36
toastynerd has joined #ruby-lang
02:37
Guest22257 has quit [Ping timeout: 245 seconds]
02:38
Technodrome has joined #ruby-lang
02:38
toastynerd has quit [Remote host closed the connection]
02:39
homeless__ has joined #ruby-lang
02:39
toastynerd has joined #ruby-lang
02:40
homeless_ has quit [Ping timeout: 246 seconds]
02:45
homeless__ has quit [Ping timeout: 246 seconds]
02:46
yfeldblu_ has quit [Remote host closed the connection]
02:50
|jemc| has joined #ruby-lang
02:53
bartoindahouse has joined #ruby-lang
02:54
jgpawletko has quit [Quit: jgpawletko]
02:55
bruno- has joined #ruby-lang
02:57
bartoindahouse has quit [Ping timeout: 255 seconds]
02:59
toretore has quit [Quit: This computer has gone to sleep]
02:59
cleopatra has joined #ruby-lang
03:01
bruno- has quit [Ping timeout: 260 seconds]
03:02
momomomomo has joined #ruby-lang
03:02
sepp2k1 has quit [Read error: Connection reset by peer]
03:03
brianpWins has quit [Quit: brianpWins]
03:03
Cakey has joined #ruby-lang
03:04
bartoindahouse has joined #ruby-lang
03:04
momomomomo has quit [Client Quit]
03:06
rcvalle has quit [Quit: rcvalle]
03:08
Miphix has joined #ruby-lang
03:09
bartoindahouse has quit [Ping timeout: 256 seconds]
03:09
deg- has quit [Ping timeout: 272 seconds]
03:11
spuk has quit [Ping timeout: 240 seconds]
03:15
xcesariox has joined #ruby-lang
03:15
Cakey has quit [Remote host closed the connection]
03:16
ap4y has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
03:17
mykoweb has quit [Remote host closed the connection]
03:17
mykoweb has joined #ruby-lang
03:20
cleopatra has left #ruby-lang ["Saliendo"]
03:22
spuk has joined #ruby-lang
03:22
mykoweb has quit [Ping timeout: 245 seconds]
03:29
kalehv has joined #ruby-lang
03:31
monees has joined #ruby-lang
03:34
Cakey has joined #ruby-lang
03:34
Technodrome has quit [Quit: Technodrome]
03:37
mykoweb has joined #ruby-lang
03:41
imperator has joined #ruby-lang
03:41
yfeldblum has joined #ruby-lang
03:41
<
imperator >
greetings programs
03:43
tylersmith has joined #ruby-lang
03:44
brianpWins has joined #ruby-lang
03:44
jonathanmarvens has quit [Remote host closed the connection]
03:49
jkprg has joined #ruby-lang
03:52
mehlah has quit [Quit: Leaving...]
03:52
<
zenspider >
hey imperator
03:54
jkprg has quit [Ping timeout: 250 seconds]
04:02
gix has quit [Ping timeout: 265 seconds]
04:03
Technodrome has joined #ruby-lang
04:05
bartoindahouse has joined #ruby-lang
04:05
gix has joined #ruby-lang
04:07
woollyams has quit [Ping timeout: 272 seconds]
04:09
kalehv has quit [Remote host closed the connection]
04:10
kalehv has joined #ruby-lang
04:10
bartoindahouse has quit [Ping timeout: 255 seconds]
04:11
vintik has quit [Ping timeout: 240 seconds]
04:14
kalehv has quit [Ping timeout: 245 seconds]
04:20
|jemc| has quit [Read error: Connection reset by peer]
04:21
|jemc| has joined #ruby-lang
04:22
vincent has joined #ruby-lang
04:23
vincent is now known as Guest90680
04:23
drbrain has quit [Ping timeout: 255 seconds]
04:23
Mon_Ouie has joined #ruby-lang
04:24
monees has quit [Remote host closed the connection]
04:24
drbrain has joined #ruby-lang
04:28
woollyams has joined #ruby-lang
04:29
sMecKs has joined #ruby-lang
04:38
<
sMecKs >
Anyone here have some time to answer a simple ruby questions? thanks!
04:40
charliesome has joined #ruby-lang
04:41
<
zenspider >
sMecKs: just ask your question. don't ask to ask.
04:43
zenojis has quit [Ping timeout: 240 seconds]
04:44
bruno- has joined #ruby-lang
04:44
bruno- is now known as Guest5408
04:49
Guest5408 has quit [Ping timeout: 264 seconds]
04:49
karamazov has quit [Remote host closed the connection]
04:50
havenn has joined #ruby-lang
04:51
havenn has quit [Remote host closed the connection]
04:51
havenwood has quit [Ping timeout: 264 seconds]
04:58
CaptainJet has quit []
05:00
djbkd has joined #ruby-lang
05:02
jonathanmarvens has joined #ruby-lang
05:04
<
zenspider >
or don't.
05:06
bartoindahouse has joined #ruby-lang
05:08
weems|mac has quit [Quit: weems|mac]
05:11
bartoindahouse has quit [Ping timeout: 272 seconds]
05:12
heftig has quit [Quit: Quitting]
05:13
spuk_ has joined #ruby-lang
05:14
Cakey has quit [Ping timeout: 240 seconds]
05:16
conquerio has joined #ruby-lang
05:19
arooni-mobile has quit [Ping timeout: 264 seconds]
05:20
jkprg has joined #ruby-lang
05:21
jxie has quit [Read error: Connection reset by peer]
05:21
Cakey has joined #ruby-lang
05:21
havenwood has joined #ruby-lang
05:22
conquerio has quit []
05:22
Technodrome has quit [Quit: Technodrome]
05:24
jxie has joined #ruby-lang
05:26
Cakey has quit [Ping timeout: 272 seconds]
05:27
drbrain has quit [Ping timeout: 255 seconds]
05:27
drbrain has joined #ruby-lang
05:30
tkuchiki_ has joined #ruby-lang
05:31
_ht has joined #ruby-lang
05:31
havenwood has quit [Ping timeout: 264 seconds]
05:31
Cakey has joined #ruby-lang
05:31
cschneid has quit [Ping timeout: 240 seconds]
05:33
tkuchiki has quit [Ping timeout: 245 seconds]
05:34
cschneid has joined #ruby-lang
05:35
Technodrome has joined #ruby-lang
05:38
bruno-_ has joined #ruby-lang
05:43
bruno-_ has quit [Ping timeout: 256 seconds]
05:43
tectonic has joined #ruby-lang
05:47
apeiros has joined #ruby-lang
05:48
pabloh has joined #ruby-lang
05:54
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
05:55
kyb3r_ has joined #ruby-lang
05:59
spuk has quit [Ping timeout: 256 seconds]
06:00
apeiros has quit [Remote host closed the connection]
06:00
apeiros has joined #ruby-lang
06:00
dangerousdave has joined #ruby-lang
06:01
brianpWins has quit [Quit: brianpWins]
06:01
jkprg has quit [Quit: jkprg]
06:04
diegoviola has quit [Quit: WeeChat 0.4.3]
06:04
apeiros has quit [Ping timeout: 245 seconds]
06:07
bartoindahouse has joined #ruby-lang
06:11
wallerdev has joined #ruby-lang
06:12
bartoindahouse has quit [Ping timeout: 264 seconds]
06:13
Guest90680 has quit []
06:14
jonathanmarvens has quit [Remote host closed the connection]
06:14
arBmind has joined #ruby-lang
06:16
imperator has quit [Quit: Valete!]
06:18
vincent has joined #ruby-lang
06:18
vincent is now known as Guest10387
06:18
relix has joined #ruby-lang
06:18
jonathanmarvens has joined #ruby-lang
06:23
charliesome has joined #ruby-lang
06:25
havenwood has joined #ruby-lang
06:30
toastynerd has quit [Remote host closed the connection]
06:30
havenwood has quit [Ping timeout: 264 seconds]
06:32
bruno- has joined #ruby-lang
06:36
brianpWins has joined #ruby-lang
06:37
bruno- has quit [Ping timeout: 250 seconds]
06:40
AKASkip has joined #ruby-lang
06:44
musl has quit [Read error: Connection reset by peer]
06:44
mykoweb has joined #ruby-lang
06:44
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
06:45
musl has joined #ruby-lang
06:46
kyb3r_ has quit [Ping timeout: 255 seconds]
06:46
kwd has joined #ruby-lang
06:47
kyb3r_ has joined #ruby-lang
06:48
mykoweb has quit [Ping timeout: 256 seconds]
06:55
AKASkip has quit [Ping timeout: 240 seconds]
07:01
tylersmith has quit [Remote host closed the connection]
07:01
toastynerd has joined #ruby-lang
07:01
tylersmith has joined #ruby-lang
07:02
dc5ala has joined #ruby-lang
07:02
kwd has quit [Quit: Leaving.]
07:04
tbuehlmann has joined #ruby-lang
07:06
tylersmith has quit [Ping timeout: 245 seconds]
07:08
bartoindahouse has joined #ruby-lang
07:08
tectonic has quit []
07:09
toastynerd has quit [Ping timeout: 255 seconds]
07:13
bartoindahouse has quit [Ping timeout: 264 seconds]
07:15
solars has joined #ruby-lang
07:15
djbkd has quit [Remote host closed the connection]
07:16
zenojis has joined #ruby-lang
07:17
scmx has joined #ruby-lang
07:21
danijoo has quit [Read error: Connection reset by peer]
07:22
danijoo has joined #ruby-lang
07:23
scmx has quit [Ping timeout: 250 seconds]
07:24
Bwild has quit [Remote host closed the connection]
07:25
scmx has joined #ruby-lang
07:25
havenwood has joined #ruby-lang
07:31
havenwood has quit [Ping timeout: 264 seconds]
07:31
Guest10387 has quit []
07:32
AKASkip has joined #ruby-lang
07:32
Forgetful_Lion has joined #ruby-lang
07:34
pabloh has quit [Quit: Saliendo]
07:34
scmx has quit [Ping timeout: 245 seconds]
07:36
Bwild has joined #ruby-lang
07:37
brianpWins has quit [Quit: brianpWins]
07:41
joonty has quit [Ping timeout: 250 seconds]
07:41
|jemc| has quit [Ping timeout: 255 seconds]
07:43
Technodrome has quit [Quit: Technodrome]
07:45
arBmind has quit [Quit: Leaving.]
07:48
havenwood has joined #ruby-lang
07:51
tkuchiki_ has quit [Remote host closed the connection]
07:53
apeiros has joined #ruby-lang
07:54
joonty has joined #ruby-lang
07:57
D9 has quit [Ping timeout: 255 seconds]
07:57
dalzony has joined #ruby-lang
07:58
tkuchiki has joined #ruby-lang
08:00
arBmind has joined #ruby-lang
08:05
mikecmpbll has joined #ruby-lang
08:09
bartoindahouse has joined #ruby-lang
08:09
sMecKs has quit [Read error: Connection reset by peer]
08:12
gouthamvel has joined #ruby-lang
08:12
gouthamvel has quit [Client Quit]
08:13
ironhide_604 has joined #ruby-lang
08:13
bartoindahouse has quit [Ping timeout: 240 seconds]
08:17
elia has joined #ruby-lang
08:17
dalzony has quit [Quit: Leaving.]
08:20
bruno- has joined #ruby-lang
08:20
dalzony has joined #ruby-lang
08:21
elia has quit [Client Quit]
08:23
woollyams has quit [Ping timeout: 272 seconds]
08:24
elia has joined #ruby-lang
08:25
bruno- has quit [Ping timeout: 245 seconds]
08:25
postmodern has quit [Ping timeout: 240 seconds]
08:26
postmodern has joined #ruby-lang
08:26
<
yorickpeterse >
morning
08:26
alexju has joined #ruby-lang
08:27
alexju has quit [Remote host closed the connection]
08:30
dalzony has quit [Quit: Leaving.]
08:32
postmodern has quit [Ping timeout: 240 seconds]
08:33
postmodern has joined #ruby-lang
08:37
Mon_Ouie has quit [Ping timeout: 250 seconds]
08:40
DivineEntity has quit [Ping timeout: 240 seconds]
08:41
postmodern has quit [Ping timeout: 240 seconds]
08:41
postmodern has joined #ruby-lang
08:42
DivineEntity has joined #ruby-lang
08:43
jkprg has joined #ruby-lang
08:44
alexju has joined #ruby-lang
08:47
alexju has quit [Read error: No route to host]
08:47
alexju has joined #ruby-lang
08:48
yie has joined #ruby-lang
08:48
Mon_Ouie has joined #ruby-lang
08:50
benlovell has joined #ruby-lang
08:51
benlovell has quit [Client Quit]
08:51
benlovell has joined #ruby-lang
08:55
Missphoenix has joined #ruby-lang
08:58
Miphix has quit [Ping timeout: 240 seconds]
09:03
workmad3 has joined #ruby-lang
09:04
Xzyx987X_ has quit [Read error: Connection reset by peer]
09:04
Xzyx987X_ has joined #ruby-lang
09:05
Blaguvest has joined #ruby-lang
09:05
sol has joined #ruby-lang
09:05
Missphoenix has quit [Quit: Leaving]
09:05
sol is now known as Guest72315
09:05
toastynerd has joined #ruby-lang
09:06
Miphix has joined #ruby-lang
09:07
jacky has quit [Ping timeout: 240 seconds]
09:07
solars has quit [Ping timeout: 255 seconds]
09:08
dalzony has joined #ruby-lang
09:10
bartoindahouse has joined #ruby-lang
09:10
toastynerd has quit [Ping timeout: 250 seconds]
09:10
jackyalcine has joined #ruby-lang
09:14
bartoindahouse has quit [Ping timeout: 245 seconds]
09:14
Forgetful_Lion has quit [Ping timeout: 272 seconds]
09:17
Forgetful_Lion has joined #ruby-lang
09:19
Cakey has quit [Ping timeout: 245 seconds]
09:21
woollyams has joined #ruby-lang
09:22
jxie has quit [Ping timeout: 240 seconds]
09:23
dalzony has quit [Quit: Leaving.]
09:24
jxie has joined #ruby-lang
09:24
jaimef has quit [Excess Flood]
09:24
kek has joined #ruby-lang
09:24
dalzony has joined #ruby-lang
09:25
dalzony has left #ruby-lang [#ruby-lang]
09:26
jaimef has joined #ruby-lang
09:31
mehlah has joined #ruby-lang
09:32
wallerdev has quit [Quit: wallerdev]
09:37
zenojis has quit [Ping timeout: 240 seconds]
09:41
alexju has quit [Ping timeout: 250 seconds]
09:42
alexju_ has joined #ruby-lang
09:44
jxie has quit [Ping timeout: 272 seconds]
09:44
jxie_ has joined #ruby-lang
09:44
kwd has joined #ruby-lang
09:46
yfeldblum has quit [Ping timeout: 250 seconds]
09:55
imperator has joined #ruby-lang
09:56
jonathanmarvens has quit []
10:03
t_ has quit [Ping timeout: 250 seconds]
10:03
t_ has joined #ruby-lang
10:06
toastynerd has joined #ruby-lang
10:06
kwd_ has joined #ruby-lang
10:06
kwd has quit [Read error: Connection reset by peer]
10:07
marr has joined #ruby-lang
10:08
kwd has joined #ruby-lang
10:08
kwd_ has quit [Read error: Connection reset by peer]
10:08
bruno- has joined #ruby-lang
10:10
bartoindahouse has joined #ruby-lang
10:11
toastynerd has quit [Ping timeout: 260 seconds]
10:13
bruno- has quit [Ping timeout: 264 seconds]
10:15
bartoindahouse has quit [Ping timeout: 240 seconds]
10:16
banisterfiend has joined #ruby-lang
10:19
Atttwww has quit [Ping timeout: 240 seconds]
10:21
bruno- has joined #ruby-lang
10:22
wmp has joined #ruby-lang
10:22
wmp has left #ruby-lang ["Konversation terminated!"]
10:23
imperator has quit [Quit: Valete!]
10:28
bin7me has joined #ruby-lang
10:28
Fushi has joined #ruby-lang
10:33
godd2 has quit [Ping timeout: 264 seconds]
10:33
zenojis has joined #ruby-lang
10:48
Eising has joined #ruby-lang
11:04
<
Eising >
hey there. I have a webapp that's been running on an old debian server using unstable ruby 1.9.2 with sinatra, and apache+passenger. I upgraded it yesterday, and it broke when it went to 1.9.3, since everything is now interpreted as US-ASCII instead of utf-8. Has anyone seen this?
11:07
toastynerd has joined #ruby-lang
11:11
thrownaway has quit []
11:11
postmodern has quit [Quit: Leaving]
11:11
toastynerd has quit [Ping timeout: 256 seconds]
11:14
cornerma1 has joined #ruby-lang
11:14
<
yorickpeterse >
Eising: what specific errors are you getting?
11:14
<
yorickpeterse >
UTF8 being changed to US-ASCII makes no sense since Ruby actually switched to UTF8 as a default (since 2.0 only if I remember correctly)
11:16
tkuchiki_ has joined #ruby-lang
11:17
<
Eising >
yorickpeterse: I set the default encoding in the main app, and then it fixed it. But it happened whenever for example ERB would parse something that had a UTF-8 character. For example:
11:17
<
Eising >
Encoding::InvalidByteSequenceError - "\xC3" on US-ASCII:
11:17
<
yorickpeterse >
That error on its own isn't very helpful sadly
11:17
<
yorickpeterse >
Out of curiosity, have you tried Ruby 2.1?
11:18
<
yorickpeterse >
Also what is the default encoding set to?
11:18
cornerman has quit [Ping timeout: 272 seconds]
11:18
<
yorickpeterse >
It sounds like you're trying to parse something that contains UTF8 data but is actually encoded as ASCII (e.g. incorrect file encodings)
11:19
<
Eising >
I don't think that ruby1.9.3 defaults to UTF-8
11:19
<
Eising >
I have to go for ruby2.0 for that
11:19
<
Eising >
but I'd love to do that
11:19
tkuchiki has quit [Ping timeout: 240 seconds]
11:20
<
yorickpeterse >
String encodings are UTF8 by default on 1.9.3
11:20
tkuchiki_ has quit [Ping timeout: 240 seconds]
11:21
<
Eising >
yorickpeterse: can I confirm that?
11:22
<
yorickpeterse >
Eising: ruby -e 'p "".encoding'
11:22
<
yorickpeterse >
Gives back #<Encoding:UTF-8> for me on 1.9.3
11:22
<
yorickpeterse >
(p448)
11:22
<
Eising >
#<Encoding:US-ASCII>
11:22
<
Eising >
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
11:22
<
Eising >
so not at that patch level
11:22
<
yorickpeterse >
Hm, that might've been changed on patch level but that would be odd
11:24
benlovell has quit [Ping timeout: 260 seconds]
11:25
<
yorickpeterse >
dangerousdave: use lowercase file names
11:26
<
yorickpeterse >
dangerousdave: don't overwrite `send` as it may conflict with Object#send
11:26
<
yorickpeterse >
I'd go with something like #send_email instead
11:29
<
apeiros >
Eising: processing an ERB file sounds like Encoding.default_external being wrong
11:29
<
dangerousdave >
yorickpeterse, thanks!
11:30
yfeldblum has joined #ruby-lang
11:30
jkprg has quit [Quit: jkprg]
11:30
<
yorickpeterse >
apeiros: that was set to UTF8 for me too on 1.9.3-p448
11:30
<
Eising >
apeiros: it was
11:30
<
yorickpeterse >
but it's worth checking
11:30
<
apeiros >
yorickpeterse: that's not a ruby default setting
11:30
<
Eising >
but the strange thing was that it worked before...
11:30
<
apeiros >
yorickpeterse: it depends on env/system/whatever
11:30
<
Eising >
so something changed the encoding during system upgrade
11:30
<
apeiros >
(might have changed to be a language default with 2.0, not sure)
11:31
kyb3r_ has quit [Read error: Connection reset by peer]
11:31
<
apeiros >
on osx, I always have all defaulting to utf-8 without me doing anything, but on our *nix boxen, I had to set it
11:32
<
Eising >
there was other weird breakage in my code
11:32
<
Eising >
for example I could not do a require 'lib/file.rb'
11:33
<
Eising >
I had to do require './lib/file.rb'
11:33
<
apeiros >
are you sure you were on 1.9.2 before and not 1.8.x?
11:33
<
apeiros >
"." was removed from the $LOAD_PATH, as it's bad to require relative to your
*working* directory
11:33
<
Eising >
pretty certain
11:34
<
apeiros >
but iirc that happened from 1.8 to 1.9, not from 1.9.2 to 1.9.3. I might be wrong on that, though.
11:34
<
Eising >
but not 100%. I have at least convinced myself I was on 1.9.2
11:34
ldnunes has joined #ruby-lang
11:34
yfeldblum has quit [Ping timeout: 255 seconds]
11:34
<
apeiros >
anyway, you should definitively fix your code. require './…' is bad.
11:34
<
Eising >
but the code was made two years ago, and I've only done small improvements since then.
11:35
<
Eising >
but the absolute paths makes it hard to move the code around
11:35
<
apeiros >
I didn't say you should use absolute paths
11:35
<
apeiros >
not sure which would be worse :)
11:35
<
Eising >
so what do you recommendthen?
11:35
<
apeiros >
proper requires use $LOAD_PATH
11:35
<
dangerousdave >
apeiros, "anyway, you should definitively fix your code. require './…' is bad." was that for me?
11:35
<
yorickpeterse >
apeiros: hmm
11:36
<
apeiros >
dangerousdave: that was @ Eising
11:36
mehlah has quit [Quit: Leaving...]
11:36
<
apeiros >
dangerousdave: but if you use such requires, you should feel addressed too :-p
11:36
<
dangerousdave >
apeiros, what do i do instead?
11:37
<
apeiros >
you put your stuff into a dir called 'lib'. if your code is a gem, the rest is handled by rubygems. if not, it depends on where you use it.
11:37
<
apeiros >
if it's a rails-app, rails adds lib to $LOAD_PATH too. sinatra probably also.
11:38
<
apeiros >
if it's something custom made, have your executable add the lib dir to $LOAD_PATH. preferably expanding the path before adding it.
11:38
<
dangerousdave >
apeiros, its a sinatra class, thanks
11:46
mehlah has joined #ruby-lang
11:47
benlovell has joined #ruby-lang
11:48
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:48
banisterfiend has quit [Quit: Computer has gone to sleep.]
11:49
banisterfiend has joined #ruby-lang
11:49
banister has joined #ruby-lang
11:50
tkuchiki has joined #ruby-lang
11:53
alexju_ has quit [Read error: Connection reset by peer]
11:54
alexju has joined #ruby-lang
11:55
bruno- has quit [Ping timeout: 240 seconds]
11:56
spuk has joined #ruby-lang
11:57
bruno- has joined #ruby-lang
12:01
Sgeo has quit [Read error: Connection reset by peer]
12:02
spuk has quit [Ping timeout: 240 seconds]
12:06
spastorino has joined #ruby-lang
12:07
toastynerd has joined #ruby-lang
12:09
bruno- has quit [Ping timeout: 272 seconds]
12:12
bartoindahouse has joined #ruby-lang
12:12
toastynerd has quit [Ping timeout: 250 seconds]
12:15
bin7me has quit [Remote host closed the connection]
12:15
ecnalyr has joined #ruby-lang
12:16
bartoindahouse has quit [Ping timeout: 240 seconds]
12:17
karamazov has joined #ruby-lang
12:20
deg- has joined #ruby-lang
12:23
havenwood has quit [Remote host closed the connection]
12:25
nathanstitt has joined #ruby-lang
12:34
yfeldblum has joined #ruby-lang
12:36
skade has joined #ruby-lang
12:36
<
yorickpeterse >
matti: Daishi Dance in general has good stuff
12:37
<
yorickpeterse >
matti: it's just a shame the Youtube comments are generally really annoying
12:37
nathanstitt has quit [Read error: Connection reset by peer]
12:37
<
yorickpeterse >
damn hippies be watching these videos
12:37
<
matti >
I never read YT comments ;]
12:38
<
yorickpeterse >
There once was this one comment something like "This music just makes me want to go outside and exercise but my muscles have to regenerate from last week's workout" or something like that
12:38
<
yorickpeterse >
I basically flipped all tables in the office after reading that
12:39
yfeldblum has quit [Ping timeout: 264 seconds]
12:43
nathanstitt has joined #ruby-lang
12:44
banister has joined #ruby-lang
12:45
nathanstitt has quit [Client Quit]
12:46
nathanstitt has joined #ruby-lang
12:48
Forgetful_Lion has quit [Remote host closed the connection]
12:51
alexju has quit [Remote host closed the connection]
12:52
malconis has joined #ruby-lang
12:53
Blaguvest has quit [Remote host closed the connection]
12:56
xcesariox has joined #ruby-lang
13:01
weems|mac has joined #ruby-lang
13:02
jgpawletko has joined #ruby-lang
13:03
<
yorickpeterse >
hnnnnggg rm'd some stuff that I actually needed
13:03
<
yorickpeterse >
and it's not yet tracked by Git
13:04
weems|mac has quit [Client Quit]
13:05
jkprg has joined #ruby-lang
13:05
DEac- has quit [Read error: Connection reset by peer]
13:05
DEac-_ has joined #ruby-lang
13:08
toastynerd has joined #ruby-lang
13:13
bartoindahouse has joined #ruby-lang
13:13
toastynerd has quit [Ping timeout: 255 seconds]
13:14
bartoind_ has joined #ruby-lang
13:14
bartoindahouse has quit [Read error: Connection reset by peer]
13:15
toretore has joined #ruby-lang
13:16
bruno- has joined #ruby-lang
13:21
bruno- has quit [Ping timeout: 250 seconds]
13:23
sarkyniin has joined #ruby-lang
13:23
centrx has joined #ruby-lang
13:24
davispuh has joined #ruby-lang
13:29
yfeldblum has joined #ruby-lang
13:29
bruno- has joined #ruby-lang
13:30
jxie_ has quit [Ping timeout: 240 seconds]
13:31
jxie has joined #ruby-lang
13:33
yfeldblum has quit [Ping timeout: 250 seconds]
13:33
shinnya has joined #ruby-lang
13:33
JohnFord has joined #ruby-lang
13:38
nathanstitt has quit [Quit: I growing sleepy]
13:38
karamazov has quit [Remote host closed the connection]
13:41
nathanstitt has joined #ruby-lang
13:51
chouhoulis has joined #ruby-lang
13:53
bruno- has quit [Quit: Lost terminal]
13:57
escues has joined #ruby-lang
13:59
nathanstitt has quit [Quit: Laters]
13:59
Technodrome has joined #ruby-lang
14:04
jgpawletko has quit [Ping timeout: 260 seconds]
14:04
aub has joined #ruby-lang
14:05
ledestin_ has joined #ruby-lang
14:05
Sirupsen has joined #ruby-lang
14:06
tylersmith has joined #ruby-lang
14:07
ledestin has quit [Ping timeout: 250 seconds]
14:07
ledestin_ is now known as ledestin
14:08
loincloth has joined #ruby-lang
14:09
davidae_ has quit [Remote host closed the connection]
14:09
badeball has quit [Remote host closed the connection]
14:09
toastynerd has joined #ruby-lang
14:11
masscrx has left #ruby-lang [#ruby-lang]
14:13
toastynerd has quit [Ping timeout: 250 seconds]
14:14
badeball has joined #ruby-lang
14:16
cmhobbs has joined #ruby-lang
14:20
bffff_ has joined #ruby-lang
14:21
dwknoxy has joined #ruby-lang
14:23
yfeldblum has joined #ruby-lang
14:27
yfeldblum has quit [Ping timeout: 260 seconds]
14:27
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
14:41
Sirupsen has joined #ruby-lang
14:41
banisterfiend has quit [Quit: Computer has gone to sleep.]
14:47
x0f has quit [Ping timeout: 250 seconds]
14:49
x0f has joined #ruby-lang
14:57
marr has quit [Read error: Connection reset by peer]
14:59
kwd has quit [Quit: Leaving.]
15:00
Guest72315 has quit [Ping timeout: 256 seconds]
15:00
jlovick has joined #ruby-lang
15:02
bronky has joined #ruby-lang
15:04
jgpawletko has joined #ruby-lang
15:07
AKASkip has quit [Ping timeout: 240 seconds]
15:08
badeball has quit [Remote host closed the connection]
15:08
Tn6o has joined #ruby-lang
15:09
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
15:09
jgpawletko has quit [Ping timeout: 240 seconds]
15:09
jgpawletko has joined #ruby-lang
15:10
toastynerd has joined #ruby-lang
15:13
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
15:14
toastynerd has quit [Ping timeout: 250 seconds]
15:15
bronky has left #ruby-lang [#ruby-lang]
15:15
bronky has joined #ruby-lang
15:16
amigo99 has joined #ruby-lang
15:16
jgpawletko_ has joined #ruby-lang
15:16
Miphix has quit [Quit: Leaving]
15:17
jgpawletko has quit [Ping timeout: 264 seconds]
15:17
jgpawletko_ is now known as jgpawletko
15:18
sharpmachine has joined #ruby-lang
15:20
bantic has joined #ruby-lang
15:21
tylersmith has quit [Remote host closed the connection]
15:22
<
darix >
rdoc getting stuck when generating docs for a gem is no fun
15:22
tylersmith has joined #ruby-lang
15:26
tylersmith has quit [Ping timeout: 240 seconds]
15:26
bartoind_ has quit []
15:26
<
yorickpeterse >
darix: gem install --no-ri --no-rdoc all the things
15:27
mykoweb has joined #ruby-lang
15:28
shinnya has quit [Ping timeout: 255 seconds]
15:31
drbrain has quit [Ping timeout: 255 seconds]
15:31
rippa has joined #ruby-lang
15:31
drbrain has joined #ruby-lang
15:32
<
darix >
yorickpeterse: yes
15:38
havenwood has joined #ruby-lang
15:46
ayonkhan has joined #ruby-lang
15:50
|jemc| has joined #ruby-lang
15:50
scmx has joined #ruby-lang
15:56
sarkyniin has quit [Ping timeout: 250 seconds]
15:59
aub has quit [Quit: aub]
15:59
toastynerd has joined #ruby-lang
16:00
nottheoilrig has quit [Remote host closed the connection]
16:00
nottheoilrig has joined #ruby-lang
16:05
loinclot_ has joined #ruby-lang
16:06
isale-eko has joined #ruby-lang
16:06
ayonkhan has joined #ruby-lang
16:06
loincloth has quit [Ping timeout: 272 seconds]
16:07
ayonkhan has quit [Client Quit]
16:09
scmx has quit [Ping timeout: 245 seconds]
16:09
kek has quit [Remote host closed the connection]
16:09
ayonkhan has joined #ruby-lang
16:10
kek has joined #ruby-lang
16:10
scmx has joined #ruby-lang
16:11
yfeldblum has joined #ruby-lang
16:13
toastynerd has quit [Remote host closed the connection]
16:13
ayonkhan has quit [Client Quit]
16:13
ayonkhan has joined #ruby-lang
16:14
aub has joined #ruby-lang
16:14
kek has quit [Ping timeout: 255 seconds]
16:14
ayonkhan has quit [Client Quit]
16:14
ssam2 has joined #ruby-lang
16:15
yfeldblum has quit [Ping timeout: 240 seconds]
16:22
katlogic has quit [Read error: Connection reset by peer]
16:22
djbkd has joined #ruby-lang
16:24
karamazov has joined #ruby-lang
16:24
nofxx has joined #ruby-lang
16:25
wallerdev has joined #ruby-lang
16:26
cornerma1 has quit [Ping timeout: 260 seconds]
16:27
jxie has quit [Ping timeout: 260 seconds]
16:27
katlogic has joined #ruby-lang
16:28
workmad3 has quit [Ping timeout: 260 seconds]
16:28
jxie has joined #ruby-lang
16:30
skade has quit [Quit: Computer has gone to sleep.]
16:30
fullybak_ has joined #ruby-lang
16:30
fullybak_ is now known as fullybaked
16:31
apeiros has quit [Remote host closed the connection]
16:33
ledestin_ has joined #ruby-lang
16:33
mikecmpbll has quit [Ping timeout: 245 seconds]
16:34
mistym has joined #ruby-lang
16:34
benlovell has quit [Ping timeout: 240 seconds]
16:36
ledestin has quit [Ping timeout: 272 seconds]
16:36
ledestin_ is now known as ledestin
16:39
scmx has quit [Ping timeout: 260 seconds]
16:39
javilm has quit [Ping timeout: 255 seconds]
16:40
scmx has joined #ruby-lang
16:40
wallerdev has quit [Quit: wallerdev]
16:40
jxie has quit [Ping timeout: 240 seconds]
16:41
CaptainJet has joined #ruby-lang
16:42
danijoo has quit [Read error: Connection reset by peer]
16:42
jxie has joined #ruby-lang
16:43
danijoo has joined #ruby-lang
16:44
charliesome has joined #ruby-lang
16:44
havenwood has quit [Remote host closed the connection]
16:45
ayonkhan has joined #ruby-lang
16:45
|jemc| has quit [Quit: WeeChat 0.4.3]
16:45
havenwood has joined #ruby-lang
16:45
mikecmpbll has joined #ruby-lang
16:46
ayonkhan has quit [Client Quit]
16:46
fullybaked has quit [Ping timeout: 250 seconds]
16:46
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:47
mello has joined #ruby-lang
16:47
havenwood has quit [Remote host closed the connection]
16:47
gpg_ has joined #ruby-lang
16:47
<
mello >
hi, quick question iv seen this alot, @something ||= [] what does that mean? why use the ||=
16:48
fullybaked has joined #ruby-lang
16:48
fullybaked has quit [Client Quit]
16:49
fullybaked has joined #ruby-lang
16:50
<
eam >
mello: it's shorthand for: if @something.nil? @something = []
16:50
<
eam >
it won't set it to [] if @something is already defined/true
16:51
<
mello >
eam: I see, thank you
16:51
ayonkhan has joined #ruby-lang
16:51
tylersmith has joined #ruby-lang
16:53
ayonkhan has quit [Client Quit]
16:54
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
16:56
sarkyniin has joined #ruby-lang
16:56
arooni-mobile has joined #ruby-lang
16:57
mello_ has joined #ruby-lang
16:58
mello has quit [Ping timeout: 260 seconds]
16:58
apeiros has joined #ruby-lang
17:00
mello_ is now known as mello
17:00
wallerdev has joined #ruby-lang
17:00
ironhide_604 has quit [Ping timeout: 260 seconds]
17:00
fullybaked has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
17:03
ecnalyr has quit [Ping timeout: 264 seconds]
17:05
<
nottheoilrig >
i want all of the items in an array except if an item matches and expression i want to skip the next two items
17:06
<
nottheoilrig >
how would you do this in ruby?
17:07
<
centrx >
nottheoilrig, There is of course the basic way of a little counter in some kind of loop
17:07
karamazov has quit [Remote host closed the connection]
17:07
toastynerd has joined #ruby-lang
17:08
charliesome has joined #ruby-lang
17:08
saarinen has joined #ruby-lang
17:10
mello has quit [Quit: Lost terminal]
17:11
JohnFord has joined #ruby-lang
17:12
ssam2 has quit [Remote host closed the connection]
17:12
<
nottheoilrig >
centrx: hmm
17:13
<
nottheoilrig >
so actually i have an array of strings and i want a single string
17:13
<
nottheoilrig >
items in the array are 1 of 4 types
17:14
<
nottheoilrig >
i have an expression for whether an item is type 2 or type 4
17:15
<
nottheoilrig >
if an item is type 2 the next two items are type 3
17:15
<
nottheoilrig >
i want to drop all type 3 items
17:15
aub has quit [Quit: aub]
17:15
<
nottheoilrig >
if an item is type 1 then the next item is type 2 or type 4
17:15
<
centrx >
Why is there no other way to identify type 3 items?
17:16
<
nottheoilrig >
the only difference between type 3 and type 1 is context
17:16
<
nottheoilrig >
i cant tell from an item alone if its type 3 or type 1
17:17
vitkovsky has joined #ruby-lang
17:17
<
nottheoilrig >
i also want to do a different String.replace on type 1, 2, and 4 items
17:18
<
nottheoilrig >
and i know if its type 4 then the next item is type 1
17:18
Sirupsen has joined #ruby-lang
17:18
Sirupsen has quit [Client Quit]
17:18
<
nottheoilrig >
oops
17:19
<
nottheoilrig >
on second thought i need to check if thats true...
17:19
Sirupsen has joined #ruby-lang
17:19
digs has joined #ruby-lang
17:20
jsullivandigs has quit [Read error: Connection reset by peer]
17:20
digs is now known as Guest88437
17:20
<
nottheoilrig >
okay its true
17:20
<
centrx >
nottheoilrig, How about something like:
17:20
<
centrx >
array.slice_before { |e| e.is_a?(TypeTwo) }.map { |chunk| chunk.first(3).last(2) }
17:20
<
centrx >
or actually chunk[1,2]
17:21
<
nottheoilrig >
ill try that
17:21
<
nottheoilrig >
an example is
17:22
<
nottheoilrig >
in [1, 2, 3, 3, 1]
17:22
<
nottheoilrig >
out "1'2'1'"
17:22
<
nottheoilrig >
as in "one prime two prime one prime"
17:23
<
centrx >
Okay, the code above will find the 3's, which you can then subtract from the array
17:24
<
centrx >
So more directly you could do
17:24
<
nottheoilrig >
yeah i see i want .map { |chunk| chunk[0] }
17:24
<
nottheoilrig >
i think
17:25
<
centrx >
that would only get you the twos
17:25
loinclot_ has quit [Read error: Connection reset by peer]
17:25
loincloth has joined #ruby-lang
17:25
<
nottheoilrig >
hmm right
17:26
dc5ala has quit [Quit: Ex-Chat]
17:27
isale-eko has quit [Ping timeout: 240 seconds]
17:27
<
centrx >
but really design your data structure better
17:27
gpg_ has quit [Quit: Page closed]
17:27
skade has joined #ruby-lang
17:27
<
nottheoilrig >
im working with the String.split output
17:28
<
nottheoilrig >
type 2, 3, and 4 are capturing groups in the pattern
17:28
<
nottheoilrig >
type 1 is everything in between
17:28
<
centrx >
nottheoilrig, Can you use named groups?
17:29
cantonic has joined #ruby-lang
17:29
<
nottheoilrig >
id be happy to but i think i tried and couldnt get at them from the String.split output?
17:29
cantonic has quit [Client Quit]
17:30
<
nottheoilrig >
let me try again
17:32
zoo-zed has joined #ruby-lang
17:32
<
nottheoilrig >
hmm why am i getting a compile error
17:32
<
nottheoilrig >
pattern = /(?<foo>a|b)/
17:32
wallerdev has quit [Ping timeout: 250 seconds]
17:33
<
nottheoilrig >
undefined (?...) sequence: /(?<foo>a|b)/
17:33
<
nottheoilrig >
maybe my ruby version?
17:33
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
17:34
<
centrx >
it's (?: )
17:34
<
centrx >
with the colon
17:34
<
centrx >
or that's uncaptured groups rather
17:35
Squarepy has joined #ruby-lang
17:35
charliesome has joined #ruby-lang
17:35
<
nottheoilrig >
right im trying a named group as you suggested
17:36
charliesome has quit [Client Quit]
17:36
vitkovsky has quit [Remote host closed the connection]
17:36
mykoweb has quit [Remote host closed the connection]
17:37
mykoweb has joined #ruby-lang
17:37
isale-eko has joined #ruby-lang
17:37
hahuang65 has joined #ruby-lang
17:38
isale-eko has quit [Client Quit]
17:39
<
nottheoilrig >
okay working now
17:39
<
nottheoilrig >
'ab'.split /(?<foo>a|b)/
17:39
loinclot_ has joined #ruby-lang
17:39
<
nottheoilrig >
["", "a", "", "b"]
17:39
<
nottheoilrig >
unless im missing something the group name foo disappears
17:39
wallerdev has joined #ruby-lang
17:40
sweo has joined #ruby-lang
17:40
JEG2 has joined #ruby-lang
17:41
arBmind has quit [Quit: Leaving.]
17:41
zoo-zed has quit [Quit: Leaving.]
17:41
<
centrx >
why not just split on type two
17:41
mykoweb has quit [Ping timeout: 240 seconds]
17:41
loincloth has quit [Ping timeout: 250 seconds]
17:41
zoo-zed has joined #ruby-lang
17:42
<
nottheoilrig >
hmm the output would then be more predictable
17:43
<
centrx >
Or use a character-by-character state machine that does exactly what you want
17:43
<
nottheoilrig >
but then id need to split the parts in between by the type 4 pattern in a second step
17:43
<
nottheoilrig >
what would that look like?
17:44
<
nottheoilrig >
(the state machine solution)
17:44
<
centrx >
basic idea is use string.each_char
17:44
<
centrx >
if you see a type two, you enter a state for capturing type 3's
17:45
<
centrx >
once you capture two type 3's after a type 2, exit the type-3-capture-state
17:45
<
centrx >
You can represent the state with a simple variable, or use a counter/index since you need to count anyway
17:45
<
centrx >
You can do the same thing with the array two
17:45
karamazov has joined #ruby-lang
17:45
<
nottheoilrig >
yeah this sounds like it might work
17:46
<
nottheoilrig >
so the state variable is outside the block you pass to each_char or whatever
17:46
charliesome has joined #ruby-lang
17:46
tlewin has joined #ruby-lang
17:46
<
nottheoilrig >
but you update it from inside the block?
17:46
<
centrx >
nottheoilrig, Yes, it has to be set before the block as false or nil or something
17:47
<
nottheoilrig >
gotcha
17:47
<
centrx >
Then it will persist across iterations
17:47
<
centrx >
and it may need the reasonable initialized value anyway
17:48
<
nottheoilrig >
i like the slice_before solution
17:48
<
centrx >
Yes, that will work too
17:48
<
nottheoilrig >
if i had an array of each chunk that started with type 2 that would work
17:49
<
centrx >
Do you plan on making these strings/processing of them more complex in the future?
17:49
<
nottheoilrig >
the problem is that the type 2 pattern could also match a type 1 or type 3
17:49
ecnalyr has joined #ruby-lang
17:49
<
nottheoilrig >
nope no more complex in future
17:50
<
centrx >
ok yeah slice_before is good
17:50
<
centrx >
nottheoilrig> the problem is that the type 2 pattern could also match a type 1 or type 3
17:50
zoo-zed has quit [Quit: Leaving.]
17:50
<
centrx >
That sounds like a problem with the specification
17:50
<
nottheoilrig >
i need to say if it matches type 2 ignore the next 3 items
17:51
<
nottheoilrig >
dont test them for the beginning of the next chunk
17:51
x0f has quit [Ping timeout: 260 seconds]
17:51
<
centrx >
Yes, then you would need the counter anyway
17:51
adphillips has joined #ruby-lang
17:51
adphillips has quit [Client Quit]
17:51
tlewin has quit [Quit: Changing server]
17:52
<
centrx >
It's the way it is, that's how you process unstructured streams of data
17:52
<
centrx >
It should be a quick implementation, just not a one-line Ruby nicety
17:53
<
nottheoilrig >
heres some more context about what im trying to do
17:54
x0f has joined #ruby-lang
17:59
<
centrx >
nottheoilrig, Regular expressions seem like the way to do it since it's a string
17:59
<
centrx >
nottheoilrig, Regular expressions comes with the state machine built-in
17:59
elia has quit [Quit: Computer has gone to sleep.]
18:00
elia has joined #ruby-lang
18:00
elia has quit [Client Quit]
18:02
<
nottheoilrig >
yeah i hacked it up pretty quick with pythons regexobject.split
18:02
<
nottheoilrig >
but unfortunately i have a lot less experience with ruby
18:03
yfeldblum has joined #ruby-lang
18:05
badeball has joined #ruby-lang
18:06
<
seanhagen >
is it possible to tell rbenv to execute a gem-installed executable without trying to reference or pull in a projects bundled gems?
18:06
ecnalyr has quit [Remote host closed the connection]
18:07
<
seanhagen >
i think it's causing some issues when trying to run librarian-puppet inside of a Rails 4 project
18:07
havenwood has joined #ruby-lang
18:09
loinclot_ has quit [Remote host closed the connection]
18:10
pixelhandler has joined #ruby-lang
18:11
karamazov has quit [Remote host closed the connection]
18:12
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:12
yfeldblum has quit [Remote host closed the connection]
18:13
faces has joined #ruby-lang
18:14
yfeldblum has joined #ruby-lang
18:15
yfeldblum has quit [Remote host closed the connection]
18:15
yfeldblum has joined #ruby-lang
18:15
face has quit [Ping timeout: 264 seconds]
18:20
yfeldblum has quit [Remote host closed the connection]
18:23
mehlah has quit [Quit: Leaving...]
18:24
postmodern has joined #ruby-lang
18:24
apeiros has quit [Remote host closed the connection]
18:24
stef1a has joined #ruby-lang
18:25
apeiros has joined #ruby-lang
18:25
jgpawletko_ has joined #ruby-lang
18:27
jgpawletko has quit [Ping timeout: 255 seconds]
18:27
jgpawletko_ is now known as jgpawletko
18:27
banister has joined #ruby-lang
18:29
apeiros has quit [Ping timeout: 255 seconds]
18:29
toretore has quit [Ping timeout: 245 seconds]
18:31
__butch__ has joined #ruby-lang
18:32
mykoweb has joined #ruby-lang
18:32
mykoweb has quit [Remote host closed the connection]
18:32
mykoweb has joined #ruby-lang
18:32
<
centrx >
stef1a, You may be able to pass the block as a Proc
18:34
yfeldblum has joined #ruby-lang
18:36
mykoweb has quit [Ping timeout: 240 seconds]
18:37
toretore has joined #ruby-lang
18:37
vintik has joined #ruby-lang
18:38
<
yorickpeterse >
argh, getting Racc test suite going is a royal pita
18:38
<
yorickpeterse >
none of the bloody hoe/rake tasks work either
18:38
<
havenwood >
stef1a: commented on your gist
18:38
<
stef1a >
havenwood: thanks so much!
18:39
tylersmith has quit [Read error: Connection reset by peer]
18:39
tylersmith has joined #ruby-lang
18:43
sweo has quit [Remote host closed the connection]
18:44
sweo has joined #ruby-lang
18:44
Squarepy has quit [Quit: Leaving]
18:44
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:46
arooni-mobile has quit [Read error: Connection reset by peer]
18:47
djbkd has quit [Remote host closed the connection]
18:48
havenwood has quit [Remote host closed the connection]
18:48
djbkd has joined #ruby-lang
18:51
dangerousdave has quit [Ping timeout: 250 seconds]
18:51
jaimef has quit [Excess Flood]
18:54
loincloth has joined #ruby-lang
18:56
havenwood has joined #ruby-lang
18:57
benlovell has joined #ruby-lang
18:59
dangerousdave has joined #ruby-lang
19:00
jaimef has joined #ruby-lang
19:04
fullybaked has joined #ruby-lang
19:06
touzin has joined #ruby-lang
19:07
dangerousdave has quit [Ping timeout: 255 seconds]
19:08
wallerdev has quit [Quit: wallerdev]
19:11
brianpWins has joined #ruby-lang
19:12
djbkd has quit [Remote host closed the connection]
19:17
dangerousdave has joined #ruby-lang
19:19
hahuang65 has quit [Read error: Connection reset by peer]
19:19
apeiros has joined #ruby-lang
19:20
hahuang65 has joined #ruby-lang
19:21
Fushi has quit [Quit: Connection closed for inactivity]
19:22
karamazov has joined #ruby-lang
19:23
AKASkip has joined #ruby-lang
19:24
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
19:26
jam__ has joined #ruby-lang
19:27
djbkd has joined #ruby-lang
19:27
Jam___ has joined #ruby-lang
19:35
scmx has quit [Ping timeout: 264 seconds]
19:36
JohnFord has joined #ruby-lang
19:38
jkprg has quit [Quit: jkprg]
19:39
relix has joined #ruby-lang
19:40
vintik has quit [Remote host closed the connection]
19:42
<
nottheoilrig >
how would you loop over all integers less than an expression whos value might change between iterations?
19:44
godd2 has joined #ruby-lang
19:47
<
centrx >
nottheoilrig, You can do that with a regular while loop
19:48
tbuehlmann has quit [Remote host closed the connection]
19:51
lele has quit [Ping timeout: 256 seconds]
19:51
vintik has joined #ruby-lang
19:54
jlovick has quit [Ping timeout: 240 seconds]
19:55
jlovick has joined #ruby-lang
19:56
amystephen has joined #ruby-lang
19:56
beawesomeinstead has quit [Quit: Connection closed for inactivity]
19:57
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
19:59
havenwood has quit [Ping timeout: 264 seconds]
19:59
yfeldblum has quit [Remote host closed the connection]
19:59
touzin has quit [Ping timeout: 256 seconds]
20:00
solars has joined #ruby-lang
20:02
yfeldblum has joined #ruby-lang
20:02
sepp2k has joined #ruby-lang
20:04
<
nottheoilrig >
how do you remove items from an array by index?
20:04
rcvalle has joined #ruby-lang
20:05
<
godd2 >
arr.delete_at(index)
20:05
Johz has joined #ruby-lang
20:05
lele has joined #ruby-lang
20:05
<
nottheoilrig >
thanks
20:06
<
nottheoilrig >
what about removing elements in a range?
20:06
<
nottheoilrig >
ill try delete_at 4..5
20:07
<
Mon_Ouie >
You can use arr[range] = []
20:07
<
nottheoilrig >
nope
20:07
<
nottheoilrig >
okay thanks Mon_Ouie
20:08
<
nottheoilrig >
what is the preferred way to get the length of the array?
20:08
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:08
<
nottheoilrig >
.lenth i assume?
20:08
benlovell has quit [Ping timeout: 256 seconds]
20:10
<
Mon_Ouie >
Probably .size considering everyone mistypes length
20:11
brianpWins has quit [Quit: brianpWins]
20:11
wallerdev has joined #ruby-lang
20:12
mehlah has joined #ruby-lang
20:15
mehlah has quit [Client Quit]
20:16
Sirupsen has joined #ruby-lang
20:21
stef1a has left #ruby-lang [#ruby-lang]
20:24
marr has joined #ruby-lang
20:25
danijoo has quit [Read error: Connection reset by peer]
20:26
danijoo has joined #ruby-lang
20:27
mistym has quit [Remote host closed the connection]
20:28
danijoo_ has joined #ruby-lang
20:28
danijoo has quit [Read error: Connection reset by peer]
20:29
fullybaked has quit []
20:32
havenwood has joined #ruby-lang
20:33
shinnya has joined #ruby-lang
20:34
arBmind1 has joined #ruby-lang
20:35
mehlah has joined #ruby-lang
20:42
mistym has joined #ruby-lang
20:46
|jemc| has joined #ruby-lang
20:49
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
20:54
Sirupsen has joined #ruby-lang
20:57
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
20:58
charliesome has joined #ruby-lang
21:00
MartynKeigher has joined #ruby-lang
21:00
yfeldblum has quit [Read error: Connection reset by peer]
21:00
<
MartynKeigher >
hey all... im working on some code and I know im so close... but its just not working! Here is the code:
http://pastebin.com/JF8n1rE1 can someone tell me what bit is wrong, and point me in the right direction!?? Thanks.
21:01
<
MartynKeigher >
you should be able to see what im doing here, but im passing a variable INTO a sql query, - and fyi, if i do this the 'non variable way' it works fine. im just trying to save my self from making lots of ruby files, for all my queries.
21:07
Atttwww has joined #ruby-lang
21:08
mehlah_ has joined #ruby-lang
21:08
mehlah has quit [Read error: Connection reset by peer]
21:09
<
centrx >
MartynKeigher, What doesn't work?
21:10
jgpawletko has quit [Quit: jgpawletko]
21:11
<
apeiros >
MartynKeigher: do NOT. EVER. user string interpolation to add variables to queries.
21:11
<
apeiros >
that's one of the main reason for security leaks.
21:11
<
MartynKeigher >
im trying to get the values of the query to show on my dashboard
21:11
<
apeiros >
every sane SQL database provides bind variables for that. that is, placeholders in your query + an array with the values.
21:12
<
MartynKeigher >
thats what im trying to apeiros .... i think im close. but not quite got it to show the values
21:13
<
MartynKeigher >
first time at using variables
21:14
havenn has joined #ruby-lang
21:14
<
MartynKeigher >
do u have any recommendations for me?
21:14
<
godd2 >
SELECT computerid FROM Computers ? shouldn't you be asking for fields on a table?
21:15
brianpWins has joined #ruby-lang
21:15
ldnunes has quit [Quit: Leaving]
21:15
djbkd has quit [Remote host closed the connection]
21:15
havenwood has quit [Ping timeout: 264 seconds]
21:18
mistym has quit [Remote host closed the connection]
21:20
_ht has quit [Remote host closed the connection]
21:21
Technodrome has quit [Quit: Technodrome]
21:21
yfeldblum has joined #ruby-lang
21:22
<
MartynKeigher >
ya.. computerid is the column. computers is the table
21:22
<
MartynKeigher >
lower in the my ruby job.. its counts the rows of the result.
21:23
<
MartynKeigher >
i know i can do object.each but for what ever reason... its not playing nicely, so im letting ruby count, and not sql
21:24
cklee has joined #ruby-lang
21:25
kyb3r_ has joined #ruby-lang
21:28
djbkd has joined #ruby-lang
21:28
cleopatra has joined #ruby-lang
21:28
sirene has joined #ruby-lang
21:29
pixelhandler has quit [Quit: pixelhandler]
21:31
karamazov has quit [Remote host closed the connection]
21:32
yfeldblum has quit [Remote host closed the connection]
21:32
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:34
pixelhandler has joined #ruby-lang
21:35
mistym has joined #ruby-lang
21:35
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:36
momomomomo has joined #ruby-lang
21:37
pixelhandler has quit [Client Quit]
21:38
yfeldblum has joined #ruby-lang
21:41
amigo99 has left #ruby-lang ["Leaving"]
21:42
djbkd has quit [Remote host closed the connection]
21:44
__butch__ has quit [Quit: Leaving.]
21:45
djbkd has joined #ruby-lang
21:48
ironhide_604 has joined #ruby-lang
21:49
centrx has quit [Quit: Mead error: Connection reset by beer]
21:51
Johz has quit [Quit: Leaving]
21:52
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:53
djbkd has quit [Remote host closed the connection]
21:53
MartynKeigher has quit [Remote host closed the connection]
21:53
Technodrome has joined #ruby-lang
21:54
solars has quit [Ping timeout: 240 seconds]
21:55
Olipro has quit [Read error: Connection reset by peer]
21:55
djbkd has joined #ruby-lang
21:59
apeiros has quit [Remote host closed the connection]
21:59
apeiros has joined #ruby-lang
22:00
karamazov has joined #ruby-lang
22:01
loincloth has quit [Remote host closed the connection]
22:01
Sgeo has joined #ruby-lang
22:01
havenn has quit [Remote host closed the connection]
22:02
Olipro has joined #ruby-lang
22:02
jaimef has quit [Excess Flood]
22:02
jaimef has joined #ruby-lang
22:03
djbkd has quit [Remote host closed the connection]
22:06
xybre has joined #ruby-lang
22:12
D9 has joined #ruby-lang
22:13
cmhobbs has quit [Remote host closed the connection]
22:14
elia has joined #ruby-lang
22:14
djbkd has joined #ruby-lang
22:20
escues has quit [Quit: escues]
22:24
djbkd has quit [Remote host closed the connection]
22:24
djbkd has joined #ruby-lang
22:26
yfeldblum has quit [Remote host closed the connection]
22:27
Xney has joined #ruby-lang
22:30
pixelhandler has joined #ruby-lang
22:30
rcvalle has quit [Quit: rcvalle]
22:32
jlovick has quit [Ping timeout: 245 seconds]
22:33
yfeldblum has joined #ruby-lang
22:33
yfeldblum has quit [Remote host closed the connection]
22:35
nofxx_ has joined #ruby-lang
22:35
nofxx_ has joined #ruby-lang
22:36
tylersmith has quit [Ping timeout: 245 seconds]
22:38
nofxx has quit [Ping timeout: 245 seconds]
22:40
tylersmith has joined #ruby-lang
22:40
spuk has joined #ruby-lang
22:40
kyb3r_ has quit [Read error: Connection reset by peer]
22:40
djbkd has quit [Remote host closed the connection]
22:42
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
22:42
spuk has quit [Client Quit]
22:43
kyb3r_ has joined #ruby-lang
22:43
_djbkd has joined #ruby-lang
22:43
ironhide_604 has quit [Ping timeout: 255 seconds]
22:44
devgiant has joined #ruby-lang
22:46
bantic has quit [Quit: bantic]
22:47
banister has joined #ruby-lang
22:48
|jemc| has quit [Quit: WeeChat 0.4.3]
22:51
kyb3r_ has quit [Read error: Connection reset by peer]
22:51
karamazov has quit [Remote host closed the connection]
22:51
karamazov has joined #ruby-lang
22:53
devgiant has quit [Quit: Leaving]
22:54
kyb3r_ has joined #ruby-lang
22:59
elia has quit [Quit: Computer has gone to sleep.]
23:01
spuk_ has quit [Ping timeout: 272 seconds]
23:02
dangerousdave has quit [Ping timeout: 255 seconds]
23:02
AKASkip has quit [Ping timeout: 264 seconds]
23:03
elia has joined #ruby-lang
23:08
elia has quit [Client Quit]
23:08
elia has joined #ruby-lang
23:10
tylersmith has quit [Remote host closed the connection]
23:10
joast has quit [Quit: Leaving.]
23:10
JEG2 has quit [Quit: Connection closed for inactivity]
23:15
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:15
Mon_Ouie has quit [Ping timeout: 264 seconds]
23:17
hackeron has quit [Ping timeout: 245 seconds]
23:20
dik_dak has joined #ruby-lang
23:20
mehlah_ is now known as mehlah
23:20
yfeldblum has joined #ruby-lang
23:21
lsegal has joined #ruby-lang
23:21
mikecmpbll has quit [Quit: i've nodded off.]
23:24
hackeron has joined #ruby-lang
23:26
|jemc| has joined #ruby-lang
23:27
hahuang65 has quit [Ping timeout: 250 seconds]
23:33
diegoviola has joined #ruby-lang
23:38
dik_dak has quit [Ping timeout: 255 seconds]
23:41
karamazov has quit []
23:42
ecnalyr has joined #ruby-lang
23:47
ecnalyr has quit [Ping timeout: 264 seconds]
23:47
lsegal has quit [Read error: Connection reset by peer]
23:47
lsegal has joined #ruby-lang
23:50
weems|mac has joined #ruby-lang
23:53
dik_dak has joined #ruby-lang
23:55
dik_dak has quit [Client Quit]
23:56
yfeldblum has quit [Remote host closed the connection]
23:57
yfeldblum has joined #ruby-lang