ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
drumond19 has joined #ruby-lang
<WillMarshall> drbrain: I am always using either ::State or HealthQuote::State
<WillMarshall> And I used this as the class def:
<WillMarshall> But yes, it's a constant resolution problem, but it's somewhat inconsistent
<drbrain> from what context do you get the wrong State back?
<drbrain> WillMarshall: I know there are places where ruby will return an unexpected constant, but I can't create one offhand
<zenspider> hoe 3.0.3 released
ConstantineXVI has joined #ruby-lang
<drbrain> I don't see them since I always have class A::B instead of class A; class B, which changes the lookup rules to avoid that case
<WillMarshall> drbrain: integration tests in a Rails app, and sporadically from an IRB session…
<WillMarshall> This is buried in a Rails app but I suspected it was more of a Ruby question
<WillMarshall> So class A::B is safer?
<WillMarshall> I prefer the syntax, so I can switch to that no problem
<drbrain> it has to do with how you nest classes and modules
<drbrain> it avoids the weird rules where you get the wrong constant back
<drbrain> but the downside is that you have to type more class names to qualify things properly
<drbrain> WillMarshall: I *think* if you ran with ruby -w you would see a warning for the "got top-level State" case
<zenspider> personally, I like the more explicit A::B just because it sets the mental state properly... but PLEASE don't cargo cult and start prefixing "::" everywhere because then I'll have to hurt you down :P
<WillMarshall> zenspider: I don't always code, but when I do I like to cargo-cult
<zenspider> I might have to blog that
<WillMarshall> Feel free
<zenspider> WillMarshall: would you like me to remove your name? :P
<WillMarshall> No?
<WillMarshall> It's funnier this way
<zenspider> hah
headius has joined #ruby-lang
<erikh> ::Prefix has its uses
<erikh> but I agree otherwise
<erikh> and I'm just talking because I'm off work and kind of bored
<zenspider> yes, and its legitimate uses are about 10% of their occurances
<WillMarshall> I had a long weekend, it was awesome
<erikh> no argument from me
<erikh> I was on vacation!
<erikh> for 9 delicious days.
<WillMarshall> Bastard
<WillMarshall> I am touring the UK, but that doesn't really count
<WillMarshall> And not for aaaages
savage- has joined #ruby-lang
<andrewvos> Long weekend ++
<Boohbah> andrewvos: syntax error, unexpected $end
<Boohbah> :D
replore has joined #ruby-lang
shevy has joined #ruby-lang
fayimora has joined #ruby-lang
loh has joined #ruby-lang
ryez has joined #ruby-lang
mistym has joined #ruby-lang
bryancp has joined #ruby-lang
t has joined #ruby-lang
macmartine has joined #ruby-lang
Sailias has joined #ruby-lang
neoesque has joined #ruby-lang
lsegal has joined #ruby-lang
deryldoucette has joined #ruby-lang
jacktrick has joined #ruby-lang
<erikh> herp
t_ has joined #ruby-lang
seanstickle has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
chimkan_ has joined #ruby-lang
<mistym> erikh: derp?
<bnagy> herp! herp! I forrgerr speek engrish!
shtirlic has joined #ruby-lang
rking has joined #ruby-lang
_santana has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
t has joined #ruby-lang
t has joined #ruby-lang
bryancp has joined #ruby-lang
andrewhl has joined #ruby-lang
RORgasm has joined #ruby-lang
mattyoho has joined #ruby-lang
rdavila has joined #ruby-lang
slyphon has joined #ruby-lang
fgomez has joined #ruby-lang
Sailias has joined #ruby-lang
Radium has joined #ruby-lang
fgomez has joined #ruby-lang
savage- has joined #ruby-lang
deobald has joined #ruby-lang
gix has joined #ruby-lang
fayimora has joined #ruby-lang
mistym has joined #ruby-lang
JohnBat26|2 has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
H2H has joined #ruby-lang
Radium has joined #ruby-lang
jtoy has joined #ruby-lang
RomyRomy has joined #ruby-lang
<bnagy> NotImplementedError: fork is not available on this platform fork at org/jruby/RubyProcess.java:962
<bnagy> on linux? :/
macmartine has joined #ruby-lang
replore has joined #ruby-lang
<bnagy> ok... so there should be a -J-Djruby.fork.enabled=true option, but it doesn't seem to work for me
<bnagy> so much for using the parallel gem on jruby :(
cirwin has quit [#ruby-lang]
headius has joined #ruby-lang
macmartine has joined #ruby-lang
jmcphers has joined #ruby-lang
dr0id has joined #ruby-lang
igotnolegs has joined #ruby-lang
toretore has joined #ruby-lang
RORgasm has joined #ruby-lang
rippa has joined #ruby-lang
Sailias has joined #ruby-lang
tr-808 has joined #ruby-lang
gnufied has joined #ruby-lang
kain_ has joined #ruby-lang
lohg has joined #ruby-lang
geekfactor_ has joined #ruby-lang
rue_XIV has joined #ruby-lang
jmeeuwen_ has joined #ruby-lang
takaokouji has joined #ruby-lang
flebel has joined #ruby-lang
ged has joined #ruby-lang
diegoviola has joined #ruby-lang
io_syl has joined #ruby-lang
io_syl has joined #ruby-lang
Tick-Tock has joined #ruby-lang
Nowaker has joined #ruby-lang
Gekz has joined #ruby-lang
Gekz has joined #ruby-lang
melter has joined #ruby-lang
tris has joined #ruby-lang
kitallis has joined #ruby-lang
yxhuvud has joined #ruby-lang
dvorak has joined #ruby-lang
havenn has joined #ruby-lang
thone has joined #ruby-lang
DEac- has joined #ruby-lang
geekfactor has joined #ruby-lang
Jade has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
future_chimp has joined #ruby-lang
mikeric has joined #ruby-lang
Gain_0 has joined #ruby-lang
<Gain_0> greetings
postmodern has joined #ruby-lang
<Gain_0> Welcome back.
<Gain_0> I'm glad you came again.
<postmodern> Gain_0, hello?
<postmodern> Gain_0, why the CTCP spam?
dvorak has joined #ruby-lang
Fullmoon has joined #ruby-lang
<Gain_0> hello.
<erikh> boo, drbrain is offline
<Gain_0> Sorry about that.
<Gain_0> I did a mistake.. i'm new on this.
<Gain_0> First time in IRC
<postmodern> Gain_0, ah understandable
<postmodern> Gain_0, so do you have a question for us? :)
<Gain_0> Sure.
<Gain_0> I found a method to send files through time-space.
<erikh> hehehe.
<Gain_0> It's up to you.
<Gain_0> That person left that program in a website but still with bugs, and I'm using it. Later I'll prove things what one can do.
<Gain_0> Again, I'm with fear for something can be happen with me.
<Gain_0> So, I'll leave in two minutes.
havenn has joined #ruby-lang
<Gain_0> If you're still interested. I'll tell you what it does.
<Gain_0> Is for reconstructing a file using a weak check sum and a weighted or strong check sum. Also it can be used to data-mine the collisions off the check sum counter exploring a single weak check-sum for specific types of files.
<Gain_0> Using a upgraded version of Rsync or a completedly customized program here is basically how one could send files through time-space.
havenn has joined #ruby-lang
<Gain_0> The basics.
<Gain_0> Both (a) and (b) know the files to each other through time and space
<Gain_0> will be between weak check sums ranges (C) and (D).
<Gain_0> So (a) wants to send (b) a file. (a) creates a file then deletes it.
<Gain_0> (b) uses a hash function to create all the files between check sum
<Gain_0> ranges (C) and (D) then (b) uses a data mining algorithm and maybe
<Gain_0> some verification methods to find the message (a) sent to (b) through time and space.
<Gain_0> Interesting, isn't it?.
<Gain_0> Here is how a program would construct computer media of the future, past, or alternate time lines. The program would use a data verification method to search weak check sum ranges for computer media from the past, future, or alternate realities.
<Gain_0> Using the above method it is possible for the user to create a paradox and observe the paradox from different temporal reference points. A paradox is where Point A occurred in past which lead to the event point B which lead to another event point C which was the event that caused point A in the past to occur because point A in the past read about point C in the future. Welcome to time travel.
<Gain_0> The main mechanism of my time travel program is the binary counter. I use special algorithms and hash functions to make the binary counter function then I use data mining and AI's to find my computer media of the past, future, or alternate realities.
<Gain_0> I could get incredibly complected here but I am trying to keep my post in terms most people can understand.
<Gain_0> Now I will try to be a little more specific about what methods I use. The methods themselves have varied greatly. On email I use a program to check for a header. That is the email format.
<Gain_0> Then I use a spell checker for quickly finding misspelled words. If there are none or very few then I use a syntax checker. I have had to write my own programs for these because the standard programs out there I have found none suited to my work.
<Gain_0> The spell checker I just used the standard text file access programing and a dic. file. The syntax was a little harder. I had to get ebooks in text format and group words two by two (kind of like noha and the ark.) along with the usual punctuation.
<Gain_0> On the counter themselves as everyone knows brute force takes a long time. So I used a standard binary counter that was trained with standard known computer media as a AI counter.
<Gain_0> So its digits when incremented do so according to a AI file that tells them what values to goto next when its their turn. Now for their turn part. Each digit in the binary counter gets assigned a random number. If the number is zero the digit does nothing for that turn. If the number is 1 then the digit increments according to its AI training file.
solars has joined #ruby-lang
x0F_ has joined #ruby-lang
<Gain_0> I could write more but my time's up.
<Gain_0> Good Night.
dhruvasagar has joined #ruby-lang
<Gain_0> If you know enough of programming, then you should know already what I was talking about.
<Boohbah> been watching Steins;Gate, have we?
<Gain_0> I know about that show, but this is more than truth.
<Gain_0> The Source from this is from another person.
<Gain_0> Ok, Night.
Gain_0 has quit [#ruby-lang]
anildigital_work has joined #ruby-lang
bjensen has joined #ruby-lang
<anildigital_work> Time.now.to_i returns - number when it is less than 1970 right?
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
<Boohbah> >> Time.utc(1970).to_i => 0
<Boohbah> >> Time.utc(1969).to_i => -31536000
srbartlett has joined #ruby-lang
workmad3 has joined #ruby-lang
drbrain has joined #ruby-lang
zmack has joined #ruby-lang
solars has joined #ruby-lang
workmad3 has joined #ruby-lang
vmoravec has joined #ruby-lang
publicvoid_ has joined #ruby-lang
rohit has joined #ruby-lang
havenn has joined #ruby-lang
Rashid has joined #ruby-lang
bjensen has joined #ruby-lang
havenn has joined #ruby-lang
nazty has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
vmoravec has joined #ruby-lang
jmcphers has joined #ruby-lang
<erikh> hrm
esad has joined #ruby-lang
RORgasm has joined #ruby-lang
<bnagy> time travel whatnow?
* bnagy checks he didn't stumble into #acidfreaks
NickXuhui has joined #ruby-lang
heftig has joined #ruby-lang
_inc_ has joined #ruby-lang
isale-eko has joined #ruby-lang
<erikh> heh
<erikh> time cube!
<bnagy> this is what happens when people go off their meds
srbartlett has joined #ruby-lang
kitallis has joined #ruby-lang
ttilley has joined #ruby-lang
<andrewvos> bnagy: This is what happens Larry
futurechimp has joined #ruby-lang
d3vic3 has joined #ruby-lang
tekin has joined #ruby-lang
vesan has joined #ruby-lang
havenn has joined #ruby-lang
srbartlett has joined #ruby-lang
ngw has joined #ruby-lang
francisfish has joined #ruby-lang
rippa has joined #ruby-lang
woollyams has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24> hi guys
<ridders24> does find.find work with more than one drive letter?
_inc has joined #ruby-lang
<bnagy> according to the docs, yes
havenn has joined #ruby-lang
kain has joined #ruby-lang
Radium has joined #ruby-lang
Radium_ has joined #ruby-lang
<ridders24> why do I have a syntax error for drive = C:/, F:/
<bnagy> looks like it should be find('C:/', 'F:/') or whatever
<ridders24> thanks bnagy
sluggy has joined #ruby-lang
hbs has joined #ruby-lang
<shevy> hmm "jobs -l" is that a bash internal command? I am trying to call that from ruby... system("jobs -l") but it is not telling me which jobs are queued from within that ruby scripts
Radium has joined #ruby-lang
voker57 has joined #ruby-lang
judofyr has joined #ruby-lang
RORgasm has joined #ruby-lang
<judofyr> easiest way to remove all 0 at the end of an Array? [1, 0, 2, 3, 0, 0, 0] => [1, 0, 2, 3]
<shevy> hmm
<shevy> reverse it, then build a new array?
<shevy> dunno if there is a better way
<yxhuvud> judofyr: I'd bet my hat that the tersest way would be with flipflops, but please don't do it that way :)
<judofyr> yxhuvud: haha, I'm writing it with flip-flops right now :D
Guest53319 has joined #ruby-lang
<judofyr> yxhuvud: a.reverse_each { |ele| b.unshift(ele) if ele > 0 .. false }
<shevy> hmm
<yxhuvud> but then you might as well do while a[-1] > 0; a.unshift; end
<judofyr> yxhuvud: example?
<Guest53319> We had a challenge at University, various challenges for various rewards. The most rewarded challenge ($10 000) was to write a Ruby-parser within a month. Nobody even tried. Anecdote :)
<yxhuvud> I'd rather not. that's not good for my mental stability. also, I didn't realize it was ok to modify the array and use unshift.
bjensen has joined #ruby-lang
<judofyr> yxhuvud: hm? I'm working on two arrays
<judofyr> yxhuvud: iterating over one, unshifting to another
<yxhuvud> ah.
<shevy> Guest53319 one month seems not a long time
<yxhuvud> I suppose b = b[0..a.rindex {|x| x != 0}] then.
<judofyr> yxhuvud: nice, didn't realize rindex could take a block
<yxhuvud> me neither until I tried :)
<Mon_Ouie> I'd use Array#slice!
<judofyr> Mon_Ouie: I need a copy though :)
<ddfreyne> I’d use reverse_detect to get the index of the last non-0 element
setmeaway has joined #ruby-lang
setmeaway has joined #ruby-lang
<shevy> one hundred ways to solve!
<judofyr> ddfreyne: there is a reverse_detect?
srbartlett has joined #ruby-lang
<shevy> peculiar name :)
<ddfreyne> nope
<ddfreyne> I was wrong
<shevy> it was a bit long too :P
woollyams has joined #ruby-lang
naz has joined #ruby-lang
neoesque has joined #ruby-lang
batmanian has joined #ruby-lang
<andrewvos> ruby-lang: ANyone know a pretty log visualiser?
<andrewvos> ruby-lang: I want to take apache logs with millions of requests and make them look pretty somehow
<judofyr> andrewvos: there's always this: http://www.fudgie.org/
<andrewvos> judofyr: Seemed a bit buggy :/
morozovm has joined #ruby-lang
<shevy> bugs are what gives programmers work
<andrewvos> shevy: Quiet sonny
kiddorails has joined #ruby-lang
rdavila has joined #ruby-lang
esad has joined #ruby-lang
Zolrath has joined #ruby-lang
kvirani has joined #ruby-lang
tekin has joined #ruby-lang
seanstickle has joined #ruby-lang
kp666 has joined #ruby-lang
kp666 has joined #ruby-lang
bryancp has joined #ruby-lang
rohit has joined #ruby-lang
m3nd3s has joined #ruby-lang
mark_locklear has joined #ruby-lang
m3nd3s has joined #ruby-lang
mssola has joined #ruby-lang
rolfb has joined #ruby-lang
RORgasm has joined #ruby-lang
geekfactor has joined #ruby-lang
mistym has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
yalue has joined #ruby-lang
kurko_ has joined #ruby-lang
fgomez has joined #ruby-lang
mrneighborly has joined #ruby-lang
sodani has joined #ruby-lang
woollyams has joined #ruby-lang
apeiros_ has joined #ruby-lang
mistym has joined #ruby-lang
bawer has joined #ruby-lang
havenn has joined #ruby-lang
febeling has joined #ruby-lang
enebo has joined #ruby-lang
sodani has quit [#ruby-lang]
codewrangler has joined #ruby-lang
dous has joined #ruby-lang
headius has joined #ruby-lang
Indian has joined #ruby-lang
justinxreese has joined #ruby-lang
dv310p3r has joined #ruby-lang
_inc has joined #ruby-lang
jtoy has joined #ruby-lang
mattyoho has joined #ruby-lang
<andrewvos> I have to curl scripts running simultaneously which are giving me tails of error logs. How can I merge these?
mattyoho has joined #ruby-lang
<andrewvos> to=two
tekin has joined #ruby-lang
esad has joined #ruby-lang
jperry has joined #ruby-lang
JEG2 has joined #ruby-lang
<jperry> Any know if there is a way to configure Bundler to install two versions of a gem?
<jperry> I have two gems that are conflicting because of dependencies on different versions
mistym has joined #ruby-lang
rdavila has joined #ruby-lang
zmack has joined #ruby-lang
slyphon has joined #ruby-lang
guns has joined #ruby-lang
outoftime has joined #ruby-lang
havenn has joined #ruby-lang
datanoise has joined #ruby-lang
<ridders24> hey mistym: I tried to add multiple drives to be searched on that script but for some reason it gets stuck. I checked the out file and it doesnt complete the full list
<mistym> ridders24: Can you paste the new version?
RORgasm has joined #ruby-lang
thone_ has joined #ruby-lang
bryancp has joined #ruby-lang
<ridders24> mistym: im getting an error now, it did kind of work earlyer, not sure what ive missed, but this is what ive got
<ridders24> mistym: http://pastie.org/3762161
<ridders24> mistym: only thing that bothered me with the out put was that i would get a result for F then C then F again. I know why becuase the block iterates each time but when I did a block for just C i still got the same result
<mistym> ridders24: That's not how you send multiple arguments to a method.
msisk has joined #ruby-lang
olesu has joined #ruby-lang
<ridders24> ahh changed it to Find.find('F:/','C:/') and that seems to be running but it may get stuck
spuk has joined #ruby-lang
<ridders24> mistym: seems to be taking its time
Swimming_Bird has joined #ruby-lang
mstratman has joined #ruby-lang
chimkan has joined #ruby-lang
<outoftime> anybody know if there's a viable binding to spidermonkey packaged as a gem?
wallerdev has joined #ruby-lang
<ridders24> mistym: i think its working, just very slowly
Fullmoon has joined #ruby-lang
d3vic3 has joined #ruby-lang
<mistym> ridders24: Presumably you have a LOT of files between those two drives. Remember, it has to locate and iterate over every single file!
<ridders24> mistym: yh thats fair enough, just thought it was broken earlier. Also how i output on the same line as the result the size of the folder the file is contained in?
Sailias has joined #ruby-lang
<shevy> ridders24 by asking the size like by doing File.size?
<shevy> or without the ?
<shevy> see here
<ridders24> shevy: its not the file though i need the size of its the dir
<ridders24> woops.
<ridders24> its the folder its contained in
<shevy> I dont think there is an inbuilt way to do this for all the subdirs and subfiles in that directory
<ridders24> oh ok, its no bother just would have been nice to know
<shevy> size = 0; Dir['**'].each {|x| size += File.size x }
<shevy> or
<shevy> size = 0; Dir['**/**'].each {|x| size += File.size x }
<ridders24> would that work for just the folder the file is contained in?
<shevy> ridders24 those questions are odd. Dir['*'] works on the current dir
<shevy> if you need to specify an absolute path, do Dir['/tmp/somewhere/**/**'] something like that
<shevy> it is not hard, just start irb and play until you have the desired result. takes 5 seconds man!
savage- has joined #ruby-lang
<shevy> Dir['/tmp/**/*'] # => ["/tmp/ssh-iezbpd7009", "/tmp/ssh-iezbpd7009/agent.7009", <--- and lots of other files here and subdirs and subfiles
kvirani has joined #ruby-lang
slyphon has joined #ruby-lang
<ridders24> shevy: I wont know what the path is
<ridders24> actually
<shevy> ok so you will never know the path you have to give to Dir?
<shevy> and btw
<ridders24> well i will once its finished finding the paths
<shevy> why do you need to know the path if you use *
<ridders24> so i could do it that way
travisjeffery has joined #ruby-lang
<ridders24> what does that mean?
<shevy> you wrote you dont know what the path is
<shevy> which I find strange in itself ;) but if it is like all files are in directory /foo
<shevy> you can get all files within /foo via Dir + '*'
rippa has joined #ruby-lang
<ridders24> yh i will know the path once its finished locating the specific files, so I might be able to use the example you gave
travisjeffery has joined #ruby-lang
<shevy> very strange
bjensen has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Nisstyre has joined #ruby-lang
macmartine has joined #ruby-lang
takaokouji has joined #ruby-lang
anildigital has joined #ruby-lang
esad has joined #ruby-lang
<andrewvos> Holy shit https://love.travis-ci.org/
dous_ has joined #ruby-lang
febeling_ has joined #ruby-lang
omarqureshi has joined #ruby-lang
havenn has joined #ruby-lang
m3nd3s has joined #ruby-lang
crackity_jones_ has joined #ruby-lang
wdperson has joined #ruby-lang
kurko__ has joined #ruby-lang
bjensen_ has joined #ruby-lang
slimfit has joined #ruby-lang
andrewhl has joined #ruby-lang
Barbaren has joined #ruby-lang
<Barbaren> quick question, using the inherited hook, how can i figure out the classname of whichever class inherited from a some parent? :)
<injekt> herp derp what?
<injekt> superclass?
macmartine has joined #ruby-lang
m3nd3s has joined #ruby-lang
<judofyr> Barbaren: hm? self is the superclass
savage- has joined #ruby-lang
<Asher> barbaren - to clarify what judofyr said, you end up in the context SuperClass.inherited( inheriting_class )
kyrylo_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
wyhaines has joined #ruby-lang
takaokouji has joined #ruby-lang
jordan` has joined #ruby-lang
t has joined #ruby-lang
io_syl has joined #ruby-lang
anildigital has joined #ruby-lang
lsegal has joined #ruby-lang
wyhaines_ has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24> mistym: whats a good book to learn from or use as a reference?
jordan` has joined #ruby-lang
vesan has joined #ruby-lang
<Tasser> ridders24, ruby?
<ridders24> tasser: yh
* Tasser to lazy to read backlog
<Tasser> huh?
<mistym> ridders24: _why's Poignant Guide to Ruby is a good starting book, especially if you're not too familiar with programming yet.
<mistym> I've heard good things about Learn to Program.
bjensen has joined #ruby-lang
<mistym> If you think you've already got a handle on some other languages, Programming Ruby (published by The Pragmatic Programmers) and Matz's The Ruby Programming Language are both good picks. They're both written with the assumption that you've got a base level of comfort programming.
<ridders24> your first suggestion sounds good. I have very little programming knowledge
<mistym> That book's what got me going in Ruby, from not really knowing anything. I definitely recommend it.
<mistym> Plus, it has cartoon foxes!
tbuehlmann has joined #ruby-lang
apeiros_ has joined #ruby-lang
havenn has joined #ruby-lang
<ridders24> yh the cartoons rock
fragrant has joined #ruby-lang
H2H has joined #ruby-lang
<fragrant> Hi, Which is the popular/mostly used html/xml parser for ruby?
<yxhuvud> fragrant: probably nokogiri
<drbrain> fragrant: nokogiri
<fragrant> Anything else?
<drbrain> nokogiri wraps libxml2 which is one of the most popular HTML/XML parsers everywhere
<drbrain> fragrant: nothing you should waste your time on
<fragrant> Ok
fragrant has quit [#ruby-lang]
codewrangler has joined #ruby-lang
<drbrain> nokogiri has it all, DOM parsing, SAX parsing, push parsing, pull parsing, XPath search, CSS search, ...
bawer has joined #ruby-lang
macmartine has joined #ruby-lang
dejongge has joined #ruby-lang
d3vic3 has joined #ruby-lang
travisjeffery has joined #ruby-lang
macmartine_ has joined #ruby-lang
elalande has joined #ruby-lang
travisje_ has joined #ruby-lang
matthijs has joined #ruby-lang
<matthijs> Hi all, I was wondering why this gives me a syntaxerror: nil || raise StandardError
<canton7> matthijs, you're probably after 'or', not '||'
<matthijs> Oh!
* apeiros_ hands matthijs some parens: ()
<canton7> yours parsed to (nil || raise) StandardError
<apeiros_> precedence…how does it fucking work?!? :)
<canton7> pick something! anything! now pick something else! anything else!
petercooper has joined #ruby-lang
ged has joined #ruby-lang
<apeiros_> canton7: stop being so picky!
outoftime has joined #ruby-lang
<canton7> s/pick/choose ;)
<apeiros_> stop being so choosey!
<canton7> s/choose/take
<apeiros_> stop being so takey!
* canton7 fires up a thesaurus
<canton7> aww, nothing ridiculous
<apeiros_> :)
macmartine_ has joined #ruby-lang
travisjeffery has joined #ruby-lang
flebel has joined #ruby-lang
drbrain has joined #ruby-lang
billturner has joined #ruby-lang
bryno has joined #ruby-lang
guns has joined #ruby-lang
brahmana has joined #ruby-lang
<brahmana> Hi all
<brahmana> I am using the standard logger in one my daemon processes like this : http://pastie.org/3763367
<brahmana> It is however not printing logs with the log-level and time stamp
<brahmana> What am I missing there?
<brahmana> btw, It works absolutely fine when I try the same code from irb.. !!
krohrbaugh has joined #ruby-lang
bryancp has joined #ruby-lang
heftig has joined #ruby-lang
codewrangler has joined #ruby-lang
<hagabaka> is rubyinline's add_type_converter something I can use to convert C++ objects to ruby ones? (I'm trying to convert a QByteArray to ruby string)
benanne has joined #ruby-lang
tbuehlmann has joined #ruby-lang
erics has joined #ruby-lang
<Asher> why doesn't slice take negative numbers without a range?
<Asher> String#slice
<Asher> or Array#slice
postmodern has joined #ruby-lang
<rippa> "qwerty".slice(-3) #=> "r"
<rippa> works for me
<shevy> long live [] on String!
<brahmana> Any pointers for the logger not printing timestamps and log-level question?
<brahmana> Here is the code .. http://pastie.org/3763367
cjs226 has joined #ruby-lang
francisfish has joined #ruby-lang
<Asher> rippa - but you can do "qwerty".slice(0, 2) => "qw" but "qwerty".slice( 0, −5 ) => nil not "qw"
<Asher> "qwerty".slice( 0..-5 ) otoh => "qw"
<apeiros_> Asher: what should a length of -5 be?
<Asher> 5 from the end
<apeiros_> Asher: you should try reading the docs
<apeiros_> slice with 2 args is offset, length
<apeiros_> so you tell ruby to get a substring of length -5
<Asher> oh i see
<apeiros_> makes little sense (python translates this to you wanting the substring reversed)
<Asher> thanks, that was the explanation i was wondering about
<rippa> apeiros_: I'd interpret it the same way
<rippa> (reversed sunstring)
<rippa> *b
<apeiros_> it's an acceptable interpretation
Fullmoon has joined #ruby-lang
<apeiros_> personally I'd prefer having separate methods for that, though
Viderizer_ has joined #ruby-lang
<anildigital> is this right? RUBY_VERSION < '1.9.3' or RUBY_VERSION < 1.9.3 one?
<apeiros_> anildigital: did you try them?
<apeiros_> (I actually know that the answer is 'no' - maybe you should try them - e.g. in irb)
<anildigital> apeiros_: RUBY_VERSION returns string
<apeiros_> anildigital: again, try it.
<Viderizer_> pastie: hi
krz has joined #ruby-lang
<apeiros_> it costs you 10s in irb.
<havenn> or 9s in pry.
<anildigital> don't know why in Ruby string comparison works for numbers
<apeiros_> …
<apeiros_> anildigital: that's not what you asked
<apeiros_> you asked whether you should do RUBY_VERSION < 1.9.3 - you should try that.
<anildigital> apeiros_: yeah.. I asked something different.. I thought RUBY_VERSION < '1.9.3' as buggy...
<anildigital> but RUBY_VESION itself returns a string...
<anildigital> and comparison is done with strings :(
<apeiros_> oh dear
<apeiros_> anildigital: 1.9.3 is not valid ruby syntax, so you *can't* do < 1.9.3, no matter what
<apeiros_> '1.8' < '1.9' is simple string comparison, largely unrelated to numbers
<rippa> at least it's not PHP
<apeiros_> it wouldn't work if you'd have '1.80' < '1.9' - 80 is > 9, but 8 is < 9
<rippa> PHP would convert both strings to numbers
<rippa> and then compare
<apeiros_> and you only can do it because matz promised that there wouldn't be 2 digit segments
<rippa> there should be something like build number
<rippa> so you can compare numbers
<anildigital> apeiros_: hmm
rdavila has joined #ruby-lang
<anildigital> I would use that for finding what Ruby constants used in framework like Rails..
Axsuul has joined #ruby-lang
jfelchner has joined #ruby-lang
benanne has joined #ruby-lang
<havenn> anildigital: My 1.9.3 RUBY_PLATFORM is "x86_64-darwin12.0.0" but this is going to vary by platform. =p
<anildigital> havenn: yeah..
<anildigital> havenn: you can edit the excelsheet if you can think it's structure should be different
<anildigital> :)
<Defusal> talking about PHP...
<havenn> anildigital: One trick you *could* use is: Gem::Version.new('1.9.3.dev') < Gem::Version.new('1.9.3')
<anildigital> havenn: Gem?
<anildigital> it's about Ruby right?
<havenn> anildigital: Or use a gem like: https://github.com/dazuma/versionomy
Skif has joined #ruby-lang
<anildigital> havenn: actually my purpose of this to change things in framework like Rails..
<anildigital> Rails won't use thirdparty gem..
<slyphon> is there a way of having a random number generator that's not, like, Kernel.rand ?
<slyphon> seems like it'd be useful to be able to have thread-local RNGs with specific seeds
<havenn> anildigital: If borrowing gem versioning would work: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/rubygems/rdoc/Gem/Version.html
<slyphon> drbrain: you know anything about that?
<anildigital> havenn: hmm.. I think it's about ruby versions.. gem version won't help right?
<havenn> anildigital: Seems to me Gem::Version.new would prolly compare Ruby versions, just following Gem versioning rules (are the rules different for Ruby and gems?).
adamTLL has joined #ruby-lang
ryanf has joined #ruby-lang
<adamTLL> Anyone willing to give me a hand install ruby. I'm using rvm on Fedora 16 with ruby 1.9.3, and everything seems to install correctly, but I'm trying to run an existing ruby program and it's giving me the error saying it cannot load -- Date (LoadError)
_inc has joined #ruby-lang
_inc has joined #ruby-lang
<adamTLL> And I'm assuming Date is a standard library (gem?)
<slyphon> require 'date' ?
<adamTLL> Using that
<adamTLL> That's where the problem comes up
heftig has joined #ruby-lang
<slyphon> when you do require 'date' ?
<slyphon> you get a load error?
<adamTLL> I can't believe I just spent 2 days trying to figure out this problem, and I realized I'm doing require 'Date', not 'date'
<adamTLL> Nevermind...
<adamTLL> I'll be going now
Zolrath has joined #ruby-lang
Yu\2 has joined #ruby-lang
dankest has joined #ruby-lang
Aengus has joined #ruby-lang
rolfb has joined #ruby-lang
IPGlider has joined #ruby-lang
frangiz has joined #ruby-lang
dejongge1 has joined #ruby-lang
<andrewvos> haha
<andrewvos> Ahhh, the wonders of Ruby.
judofyr has joined #ruby-lang
bjensen has joined #ruby-lang
esad has joined #ruby-lang
sandbags has joined #ruby-lang
Tearan has joined #ruby-lang
frangiz_ has joined #ruby-lang
<jtoy> i gave my friend the book "learn to program" to learn basic coding, what is the next easiest level book you guys would recommend, he hasn't really done programming so I want to ease him into it as smooth as possible
<andrewvos> jtoy: Just start coding?
<andrewvos> jtoy: Maybe use the koans or something like that.
<jtoy> andrewvos: yeah, his name is andrew too!
<andrewvos> Wait, IT'S NOT ME IS IT
<shevy> I think it is him
<shevy> arrest him!
<shevy> jtoy you mean ruby programming or general programming
<shevy> tell him to learn C first :D it's harder but once he knows ruby he does not wanna learn C anymore
<lianj> c/ruby the hard way?
<jtoy> shevy: any programming, but I want him to do ruby
dreieins has joined #ruby-lang
<shevy> hmm
<shevy> other than learn to program, I didnt like the few books I read
<shevy> the older pickaxe was nice
<shevy> I didnt like the current one as much :(
<jtoy> yeah , ruby the hard way doesn't seem too bad actually
<shevy> don't know it, can't judge it
<jtoy> i just browsed a few chapters, doesn't seem that hard
<jtoy> and it has exercises for him to go through
<hagabaka> I looked at koans.heroku.com but it doesn't seem very helpful for people who don't already know the answers
<Boohbah> hagabaka: try http://www.rubyquiz.com/
<hagabaka> I mean, most people would know the basic ruby concepts before they move on to test/unit
<hagabaka> I like the "koans" format, but I just think they're letting you fill in things in irrelevant places...a lot of times, just "true" or "false" instead of the thing you're supposed to learn
<lianj> jtoy: go for the hard way, which is a misleading title
<Boohbah> oh, jtoy
chimkan_ has joined #ruby-lang
tjadc has joined #ruby-lang
jmcphers has joined #ruby-lang
samuelk|away has joined #ruby-lang
havenn has joined #ruby-lang
sluggy_ has joined #ruby-lang
samuelkaz has joined #ruby-lang
<jtoy> Boohbah: i actually think that one is too hard for now
<Boohbah> jtoy: i think it's a good way to learn to program, working on actual problems
<jtoy> yeah, maybe that is the 3rd thing to work on after learn to program, then the hard way,
brianpWins has joined #ruby-lang
io_syl has joined #ruby-lang
mbriggs has joined #ruby-lang
<shevy> I always tell folks to work through "learn to program" and then to start solve problem with .rb scripts on their own
alexkane has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
vesan has joined #ruby-lang
esad has joined #ruby-lang
Aengus has joined #ruby-lang
tonesfrommars has joined #ruby-lang
jperry has joined #ruby-lang
<rolfb> how do i get ["bla", "bla", "bla"] from "blablabla" with regex in ruby?
Boohbah has joined #ruby-lang
<lianj> "blablabla".scan(/bla/)
<rolfb> that gives me an array of arrays
<erikh> you can flatten it
<rolfb> that's beside the point
<rolfb> :)
<erikh> actually the above code doesn't
<erikh> I was wondering about that -- if you put it in a capture group it will create a subarray.
<rolfb> ok, can I have { :bla => ["bla", "bla", "bla"] somehow?
<rolfb> missing the last }
<rolfb> named capture
<erikh> 1.9.3p125 :001 > "blablabla".scan(/bla/)
<erikh> => ["bla", "bla", "bla"]
<erikh> let's see
<rolfb> erikh: you're right, i did my experiment with /(bla)/
Swimming_Bird has joined #ruby-lang
<rolfb> which gave me array of arrays
<havenn> rolfb: 'blablabla'.scan('bla').join #=> "blablabla"
<erikh> not sure about named captures
<rolfb> havenn: indeed :)
<rolfb> i could make do if I had something like the /g option
<rolfb> for .match(regex)
<erikh> that's what scan is
<erikh> basically /g from perl and sed
<rolfb> hmm
<rolfb> but it doesn't support named captures
<erikh> named captures don't work, just tested
deobald has joined #ruby-lang
<rolfb> hmm
VegetableSpoon has joined #ruby-lang
<rolfb> wish match would have the /g option
<lianj> .scan
<rolfb> lianj: "blablablabla".match(/(?<foo>bla)/)["foo"] vs "blablablabla".scan(/(?<foo>bla)/)["foo"]
<rolfb> the latter doesn't work
justinxreese has joined #ruby-lang
<erikh> scan doesn't return matchdata is why
<erikh> hrm
<erikh> appending {3} doesn't work either
<erikh> or +, etc.
<rolfb> :)
VegetableSpoon has quit ["Leaving"]
esad has joined #ruby-lang
<rolfb> erikh: thing is, i need named matched
<rolfb> named captures
<erikh> sure, but I can't seem to find a way to make that work
<erikh> I have a patch to ruby's MatchData object that implements named captures across values_at, but it hasn't been merged yet (and might not be)
<erikh> s/might not/probably won't/
<rolfb> ooh :)
<rolfb> cool comment
<erikh> is the patch, but yeah
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
<erikh> it's against 1.9.1 I think and is pretty archaic compared to the 2.0 trunk
Fullmoon_ has joined #ruby-lang
<erikh> Honestly, if you can use positional arguments that'd probably be best.
<erikh> 1.9.3p125 :002 > "blablabla".match(/(?<foo>(bla){3})/)
<erikh> => #<MatchData "blablabla" foo:"blablabla">
<erikh> is as close as I can get
<erikh> maybe you can match that way and scan after the fact? not elegant but should work.
<drbrain> erikh: trailing whitespace in your patch ☹
<erikh> yeah it's not a very good patch
<rolfb> erikh: i have 5 regexps that I want to name, combine and be matched against a string
<rolfb> some of them need global matching, but not all
<rolfb> :)
<erikh> ah
<erikh> you could run them through two procs, and switch based on the type of content.
<drbrain> erikh: "This feature itself is acceptable, but proposed method name (API) is not acceptable."
<erikh> drbrain: yeah, saw that.
<erikh> maybe I should take some time this week to clean it up
<rolfb> erikh: really appreciate the help though
<erikh> drbrain: btw, I was trying to get ahold of you last night; I was wondering if you had any open source stuffs I could work on.
burgestrand has joined #ruby-lang
<erikh> easy win tickets and so forth
<drbrain> hrm
<erikh> or just yak shaving is fine too.
<drbrain> erikh: you should resubmit your patch using all_values
<drbrain> or named_values
<drbrain> or something
<drbrain> "Page of Glory" and "Link to the parent-class implementation of methods that use super" should be reasonably easy
<erikh> ok, I'll give those a shot. thanks.
<drbrain> for the former, see RDoc::Stats
<erikh> ok
olesu has joined #ruby-lang
<erikh> I was thinking maybe just putting it in the lower left of the homepage? or were you thinking of something more detailed?
<erikh> or maybe on each page for each doco item
<drbrain> I was thinking a separate page
<drbrain> like /coverage_report.html
<erikh> gotcha
dfr|mac has joined #ruby-lang
<erikh> and just a line item for each class/module?
<drbrain> that way it's not noise for people who just want to read the documentation
<drbrain> since I'm lazy, I would just create HTML similar to `rdoc -C`
<erikh> fair enough
<erikh> back in a bit, store run
<drbrain> if you have better ideas, awesome
virunga has joined #ruby-lang
workmad3 has joined #ruby-lang
Indian has joined #ruby-lang
woollyams has joined #ruby-lang
mistym_ has joined #ruby-lang
gregf has joined #ruby-lang
Carnage\ has joined #ruby-lang
petercooper has joined #ruby-lang
adam12 has joined #ruby-lang
crackity_jones_ has joined #ruby-lang
macmartine has joined #ruby-lang
jtoy has joined #ruby-lang
matled has joined #ruby-lang
datanoise has joined #ruby-lang
Pip has joined #ruby-lang
cjs226 has joined #ruby-lang
francisfish has joined #ruby-lang
<neilc> zenspider: around?
<zenspider> sorta
<neilc> zenspider: well, whenever you've got some spare time
<neilc> zenspider: (1) https://github.com/seattlerb/ruby2ruby/issues/5 => i provided the info you asked for
<neilc> zenspider: (2) https://github.com/seattlerb/ruby2ruby/pull/6 => eta for merge + push new release?
io_syl has joined #ruby-lang
<zenspider> merge I dunno... pushing a new release is blocked by the last failing test on ruby_parser + some extra work that needs to be done
<zenspider> I'm hoping that someone will conquer the last failing test soon... but that really is just a hope
<zenspider> unless you want to take a whack at it :)
travisjeffery has joined #ruby-lang
<neilc> heh
<neilc> not sure i'll have cycles in the next week, but i can try to take a look when i get some spare time
francisfish has joined #ruby-lang
<zenspider> looking at your pull req now
<neilc> thanks
<zenspider> since I don't have a clean test run (because of ruby_parser chaos) I'll prolly not merge it until the ruby_parser stuff is done
<zenspider> there's a lot of changes in the pipeline... it'll come out on sexp_processor, ruby_parser, flog, flay, ruby2ruby, ruby2c...
<zenspider> what are you doing with ruby2ruby?
Karmaon has joined #ruby-lang
<neilc> zenspider: www.bloom-lang.org
mistym has joined #ruby-lang
<zenspider> neilc: interesting... so you're parsing on your own, generating sexps and throwing them through r2r?
<erikh> neat
<neilc> our initial scheme was to use parsetree to get the ast from the live ruby class representing the user's code
<neilc> and then munge that as needed to implement our dsl
<neilc> but we've recently switched to using ruby_parser (using caller() to find the appropriate source file ... kind of a hack)
<neilc> but yeah, get AST, rewrite, eval to produce a set of rules; then we eval the rules, which basically results in code generation
havenn has joined #ruby-lang
<neilc> and then we run the resulting "code" (i.e., a dataflow graph of operators akin to a dbms query plan) to actually evaluate the user's program
dv310p3r has joined #ruby-lang
<zenspider> huh. I'm surprised you can use ruby_parser as that example doesn't look like valid ruby
<zenspider> but if you're using ruby_parser... then the changes I have coming should be fine as I'll be sure to release ruby_parser and ruby2ruby in sync with each other
<neilc> cool
<zenspider> I will be changing AST structure on several things tho, so if you're munging you'll need to do extra testing
<zenspider> like punting on arglist
<zenspider> nuking scope node
<neilc> re: valid ruby, it parses -- e.g., the "state" and "bloom" syntax are just class methods defined by the Bud module
<zenspider> generally splatting stuff out more
headius has joined #ruby-lang
<zenspider> kk
<zenspider> send me an email and I'll try to ping you when I get some of the more major stuff in place
<neilc> zenspider: sure -- thanks!
travisjeffery has joined #ruby-lang
<zenspider> commented on your other ticket
<neilc> thanks
<zenspider> lemme know if that doesn't make sense... I'm post workout and a little low on brain nutrients
esad has joined #ruby-lang
<neilc> zenspider: i think it makes sense -- my rvm install just got borked (sigh), but once i sort that out i can double-check
IPGlider has joined #ruby-lang
chendo_ has joined #ruby-lang
Kero_ has joined #ruby-lang
jperry has joined #ruby-lang
sluggy_ has joined #ruby-lang
nif has joined #ruby-lang
<youngin> oddmunds: hey
<oddmunds> hey
<youngin> ah
<youngin> caught u in the right moment
<youngin> wassup bro?
<youngin> klar for en ny kollab?
<youngin> sjekk
<youngin> havent mastered it with proper speakers though
<youngin> maybe shoulda taken this in #soundcloud
Pip has quit ["Leaving"]
kvirani has joined #ruby-lang
jarred has joined #ruby-lang
frankaa112 has joined #ruby-lang
bryancp has joined #ruby-lang
slyphon has joined #ruby-lang
Joeysomo has joined #ruby-lang