00:00
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:01
j4cknewt has quit [Remote host closed the connection]
00:04
skade has quit [Quit: Computer has gone to sleep.]
00:08
ledestin has joined #ruby-lang
00:09
skade has joined #ruby-lang
00:16
houhoulis has joined #ruby-lang
00:20
kr3ssh has quit [Ping timeout: 272 seconds]
00:22
skade has quit [Quit: Computer has gone to sleep.]
00:22
|jemc| has quit [Quit: WeeChat 1.1.1]
00:23
|jemc| has joined #ruby-lang
00:24
skade has joined #ruby-lang
00:27
toretore has quit [Quit: This computer has gone to sleep]
00:29
cb__ has quit [Remote host closed the connection]
00:32
iamninja_ has quit [Read error: Connection reset by peer]
00:33
Musashi007 has quit [Quit: Musashi007]
00:33
iamninja_ has joined #ruby-lang
00:34
cb__ has joined #ruby-lang
00:36
cb__ has quit [Remote host closed the connection]
00:37
crankharder has joined #ruby-lang
00:37
cb__ has joined #ruby-lang
00:38
bruno- has quit [Ping timeout: 244 seconds]
00:39
j4cknewt has joined #ruby-lang
00:40
cb__ has quit [Remote host closed the connection]
00:40
skade has quit [Quit: Computer has gone to sleep.]
00:42
cb_ has joined #ruby-lang
00:42
cb_ has joined #ruby-lang
00:45
dented42 has joined #ruby-lang
00:58
dorei has quit [Ping timeout: 264 seconds]
00:58
charliesome has joined #ruby-lang
01:01
simi has quit [Ping timeout: 256 seconds]
01:02
datanoise has joined #ruby-lang
01:02
alestuber has joined #ruby-lang
01:03
caesararum has joined #ruby-lang
01:03
nertzy has joined #ruby-lang
01:07
alestuber has quit [Ping timeout: 255 seconds]
01:07
datanoise has quit [Ping timeout: 258 seconds]
01:07
djellemah_ has joined #ruby-lang
01:09
<
caesararum >
can anyone help me understand why if I create a module that has a method that calls ObjectSpace.each_object(Module).count and run it, it consistently returns 0
01:10
<
apeiros >
caesararum: uh, what? ObjectSpace.each_object(Module).count should never return 0
01:10
<
caesararum >
right?
01:10
<
apeiros >
gist your code
01:11
djellemah has quit [Ping timeout: 276 seconds]
01:14
<
caesararum >
oh ffs I think I might see it
01:14
<
caesararum >
GOD DAMMIT
01:14
<
apeiros >
namespace…
01:14
<
caesararum >
I thought I was being cheeky by naming something Project::Module
01:14
<
apeiros >
you need ::Module there
01:14
<
caesararum >
thanks for being a rubber duck, I guess
01:14
gambl0re has joined #ruby-lang
01:14
* apeiros
floats away
01:17
bahar has quit [Ping timeout: 255 seconds]
01:20
iamninja_ has quit [Read error: Connection reset by peer]
01:23
bahar has joined #ruby-lang
01:23
cb_ has quit [Remote host closed the connection]
01:25
j4cknewt has quit [Remote host closed the connection]
01:25
nertzy has quit [Quit: This computer has gone to sleep]
01:30
cb__ has joined #ruby-lang
01:35
bruno- has joined #ruby-lang
01:39
cb__ has quit [Remote host closed the connection]
01:40
bruno- has quit [Ping timeout: 272 seconds]
01:44
iamninja_ has joined #ruby-lang
01:48
kfpratt has joined #ruby-lang
01:49
postmodern has joined #ruby-lang
01:50
dented42_ has joined #ruby-lang
01:50
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
01:51
Ropeney has joined #ruby-lang
01:52
<
caesararum >
ack :P
01:52
caesararum has quit [Quit: WeeChat 1.1.1]
01:52
caesararum has joined #ruby-lang
01:52
dented42 has quit [Ping timeout: 265 seconds]
01:54
Forgetful_Lion has joined #ruby-lang
02:00
slawrence00 has joined #ruby-lang
02:04
dented42_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:14
charliesome has quit [Quit: zzz]
02:15
kfpratt has quit [Remote host closed the connection]
02:17
cb_ has joined #ruby-lang
02:20
<
postmodern >
where on ruby-lang.org does it show the support timeframes for 2.1 and 2.2?
02:20
<
postmodern >
found a minor bug in 2.1 and wondering if it's still technically supported/maintained
02:22
kfpratt has joined #ruby-lang
02:26
Miphix has joined #ruby-lang
02:27
BanzaiJoe has joined #ruby-lang
02:30
io_syl_ has joined #ruby-lang
02:30
io_syl has quit [Ping timeout: 256 seconds]
02:42
cb_ has quit [Remote host closed the connection]
02:44
kfpratt has quit [Remote host closed the connection]
02:44
<
jhass >
I think they only announce it in the news
02:44
tsujp has joined #ruby-lang
02:44
<
jhass >
when a version enters security maintenance and EOLs
02:45
<
jhass >
like "this is the last bugfix release blabla"
02:51
datanoise has joined #ruby-lang
02:53
cb__ has joined #ruby-lang
02:56
datanoise has quit [Ping timeout: 245 seconds]
03:10
joast has joined #ruby-lang
03:13
charliesome has joined #ruby-lang
03:20
shakes has joined #ruby-lang
03:28
tsujp has quit [Quit: tsujp is snoozing]
03:32
BanzaiJoe has quit [Ping timeout: 246 seconds]
03:32
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:33
tibig has quit [Ping timeout: 256 seconds]
03:35
dented42 has joined #ruby-lang
03:44
fedexo has joined #ruby-lang
03:48
kfpratt has joined #ruby-lang
03:48
Musashi007 has joined #ruby-lang
03:50
iamninja_ has quit [Read error: Connection reset by peer]
03:56
David_H__ has joined #ruby-lang
03:59
David_H_Smith has quit [Ping timeout: 256 seconds]
04:00
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
04:04
fungal has quit [Read error: Connection reset by peer]
04:04
fungal has joined #ruby-lang
04:07
Ropeney has joined #ruby-lang
04:07
Musashi007 has quit [Quit: Musashi007]
04:08
datanoise has joined #ruby-lang
04:14
iamninja_ has joined #ruby-lang
04:18
fungal has quit [Read error: Connection reset by peer]
04:20
dabradley has quit [Ping timeout: 244 seconds]
04:21
dabradley has joined #ruby-lang
04:22
caesararum has quit [Read error: Connection reset by peer]
04:38
simi has joined #ruby-lang
04:52
datanoise has quit [Ping timeout: 256 seconds]
04:53
j4cknewt has joined #ruby-lang
04:56
gianlucadv has joined #ruby-lang
04:57
riotjones has joined #ruby-lang
04:57
caseypatrickdris has quit [Remote host closed the connection]
04:58
riotjones has quit [Read error: Connection reset by peer]
04:58
riotjone_ has joined #ruby-lang
04:59
riotjone_ has quit [Read error: Connection reset by peer]
04:59
riotjones has joined #ruby-lang
04:59
riotjones has quit [Read error: Connection reset by peer]
05:00
riotjones has joined #ruby-lang
05:00
riotjones has quit [Read error: Connection reset by peer]
05:01
riotjones has joined #ruby-lang
05:05
riotjones has quit [Ping timeout: 265 seconds]
05:12
caesararum has joined #ruby-lang
05:12
iamninja_ has quit [Read error: Connection reset by peer]
05:13
bruno- has joined #ruby-lang
05:17
iamninja_ has joined #ruby-lang
05:18
bruno- has quit [Ping timeout: 256 seconds]
05:24
TexqAlt is now known as AlexAltea
05:25
gianlucadv has quit [Ping timeout: 264 seconds]
05:26
shakes has quit [Quit: Leaving]
05:27
k6 has quit [Ping timeout: 265 seconds]
05:28
ubernil has joined #ruby-lang
05:28
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
05:31
j4cknewt has quit [Remote host closed the connection]
05:35
simi has quit [Ping timeout: 246 seconds]
05:38
David_H__ has quit [Remote host closed the connection]
05:39
kfpratt has quit [Ping timeout: 272 seconds]
05:42
shinnya has quit [Ping timeout: 256 seconds]
05:46
houhoulis has quit [Remote host closed the connection]
05:48
datanoise has joined #ruby-lang
05:49
chinmay_dd has joined #ruby-lang
05:56
chinmay_dd has quit [Remote host closed the connection]
05:58
David_H_Smith has joined #ruby-lang
05:59
David_H__ has joined #ruby-lang
06:03
David_H_Smith has quit [Ping timeout: 258 seconds]
06:08
slumos is now known as slumos[away]
06:09
slumos[away] is now known as slumos
06:13
io_syl_ has quit []
06:17
chinmay_dd has joined #ruby-lang
06:21
revath has joined #ruby-lang
06:21
datanoise has quit [Ping timeout: 255 seconds]
06:25
|jemc| has quit [Ping timeout: 252 seconds]
06:27
revath has quit [Ping timeout: 258 seconds]
06:32
j4cknewt has joined #ruby-lang
06:33
nedp has quit [Remote host closed the connection]
06:34
iamninja_ has quit [Ping timeout: 276 seconds]
06:37
kfpratt has joined #ruby-lang
06:38
j4cknewt has quit [Ping timeout: 265 seconds]
06:39
face has joined #ruby-lang
06:46
fungal has joined #ruby-lang
06:54
caesararum has quit [Read error: Connection reset by peer]
06:55
<
ddfreyne >
postmodern: I guess so. Even 2.0 is still maintained.
06:55
<
ddfreyne >
postmodern: Oh, security fix vs non-security fix? I have no idea.
06:59
ta has quit [Remote host closed the connection]
07:02
fedexo has quit [Ping timeout: 265 seconds]
07:08
kfpratt has quit [Ping timeout: 252 seconds]
07:18
datanoise has joined #ruby-lang
07:23
kr3ssh has joined #ruby-lang
07:23
datanoise has quit [Ping timeout: 264 seconds]
07:23
VinnyBoy has quit [Read error: Connection reset by peer]
07:28
slawrence00 has joined #ruby-lang
07:28
micmus has joined #ruby-lang
07:32
djbkd_ has joined #ruby-lang
07:37
ta has joined #ruby-lang
07:43
chinmay_dd has quit [Quit: See ya!]
07:48
k3asd` has joined #ruby-lang
07:50
bb010g has quit [Quit: Connection closed for inactivity]
07:56
kyb3r_ has joined #ruby-lang
07:57
niemcu has joined #ruby-lang
07:58
bruno- has joined #ruby-lang
07:58
kyb3r_ has quit [Client Quit]
08:02
iamninja_ has joined #ruby-lang
08:05
clauswitt has joined #ruby-lang
08:11
fungal has quit [Ping timeout: 265 seconds]
08:17
kr3ssh has quit [Ping timeout: 264 seconds]
08:25
ta has quit [Remote host closed the connection]
08:32
nedp has joined #ruby-lang
08:34
fungal has joined #ruby-lang
08:39
fungal has quit [Ping timeout: 276 seconds]
08:51
ubernil has quit [Ping timeout: 276 seconds]
08:52
chinmay_dd has joined #ruby-lang
08:52
ubernil has joined #ruby-lang
08:53
kfpratt has joined #ruby-lang
09:00
shinnya has joined #ruby-lang
09:06
niemcu has quit [Ping timeout: 265 seconds]
09:07
datanoise has joined #ruby-lang
09:10
simi has joined #ruby-lang
09:10
djbkd_ has quit [Remote host closed the connection]
09:10
fungal has joined #ruby-lang
09:12
datanoise has quit [Ping timeout: 265 seconds]
09:15
cornerma1 has joined #ruby-lang
09:15
fungal has quit [Ping timeout: 255 seconds]
09:18
cornerman has quit [Ping timeout: 255 seconds]
09:18
cornerma1 is now known as cornerman
09:19
araujo has quit [Read error: Connection timed out]
09:20
araujo has joined #ruby-lang
09:23
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
09:26
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
09:26
kfpratt has quit [Ping timeout: 256 seconds]
09:27
vmatiyko has joined #ruby-lang
09:28
skade has joined #ruby-lang
09:32
toretore has joined #ruby-lang
09:34
cb__ has quit [Remote host closed the connection]
09:37
micmus has quit [Ping timeout: 256 seconds]
09:38
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
09:46
elia has joined #ruby-lang
09:50
micmus has joined #ruby-lang
09:51
ubernil has quit [Read error: Connection reset by peer]
09:53
ubernil has joined #ruby-lang
09:58
niemcu has joined #ruby-lang
10:04
AlxAltea has joined #ruby-lang
10:04
nedp has quit [Remote host closed the connection]
10:04
AlexAltea has quit [Ping timeout: 265 seconds]
10:04
djellemah_ has quit [Ping timeout: 250 seconds]
10:08
AlxAlt has joined #ruby-lang
10:09
AlxAltea has quit [Ping timeout: 255 seconds]
10:10
stamina has joined #ruby-lang
10:11
elia has quit [Quit: Computer has gone to sleep.]
10:12
druznek has joined #ruby-lang
10:14
sarkyniin has joined #ruby-lang
10:21
djbkd_ has joined #ruby-lang
10:22
Mon_Ouie has quit [Ping timeout: 252 seconds]
10:23
lapide_viridi has joined #ruby-lang
10:25
djbkd_ has quit [Ping timeout: 252 seconds]
10:26
lapide_viridi has quit [Client Quit]
10:32
charliesome has quit [Quit: zzz]
10:37
fungal has joined #ruby-lang
10:38
chinmay_dd has quit [Remote host closed the connection]
10:39
charliesome has joined #ruby-lang
10:39
charliesome has quit [Client Quit]
10:42
fungal has quit [Ping timeout: 255 seconds]
10:43
charliesome has joined #ruby-lang
10:43
charliesome has quit [Client Quit]
10:46
chinmay_dd has joined #ruby-lang
10:46
riotjones has joined #ruby-lang
10:47
riotjones has quit [Read error: Connection reset by peer]
10:47
riotjones has joined #ruby-lang
10:50
chinmay_dd has quit [Remote host closed the connection]
10:50
tibig has joined #ruby-lang
10:52
riotjones has quit [Ping timeout: 246 seconds]
10:54
stardiviner has joined #ruby-lang
10:55
slawrence00 has joined #ruby-lang
10:55
j4cknewt has joined #ruby-lang
10:57
datanoise has joined #ruby-lang
10:59
stardiviner has quit [Ping timeout: 252 seconds]
11:01
datanoise has quit [Ping timeout: 258 seconds]
11:05
cb__ has joined #ruby-lang
11:05
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:08
araujo has quit [Quit: Leaving]
11:10
sarkyniin has quit [Ping timeout: 256 seconds]
11:11
kfpratt has joined #ruby-lang
11:12
stardiviner has joined #ruby-lang
11:14
nedp has joined #ruby-lang
11:17
stardiviner has quit [Ping timeout: 255 seconds]
11:20
araujo has joined #ruby-lang
11:20
araujo has joined #ruby-lang
11:21
kfpratt has quit [Ping timeout: 256 seconds]
11:24
Pathfinder has joined #ruby-lang
11:26
kr3ssh has joined #ruby-lang
11:26
chinmay_dd has joined #ruby-lang
11:29
stardiviner has joined #ruby-lang
11:37
<
jhass >
they also do parens for raise, so...
11:37
<
jhass >
contrived argument: duck typing, I could pass in something that pretends to be TrueClass or FalseClass
11:38
<
jhass >
(an instance of)
11:38
<
jhass >
but then that falls apart with the assignment later, so meh
11:38
<
ledestin >
jhass but it's .class == TrueClass, not kind_of
11:39
<
jhass >
yeah, class MyTrue; def class; TrueClass; end; end;
11:39
<
jhass >
I prefixed with contrived for reason!
11:40
<
ledestin >
what about A < TrueClass? wouldnt' work
11:40
<
jhass >
so just being silly
11:41
<
ledestin >
but then, can't call A.new :(
11:42
<
ledestin >
jhass thanks
11:45
fungal has joined #ruby-lang
11:45
charliesome has joined #ruby-lang
11:49
tkuchiki has joined #ruby-lang
11:50
fungal has quit [Ping timeout: 264 seconds]
11:53
dorei has joined #ruby-lang
11:53
revath has joined #ruby-lang
11:54
banister has joined #ruby-lang
11:55
skade has quit [Quit: Computer has gone to sleep.]
11:57
nedp has quit [Remote host closed the connection]
11:58
datanoise has joined #ruby-lang
11:59
k3asd` has quit [Ping timeout: 272 seconds]
12:00
charliesome has quit [Quit: zzz]
12:00
charliesome has joined #ruby-lang
12:00
kr3ssh has quit [Ping timeout: 256 seconds]
12:02
revath has quit [Ping timeout: 245 seconds]
12:03
bahar has quit [Ping timeout: 250 seconds]
12:04
datanoise has quit [Ping timeout: 240 seconds]
12:09
druznek has quit [Ping timeout: 244 seconds]
12:09
bahar has joined #ruby-lang
12:10
kr3ssh has joined #ruby-lang
12:11
pico-pete has joined #ruby-lang
12:13
vmatiyko has quit [Ping timeout: 272 seconds]
12:14
vmatiyko has joined #ruby-lang
12:17
kr3ssh has quit [Ping timeout: 244 seconds]
12:18
symm- has quit [Ping timeout: 240 seconds]
12:18
simi has quit [Ping timeout: 265 seconds]
12:19
dented42 has joined #ruby-lang
12:21
symm- has joined #ruby-lang
12:21
atomical has joined #ruby-lang
12:22
fusillicode1 has joined #ruby-lang
12:25
fusillicode has quit [Ping timeout: 255 seconds]
12:26
kr3ssh has joined #ruby-lang
12:29
pgatt has joined #ruby-lang
12:30
[k- has joined #ruby-lang
12:32
Forgetful_Lion has quit [Remote host closed the connection]
12:33
kfpratt has joined #ruby-lang
12:34
kr3ssh has quit [Ping timeout: 264 seconds]
12:40
kfpratt has quit [Ping timeout: 272 seconds]
12:43
<
yorickpeterse >
I would kill for a laptop with a screen that's just as readable out in the sun as inside
12:43
<
yorickpeterse >
super nice weather and I really need to get some coding done, which sadly means staying inside :<
12:44
<
ledestin >
yorickpeterse um, umbrella-like thingie, like on the beach?
12:46
iamninja_ has quit [Read error: Connection reset by peer]
12:47
iamninja_ has joined #ruby-lang
12:47
<
yorickpeterse >
haha
12:47
<
[k- >
do people really use that
12:47
<
yorickpeterse >
I can't see that being very comfortable outside
12:48
<
yorickpeterse >
also that's going to hurt your neck like crazy
12:48
<
apeiros >
my wife said I should use that when I'm using my laptop in bed :D
12:49
<
toretore >
what are you doing on your laptop in bed that makes her say that?
12:49
<
yorickpeterse >
downloading Linux ISOs of course
12:49
<
apeiros >
I'm using it. and it's bright. and she can't sleep. but she doesn't want me to go out of the room either…
12:50
<
yorickpeterse >
hm, I guess I also should finally plan what I want to do on my vacation
12:50
<
yorickpeterse >
since that starts next week
12:51
<
toretore >
my laptop has no battery and no keyboard, so using it in bed gets difficult
12:51
<
toretore >
not much trackpad either
12:53
<
yorickpeterse >
so..it's not a laptop?
12:54
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
12:56
<
toretore >
i guess not
12:57
<
[k- >
are you sure it is even portable...
12:59
<
yorickpeterse >
can you put it on your lap?
12:59
<
toretore >
it's a laptop, it's just that the battery, keyboard and trackpad are broken
12:59
<
yorickpeterse >
heh
13:09
stan has joined #ruby-lang
13:11
<
rio >
when using scan with a regex like /(a)|(b)/, is there a way to obtain the results like [matched, group number] instead of ["a", nil] and [nil, "b"]?
13:13
<
yorickpeterse >
tried using /(a|b)/ ?
13:13
<
yorickpeterse >
e.g.
13:13
<
yorickpeterse >
>> 'aaaa 123 bbb'.scan(/(a|b)/)
13:13
<
rio >
then i can't decide which one matched at all...
13:13
<
toretore >
you can use $~ or whatever it is
13:14
<
yorickpeterse >
well, I guess you can also use named captures
13:14
<
rio >
i have a list of patterns and want to search a string for all occurences of the patterns, and i want to know which match belongs to which pattern
13:14
<
yorickpeterse >
>> 'aaaa 123 bbb'.scan(/(?<group_a>a)|(?<group_b>b)/)
13:14
<
eval-in >
yorickpeterse => [["a", nil], ["a", nil], ["a", nil], ["a", nil], [nil, "b"], [nil, "b"], [nil, "b"]] (
https://eval.in/366475)
13:14
<
yorickpeterse >
errr what was the syntax again
13:15
<
yorickpeterse >
oh hm, that's supposed to be right
13:15
<
yorickpeterse >
>> 'aaaa 123 bbb'.match(/(?<group_a>a)|(?<group_b>b)/)
13:15
<
yorickpeterse >
Ah, scan discards it
13:17
<
toretore >
>> ms=[]; 'aaaa 123 bbb'.scan(/(?<group_a>a)|(?<group_b>b)/){ ms << $~ }; ms
13:17
<
eval-in >
toretore => [#<MatchData "a" group_a:"a" group_b:nil>, #<MatchData "a" group_a:"a" group_b:nil>, #<MatchData "a" group_a:"a" group_b:nil>, #<MatchData "a" group_a:"a" group_b:nil>, #<MatchData "b" group_a:nil grou ... (
https://eval.in/366477)
13:18
<
yorickpeterse >
ah yes $~
13:18
<
toretore >
one of the non-features of ruby i really dislike, the non-use of MatchData
13:18
<
rio >
where can i read about $~?
13:19
<
[k- >
i don't really like matchdata...
13:19
<
toretore >
it's a magic variable that is set to the last regex match
13:19
<
toretore >
like $&, $1, etc
13:20
<
yorickpeterse >
toretore: oh yeah, it's odd String#scan can't just return an array of MatchData instances
13:20
<
toretore >
just an early decision that's too late to change now i guess
13:20
<
rio >
so now i need to find the unique group that hasn't a nil match :|
13:21
<
yorickpeterse >
toretore: sadly Ruby is riddled with those
13:21
<
yorickpeterse >
rio: what are you trying to do actually?
13:21
<
yorickpeterse >
as in, what kind of input are you trying to match and group together?
13:21
<
yorickpeterse >
There might be better ways to solve the problem, hence the question
13:21
<
toretore >
rio's boss: "hey rio, i have a bunch of a's and b's, i need you to write a program to match those"
13:21
<
rio >
yorickpeterse: let's say i have a hash of patterns and want to find all occurences in a string (in order of occurence) and for each of the patterns do something (depending on which pattern matched)
13:22
<
yorickpeterse >
Ah, so for "aaabbbccc" you basically want ["aaa", "bbbb", "ccc"]?
13:23
<
rio >
i have something like { :youtube => pattern_for_youtube_url, :twitter => pattern_for_twitter_url }
13:23
<
rio >
and now i want to iterate over matches of those in a string, knowing which one matched and what it matched
13:24
<
toretore >
you want to know which type of url it is?
13:24
<
rio >
yes i want to know which pattern of my patterns matched
13:24
<
yorickpeterse >
well, in such a case you could do something like
13:25
<
yorickpeterse >
{:youtube => /.../, :twitter => /.../}.each { |type, regex| if input_url.match(regex); ...; end }
13:25
<
toretore >
patterns.inject(nil){|res, (type, pattern)| url =~ pattern ? type : res }
13:25
<
yorickpeterse >
String#match returns nil upon no match, so if it
_does_ return a MatchData you know that the input URL is of the type "type" (as per the example above)
13:26
<
rio >
yorickpeterse: what about multiple occurences of the same pattern?
13:26
kr3ssh has joined #ruby-lang
13:27
<
rio >
also, what about the order of occurence?
13:27
<
yorickpeterse >
If multiple patterns match you have to decide somehow which one is correct
13:28
<
yorickpeterse >
or use unique patterns
13:28
<
toretore >
patterns.each_with_object([]){|matches, (type, pattern)| matches << type if url =~ pattern }
13:28
<
rio >
yorickpeterse: i ment a string with say 3 youtube url followed by 1 twitter url followed by another youtube url
13:28
<
yorickpeterse >
oh right
13:28
<
rio >
now i want to iterate over those in the order of occurence
13:28
<
yorickpeterse >
well in that case you can do something like
13:29
<
toretore >
rio: it would be helpful if you told us what the actual goal is
13:29
<
rio >
toretore: having a set of uri-patterns and matching them against a string to iterate over the occurences
13:30
<
rio >
the patterns themselfs are disjoint
13:30
<
toretore >
no, that's not the goal; that is the solution you think it going to get you to the goal
13:30
<
rio >
no, that's the goal
13:31
datanoise has joined #ruby-lang
13:31
<
yorickpeterse >
something along those lines
13:32
<
rio >
this doesn't match multiple occurences
13:33
<
yorickpeterse >
Then adjust it so it does
13:33
<
yorickpeterse >
it's just a matter of changing the "match = ... if" to a while loop
13:33
<
rio >
no, then the order of occurence is wrong
13:34
<
yorickpeterse >
The only way to do it in input order is to use something like StringScanner
13:34
<
yorickpeterse >
As otherwise you'll either do it in order of the patterns, or in order of matches
13:34
<
yorickpeterse >
errr s/matches/types
13:34
<
rio >
okay, ill have a look
13:36
caseypatrickdris has joined #ruby-lang
13:36
datanoise has quit [Ping timeout: 264 seconds]
13:36
cb__ has quit [Remote host closed the connection]
13:37
cb__ has joined #ruby-lang
13:37
kr3ssh has quit [Ping timeout: 250 seconds]
13:38
bertocode has joined #ruby-lang
13:40
stardiviner has quit [Ping timeout: 256 seconds]
13:43
symm- has quit [Ping timeout: 264 seconds]
13:47
cb__ has quit [Remote host closed the connection]
13:53
stardiviner has joined #ruby-lang
14:00
stardiviner has quit [Ping timeout: 250 seconds]
14:08
dented42 has quit [Ping timeout: 244 seconds]
14:10
dented42 has joined #ruby-lang
14:13
shinnya has quit [Ping timeout: 265 seconds]
14:15
skade has joined #ruby-lang
14:18
Guest20 has joined #ruby-lang
14:24
myork80 has joined #ruby-lang
14:25
kfpratt has joined #ruby-lang
14:27
cb_ has joined #ruby-lang
14:27
cb_ has joined #ruby-lang
14:27
sarkyniin has joined #ruby-lang
14:28
myork80 has quit [Client Quit]
14:28
myork80 has joined #ruby-lang
14:28
charliesome has quit [Ping timeout: 265 seconds]
14:30
charliesome has joined #ruby-lang
14:30
skade has quit [Quit: Computer has gone to sleep.]
14:30
skade has joined #ruby-lang
14:31
druznek has joined #ruby-lang
14:31
skade has quit [Client Quit]
14:33
kr3ssh has joined #ruby-lang
14:33
skade has joined #ruby-lang
14:33
kfpratt has quit [Ping timeout: 244 seconds]
14:36
banister has quit [Ping timeout: 256 seconds]
14:36
sarkyniin has quit [Remote host closed the connection]
14:38
|jemc| has joined #ruby-lang
14:40
pgatt has quit [Quit: Connection closed for inactivity]
14:43
datanoise has joined #ruby-lang
14:44
stardiviner has joined #ruby-lang
14:48
sarkyniin has joined #ruby-lang
14:53
j0n3 has joined #ruby-lang
14:56
Ropeney has joined #ruby-lang
14:58
stan has quit [Ping timeout: 265 seconds]
14:58
datanoise has quit [Read error: Connection reset by peer]
15:01
caseypatrickdris has quit [Remote host closed the connection]
15:06
slawrence00 has joined #ruby-lang
15:06
druznek has quit [Ping timeout: 240 seconds]
15:07
ubernil_ has joined #ruby-lang
15:08
ubernil has quit [Ping timeout: 252 seconds]
15:09
weaksauce has quit [Ping timeout: 256 seconds]
15:10
druznek has joined #ruby-lang
15:12
fungal has joined #ruby-lang
15:16
fungal has quit [Ping timeout: 256 seconds]
15:21
banister has joined #ruby-lang
15:23
chinmay_dd has quit [Remote host closed the connection]
15:25
charliesome has quit [Quit: zzz]
15:26
caseypatrickdris has joined #ruby-lang
15:26
caseypatrickdris has quit [Remote host closed the connection]
15:28
caseypatrickdris has joined #ruby-lang
15:29
skade has quit [Quit: Computer has gone to sleep.]
15:33
caseypatrickdris has quit [Ping timeout: 256 seconds]
15:33
riotjones has joined #ruby-lang
15:34
riotjones has quit [Read error: Connection reset by peer]
15:34
riotjones has joined #ruby-lang
15:35
riotjones has quit [Read error: Connection reset by peer]
15:35
riotjones has joined #ruby-lang
15:36
druznek has quit [Quit: Leaving]
15:36
VinnyBoy has joined #ruby-lang
15:40
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:40
riotjones has quit [Ping timeout: 250 seconds]
15:40
cb_ has quit [Remote host closed the connection]
15:43
bahar has quit [Ping timeout: 252 seconds]
15:43
palar has joined #ruby-lang
15:46
myork80 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:48
sarkyniin has quit [Ping timeout: 256 seconds]
15:49
Volsus has joined #ruby-lang
15:49
bahar has joined #ruby-lang
15:57
skade has joined #ruby-lang
16:11
stamina has quit [Ping timeout: 256 seconds]
16:15
bb010g has joined #ruby-lang
16:16
caseypatrickdris has joined #ruby-lang
16:20
sarkyniin has joined #ruby-lang
16:25
amclain has joined #ruby-lang
16:25
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
16:33
atomical has joined #ruby-lang
16:35
ljarvis_ is now known as ljarvis
16:36
atomical has quit [Client Quit]
16:37
atomical has joined #ruby-lang
16:38
rippa has joined #ruby-lang
16:39
skade has quit [Quit: Computer has gone to sleep.]
16:42
skade has joined #ruby-lang
16:51
chinmay_dd has joined #ruby-lang
16:53
djellemah has joined #ruby-lang
17:02
caseypatrickdris has quit [Remote host closed the connection]
17:04
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
17:07
Volsus has quit [Quit: Leaving]
17:08
Pathfinder has quit [Ping timeout: 264 seconds]
17:11
slawrence00 has joined #ruby-lang
17:16
flgr_ is now known as flgr
17:19
j4cknewt has quit [Remote host closed the connection]
17:24
shinnya has joined #ruby-lang
17:32
ascarter has joined #ruby-lang
17:39
alestuber has joined #ruby-lang
17:41
j4cknewt has joined #ruby-lang
17:42
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
17:45
sarkyniin has quit [Remote host closed the connection]
17:54
niemcu has quit [Read error: Connection reset by peer]
17:54
fedexo has joined #ruby-lang
17:56
seank_ has quit [Remote host closed the connection]
17:56
ascarter has joined #ruby-lang
17:58
seank_ has joined #ruby-lang
17:58
stamina has joined #ruby-lang
17:59
chinmay_dd has quit []
17:59
fungal has joined #ruby-lang
18:04
fungal has quit [Ping timeout: 244 seconds]
18:05
weaksauce has joined #ruby-lang
18:10
ledestin has joined #ruby-lang
18:12
banister is now known as banisterfiend
18:17
skade has quit [Quit: Computer has gone to sleep.]
18:18
skade has joined #ruby-lang
18:18
joaomdmoura has joined #ruby-lang
18:18
palar has quit [Remote host closed the connection]
18:28
j4cknewt has quit [Remote host closed the connection]
18:32
tkuchiki has quit [Ping timeout: 244 seconds]
18:33
ubernil_ has quit [Ping timeout: 244 seconds]
18:35
fungal has joined #ruby-lang
18:39
j4cknewt has joined #ruby-lang
18:40
fungal has quit [Ping timeout: 272 seconds]
18:44
fungal has joined #ruby-lang
18:51
joaomdmoura has quit [Remote host closed the connection]
18:53
symm- has joined #ruby-lang
18:54
nwhirschfeld has joined #ruby-lang
18:56
joaomdmoura has joined #ruby-lang
19:04
fedexo has quit [Ping timeout: 265 seconds]
19:07
skade has quit [Quit: Computer has gone to sleep.]
19:07
k3asd` has joined #ruby-lang
19:08
alestuber has quit [Ping timeout: 258 seconds]
19:13
sarkyniin has joined #ruby-lang
19:14
sarkyniin is now known as SomeDude
19:14
skade has joined #ruby-lang
19:14
SomeDude is now known as SomeAnonDude
19:15
alestuber has joined #ruby-lang
19:20
alestuber has quit [Ping timeout: 264 seconds]
19:22
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
19:24
araujo has quit [Quit: Leaving]
19:25
j4cknewt has quit [Remote host closed the connection]
19:26
alestuber has joined #ruby-lang
19:27
j4cknewt has joined #ruby-lang
19:28
fusillicode1 has quit [Quit: Leaving.]
19:28
fusillicode has joined #ruby-lang
19:28
caseypatrickdris has joined #ruby-lang
19:29
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:30
fungal has quit [Ping timeout: 240 seconds]
19:31
lele|w has quit [Ping timeout: 272 seconds]
19:31
fungal has joined #ruby-lang
19:31
Miphix has quit [Quit: Leaving]
19:33
nwhirschfeld has quit [Ping timeout: 250 seconds]
19:35
fusillicode1 has joined #ruby-lang
19:35
fusillicode has quit [Read error: Connection reset by peer]
19:38
k3asd` has quit [Remote host closed the connection]
19:38
fluchtreflex has joined #ruby-lang
19:38
fluchtreflex has joined #ruby-lang
19:41
Randroid has joined #ruby-lang
19:42
lele|w has joined #ruby-lang
19:42
fluchtreflex has quit [Client Quit]
19:44
fluchtreflex has joined #ruby-lang
19:44
fluchtreflex has joined #ruby-lang
19:44
fluchtreflex has quit [Changing host]
19:45
dented42 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:47
k3asd` has joined #ruby-lang
19:50
fusillicode1 has quit [Quit: Leaving.]
19:50
fusillicode has joined #ruby-lang
19:55
fluchtreflex has joined #ruby-lang
19:55
fluchtreflex has joined #ruby-lang
19:56
duderonomy has joined #ruby-lang
19:57
leat has joined #ruby-lang
19:58
ur5us has joined #ruby-lang
20:00
fluchtreflex has quit [Client Quit]
20:01
fluchtreflex has joined #ruby-lang
20:01
fluchtreflex has quit [Changing host]
20:01
fluchtreflex has joined #ruby-lang
20:01
alestuber has quit [Remote host closed the connection]
20:02
tsujp has joined #ruby-lang
20:03
ur5us has quit [Ping timeout: 252 seconds]
20:11
joaomdmoura has quit [Remote host closed the connection]
20:12
joaomdmoura has joined #ruby-lang
20:13
alestuber has joined #ruby-lang
20:15
dede has quit [Quit: Connection closed for inactivity]
20:17
joaomdmoura has quit [Ping timeout: 256 seconds]
20:18
Musashi007 has joined #ruby-lang
20:23
tsujp has quit [Quit: tsujp is snoozing]
20:27
j4cknewt has quit [Remote host closed the connection]
20:27
malconis has joined #ruby-lang
20:31
j4cknewt has joined #ruby-lang
20:32
fluchtreflex has joined #ruby-lang
20:32
fluchtreflex has quit [Changing host]
20:32
fluchtreflex has joined #ruby-lang
20:37
fluchtreflex has quit [Client Quit]
20:37
fluchtreflex has joined #ruby-lang
20:37
fluchtreflex has quit [Changing host]
20:37
fluchtreflex has joined #ruby-lang
20:37
fluchtreflex has quit [Remote host closed the connection]
20:37
fluchtreflex has joined #ruby-lang
20:37
fluchtreflex has quit [Changing host]
20:37
fluchtreflex has joined #ruby-lang
20:39
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
20:42
gianlucadv has joined #ruby-lang
20:47
fluchtreflex has joined #ruby-lang
20:47
fluchtreflex has quit [Changing host]
20:47
fluchtreflex has joined #ruby-lang
20:50
rawrmonstar has joined #ruby-lang
20:52
gix has joined #ruby-lang
20:52
bennyklo2z has joined #ruby-lang
20:53
ur5us has joined #ruby-lang
20:54
bennyklo2z has quit [Client Quit]
20:55
bennyklo2z has joined #ruby-lang
20:56
bennyklo2z has left #ruby-lang [#ruby-lang]
21:04
tak1n has joined #ruby-lang
21:05
tak1n has quit [Client Quit]
21:06
tak1n has joined #ruby-lang
21:07
tak1n has quit [Client Quit]
21:08
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
21:11
stamina has quit [Quit: WeeChat 1.1.1]
21:12
kr3ssh has quit [Ping timeout: 264 seconds]
21:13
alestuber has quit [Ping timeout: 264 seconds]
21:13
joaomdmoura has joined #ruby-lang
21:15
seank_ has quit [Remote host closed the connection]
21:16
rawrmonstar has quit [Read error: Connection reset by peer]
21:16
rawrmons_ has joined #ruby-lang
21:17
seank_ has joined #ruby-lang
21:17
pothibo has joined #ruby-lang
21:17
kr3ssh has joined #ruby-lang
21:17
bennyklotz has quit [Quit: Lost terminal]
21:17
bennyklo1z has quit [Quit: Lost terminal]
21:17
joaomdmoura has quit [Ping timeout: 256 seconds]
21:18
cornerma1 has joined #ruby-lang
21:19
alestuber has joined #ruby-lang
21:20
Mon_Ouie has joined #ruby-lang
21:20
Mon_Ouie has joined #ruby-lang
21:21
cornerman has quit [Ping timeout: 265 seconds]
21:21
cornerma1 is now known as cornerman
21:22
tak1n has joined #ruby-lang
21:22
kr3ssh has quit [Ping timeout: 244 seconds]
21:23
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:24
pothibo has quit [Quit: pothibo]
21:24
alestuber has quit [Ping timeout: 265 seconds]
21:25
alestuber has joined #ruby-lang
21:27
atomical has joined #ruby-lang
21:27
Randroid has quit [Quit: Randroid]
21:29
marr has joined #ruby-lang
21:33
alestuber has quit [Remote host closed the connection]
21:33
SomeAnonDude has quit [Remote host closed the connection]
21:34
gianlucadv has quit [Ping timeout: 264 seconds]
21:36
joaomdmoura has joined #ruby-lang
21:48
fedexo has joined #ruby-lang
21:57
malconis has joined #ruby-lang
22:01
malconis has quit [Client Quit]
22:02
duderonomy has quit [Ping timeout: 256 seconds]
22:04
iamninja_ has quit [Read error: Connection reset by peer]
22:04
iamninja_ has joined #ruby-lang
22:07
joaomdmoura has quit [Remote host closed the connection]
22:07
joaomdmoura has joined #ruby-lang
22:09
joaomdmoura has quit [Remote host closed the connection]
22:09
k3asd` has quit [Remote host closed the connection]
22:11
k3asd` has joined #ruby-lang
22:20
ledestin has joined #ruby-lang
22:24
fedexo has quit [Ping timeout: 265 seconds]
22:26
slawrence00 has joined #ruby-lang
22:29
Mon_Ouie has quit [Ping timeout: 244 seconds]
22:30
palar has joined #ruby-lang
22:31
malconis has joined #ruby-lang
22:34
arBmind1 has joined #ruby-lang
22:34
stardiviner has quit [Ping timeout: 255 seconds]
22:35
arBmind has quit [Ping timeout: 264 seconds]
22:35
malconis has quit [Client Quit]
22:38
kr3ssh has joined #ruby-lang
22:40
houhoulis has joined #ruby-lang
22:43
j4cknewt has quit [Remote host closed the connection]
22:43
Mon_Ouie has joined #ruby-lang
22:44
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:45
k3asd` has quit [Ping timeout: 244 seconds]
22:46
stardiviner has joined #ruby-lang
22:47
Musashi007 has quit [Quit: Musashi007]
22:50
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
23:05
joaomdmoura has joined #ruby-lang
23:07
j4cknewt has joined #ruby-lang
23:10
bahar has quit [Ping timeout: 250 seconds]
23:11
joaomdmoura has quit [Remote host closed the connection]
23:12
joaomdmoura has joined #ruby-lang
23:16
bahar has joined #ruby-lang
23:18
jo__ has joined #ruby-lang
23:18
tibig has quit [Read error: Connection reset by peer]
23:18
tibig has joined #ruby-lang
23:23
arBmind1 has quit [Quit: Leaving.]
23:23
ryba has joined #ruby-lang
23:27
Ropeney has joined #ruby-lang
23:29
kr3ssh has quit [Ping timeout: 246 seconds]
23:31
Pathfinder has joined #ruby-lang
23:33
nedp has joined #ruby-lang
23:44
bahar has quit [Ping timeout: 246 seconds]
23:46
A124 has quit [Quit: RoBo_V1]
23:46
A124 has joined #ruby-lang
23:46
bungoman has joined #ruby-lang
23:47
snsei has joined #ruby-lang
23:47
slumos is now known as slumos[away]
23:47
slumos[away] is now known as slumos
23:48
slumos is now known as slumos[away]
23:48
joaomdmoura has quit [Remote host closed the connection]
23:50
bahar has joined #ruby-lang