apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p327: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
razibog has quit [Quit: Leaving.]
<canton7> merry christmas all
xaq_ has joined #ruby
IceDragon has quit [Quit: Space~~~]
g_bleezy has quit [Remote host closed the connection]
<timur> canton7: same to you
<timur> canton7: ok, actually i figured out the problem
<canton7> ooh?
<timur> canton7: it's the netaddr gem that's actually being screwy. let me show you
<timur> all the files are just in /lib
xaq has quit [Ping timeout: 265 seconds]
<timur> so, that's why the tree gets pulled in
<canton7> aha, ouch
<canton7> yeah, that's bad.
<timur> yea... very tempted to curse them out
<canton7> hack: stick the problem location of tree.rb onto the start of LOAD_PATH just before requiring it :P
<canton7> s/problem/proper
<timur> canton7: yikes!
<canton7> that or nuke the netaddr entry from LOAD_PATH after it's been required heh :P
havenn has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
nmabry has quit [Quit: nmabry]
foohey has joined #ruby
foohey has quit [Remote host closed the connection]
rellin has quit [Quit: Nettalk6 - www.ntalk.de]
foohey has joined #ruby
foohey has quit [Read error: Connection reset by peer]
foohey has joined #ruby
thufir_ has joined #ruby
hoelzro is now known as hoelzro|away
<timur> canton7: hax hax :)
<timur> canton7: do you know of any other gem that does netmask validation?
<canton7> fraid not. ruby-toolbox is probably a good place to start looking
toekutr has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
nomenkun has joined #ruby
tenmilestereo has quit [Quit: Leaving]
neurotech has joined #ruby
xaq_ has quit [Ping timeout: 252 seconds]
love_color_text has joined #ruby
Yarou has joined #ruby
Yarou has quit [Changing host]
Yarou has joined #ruby
_alejandro has joined #ruby
Andre has joined #ruby
nomenkun has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
Andre is now known as Andrevan
moshee has quit [Ping timeout: 246 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Andrevan has quit [Changing host]
Andrevan has joined #ruby
<timur> canton7: i ended up using a one-liner similar to this: http://stackoverflow.com/questions/1825928/netmask-to-cidr-in-ruby
matchaw_ has quit [Remote host closed the connection]
<canton7> timur, hah, nice
cableray has joined #ruby
dyrot has quit [Quit: Leaving]
Noldorin has joined #ruby
<Noldorin> where can i find a list of the FNM_xxx parameter?
<Noldorin> parameters*
benlieb has joined #ruby
dyrot has joined #ruby
savant has left #ruby [#ruby]
mercwithamouth has quit [Ping timeout: 255 seconds]
<Noldorin> also, how do i get a single item from an array, ensuring that the array has a single item?
<apeiros_> Noldorin: you mean ensuring that the array has that item or ensuring that array.length == 1?
Jasko has quit [Read error: Connection reset by peer]
<Noldorin> apeiros_ the latter
sn0wb1rd has quit [Read error: Connection reset by peer]
<apeiros_> odd question
<Noldorin> in .NET we just do array.Single()
cableray has quit [Quit: cableray]
<Noldorin> ^^
sn0wb1rd has joined #ruby
<Noldorin> so not really :P
<canton7> well you ensure that the array has one item, then you retrieve the one item...
Jasko has joined #ruby
<apeiros_> Noldorin: it sounds to me like you're trying to apply patterns from other languages which are broken in the domain of ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<Noldorin> apeiros_: it's a common think in the functional paradigm
<Noldorin> thing*
<apeiros_> class Array; def single; raise "blurp" unless length == 1; at(0); end; end
<canton7> Noldorin, got a docs page for Single()? I'm curious
<canton7> (and 'single', as a function name, isn't easy to google for)
<canton7> ta
<canton7> aah it's on Enumable. Didn't try that)
<apeiros_> Noldorin: yeah, still. probably broken pattern in ruby and can be done in a nicer fashion.
<Noldorin> apeiros_, i see
<Noldorin> fair enough then!
ner0x has joined #ruby
<apeiros_> but the above gives you ary.single
<apeiros_> which does what you described
sn0wb1rd has quit [Read error: Connection reset by peer]
<Noldorin> apeiros_: yeah, looks like that works. thanks :)
<apeiros_> you can add it to enumerable too, but that'd require different code
<apeiros_> (since Enumerable doesn't have #length)
<Noldorin> any idea about my first question incidentally?
<Noldorin> right
sn0wb1rd has joined #ruby
<Noldorin> it would be slightly trickier, but not much...
<apeiros_> don't know what you mean by FNM_xxx is
<apeiros_> -is
sn0wb1rd has quit [Remote host closed the connection]
karupanerura has quit [Excess Flood]
<Noldorin> apeiros_ e.g. values for the second parameter (flags) of Dir.glob
<apeiros_> oh, I think that's on fnmatch
alexspeller has joined #ruby
<Noldorin> didn't see it there :/
<apeiros_> not sure
<apeiros_> can also do File.constants in irb/pry
<apeiros_> File.constants.grep(/FNM/)
mercwithamouth has joined #ruby
<Noldorin> ah yes
karupanerura has joined #ruby
<canton7> yeah, descriptions in man fnmatch (http://linux.die.net/man/3/fnmatch)
love_color_text has quit [Remote host closed the connection]
<Noldorin> oh right, that fnmatch
<Noldorin> thought you meant the ruby version heh
<canton7> well, the ruby fnmatch steals the same constants I believe
<Noldorin> indeed
<canton7> but the rubydoc page for File didn't list the constants, so I went hunting elsewhere :P
<Noldorin> apeiros_, canton7 so that doesn't actually have what i want unfortunately. is there anyway to do Dir.glob(…) easily but only match directories?
samphippen has quit [Quit: Computer has gone to sleep.]
<apeiros_> trail with /
<apeiros_> Dir.glob('**/*/')
Xeago has quit [Remote host closed the connection]
alexspeller has quit [Read error: Connection reset by peer]
<canton7> any difference between that and Dir.glob('**/') ?
<Noldorin> apeiros_ oh that's too easy heh
cableray has joined #ruby
dsdeiz has quit [Remote host closed the connection]
<Noldorin> canton7, i think his example only matches directories at the leaves within the search tree rooted on the current dir
<Noldorin> rather than directories *or* files as leaves
<canton7> I ran both in a test dir and they had the same number of hits
<apeiros_> canton7: yes
<apeiros_> '**/' is what I'd write if it wasn't 0200 :)
<Noldorin> heh
<canton7> and the arrays were equal :P heh
<canton7> coolies, just making sure I'm not missing something important with globs
<matti> ;]
<Noldorin> anyway thanks guys
<Noldorin> that seems to work
alexspeller has joined #ruby
kirun has quit [Quit: Client exiting]
jonathanwallace has joined #ruby
alejandro_ has joined #ruby
_alejandro has quit [Ping timeout: 252 seconds]
alexspeller has quit [Ping timeout: 252 seconds]
zeade has joined #ruby
maddog_ has quit [Ping timeout: 252 seconds]
slash_nick has quit [Ping timeout: 255 seconds]
slash_nick has joined #ruby
nwertman has joined #ruby
<ner0x> I've asked for a list of books but does anyone here have any other suggestions. I have "TDD Development, The Ruby Programming Language, Rails 3 in Action"
<Noldorin> hrmm
<Noldorin> apeiros_, canton7 actually i noticed some functions (e.g. system) seem to implicitly convert arguments that are arrays into strings
<Noldorin> how can i do this?
reppard has joined #ruby
<apeiros_> Noldorin: you want to use e.g. args = ['ls', '-la', '.'] with system to get system('ls', '-la', '.')?
<apeiros_> that'd by system(*args)
cableray has quit [Quit: cableray]
<Noldorin> no no
Jasko has quit [Read error: Connection reset by peer]
<Noldorin> apeiros_, i'm saying i do something like:
Jasko has joined #ruby
<Noldorin> system "which", Dir['foo.*']
<Noldorin> (arbitrary example)
<Noldorin> and this works
<Noldorin> somehow the result of Dir, which is an array, gets converted into a string
<Noldorin> how does this work exactly?
<Noldorin> i.e. how can i reproduce such behaviour myself
<apeiros_> it probably calls to_s on it
<Noldorin> ah got it
joofsh has quit [Remote host closed the connection]
<Noldorin> ta
taoru has joined #ruby
nwertman has quit [Ping timeout: 255 seconds]
Virunga has quit [Remote host closed the connection]
toekutr has joined #ruby
cableray has joined #ruby
jfl0wers has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
jfl0wers has quit [Client Quit]
tenmilestereo has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 252 seconds]
reppard has quit [Ping timeout: 246 seconds]
havenn has joined #ruby
_alejandro has joined #ruby
_64k has quit [Quit: _64k]
gnul0ver has joined #ruby
alejandro_ has quit [Ping timeout: 250 seconds]
verto is now known as verto|off
Astral__ has joined #ruby
Steve1UK has quit []
icole has joined #ruby
<aedorn> I have a headache. Now would be a good time to program something using C++ templates.
nomenkun has joined #ruby
Astral_ has quit [Ping timeout: 264 seconds]
swex_ has joined #ruby
swex has quit [Ping timeout: 252 seconds]
<matti> lol
nerd has quit [Ping timeout: 265 seconds]
thufir_ has quit [Remote host closed the connection]
nomenkun has quit [Ping timeout: 244 seconds]
cableray has quit [Quit: cableray]
sepp2k has quit [Remote host closed the connection]
jibi has joined #ruby
SeySayux has quit [Ping timeout: 246 seconds]
sweet_kid has quit [Ping timeout: 246 seconds]
jibi has quit [Client Quit]
foohey has quit [Ping timeout: 246 seconds]
x42 has quit [Ping timeout: 246 seconds]
SeySayux has joined #ruby
foohey has joined #ruby
sweet_kid has joined #ruby
nyuszika7h has quit [Ping timeout: 246 seconds]
x42 has joined #ruby
widith has joined #ruby
widith has left #ruby ["WeeChat 0.3.9.2"]
Noldorin has quit [Quit: Computer has gone to sleep.]
nyuszika7h has joined #ruby
nerd has joined #ruby
kenneth has quit [Quit: kswizz.com]
aedorn has quit [Quit: Konversation terminated!]
ttt has joined #ruby
iamjarvo has joined #ruby
aedorn has joined #ruby
Noldorin has joined #ruby
Takehiro has joined #ruby
mrdtt has joined #ruby
x82_nicole has joined #ruby
Takehiro has quit [Ping timeout: 246 seconds]
nari_ has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
taoru has quit [Ping timeout: 252 seconds]
Jasko has joined #ruby
mahmoudi_ has joined #ruby
slash_nick has quit [Ping timeout: 260 seconds]
slash_nick has joined #ruby
tommyvyo has joined #ruby
Noldorin has quit [Quit: Computer has gone to sleep.]
nomenkun has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
mahmoudi_ has quit [Quit: Computer has gone to sleep.]
tommyvyo has quit [Client Quit]
timur has left #ruby [#ruby]
nomenkun has quit [Ping timeout: 252 seconds]
eka has quit [Quit: Computer has gone to sleep.]
jenrzzz has joined #ruby
chord has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
jekotia has joined #ruby
Hanmac1 has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
benlieb has quit [Quit: benlieb]
Hanmac has quit [Ping timeout: 250 seconds]
voodoofish has quit [Ping timeout: 252 seconds]
benlieb has joined #ruby
TheFuzzball has quit [Quit: Leaving...]
<shevy> yeah
voodoofish has joined #ruby
<chord> whats the difference between include and extend where Humor is a module and what does it mean when a class has both include and extend, for example: class Grouchy include Humor extend Humor end
jenrzzz has quit [Ping timeout: 246 seconds]
<apeiros_> chord: do you know the `class <<self` construct? (singleton_class)
<chord> no
<apeiros_> ok. extend adds the (instance-)methods of the given module only to a single object
<apeiros_> (the one you extend)
<chord> so then what does include do
<apeiros_> include adds the (again, instance-)methods of the given module to a class, and there as instance methods. i.e. they're not available on the class object itself, only instances of that class
atno has quit [Read error: Connection reset by peer]
<apeiros_> (which is why include is Module#include, and extend is Object#extend - i.e., you can only use include on classes and modules, whereas you can use extend on [almost] every object)
atno has joined #ruby
<chord> so include makes the methods part of the class object not part of instances of the class?
<zastern> As I understand it, .include? operates on arrays. But I can do foo = "12"; foo.include? "1" and get true. Does it just convert to an array automatically for the purposes of the test or something?
<heftig> zastern: no, include? is just a method name
<zastern> actually never mind
<heftig> both String and Array implement it
<zastern> yeah i just realized that haha
icole has quit [Remote host closed the connection]
<apeiros_> chord: um, no? that's quite the opposite of what I just said…
<zastern> (new to programming)
<apeiros_> chord: http://pastie.org/5574652
altivec has quit [Quit: WeeChat 0.3.7]
<chord> so extend makes it part of the class object?
<chord> does that mean it references instance variables makes no sense for them
_alejandro has quit [Remote host closed the connection]
<apeiros_> can't make sense of your last question
<apeiros_> but I think this helps:
<apeiros_> classes are objects
<apeiros_> all objects can have ivars
<apeiros_> (almost all, at least)
<chord> what happens if you reference instance variables from a method obtained through extend
<chord> instance variables of the objects
ner0x has quit [Quit: Leaving]
<apeiros_> self is relevant
<zastern> I'm trying to check if a string includes any number in a range - e.g. next_move.include?(0..9) - but that's not right. Is there any way to do this simply?
<apeiros_> in any method call, self will be the receiver of the method. ivars belong to that self.
<apeiros_> zastern: a single digit only? or could the range also be multi-digit, e.g. 23..45 ?
<zastern> uhhh basically I need to know if the string contains anything from 0-9, but it could be any combonation, e.g. yes 43, 67, etc
joshman_ has joined #ruby
<zastern> so uh, im really checking that it's a base-10 number i guess
bitri has joined #ruby
<apeiros_> zastern: then you'll have to extract the numbers, convert them to integer, and test that
<apeiros_> 03:59 zastern: so uh, im really checking that it's a base-10 number i guess
<apeiros_> eh, that's an entirely different problem…
borkmouse has joined #ruby
<zastern> i mean the issue is just to make sure the person typed in a number.
<apeiros_> Integer(str, 10) # will raise if it isn't base10
<apeiros_> wow, you keep changing your problem description fast :-p
<apeiros_> can you make up your mind what you really want to test?
<zastern> lol
<zastern> did the person type in a number that is a combonation of the digits 0 through 9, or any single digit.
The_8473 has joined #ruby
The_8472 has quit [Ping timeout: 244 seconds]
Aqua has quit [Ping timeout: 244 seconds]
Aqua has joined #ruby
jonahR has joined #ruby
bitri has quit [Client Quit]
joshman_ has quit [Ping timeout: 265 seconds]
<zastern> if next_move.to_i != 0 sort of works, except that now we fail if they actually do type in zero
<zastern> ill figure it out eventually
jimeh has quit [Quit: Computer has gone to sleep.]
<apeiros_> zastern: you can use a regex or Integer(str, 10)
phelps has joined #ruby
<apeiros_> is chord pm'ing anybody else?
jenrzzz has joined #ruby
<havenn> apeiros_: Yeah, has before. Troll, troll, troll.
chord was kicked from #ruby by apeiros_ [chord]
<apeiros_> k, thx.
<zastern> apeiros_: I figured out how to do the regex with ~= but how do you actually use Integer(str, 10)?
<apeiros_> o0
<apeiros_> Integer("14", 10) # => 14
<apeiros_> Integer("hello", 10) # !> kaboom
<apeiros_> if it goes kaboom, it's not a base10 integer
<zastern> ah ok i get it
<zastern> cool thanks
<zastern> but that just returns the number
<zastern> not true false
<apeiros_> correct. the thing you want to look out for is the exception.
otters has joined #ruby
<zastern> yeah i dont think im at the point of exception handling just yet
<zastern> but ive got the regex working
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
<apeiros_> you probably should show the regex
<apeiros_> there's quite a bit of things one can do wrong there
benlieb has quit [Quit: benlieb]
Rym has quit [Quit: Rym]
jenrzzz has quit [Ping timeout: 264 seconds]
<zastern> apeiros_: good thing this is just a test exercise then :)
benlieb has joined #ruby
gnul0ver has quit [Ping timeout: 252 seconds]
diegoviola has quit [Quit: WeeChat 0.3.9.2]
neurotech has quit [Remote host closed the connection]
jenrzzz has joined #ruby
malte__ has joined #ruby
malte_ has quit [Ping timeout: 252 seconds]
malte__ is now known as malte_
domdom has joined #ruby
<shevy> bugs bugs bugs
PetePorty has joined #ruby
PetePorty has quit [Changing host]
PetePorty has joined #ruby
<domdom> hi everyone
<domdom> is there a more clean way to do the same as here http://pastebin.com/C5iZDf4V
<shevy> if (hosts.count == 1)
<shevy> if hosts.count == 1
<shevy> ternary operator
<shevy> x = 5 < 4 ? 'hi' : 'bye'
<shevy> is 5 smaller than 4?
<shevy> no, so we enter the second part after the :
<domdom> thanks shevy
xpen has joined #ruby
<shevy> domdom, this would also be a way http://pastie.org/5574727
<shevy> but with the ternary operator, you could put it all on one line
<shevy> however
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<shevy> this is a bit strange what you are doing
<shevy> the only difference is that, when hosts is one, you use the english word "one"
PetePorty has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
<shevy> and if it is more than one, you use numbers, right?
jenrzzz has quit [Ping timeout: 244 seconds]
ewag has joined #ruby
<domdom> yes
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
Takehiro has joined #ruby
<shevy> any reason why you want this that way?
<shevy> the Linguistics gem could translate this for you
<shevy> 5.en.numwords # => "five"
<shevy> 1.en.numwords # => "one"
<shevy> then you could use just one line in your code, though you would have to add that dependency...
<shevy> probably not worth it for 3 lines of code
xpen has quit []
<domdom> i will go with solution that you posted at pastie and thank you for your help ^^
domdom has quit [Quit: Leaving]
xpen has joined #ruby
<shevy> kk you are welcome
havenn has quit [Ping timeout: 256 seconds]
Takehiro has quit [Ping timeout: 255 seconds]
havenn has joined #ruby
Artheist has quit [Remote host closed the connection]
Andrevan has quit []
Andrevan has joined #ruby
dsdeiz has joined #ruby
Proshot has joined #ruby
statarb3 has quit [Ping timeout: 244 seconds]
Proshot has quit [Read error: Connection reset by peer]
Proshot has joined #ruby
track7 has joined #ruby
Proshot has quit [Excess Flood]
LouisGB has joined #ruby
Proshot has joined #ruby
Nisstyre-laptop has joined #ruby
xpen has quit [Read error: Connection timed out]
jonahR has quit [Quit: jonahR]
xpen has joined #ruby
havenn has quit [Remote host closed the connection]
radic has quit [Disconnected by services]
radic_ has joined #ruby
mercwithamouth has joined #ruby
love_color_text has joined #ruby
ananthakumaran has joined #ruby
__class__ has quit [Read error: Connection reset by peer]
tenmilestereo has quit [Read error: Connection reset by peer]
benlieb has quit [Quit: benlieb]
ryanf has joined #ruby
matip_ has joined #ruby
jxriddle has joined #ruby
jaygen has quit [Remote host closed the connection]
matip__ has quit [Ping timeout: 252 seconds]
_alejandro has joined #ruby
zeade has quit [Quit: Leaving.]
jxriddle has quit [Quit: jxriddle]
apeiros_ has joined #ruby
apeiros_ has quit [Ping timeout: 260 seconds]
solidresolve has joined #ruby
<shevy> haha
<shevy> linus is so funny
<shevy> https://lkml.org/lkml/2012/3/8/495 " If you continue to pooh-pooh the issue, you only show yourself to be unreliable."
<shevy> matz is a little smiling buddha compared to the others ;)
<aedorn> He's been getting pretty outspoken as of late.. or maybe he always has been, just can now see it easier
Takehiro has joined #ruby
_alejandro has quit [Remote host closed the connection]
<shevy> hehe
Takehiro has quit [Ping timeout: 252 seconds]
yshh has quit [Remote host closed the connection]
Chronax has joined #ruby
<Chronax> Can anyone tell me how to consolidate these 3 lines of code into 1? http://pastie.org/5574849
kamsel has quit [Ping timeout: 250 seconds]
<heftig> stuff = "Ho#{"m" * rand(6..18)}e!!"
ryanf_ has joined #ruby
<Chronax> Thanks, heftig!
<Chronax> Could I also have appended .join after the curly braces?
<heftig> no
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
love_color_text has quit [Ping timeout: 252 seconds]
ryanf has quit [Ping timeout: 265 seconds]
matip_ has quit [Remote host closed the connection]
tar_ has joined #ruby
zeade has joined #ruby
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
freeayu has joined #ruby
yshh has joined #ruby
mercwithamouth has quit [Ping timeout: 264 seconds]
ananthakumaran has quit [Quit: Leaving.]
zeade has quit [Ping timeout: 276 seconds]
jblack has quit [Ping timeout: 265 seconds]
cableray has joined #ruby
ryanf_ has quit [Quit: broken pipes |||]
Hanmac1 is now known as Hanmac
philips_ has quit [Excess Flood]
mercwithamouth has joined #ruby
zeade has joined #ruby
zeade has quit [Client Quit]
jenrzzz has joined #ruby
dr_neek has joined #ruby
philips_ has joined #ruby
ananthakumaran has joined #ruby
jxriddle has joined #ruby
philips_ has quit [Excess Flood]
jxriddle has quit [Ping timeout: 246 seconds]
ryanf has joined #ruby
havenn has joined #ruby
taoru has joined #ruby
philips_ has joined #ruby
eldariof has joined #ruby
borkmouse has quit [Remote host closed the connection]
tommyvyo has joined #ruby
kmurph has joined #ruby
xaq has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
ryanf has quit [Quit: broken pipes |||]
taoru has quit [Ping timeout: 252 seconds]
__class__ has joined #ruby
kokainepizza has quit [Quit: My pooter is sleep.]
berserkr has quit [Quit: Leaving.]
LouisGB has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Quit: Lost terminal]
cantonic has joined #ruby
bigmcq77 has joined #ruby
xaq has quit [Remote host closed the connection]
<aedorn> I want to use postgres - I just don't know why.
<Hanmac> you mean you dont know why you want to use postgres?
dvdwlsh has joined #ruby
dvdwlsh has quit [Client Quit]
<aedorn> Exactly. It's like ... I want to eat that cookie, but I don't know why.
<tar_> marketing
<aedorn> mmm marketing is tasty
jekotia has quit [Ping timeout: 252 seconds]
jekotia_ has joined #ruby
taoru has joined #ruby
jekotia_ is now known as jekotia
jekotia has quit [Client Quit]
zastern has quit [Remote host closed the connection]
bigmcq77 has quit [Quit: Computer has gone to sleep.]
rippa has joined #ruby
rockets has joined #ruby
rockets has quit [Remote host closed the connection]
phelps has joined #ruby
taoru has quit [Ping timeout: 255 seconds]
LouisGB has joined #ruby
iamjarvo has quit [Quit: Leaving.]
nazty has quit [Read error: Connection reset by peer]
taoru has joined #ruby
Chronax has quit [Ping timeout: 264 seconds]
yacks has quit [Ping timeout: 252 seconds]
lenovodroid has quit [Ping timeout: 260 seconds]
wargasm has quit [Ping timeout: 252 seconds]
Guest9041 has quit [Read error: Connection reset by peer]
jsilver has joined #ruby
Guest9041 has joined #ruby
Guest9041 has quit [Read error: Connection reset by peer]
Guest9041 has joined #ruby
d2dchat has joined #ruby
taoru has quit [Ping timeout: 246 seconds]
dsdeiz has quit [Remote host closed the connection]
taoru has joined #ruby
cj3kim has joined #ruby
Takehiro has joined #ruby
d2dchat has quit [Remote host closed the connection]
medik has quit [Quit: medik has no reason]
jessta has quit [Ping timeout: 256 seconds]
JohnBat26 has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
eldariof has quit []
rdegraci has quit [Quit: rdegraci]
wargasm has joined #ruby
samuel02 has joined #ruby
yshh_ has joined #ruby
yshh has quit [Read error: No route to host]
wildcard0 has quit [Ping timeout: 250 seconds]
wildcard1 has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
yshh_ has quit [Read error: No route to host]
yshh has joined #ruby
postmodern has joined #ruby
gregorg has quit [Ping timeout: 255 seconds]
taoru has quit [Ping timeout: 252 seconds]
robustus has quit [Ping timeout: 255 seconds]
gregorg has joined #ruby
h4mz1d has joined #ruby
robustus has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
kmurph has quit [Quit: kmurph]
vlad_starkov has joined #ruby
io_syl has joined #ruby
slash_nick has quit [Quit: leaving]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
gaze__ has joined #ruby
Asher has quit [Quit: Leaving.]
<gaze__> hey guys. I'm having a difficult time understanding how the require path works. Say I'm using ruby1.9.1, and I have a.rb and b.rb in the same directory. In a.rb, I should be able to do " require 'b' " and it should work, correct?
<gaze__> This happens to work on ruby 1.8, but not on 1.9.1
Takehiro has quit [Remote host closed the connection]
ddd1 has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby
<gaze__> It fails with -- in `require': no such file to load -- b (LoadError)
Takehiro has joined #ruby
keanehsiao has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
<keanehsiao> hihi
vlad_sta_ has quit [Remote host closed the connection]
<keanehsiao> wondering how to convert chinese 彩虹橋 to /u5f69/u8679/u6a4b
havenn has quit [Ping timeout: 255 seconds]
<gaze__> okay so why is "." in my LOAD_PATH on 1.8, and not on 1.9.1 by default?
<gaze__> and where is this set?
xaq has joined #ruby
phelps has quit [Ping timeout: 260 seconds]
kmurph has joined #ruby
phelps has joined #ruby
<keanehsiao> wondering how to convert chinese 彩虹橋 to /u5f69/u8679/u6a4b
gaze__ has quit [Quit: Page closed]
gregorg has quit [Read error: No route to host]
jxriddle has joined #ruby
gregorg has joined #ruby
jsilver has quit [Remote host closed the connection]
xaq has quit [Read error: Connection reset by peer]
moshee has quit [Ping timeout: 264 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
jxriddle has quit [Ping timeout: 252 seconds]
tar_ has quit [Quit: farewell]
jonahR has joined #ruby
sayan has joined #ruby
d3vic3 has joined #ruby
eldariof has joined #ruby
wallerdev has joined #ruby
jonahR has quit [Quit: jonahR]
ebouchut has joined #ruby
lordnaz has joined #ruby
havenn has joined #ruby
kmurph has quit [Quit: kmurph]
lordnaz has quit [Quit: Lost terminal]
h4mz1d has quit [Ping timeout: 245 seconds]
toekutr has quit [Remote host closed the connection]
kmurph has joined #ruby
rakl has joined #ruby
Gooder has joined #ruby
Takehiro has quit [Remote host closed the connection]
kmurph has quit [Client Quit]
topriddy has joined #ruby
LouisGB has quit [Ping timeout: 252 seconds]
gnul0ver has joined #ruby
topriddy has quit [Client Quit]
<Hanmac> keanehsiao: are you still wondering? i think i solved it
<keanehsiao> yes
<Hanmac> puts "彩虹橋".unpack("U*").map {|i|"\\u#{i.to_s(16)}"}.join #=> \u5f69\u8679\u6a4b
<keanehsiao> still no answer
<keanehsiao> :D
<Hanmac> (i look if i found an nicer function)
<keanehsiao> cool
<keanehsiao> let me try.. :D
ddd1 has quit [Ping timeout: 245 seconds]
<keanehsiao> so coooool :D thanks. big hug
<keanehsiao> :D
yshh has quit [Ping timeout: 252 seconds]
yshh has joined #ruby
havenn has quit [Ping timeout: 256 seconds]
_64k has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
xaq has joined #ruby
<Hanmac> keanehsiao: i found an better way: "彩虹橋".each_codepoint.map {|c|"\\u%x" % c}.join
<keanehsiao> :D
<keanehsiao> cool
keyvan has quit [Remote host closed the connection]
dsdeiz has joined #ruby
_64k has quit [Quit: _64k]
jsilver has joined #ruby
kiyoura has quit [Ping timeout: 264 seconds]
Siphonblast has quit [Ping timeout: 260 seconds]
tommyvyo has joined #ruby
love_color_text has joined #ruby
Siphonblast has joined #ruby
jsilver_ has joined #ruby
jsilver has quit [Ping timeout: 256 seconds]
jsilver has joined #ruby
love_color_text has quit [Ping timeout: 252 seconds]
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
jsilver_ has quit [Ping timeout: 260 seconds]
ryanf has joined #ruby
dsdeiz has quit [Ping timeout: 265 seconds]
bigmcq77 has joined #ruby
dsdeiz has joined #ruby
Gooder has quit [Read error: Connection reset by peer]
Gooder has joined #ruby
xaq has quit [Remote host closed the connection]
gregorg has quit [Ping timeout: 260 seconds]
nerd has joined #ruby
malte__ has joined #ruby
malte_ has quit [Ping timeout: 256 seconds]
malte__ is now known as malte_
phelps has joined #ruby
love_color_text has joined #ruby
h4mz1d has joined #ruby
gregorg has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
ebouchut has quit [Quit: This computer has gone to sleep]
cj3kim has joined #ruby
gregorg has quit [Read error: No route to host]
jgrevich has quit [Quit: jgrevich]
gregorg has joined #ruby
rakl has quit [Quit: sleeping]
cableray has quit [Quit: cableray]
phelps has quit [Quit: Computer has gone to sleep.]
gregorg_taf has joined #ruby
phelps has joined #ruby
gregorg has quit [Ping timeout: 246 seconds]
TheNumb has quit [Quit: ZNC - http://znc.sourceforge.net]
Quadlex is now known as AwayLex
d3vic3 has quit [Ping timeout: 264 seconds]
slava_dp has joined #ruby
darthdeus has joined #ruby
phelps has quit [Quit: Computer has gone to sleep.]
wargasm has quit [Ping timeout: 260 seconds]
TheNumb has joined #ruby
cableray has joined #ruby
tPl0ch has joined #ruby
ryanf has quit [Quit: broken pipes |||]
jsilver has quit [Ping timeout: 252 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
gnul0ver has quit [Ping timeout: 252 seconds]
jsilver has joined #ruby
jsilver has quit [Read error: Connection reset by peer]
jsilver has joined #ruby
Chryson has quit [Ping timeout: 252 seconds]
dyrot has quit [Quit: Leaving]
koshii has joined #ruby
Andrevan has quit []
Morkel has joined #ruby
Takehiro has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
mrdtt has quit [Remote host closed the connection]
crackfu has joined #ruby
dsdeiz has quit [Remote host closed the connection]
nari_ has quit [Ping timeout: 245 seconds]
emocakes has joined #ruby
mikekelly has joined #ruby
koshii has quit [Ping timeout: 256 seconds]
xpen has quit [Ping timeout: 256 seconds]
jxriddle has joined #ruby
tk__ has joined #ruby
Guest9041 has quit [Ping timeout: 265 seconds]
Guest9041 has joined #ruby
h4mz1d has quit [Ping timeout: 260 seconds]
malte_ has quit [Quit: malte_]
jxriddle has quit [Ping timeout: 264 seconds]
arkiver has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
mikekelly has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
PragCypher has joined #ruby
sayan has quit [Read error: Connection reset by peer]
io_syl has quit [Quit: Computer has gone to sleep.]
s1n4 has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
koshii has joined #ruby
Gooder has quit [Read error: Connection reset by peer]
_64k has joined #ruby
_64k has quit [Client Quit]
burgestrand has joined #ruby
emocakes has quit [Quit: emocakes]
zsoltgyongyosi has joined #ruby
xAndy is now known as xandy
zsoltgyongyosi has quit [Client Quit]
xandy is now known as xAndy
bigmcq77 has quit [Quit: Textual IRC Client: www.textualapp.com]
Neomex has joined #ruby
bigmcq77 has joined #ruby
nicoulaj has joined #ruby
<fasta> If I do Dir["*.abc].each{ |file|, exit ... in a directory containing 100 million abc files. Is this going to run in constant time?
jenrzzz has joined #ruby
cableray has quit [Quit: cableray]
<fasta> minus the , and completing in the obvious way.
<fasta> In other words, is it first going to build the complete 100 million element list?
koshii has quit [Ping timeout: 260 seconds]
<Hanmac> fasta: Dir.glob("*.abc") {|file| ... }
burgestrand1 has joined #ruby
koshii has joined #ruby
burgestrand has quit [Ping timeout: 265 seconds]
keanehsiao has quit [Quit: keanehsiao]
yacks has joined #ruby
emocakes has joined #ruby
GeekOnCoffee has quit [Ping timeout: 276 seconds]
ebouchut has joined #ruby
cantonic has quit [Quit: cantonic]
wallerdev has quit [Quit: wallerdev]
tommyvyo has quit [Quit: Computer has gone to sleep.]
_64k has joined #ruby
koshii has quit [Ping timeout: 265 seconds]
nemesit has joined #ruby
vlad_starkov has joined #ruby
karakedi has joined #ruby
pmros has joined #ruby
samphippen has joined #ruby
_64k has quit [Quit: _64k]
love_color_text has quit [Ping timeout: 252 seconds]
_64k has joined #ruby
_64k has quit [Client Quit]
jenrzzz has quit [Ping timeout: 265 seconds]
_64k has joined #ruby
nemesit has quit [Read error: Connection reset by peer]
ToTo has joined #ruby
_64k has quit [Client Quit]
darthdeus has quit [Quit: Leaving...]
Neomex has quit [Quit: Neomex]
Jackneill has joined #ruby
Jackneill has quit [Changing host]
Jackneill has joined #ruby
* arkiver wishes Merry Christmas to all fellow rubyists :)
nemesit has joined #ruby
rdegraci has joined #ruby
jsilver has quit [Remote host closed the connection]
<pmros> merry christmas
Spaceghostc2c has quit [Excess Flood]
Spaceghostc2c has joined #ruby
* Hanmac thoughts about when the world is getting colder it could be interesting to be naughty to get coal from santa
jessta has joined #ruby
slainer68 has quit [Remote host closed the connection]
d3vic3 has joined #ruby
rdegraci has quit [Quit: rdegraci]
subr00t has joined #ruby
Virunga has joined #ruby
love_color_text has joined #ruby
crackfu has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 252 seconds]
AwayLex is now known as Quadlex
spike|spiegel has quit [Quit: WeeChat 0.3.9.2]
subr00t has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
pmros has quit [Quit: Konversation terminated!]
s1n4 has quit [Quit: leaving]
Proshot has quit [Read error: Connection reset by peer]
thibauts has quit [Ping timeout: 256 seconds]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
ebouchut has quit [Quit: This computer has gone to sleep]
GeekOnCoffee has joined #ruby
nemesit|osx has joined #ruby
statarb3 has quit [Read error: Connection reset by peer]
statarb3 has joined #ruby
emergion has joined #ruby
onibox has joined #ruby
thibauts has joined #ruby
Proshot has joined #ruby
nemesit has quit [Ping timeout: 245 seconds]
apeiros_ has joined #ruby
ikaros has joined #ruby
DevoPs has joined #ruby
statarb3 has quit [Ping timeout: 256 seconds]
GeekOnCoffee has quit [Ping timeout: 276 seconds]
Proshot has quit [Ping timeout: 264 seconds]
matrixise has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
matip has joined #ruby
_64k has joined #ruby
<matip> is there a method to escape quotes and sanitize a string to execute it as a SQL query?
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
<apeiros_> matip: bad idea. use bind variables instead.
fowl has quit [Ping timeout: 252 seconds]
<apeiros_> that's those ? in the queries.
emergion has quit [Quit: Computer has gone to sleep.]
<matip> nop, I can't
<matip> I'm executing this query because datamapper doesn't support bulk insert, so I'm creating the query by hand, apeiros_
jxriddle has joined #ruby
<apeiros_> matip: BS, you still can
<matip> how would you? it would be something like INSERT INTO foo(bar, xux) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), ...
<apeiros_> just because you can't do it with datamapper doesn't mean you can't use sane mechanics at all
<matip> apeiros_, what's your idea?
<apeiros_> I don't see what's difficult about that
<apeiros_> query = "INSERT INTO foo(bar, xux) VALUE "+'(?, ?), '*100
<apeiros_> then prepare & execute the statement
<apeiros_> well, chomp(', ') the trailing ', '
<matip> hmn, let me see how to prepare it
<matip> thanks
jsilver has joined #ruby
jxriddle has quit [Ping timeout: 244 seconds]
picca has joined #ruby
<Hanmac> imo the Database wrapper should handle something like insert for you
<matip> DM does handle insert, not bulk insert
timonv has quit [Remote host closed the connection]
<Hanmac> imo that is worth a feature request
emmanuelux has joined #ruby
<matip> I've found some messages from 2008 and 2010 asking for that, I wouldn't expect this feature anytime soon :P
tPl0ch has quit [Quit: Verlassend]
<matip> Hanmac, actually even ActiveRecord doesn't support it ;)
<Hanmac> is it soo important that its a bulk insert?
emergion has joined #ruby
<matip> it's not a bulk insert because it's important.. actually all the opposite
<matip> I'm inserting A LOT of -unimportant- rows
<apeiros_> matip: if the reason is performance, you may want to go lower level. some db clients provide special means to deal with bulk data
<matip> you're talking about COPY, right?
<apeiros_> i.e. with oracle, I got a ~10x speed up using a specific API for bulk inserts
GeekOnCoffee has joined #ruby
EhyehAsherEhyeh has joined #ruby
<apeiros_> no, I'm talking about how the db client interacts with the db. that's outside of sql.
<matip> in pgsql there's a faster method called COPY TO/FROM
sepp2k has joined #ruby
<matip> you don't have SQL at all there
<matip> you basically send all the rows in a CSV style to pgsql's stdin
g_bleezy has joined #ruby
GeekOnCoffee has quit [Ping timeout: 248 seconds]
<matip> look, prepared statements works like that in DM: repository.adapter.execute('INSERT INTO foo(bar, xux) VALUES '+('(?, ?), '*collection.length).chop.chop, ...collection...)
<matip> I have to provide all the parameters to bind the variables like in ...chop, "bar1", "xux1", "bar2", "xux2", "bar3", "xux3")
<matip> how would you do that?
darthdeus has joined #ruby
g_bleezy has quit [Ping timeout: 252 seconds]
mikekelly has quit [Ping timeout: 265 seconds]
nerd has joined #ruby
arturaz has joined #ruby
<matip> <apeiros_> I don't see what's difficult about that
<matip> :P
Xeago has joined #ruby
cantonic has joined #ruby
mikekelly has joined #ruby
<apeiros_> I still don't
<apeiros_> you know what an array is, do you?
nari_ has joined #ruby
<matip> I don't think you can do "...chop, array)", but maybe there's a method like .call or .args or something like that (third day with ruby, don't ask me!)
eka has joined #ruby
Slivka has joined #ruby
<apeiros_> *array
emmanuelux has quit [Remote host closed the connection]
<matip> OMG
<matip> I love ruby lol
<matip> apeiros_, I didn't know that. thank you
Virunga has quit [Remote host closed the connection]
picca has quit [Ping timeout: 265 seconds]
_64k has quit [Quit: _64k]
emergion has quit [Quit: Computer has gone to sleep.]
emmanuelux has joined #ruby
iamjarvo has joined #ruby
toto-_ has joined #ruby
Nisstyre-laptop has quit [Ping timeout: 245 seconds]
nimred has quit [Ping timeout: 246 seconds]
nimred has joined #ruby
toto--_ has joined #ruby
ToTo has quit [Ping timeout: 252 seconds]
_64k has joined #ruby
toto-_ has quit [Ping timeout: 252 seconds]
_64k has quit [Client Quit]
ttt has quit [Remote host closed the connection]
koshii has joined #ruby
banisterfiend has joined #ruby
vlad_starkov has joined #ruby
iamjarvo has quit [Quit: Leaving.]
_64k has joined #ruby
nemesit|osx has quit [Quit: Linkinus - http://linkinus.com]
nemesit has joined #ruby
Takehiro has quit [Remote host closed the connection]
swex_ has quit [Read error: Operation timed out]
Emmanuel_Chanel has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Remote host closed the connection]
swex has joined #ruby
tenmilestereo has joined #ruby
_64k has quit [Quit: _64k]
Emmanuel_Chanel has joined #ruby
iamjarvo has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
jsilver has quit [Remote host closed the connection]
jsilver has joined #ruby
emocakes has quit [Quit: emocakes]
nerd has joined #ruby
akemrir has joined #ruby
Xeago has quit [Remote host closed the connection]
ippif has joined #ruby
slainer68 has joined #ruby
cantonic has quit [Quit: cantonic]
ananthakumaran has quit [Quit: Leaving.]
banisterfiend has quit [Remote host closed the connection]
nerd has quit [Quit: WeeChat 0.3.9.2]
nerd has joined #ruby
slainer68 has quit [Remote host closed the connection]
iamjarvo has quit [Quit: Leaving.]
_64k has joined #ruby
_64k has quit [Client Quit]
ToTo has joined #ruby
freeayu has quit [Remote host closed the connection]
akam-it has quit [Remote host closed the connection]
mengu has joined #ruby
toto--_ has quit [Ping timeout: 250 seconds]
onibox has quit [Quit: leaving]
<shevy> ruby has great magik
<shevy> and live coding too! https://github.com/mruby/mruby matz authored 33 minutes ago
_64k has joined #ruby
_64k has quit [Client Quit]
vlad_starkov has joined #ruby
_64k has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
kirun has joined #ruby
_64k has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
timonv has joined #ruby
otters has quit [Ping timeout: 251 seconds]
Takehiro has joined #ruby
nerd has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
x0F_ is now known as x0F
slainer68 has joined #ruby
ananthakumaran has joined #ruby
Takehiro has joined #ruby
GeekOnCoffee has joined #ruby
nari_ has quit [Ping timeout: 252 seconds]
timonv has quit [Remote host closed the connection]
Xeago has joined #ruby
slainer68 has quit [Remote host closed the connection]
ltsstar has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
DevoPs has quit [Ping timeout: 244 seconds]
postmodern has quit [Quit: Leaving]
ippif has quit [Quit: Computer has gone to sleep.]
elico has quit [Ping timeout: 252 seconds]
DevoPs has joined #ruby
nomenkun has joined #ruby
ttt has joined #ruby
nick_h has quit [Ping timeout: 256 seconds]
nick_h has joined #ruby
Guest9041 has quit [Ping timeout: 250 seconds]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 246 seconds]
Guest9041 has joined #ruby
iamjarvo has joined #ruby
arturaz has quit [Remote host closed the connection]
nerd has quit [Ping timeout: 264 seconds]
ttt has quit [Ping timeout: 276 seconds]
ippif has joined #ruby
kamsel has joined #ruby
Xeago has quit [Remote host closed the connection]
_64k has joined #ruby
Guest9041 has quit [Ping timeout: 246 seconds]
cantonic has joined #ruby
Guest9041 has joined #ruby
PragCypher has quit [Quit: Leaving]
Guest9041 has quit [Excess Flood]
Guest9041 has joined #ruby
cousine has joined #ruby
cousine has quit [Remote host closed the connection]
nerd has joined #ruby
ewag has quit [Ping timeout: 260 seconds]
lkba has quit [Ping timeout: 246 seconds]
matip has quit [Ping timeout: 252 seconds]
jianmeng3 has joined #ruby
matip has joined #ruby
EhyehAsherEhyeh has quit [Read error: Operation timed out]
love_color_text has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
Hanmac has joined #ruby
ananthakumaran1 has quit [Ping timeout: 252 seconds]
otters has joined #ruby
ippif has quit [Quit: Textual IRC Client: www.textualapp.com]
apeiros_ has quit [Remote host closed the connection]
havenn has joined #ruby
lolmaus has quit []
VegetableSpoon has joined #ruby
EhyehAsherEhyeh has joined #ruby
JohnBat26 has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
banisterfiend has joined #ruby
love_color_text has joined #ruby
Takehiro has quit [Remote host closed the connection]
lkba has joined #ruby
timonv has joined #ruby
JohnBat26 has quit [Read error: Connection reset by peer]
nomenkun has quit [Remote host closed the connection]
<matip> I've a strange bug that seems to be a race condition due to a couple of threads that are pushing elems into an array continuously. should it be a problem? I don't know how it's implemented internally, maybe the bug is not there.. what's your opinion?
nomenkun has joined #ruby
JohnBat26 has joined #ruby
slainer68 has joined #ruby
_64k has quit [Quit: _64k]
Takehiro has joined #ruby
slainer68 has quit [Read error: Operation timed out]
markit has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
nerd has joined #ruby
<markit> hi, ruby 1.8. If I have a string, 'this is a string' and I want to match with a regular expression and search for 'string' and get back only the part BEFORE that match?
<markit> i.e. in that example I would like to have back 'this is a'
<markit> and '' if does not match
<markit> or nil..
<Hanmac> markit maybe somethnig like this? /(.+)\sstring/ =~ 'this is a string';$1
<Hanmac> or like 'this is a string'.scan(/(.+)\sstring/).flatten[0]
<markit> Hanmac: magic!
<markit> Hanmac: thanks a lot (also did not thought of swap regex - string position)
karakedi has quit [Ping timeout: 252 seconds]
<Hanmac> markit or the best way: 'this is a string'[/(.+)\sstring/,1]
arkiver has quit [Quit: Leaving]
Guest9041 has quit [Ping timeout: 252 seconds]
<matip> > ('foo bar xux'.match /xux/).pre_match
<matip> => "foo bar "
Guest9041 has joined #ruby
<Hanmac> matip you are wrong, when it does not match it does fail
banisterfiend has quit [Ping timeout: 252 seconds]
jianmeng3 has left #ruby [#ruby]
banisterfiend has joined #ruby
<matip> come on... first match, then compare, then call pre_match
<matip> > (m = 'foo bar xux'.match /xux/) ? m.pre_match : ''
<matip> => "foo bar "
<matip> > (m = 'foo bar xux'.match /zaz/) ? m.pre_match : ''
<matip> => ""
skcin7 has joined #ruby
<matip> or do that ^
rippa has joined #ruby
Astral__ has quit [Ping timeout: 252 seconds]
<Hanmac> matip my last version is better than yours
<matip> in what way?
<Hanmac> shorter and does not need an local variable (and it may be faster)
<matip> provide benchmarks to assert that :P
<matip> begin ('foo bar xux'.match /xu2/).pre_match rescue '' end
<matip> without "m"!!
DevoPs has quit [Quit: Leaving]
<matip> (btw, I like your solution, I was just kidding ;)
assurbanipal has joined #ruby
Virunga has joined #ruby
razibog1 has joined #ruby
<Hanmac> and i tested it ... my version is faster
regedarek has quit [Ping timeout: 246 seconds]
regedarek has joined #ruby
Morkel has quit [Quit: Morkel]
Virunga has quit [Remote host closed the connection]
iamjarvo has quit [Quit: Leaving.]
nomenkun has quit [Remote host closed the connection]
nomenkun has joined #ruby
_64k has joined #ruby
JohnBat26 has quit [Read error: Connection reset by peer]
thone has quit [Ping timeout: 246 seconds]
thone has joined #ruby
tk__ has quit [Quit: ばいばい]
<markit> Hanmac: wow, like the last version even more
<markit> I'm just grasping regex, a new wider world is opening to me
razibog1 has quit [Quit: Leaving.]
niklasb has joined #ruby
reppard has joined #ruby
Takehiro has quit [Remote host closed the connection]
lenovodroid has joined #ruby
banisterfiend has quit [Ping timeout: 265 seconds]
Morkel has joined #ruby
adkron has quit [Ping timeout: 265 seconds]
fowl has joined #ruby
Takehiro has joined #ruby
h8R has quit [Remote host closed the connection]
banisterfiend has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.9.2]
razibog has joined #ruby
Morkel has quit [Quit: Morkel]
nerd has quit [Quit: WeeChat 0.3.9.2]
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
nomenkun has quit [Remote host closed the connection]
wermel has joined #ruby
Takehiro has quit [Remote host closed the connection]
Virunga has joined #ruby
reppard has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Ping timeout: 245 seconds]
Virunga has quit [Remote host closed the connection]
Virunga has joined #ruby
_64k has quit [Quit: _64k]
gnul0ver has joined #ruby
gnul0ver has quit [Client Quit]
Xeago has joined #ruby
nomenkun has joined #ruby
arietis has joined #ruby
assurbanipal has quit [Remote host closed the connection]
Guest49457 has joined #ruby
jxriddle has joined #ruby
rdegraci has joined #ruby
nerd has joined #ruby
yfeldblum has joined #ruby
cousine has joined #ruby
jxriddle has quit [Ping timeout: 264 seconds]
timonv has quit [Remote host closed the connection]
_64k has joined #ruby
ikaros has quit [Quit: Ex-Chat]
eldariof has quit [Ping timeout: 260 seconds]
nomenkun has quit [Remote host closed the connection]
ToTo has quit [Quit: Linkinus - http://linkinus.com]
<matip> Hanmac, how is that it works? I don't know the syntax "string"[regexp, key]
_64k has quit [Quit: _64k]
Virunga has quit [Remote host closed the connection]
<matip> ah, wait.. it's "string"[start, n]
<matip> never mind
g_bleezy has joined #ruby
<Hanmac> matip wrong: its also str[regexp, fixnum]
<Hanmac> and str[regexp, symbol] does work too
<matip> but is it special or a particular case of []?
<matip> I mean, of "foo"[1,2]
<matip> or whatever
<Hanmac> matip read the docs
_64k has joined #ruby
<Hanmac> matip: http://www.ruby-doc.org/core-1.9.3/String.html#method-i-5B-5D second paragraph about "If a Regexp is supplied, ... "
<matip> alright, thanks
g_bleezy has quit [Ping timeout: 252 seconds]
VegetableSpoon has quit [Quit: Leaving]
Astral_ has joined #ruby
diece has joined #ruby
Asher has joined #ruby
banisterfiend has joined #ruby
diece has quit [Quit: Leaving.]
Guest49457 has quit []
sayan has joined #ruby
diece has joined #ruby
ltsstar has quit [Quit: ltsstar]
track7 has quit [Read error: Connection reset by peer]
Chryson has joined #ruby
matip_ has joined #ruby
track7 has joined #ruby
arkiver has joined #ruby
arya has joined #ruby
<shevy> hmm
<shevy> does the import-functionality of python offer something that ruby require/include can not achieve?
<shevy> I am staring at:
<shevy> from werkzeug.wrappers import Request, Response
diece has left #ruby [#ruby]
matip has quit [Ping timeout: 252 seconds]
sayan has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
Noldorin has joined #ruby
havenn has joined #ruby
<rking> shevy: Kind of. The way they do namespacing is different. By default when you 'import foo' you get everything prefixed with 'foo.', IIRC
<rking> So saying 'from foo import Bar' is how you make 'Bar' work where 'foo.Bar' had to be
darthdeus has quit [Ping timeout: 252 seconds]
<shevy> hmm
<rking> But Ruby has other means of accomplishing this, and in general isn't annoyingly strict with symbol exports.
nerd has quit [Quit: WeeChat 0.3.9.2]
dagnachew has joined #ruby
io_syl has joined #ruby
nemesit has quit [Ping timeout: 260 seconds]
dagnachew has quit [Client Quit]
havenn has quit [Ping timeout: 244 seconds]
icole has joined #ruby
Xeago has quit [Remote host closed the connection]
_64k has quit [Quit: _64k]
sepp2k has quit [Remote host closed the connection]
wermel has quit [Remote host closed the connection]
darthdeus has joined #ruby
iamjarvo has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
Guest9041 has quit [Read error: Connection reset by peer]
Guest9041 has joined #ruby
slava_dp has quit [Quit: Bye]
schaerli has joined #ruby
h4mz1d has quit [Ping timeout: 264 seconds]
cousine has quit [Remote host closed the connection]
nemesit has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
zastern has joined #ruby
banisterfiend has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
arya has quit [Ping timeout: 244 seconds]
nerd has joined #ruby
phelps has joined #ruby
staafl has quit [Ping timeout: 250 seconds]
foohey_ has joined #ruby
foohey has quit [Quit: /ɪts ˌnɒt ə ˈbʌg ɪts ə ˈfiː.tʃə/]
arya has joined #ruby
foohey_ has quit [Client Quit]
staafl has joined #ruby
foohey has joined #ruby
phelps has quit [Read error: Connection reset by peer]
stayarrr has joined #ruby
foohey has quit [Client Quit]
Morkel has joined #ruby
tommyvyo has joined #ruby
nomenkun has joined #ruby
zastern has quit [Remote host closed the connection]
nomenkun has quit [Ping timeout: 252 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
Noldorin has quit [Quit: Computer has gone to sleep.]
d3vic3_ has joined #ruby
moshee has quit [Ping timeout: 245 seconds]
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
d3vic3 has quit [Ping timeout: 244 seconds]
`0x00 has joined #ruby
`0x00 has left #ruby [#ruby]
benlieb has joined #ruby
banister_ has joined #ruby
nomenkun has joined #ruby
slainer68 has joined #ruby
jxriddle has joined #ruby
tommyvyo has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
foohey has joined #ruby
banister_ has quit [Ping timeout: 252 seconds]
banisterfiend has joined #ruby
cousine has joined #ruby
arya has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
arya has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
d3vic3 has joined #ruby
nomenkun has quit [Remote host closed the connection]
foohey has quit [Quit: Reconnecting]
philips_ has quit [Excess Flood]
foohey has joined #ruby
d3vic3_ has quit [Ping timeout: 265 seconds]
eldariof has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
akemrir has joined #ruby
_64k has joined #ruby
philips_ has joined #ruby
nomenkun has joined #ruby
arya has quit []
foohey has quit [Quit: Lost terminal]
philips_ has quit [Excess Flood]
banisterfiend has quit [Ping timeout: 252 seconds]
d3vic3 has quit [Ping timeout: 246 seconds]
d3vic3 has joined #ruby
bigmac has quit [Quit: Leaving]
arya has joined #ruby
nomenkun has quit [Remote host closed the connection]
foohey has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
arkiver has quit [Ping timeout: 255 seconds]
nerd has joined #ruby
foohey has quit [Quit: Reconnecting]
foohey has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
foohey has quit [Client Quit]
foohey has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
slainer68 has quit [Remote host closed the connection]
cakehero has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
slainer68 has joined #ruby
foohey has quit [Client Quit]
Neomex has joined #ruby
foohey has joined #ruby
foohey has quit [Client Quit]
icole has quit [Remote host closed the connection]
foohey has joined #ruby
eka has joined #ruby
foohey has quit [Client Quit]
dyrot has joined #ruby
crackfu has joined #ruby
foohey has joined #ruby
baphled has joined #ruby
_64k has quit [Quit: _64k]
SiliconDon has joined #ruby
jgrevich has joined #ruby
SiliconDon has quit [Client Quit]
schaerli has quit [Remote host closed the connection]
nomenkun has joined #ruby
ccooke has quit [Ping timeout: 252 seconds]
philips_ has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
EhyehAsherEhyeh has quit [Ping timeout: 252 seconds]
Virunga has joined #ruby
nwertman has joined #ruby
scruple has joined #ruby
arya has quit [Ping timeout: 244 seconds]
scruple has quit [Ping timeout: 255 seconds]
banisterfiend has joined #ruby
scruple has joined #ruby
Nisstyre-laptop has joined #ruby
h4mz1d has joined #ruby
benlieb has quit [Quit: benlieb]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
ccooke has joined #ruby
havenn has quit [Read error: No route to host]
nerd has joined #ruby
havenn has joined #ruby
arya has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
h4mz1d has quit [Ping timeout: 264 seconds]
arya has quit [Ping timeout: 244 seconds]
jonahR has joined #ruby
wallerdev has joined #ruby
nwertman has quit [Ping timeout: 244 seconds]
akemrir has quit [Quit: WeeChat 0.3.9.2]
alexspeller has joined #ruby
arya has joined #ruby
foohey has quit [Quit: leaving]
akemrir has joined #ruby
yfeldblum has quit [Ping timeout: 252 seconds]
_64k has joined #ruby
ewag has joined #ruby
elico has joined #ruby
_64k has quit [Quit: _64k]
yacks has joined #ruby
<TTilus> the way ruby libs are usually written almost guarantees youll have namespace collisions when you use a lot of libs
iamjarvo has quit [Quit: Leaving.]
<TTilus> and reopening classes makes collisions subtle
foohey has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
jimeh has joined #ruby
jimeh has quit [Client Quit]
seanwash has joined #ruby
seanwash has quit [Remote host closed the connection]
Aqua has quit [Ping timeout: 252 seconds]
Aqua has joined #ruby
slainer68 has quit [Remote host closed the connection]
<TTilus> the one thing ive wished more than once is the ability to wrap stuff inside a namespace
dr_neek has quit [Quit: dr_neek]
<TTilus> just to be able to separate two colliding libs
Agbeladem has joined #ruby
jimeh has joined #ruby
_whitelogger has joined #ruby
ewag has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
<TTilus> within JailModule require "global-namespace-polluting-lib"
<TTilus> and im fully aware thet in ruby that feature is far from being trivial to implement
dr_neek has joined #ruby
<Agbeladem> Okay guys I'm losing it here
wallerdev has quit [Quit: wallerdev]
<Agbeladem> I got "." in my classpath. If I do "series" I'm getting ": No such file or directory", and the first line is #!/usr/bin/env ruby but "ruby series" works just fine
<reactormonk> Agbeladem, "." in your loadpath is always a security issue
lenovodroid has quit [Ping timeout: 245 seconds]
icole has joined #ruby
<Agbeladem> reactormonk: okay, now why doesn't this work considering I got other ruby scripts in the same folder with the same first-line header ?
<Agbeladem> /usr/bin/env ruby -v returns ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux]
lenovodroid has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
icole has quit [Ping timeout: 252 seconds]
cousine has quit [Remote host closed the connection]
slainer68 has joined #ruby
<Agbeladem> reactormonk: that's not the point, ./series won't work either, same error
SiegeX has quit [Ping timeout: 252 seconds]
cj3kim has joined #ruby
CaptainJet has joined #ruby
<Agbeladem> So, anybody ? :(
SiegeX has joined #ruby
srji has joined #ruby
<Hanmac> Agbekadem use an newer ruby and then use require_relative
<Agbeladem> Hanmac: oh ?
<Hanmac> "1.9.2" is not the latest ruby verson ... 1.9.3 is current, 1.9.2 may be buggy
crackfu has quit [Remote host closed the connection]
jfl0wers has joined #ruby
slainer68 has quit [Remote host closed the connection]
<Hanmac> use require for external stuff and require_relative for internal ... like <> and "" with #include in C/C++
cakehero has quit [Quit: Computer has gone to sleep.]
matchaw_ has joined #ruby
cj3kim has quit [Ping timeout: 276 seconds]
nick_h has quit [Ping timeout: 246 seconds]
wallerdev has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
EhyehAsherEhyeh has joined #ruby
Jasko has joined #ruby
arya has quit [Ping timeout: 244 seconds]
jimeh has quit [Quit: Computer has gone to sleep.]
nicoulaj has quit [Read error: No route to host]
Chryson has quit [Quit: Leaving]
kidoz has joined #ruby
nick_h has joined #ruby
arya has joined #ruby
alexspeller has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 240 seconds]
fowl has quit [Ping timeout: 256 seconds]
Jelco_ has quit [Ping timeout: 260 seconds]
nwertman has joined #ruby
Villadelfia has joined #ruby
Villadelfia has quit [Excess Flood]
Jelco_ has joined #ruby
Villadelfia has joined #ruby
Villadelfia has quit [Changing host]
Villadelfia has joined #ruby
nwertman has quit [Read error: Operation timed out]
Villadelfia has quit [Client Quit]
Neomex has quit [Quit: Neomex]
Villadelfia has joined #ruby
Villadelfia has quit [Excess Flood]
Villadelfia has joined #ruby
Villadelfia has quit [Excess Flood]
jxriddle has quit [Quit: jxriddle]
lordnaz has joined #ruby
arya has quit [Ping timeout: 244 seconds]
slainer68 has joined #ruby
akram has joined #ruby
vlad_starkov has joined #ruby
arya has joined #ruby
razibog has quit [Ping timeout: 260 seconds]
eldariof has quit []
g_bleezy has joined #ruby
arya has quit [Ping timeout: 244 seconds]
arya has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
g_bleezy has quit [Ping timeout: 252 seconds]
cj3kim has joined #ruby
vlad_starkov has quit [Ping timeout: 255 seconds]
banisterfiend has joined #ruby
crackfu has joined #ruby
slainer68 has quit [Ping timeout: 265 seconds]
akram has quit [Remote host closed the connection]
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
arya has quit [Ping timeout: 260 seconds]
crackfu has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
Villadelfia has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
shevy has quit [Ping timeout: 265 seconds]
lenovodroid has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
arya has joined #ruby
thomsch has joined #ruby
Morkel_ has joined #ruby
AtoxIO has joined #ruby
akram has joined #ruby
Morkel has quit [Ping timeout: 260 seconds]
Morkel_ is now known as Morkel
Noldorin has joined #ruby
kiyoura has joined #ruby
Villadelfia has quit [Quit: Leaving.]
banisterfiend has joined #ruby
nerd has quit [Quit: WeeChat 0.3.9.2]
ryanf has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
shevy has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.9.2]
Villadelfia_ is now known as Villadelfia
banisterfiend has quit [Ping timeout: 245 seconds]
alexwh has quit [Remote host closed the connection]
arya has quit [Ping timeout: 260 seconds]
Virunga has quit [Remote host closed the connection]
koshii has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
koshii has joined #ruby
slainer68 has joined #ruby
pxjorge has joined #ruby
ddd has joined #ruby
Jake232 has joined #ruby
jxriddle has joined #ruby
rakl has joined #ruby
postmodern has joined #ruby
banisterfiend has quit [Ping timeout: 255 seconds]
benlieb has joined #ruby
kokainepizza has joined #ruby
alexspeller has joined #ruby
akram has quit [Remote host closed the connection]
ltsstar has joined #ruby
lenovodroid has quit [Read error: Connection reset by peer]
lenodroid has joined #ruby
havenn has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
havenn has joined #ruby
banisterfiend has joined #ruby
havenn has quit [Ping timeout: 252 seconds]
srji has quit [Ping timeout: 244 seconds]
arya has joined #ruby
skcin7 has quit [Ping timeout: 252 seconds]
Virunga has joined #ruby
toekutr has joined #ruby
slainer68 has quit [Remote host closed the connection]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
picca has joined #ruby
jxriddle has quit [Quit: jxriddle]
jenrzzz has joined #ruby
slainer68 has joined #ruby
jfl0wers has quit [Ping timeout: 252 seconds]
jxriddle has joined #ruby
ryanf_ has joined #ruby
stayarrr has quit [Quit: Leaving...]
bricker has joined #ruby
ryanf has quit [Ping timeout: 252 seconds]
lenodroid has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
Iszak has joined #ruby
nwertman has joined #ruby
srji has joined #ruby
cantonic_ has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
jxriddle has quit [Quit: jxriddle]
eph3meral has joined #ruby
Hanmac has joined #ruby
Noldorin has quit [Quit: Computer has gone to sleep.]
nwertman has quit [Ping timeout: 252 seconds]
bricker has quit [Ping timeout: 252 seconds]
picca has quit [Ping timeout: 260 seconds]
jxriddle has joined #ruby
nemesit has quit [Ping timeout: 244 seconds]
x82_nicole has joined #ruby
Morkel has quit [Quit: Morkel]
Iszak has quit []
ryanf_ has quit [Quit: broken pipes |||]
frogstarr78 has quit [Read error: Connection reset by peer]
srji has quit [Quit: leaving]
frogstarr78 has joined #ruby
bricker has joined #ruby
mockra has joined #ruby
Goles has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
thomsch has quit [Remote host closed the connection]
ryanf has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
ryanf has quit [Client Quit]
Jackneill has quit [Remote host closed the connection]
Chronax has joined #ruby
Fezzler has joined #ruby
arya has quit [Ping timeout: 244 seconds]
Fezzler has quit [Client Quit]
bricker has quit [Ping timeout: 265 seconds]
rakl has joined #ruby
arya has joined #ruby
felipe_Brz has joined #ruby
mengu has quit [Quit: Konversation terminated!]
iamjarvo has joined #ruby
<felipe_Brz> right now I need to do a simple container for a few methods... in other languages I would perhaps write static methods in a class... what's the best way to do this in ruby?
<lupine> well, what are the methods to do?
lenovodroid has joined #ruby
bricker has joined #ruby
<lupine> you could stick them in a module (rails helpers are like this, for instance)
jenrzzz has quit [Ping timeout: 260 seconds]
Slivka has quit [Remote host closed the connection]
<felipe_Brz> well i'm making a few helper methods for my own use
g_bleezy has joined #ruby
<lupine> I'd generally stick to instance methods, rather than class methods, if you do, though
<felipe_Brz> hmm can I call instance methods on a class without instantiating it?
<felipe_Brz> like foo = MyClass.someMethod()
<lupine> a module isn't a class ^^. you'd need to include the module on something before being able to call them
<lupine> one trick would be to extend the module with itself, so you can call MyModule.my_method or include MyModule ; my_method
<lupine> but don't forget, you can reopen any existing class. maybe your method more properly belongs on String, or Fixnum, or some other already-existing class
<lupine> whatever makes its intent clearest
<felipe_Brz> yes you're talking about partial classes
<felipe_Brz> it's a real clever concept
<lupine> ?
<felipe_Brz> isn't that what partial classes are?
<felipe_Brz> like you add a method to class Array at runtime
<felipe_Brz> you define a class called Array and add a method to it
<lupine> well, ruby doesn't have class definitions, as such
toekutr has quit [Read error: Connection reset by peer]
<lupine> so the idea of a partial class definition (dot-net, right?) doesn't exactly apply
<felipe_Brz> no, not dot net
<felipe_Brz> i learnt about it on a rails web course
<lupine> well, if it's not apeing http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.80).aspx, I don't know of it
<felipe_Brz> yes, that's similar to what i mean
<felipe_Brz> perhaps i'm calling it the wrong name
<lupine> I wouldn't consider ruby's modules, or class reopening, to be comparable
<felipe_Brz> but yes that it
<felipe_Brz> hmm
rdegraci has quit [Quit: rdegraci]
<lupine> the main conmon feature is merely that the code can end up in multiple files
<lupine> common*
Chronax has quit [Quit: Leaving]
rdegraci has joined #ruby
mockra has quit [Remote host closed the connection]
otters has quit [Ping timeout: 252 seconds]
scruple has quit [Quit: Leaving]
havenn has joined #ruby
lenovodroid has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
rking has quit [Quit: WeeChat 0.4.0-dev]
razibog has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
keppy has joined #ruby
Jasko has joined #ruby
vlad_starkov has joined #ruby
havenn has quit [Ping timeout: 252 seconds]
_64k has joined #ruby
Noldorin has joined #ruby
jxriddle has quit [Quit: jxriddle]
keppy has quit []
rdegraci has quit [Quit: rdegraci]
dreinull has joined #ruby
arya has quit [Ping timeout: 244 seconds]
<dreinull> what are these lines in enumerate.c about? https://github.com/ruby/ruby/blob/trunk/enumerator.c#L213-#L215
<dreinull> enumerator.c that is
benlieb has quit [Quit: benlieb]
vlad_starkov has quit [Ping timeout: 260 seconds]
<lupine> dreamfall, if you're iterating over an array, you don't want to modify the same instance being enumerated
<lupine> I guess it's related to that
arya has joined #ruby
slainer68 has quit [Remote host closed the connection]
Guest9041 has quit [Ping timeout: 265 seconds]
rakl has quit [Quit: sleeping]
Guest9041 has joined #ruby
atmosx has joined #ruby
toekutr has joined #ruby
bricker has quit [Quit: leaving]
rking has joined #ruby
<felipe_Brz> anyone got a suggestion for a simple ide with macro recording/scripting?
<felipe_Brz> ide or code editor
<eph3meral> felipe_Brz: I love vim
<eph3meral> felipe_Brz: but there are many to choose from http://en.wikipedia.org/wiki/List_of_text_editors
<felipe_Brz> eph3meral: i know about recording in vim but is it easy to script and hook actions to hotkeys or key combos?
<eph3meral> felipe_Brz: if you /join #vim I'll be glad to answer some of those questions
<dreinull> lupine: you mean I get the enumerator obj first and then enumerate over it?
<felipe_Brz> eph3meral: sure, sorry about that.
lenovodroid has joined #ruby
staafl has quit [Read error: Connection reset by peer]
emergion has joined #ruby
<atmosx> What is the best way to execute a script every 5 hours, using ruby? EventMachine.add_timer ?
Astral_ has quit [Read error: Connection reset by peer]
Noldorin has quit [Quit: Computer has gone to sleep.]
<whitequark> atmosx: cron.
<atmosx> I want to get statistics from a db.
Astral_ has joined #ruby
<atmosx> whitequark: nah, cron is to linux/unix centric… I wonder if there's a pure ruby-ish way to do it.
<atmosx> Although cron would be much more easy to configure/use
<atmosx> hmm
nwertman has joined #ruby
Spaceghostc2c has quit [Excess Flood]
_64k has quit [Quit: _64k]
nwertman has quit [Ping timeout: 250 seconds]
arya has quit [Ping timeout: 244 seconds]
matchaw_ has quit [Remote host closed the connection]
Spaceghostc2c has joined #ruby
arya has joined #ruby
matchaw_ has joined #ruby
otters has joined #ruby
benlieb has joined #ruby
g_bleezy has quit [Remote host closed the connection]
<shevy> hmm is there a way to "round" something like 90.1709401709402 via sprintf() alone? or do I have to use .round
<shevy> would have to become 90.17 (is percent)
<atmosx> sure
<atmosx> sprintf("%0.2f blah blah", x.to_f)
Goles has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
alexspeller has quit [Remote host closed the connection]
Iszak has joined #ruby
agarie has joined #ruby
<lupine> shevy, or indeed, "%0.2f blah blah" % x.to-f
<shevy> ah
<lupine> String#% is badass
<shevy> strange
<shevy> the 0. part
Xeago has joined #ruby
<lupine> it's standard printf syntax
<shevy> works nicely, thanks :)
<lupine> it probably goes to the C library call untouched
iamjarvo has quit [Quit: Leaving.]
cousine has joined #ruby
cantonic has quit [Quit: cantonic]
benlieb has quit [Quit: benlieb]
dyrot_ has joined #ruby
<Iszak> I love the % method
dyrot has quit [Disconnected by services]
dyrot_ is now known as dyrot
cousine has quit [Remote host closed the connection]
scruple has joined #ruby
cantonic has joined #ruby
alanp has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
jblack has joined #ruby
<Hanmac> lupine ruby's sprintf could do far more, you could use named replacemends "%<number>d %<string>s" % {:number => 4, :string => "a" }
<lupine> heh, I didn't know that
alanp_ has quit [Ping timeout: 255 seconds]
<lupine> is it smart enough to call <methodname> on the object if it doesn't respond to []?
marr has joined #ruby
* lupine guesses not
<lupine> not hard to stick an adaptor in for it, anyway
nilg has joined #ruby
<Hanmac> lupine and the reverse if you use regex-literal =~ string with named captures inside the regex it does assign LOCAL variables
kirun_ has joined #ruby
samuel02 has quit [Remote host closed the connection]
kirun has quit [Ping timeout: 264 seconds]
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
agarie has quit [Remote host closed the connection]
iamjarvo has joined #ruby
EhyehAsherEhyeh has quit [Ping timeout: 244 seconds]
mengu has joined #ruby
benlieb has joined #ruby
fowl has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
atmosx has quit [Quit: And so the story goes…]
Aqua has quit [Ping timeout: 250 seconds]
Aqua has joined #ruby
rakl has joined #ruby
phelps has joined #ruby
Xeago has quit [Remote host closed the connection]
seeqwell has joined #ruby
seeqwell has left #ruby [#ruby]
chrisramon has joined #ruby
arya has quit [Ping timeout: 244 seconds]
<chrisramon> hi … is there any other purpose besides passing do/end closure, when using ampersand before a argument name ?
arya has joined #ruby
kirun_ has quit [Quit: Client exiting]
arya has quit [Ping timeout: 244 seconds]
<Hanmac> chrisramon, no, but you can store it in a variable and call it later
nipara has joined #ruby
Takehiro has joined #ruby
nipar has quit [Ping timeout: 272 seconds]
<chrisramon> Hanmac, yeah thx
arya has joined #ruby
AtoxIO has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 244 seconds]
AtoxIO has joined #ruby
daniel_- has joined #ruby
x82_nicole has quit [Quit: Textual IRC Client: www.textualapp.com]
arya has joined #ruby
apeiros_ has joined #ruby
ccooke has quit [Ping timeout: 252 seconds]
Hanmac has quit [Ping timeout: 255 seconds]
agarie has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
tenmilestereo[aw has joined #ruby
burgestrand1 has quit [Quit: Leaving.]
nazty has joined #ruby
tommyvyo has joined #ruby
tenmilestereo has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
_64k has joined #ruby
dpn` has quit [Excess Flood]
rdegraci has joined #ruby
Noldorin has joined #ruby
dpn` has joined #ruby
ccooke has joined #ruby