Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
looopy joined #ruby-lang
<Guest2452> how can i clear gem's downloaded gem files?
Guest2452 joined #ruby-lang
Guest2452 left #ruby-lang
zenspider joined #ruby-lang
mksm joined #ruby-lang
<mksm> How can i clear gem's downloaded gems?
<havenn> Guest2452: If what you are asking is how to uninstall all gems, this is what I do (sane or not): `gem list`.split("\n").each { |gem| system "gem uninstall -aI #{gem.split(" ").first}" }
<zenspider> mksm: do what?
<mksm> havenn, not really. I want to force gem to refetch the gem and install
Nisstyre joined #ruby-lang
<erikh> $GEM_HOME/cache/ is probably where you want to look, or each item in $GEM_PATH's /cache/ dir
<erikh> but that's a semi-educated guess.
<zenspider> mksm: why?
<mksm> zenspider, i want to reinstall a gem that has some modifications and it keeps installing the old one.
<mksm> version numbers are the same (i know)
<andrewvos> mksm rvm clean or something?
<andrewvos> mksm: Or just delete the gems path
<andrewvos> Oh wait. Will that delete cahce I wonder?
<zenspider> rm the .gem file from the corresponding cache directory (use gem list -d gemname)
onio joined #ruby-lang
<zenspider> then just reinstall
<zenspider> and then chastise the author for publishing a gem with changes without modifying the version
<zenspider> esp if that author is you :P
<mksm> andrewvos not gem cache
<mksm> zenspider, thanks. will install always overwrite?
nouser joined #ruby-lang
<zenspider> yes
looopy joined #ruby-lang
looopy joined #ruby-lang
statim joined #ruby-lang
replore_ joined #ruby-lang
uniqanomaly__ joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
babinho joined #ruby-lang
lele|w joined #ruby-lang
slyphon joined #ruby-lang
nouser left #ruby-lang
<andrewvos> What does everyone use for irssi notifications?
<shevy> xchat
<shevy> ,D
<zenspider> emacs :P
<steveklabnik> alt-tab
<andrewvos> *disapproving look*
<shevy> haha
<steveklabnik> oh, yeah, sorry, i'm on a Mac. command-tab
<steveklabnik> :p
<andrewvos> HAH BUSTED
<andrewvos> Just seems primitive that I have to ^n to find peoples messages that have been around for ages.
<steveklabnik> i mean, it highlights when you get mentioned
<steveklabnik> at least, mine does.
<andrewvos> hmmm.
<andrewvos> Mine doesn't
<steveklabnik> odd
<steveklabnik> irssi 0.8.15 (20100403 1617)
<steveklabnik> regular old arch linux.
<andrewvos> No idea what version I'm on
<steveklabnik> irssi 0v
<steveklabnik> -v
<andrewvos> Running on an ec2 instance for months. Too scared to touch it cause i have no backups
<andrewvos> Ah. Same version
<andrewvos> Anyway, who cares. Night everyone
<j`ey> andrewvos: /hilight andrewvos
Diaoer joined #ruby-lang
<andrewvos> j`ey: Worth a try
<j`ey> andrewvos: hey hey hey yellow text
looopy joined #ruby-lang
s3mi0 joined #ruby-lang
<shevy> lol
zedUNDginger joined #ruby-lang
neoesque joined #ruby-lang
edwardsharp joined #ruby-lang
tenderlove joined #ruby-lang
Oloryn_lt1 joined #ruby-lang
<zedUNDginger> can anyone think of a way a method can get a Method object of itself without using its name
<zedUNDginger> Mon_Ouie: ping
Asher joined #ruby-lang
<vereteran> where is the site or source for hash table used in ruby (that st.c file in sources)? it credits to Peter Moore, but googling doesn't help :( it seems like he doesn't have a site or something similar
porcelina joined #ruby-lang
<steveklabnik> vereteran: the source for Hash?
<vereteran> steveklabnik, yes
<steveklabnik> ^
jxie joined #ruby-lang
<vereteran> steveklabnik, no, i want original source, this one is edited for ruby. see the file: it includes either ruby/ruby.h or if its not ruby source then st.h
<steveklabnik> ...what?
<zenspider> headius: oi
<vereteran> steveklabnik, it was modified for ruby, its not original part of it. i want original source
<zedUNDginger> steveklabnik: he means the internal hash implementation used by ruby, st.c
<headius> hi there...I'm getting to that pull request :)
babinho joined #ruby-lang
<steveklabnik> ah.
<headius> recovering from flu...a little slow
<steveklabnik> oh
<steveklabnik> okay
<steveklabnik> i FINALLY got you
<steveklabnik> sorry
<steveklabnik> apparently i'm dense today
<zenspider> headius: the more aaron and I talk about this, the more we want to push back on this and have platform predicates instead... what was your argument against that?
<zenspider> eg: putting 'skip "bug 1234" if jruby?' in tests directly
<vereteran> steveklabnik, thank you! seems to be it
<headius> zenspider: the set of tests we will or will not pass over time is going to change...maybe on a daily basis
<zenspider> that st.c is going to have drifted a long way out from ours
<headius> having guards in the tests themselves is not going to be efficient
<headius> plus I don't have commit access to MRI, so I can't remove or change the guards as we pass them
<steveklabnik> zenspider: since 1985? that's such a short time!
<zenspider> headius: I can fix the commit bit issue
<zenspider> and I assume you'd be doing this all the time but merging the tests to mri only periodically?
<zenspider> which I think you should be doing already... as you prolly have modifications/fixes/improvements to mri tests already, no?
<headius> as with rubyspec, I'd like our test run to pull a specific revision of tests at the start
<headius> no, we have tried to avoid modifying them at all
<headius> we have removed a few tests that we can't pass because we have no other way to mask them
<headius> the ideal situation would be that we can just grab a certain rev of MRI repo and run with a set of tags against it
<headius> then I never have to commit or modify the tests in any way
<zenspider> wouldn't it be preferable to take those removed tests and merge in a skip line?
<headius> it would be preferable to what we do now, but having an external list of tests to skip would better isolate us
<headius> I don't have a strong preference, but skip lines specific to JRuby living in MRI's tests seems really ugly to me
<headius> and then what if other impls want skips too?
<zenspider> ok. I'm gonna record this dialog off and talk to aaron about it. I still think you're wrong... but I'm open to the change. :P
<headius> it's a mess
<zenspider> I have a test up and running for it already
<zenspider> that's NOT a mess
<zenspider> that's GREAT
<headius> show me what you mean
<headius> maybe I'm not understanding how the tests would look
<zenspider> it means at once glance you can see the state of the official tests across all the major impls
<zenspider> def test_ary_blah_blah; skip "bug 1234" if jruby?; assert_blah; end
<headius> hmm
<headius> well if it were my codebase I'd hate it, but it does serve the same function
<zenspider> by internalizing the data, third party libs, auditors, etc, can all see at a glance what the state is
<headius> I'm also a little surprised that ruby-core would agree to it
<zenspider> lemme argue your case with aaron over dinner and see where it goes
<zenspider> I'm not really thinking of asking them :P
<zenspider> ok. dinner. bbl
<headius> ok
lsegal joined #ruby-lang
hahuang65 joined #ruby-lang
babinho joined #ruby-lang
looopy joined #ruby-lang
roberto_bob joined #ruby-lang
s3mi0_ joined #ruby-lang
neoesque joined #ruby-lang
wyhaines joined #ruby-lang
<jmontross> what is the best way to compare two files to determine if they contain same text? One is an erb template and the other is a file that the erb template will replace if they are not the same
malev joined #ruby-lang
<steveklabnik> sha1 them?
<zedUNDginger> jmontross: File.read(f1) == File.read(f2) ?
<jmontross> yeah, i'm planning to md5 them…. thanks zed
<Spooner> If they are large, it can be faster to compare both sizes first (if they aren't the same size, they aren't the same).
<jmontross> thanks. that is good idea.. they are only like 8 lines of text for a /etc/environment
<porcelina> uhm, byte by byte comparison is faster than md5
<Spooner> Speed probably doesn't matter then (and anyway, if they are the same most of the time, you'd still need to compare them).
<porcelina> unless you're storing it
<porcelina> since you have to read both files either way
<porcelina> and byte by byte comparison has no hashing and can shortcut as soon as you hit a dissimilar byte
<jmontross> really? i heard md5 was faster…. that makes perfcet sense tho - you'd store the md5 if you had to keep comparing same fil
<porcelina> if it's like 3 files, md5 is faster
<lianj> "thanks zed" sounds scray in this channel
<steveklabnik> lol
<Spooner> He is just paying homage to my game. He should pay me to use the name though :D
<porcelina> what game?
<Spooner> Zed and Ginger :D
<lianj> surfing cats, nice!
<Spooner> Not enough people making Ruby games!
<porcelina> what are you writing it in? ruby?
<Spooner> Ruby with Mon_Ouie's Ray library, but I usually use Gosu.
<porcelina> i thought about using ruby with a custom c backend... but it just seems like a lot of work
<lianj> did you enjoy writing it in ray vs gosu?
<Spooner> Ray does have a lot more magic features (like glsl) but I found gosu a bit more mature.
<porcelina> are there any 3d libraries?
<Spooner> You can use 3D in Ray, but in Gosu you need to use the OpenGL gem.
<Spooner> I didn't do any 3D though. All just 2D sprites with some shaders.
<lianj> modern gl is mostly pushing mesh data to the gpu and using shaders
<porcelina> yeah
<porcelina> if you load and manage all your meshes in c it seems like you should be able to do all the high level stuff in ruby with no real hit on performance
<Spooner> I think you can happily load objects into Ray.
<Spooner> http://mon-ouie.github.com/projects/ray.html (teapot is the standard example)
Sailias joined #ruby-lang
<porcelina> is it multi-platform?
<Spooner> Yeah, they both work on all 3 OSes and I know Ray works on Rubinius and jRuby (not on Windows, of course :D).
<lianj> porcelina: you can attach a physicslib and opengl via ffi. prepare buffers and have ffi pointers to them. then just pass the pointers from opengl to physics and let both c libs handle the hard work
tphummel joined #ruby-lang
<Spooner> Yes, the main problem is that Ruby is slow and all the C++ underneath is fast.
<Spooner> In trying to make a game that runs at a decent FPS, of course.
<porcelina> yeah
<porcelina> that's why i was thinking custom c backend might be easier
<porcelina> instead of loading opengl and phsics with ffi just load them in c and load your own c in ffi
<Spooner> Depends what you want to do. The existing libraries do fine. I have made chipmunk+gosu games and they run well, but hooking them up via Ruby does burn CPU, I guess.
<lianj> i did that at first and went back to pure ffi. not that its the best solution in any case, but works fine for my cases
<tphummel> hi everyone. sorry in advance for being a noob. i have a question about doing the equivalent of "next" within map or reduce, where i want to return memo for the next iteration of the map/reduce. return breaks out of the containing function which is too much.
<steveklabnik> tphummel: break?
<steveklabnik> maybe?
<lianj> for example, im using gstreamer and gl. the frame buffer never hits ruby code, you pass the pointer of it directly to gl
<tphummel> can i pass my memo var to break?
<ryanf> I think break might still be too heavy
<ryanf> but doesn't next work?
<steveklabnik> yeah
<porcelina> uhm, doesn't map reduce need a result?
<porcelina> if you're memoizing just do memo || calculation...
<tphummel> yeah, that's what i thought. b/c you return your memo at the end of each run
<porcelina> yeah
<porcelina> and it should shortcut out if it finds the memo
<porcelina> i'd do like { |i| memo[i] || memo[i] = (calc) }
<tphummel> ok, i think i see
swarley joined #ruby-lang
<porcelina> be nice if there was like .map.memoize or something that did it for you tho
Diaoer joined #ruby-lang
Wardrop_ joined #ruby-lang
Diaoer joined #ruby-lang
<tphummel> i can accomplish what i'm trying for with an if statement. if satisfaction==false memo else do_my_logic(). but that doesn't seem as easy to follow as an early return/short circuit at the top of the reduce
towski joined #ruby-lang
<porcelina> "require 'ray'; Ray.game 'hi' do end" crashes irb. :(
<Spooner> Try the examples (in the gem folder)?
Xzyx987X_ joined #ruby-lang
<Spooner> That does work for me though.
<porcelina> it gives me a bad x opcode error. :\
<porcelina> i think i didn't install it properly...
<porcelina> yeah, the hello world example in the gem folder fails to create a window
<Spooner> Actually, that snippet crashes for me in my Linux VM, but is fine in Windows with Ruby 1.9.3.
<porcelina> what's it say on your linux?
<porcelina> Major opcode of failed request: 1 (X_CreateWindow)
<porcelina> this?
<Spooner> Hmm, but Mon_Ouie says it works fine on his proper linux box.
<Spooner> I just get /usr/share/ruby-rvm/gems/ruby-1.9.2-p180/gems/ray-0.2.0/lib/ray/game.rb:98: [BUG] Segmentation fault (but I just set up the VM and have not had Ray working on it yet).
<porcelina> hmm
<Spooner> Mon_Ouie is the person to talk to about it breaking. All I know is that it needs some sort of shader support (nothing advanced) and doesn't like Intel integrated cards.
<Spooner> I did all my dev work on Win7 and I can't remember if I got it working in my old VM before I reinstalled the VM.
<Spooner> This is one problem I found with Ray. Gosu has been around longer and has a larger user-base, so bugs on machines other than developer have had more opportunity to be fixed :)
<porcelina> yeah
<porcelina> idk, it's weird cuz if i can't open an xwin then... i shouldn't have a desktop environment. :\
<Spooner> There is a #ray on this IRC server if you are interested in doing more with the library.
neoesque joined #ruby-lang
igotnolegs joined #ruby-lang
<Spooner> You'd think so, wouldn't you?
thone_ joined #ruby-lang
<zenspider> back
dv310p3r joined #ruby-lang
<zenspider> what is RUBY_PLATFORM on jruby?
<headius> "jruby"
<headius> er
<headius> platform? "java"
<headius> RUBY_ENGINE is "jruby"
<headius> trying to come up with the cleanest guard?
<headius> maybe minitest should have some built-in guards? there's not that many impls
<zenspider> I'm adding guards now
<headius> well, there ya go!
<zenspider> RUBY_PLATFORM predates RUBY_ENGINE, right?
<headius> platform == "java" is the classic way and works everywhere
<zenspider> seems the safer bet
<zenspider> kk
<headius> unfortunately there's no RUBY_ENGINE on 1.8.7, which still annoys me
<zenspider> right
brianpWins joined #ruby-lang
<zenspider> is there ANY reason for an mri guard?
<headius> if I write tests that MRI fails I might want to commit them until they're fixed
<shevy> hmm perhaps yugui or whatever was her name could add RUBY_ENGINE
<headius> MRI ain't perfect either, of course
<zenspider> YES IT IS HOW DARE YOU
<headius> shevy: matz said he didn't want to backport RUBY_ENGINE, unfortunately :(
amerine joined #ruby-lang
sulo joined #ruby-lang
<headius> I sometimes wonder how he distinguishes changes that should be backported from changes that should not...we asked for this early in 1.8.7 cycle, and I doubt it would have hurt anyone to add it
<headius> anyway...that train has sailed
<zedUNDginger> fo shizzle it sucks going defined?(RUBY_ENGINE) && RUBY_ENGINE == ...
<zenspider> it wasn't a syntax change so it shouldn't go in :P
<headius> zenspider: exactly
<shevy> hehe
hahuang65 joined #ruby-lang
<zenspider> fuck... how to write a guard for mri? the best I have at this point is RUBY_DESCRIPTION =~ /^ruby/
<zenspider> and that seems... weak
<headius> hmm
<headius> I'm sure there's fields in rbconfig that would work, but this is why we added RUBY_ENGINE
<headius> zenspider: description is lame but all the impls seem to have their own name at the start...so it works
* zenspider sighs
<zenspider> rbconfig looks like a no-go
<zenspider> I could look for PREP == "miniruby" :/
<headius> I think I've run into this before and couldn't come up with anything good
<headius> let me see what mspec does
<headius> zenspider: https://gist.github.com/1407903
<headius> then compares that to the usual 'jruby', 'ruby', 'rbx', etc
hahuang65 joined #ruby-lang
<zenspider> *cough*no-way*cough*
<headius> :)
nuclearsandwich joined #ruby-lang
achamian joined #ruby-lang
sakamal1 joined #ruby-lang
x0F__ joined #ruby-lang
twittard joined #ruby-lang
Banistergalaxy joined #ruby-lang
WillMarshall joined #ruby-lang
Ruthenium joined #ruby-lang
<postmodern> i keep getting this weird bug on ruby 1.8.7 with net/http
<postmodern> net/http.rb:1060 :: @socket.close if @socket and not @socket.closed?
<postmodern> somehow it passes the `if @socket` test
<postmodern> and calls @socket.closed?, but somehow @socket becomes nil
sakamal2 joined #ruby-lang
<postmodern> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1060:in request': undefined methodclosed?' for nil:NilClass (NoMethodError)
<slyphon> no way, a bug in net/http?!
<slyphon> postmodern: i'm pretty sure that's a known issue
* postmodern drops monocle
<slyphon> i'm pretty sure the chef guys have even worked around it
<postmodern> slyphon, ok, i'll try to find the exact issue for the user reporting this
* slyphon nods
<slyphon> so if ruby strings used to be character ignorant, and now are character encoding aware, how does one treat them as if they're just bytes?
<slyphon> my solution that everyone should just speak ASCII was just callously ignored
<postmodern> for the record: https://redmine.ruby-lang.org/issues/3955
<slyphon> ah yes
<slyphon> net/http is such a hairy piece of shit, it should be put down
<slyphon> just admit you did it wrong, and start net/http2
<slyphon> and get people who *don't* smoke crack regularly to design the API and implement it
<steveklabnik> slyphon: String#bytes or String#each_byte
<mksm> should just wrap curl and replace net/*
<slyphon> hm
<slyphon> mksm: i tried that w/ FFI a while ago, didn't go too well
<slyphon> maybe possible w/ FFI 1.0
<slyphon> but yeah
<postmodern> net/http actually implements A LOT of the HTTP spec
<postmodern> and curl is horrible
<slyphon> pfft
<slyphon> curl pwns you
<postmodern> actually net/http beats curb in benchmarks
<postmodern> due to net/http reusing connections
<slyphon> the only problem is net/http is fucking RETARDED
<slyphon> as far as APIs go
<postmodern> slyphon, care to quantify that?
<postmodern> slyphon, it's actually pretty logical, if you understand HTTP
<steveklabnik> ehhhhhhhhh
<slyphon> not really
<postmodern> slyphon, what do you not understand about HTTP?
<postmodern> slyphon, quantify whats wrong
<steveklabnik> postmodern: have you USED Net::HTTP?
<steveklabnik> ;)
<postmodern> step 1 to bad design recovery, define the problem :)
<postmodern> steveklabnik, look at Spidr :)
<postmodern> steveklabnik, also see wycats talk about Net::HTTP internals
<slyphon> it doesn't grok URI for one
<postmodern> steveklabnik, it's not the best API, but you can see why they made certain choices
<slyphon> that's *always* been a major annoyance of mine
<slyphon> s/of mine/for me/
<postmodern> steveklabnik, also see ronin-support, which has lots of wrapper methods i wrote to make net/http friendlier
<steveklabnik> totally
<slyphon> postmodern: that's the retarded i'm talking about
<steveklabnik> but even the easiest GET is hard.
<steveklabnik> that's the issue for me
<steveklabnik> i have to look it up EVERY TIME
<slyphon> everyone has to write those fucking methods
<slyphon> steveklabnik: *yes*
<mksm> yeah, there are too many wrappers around net/http
<postmodern> steveklabnik, Net::HTTP.get(URI(url))
<postmodern> steveklabnik, or get_response, get_print
<mksm> Net::HTTP doesn't bind to local ip or port
<postmodern> slyphon, you should look at my convenience methods
<postmodern> slyphon, they are probably not what you expect ;)
<slyphon> i don't want to look at your convenience methods, i want the standard library to not suck
<slyphon> (no offense)
<steveklabnik> good luck with that
<postmodern> slyphon, they all suck a little bit, compatibility wise
<postmodern> slyphon, there's excon which is somewhat ok
<steveklabnik> postmodern: right, if it gets a string, why doesnt it wrap it in URI for me?
<shevy> only the spirit inside knows the answer to that question!
<slyphon> hah
<postmodern> steveklabnik, because the first argument can also be a hostname
<postmodern> steveklabnik, followed by an optional path arg
<postmodern> steveklabnik, technically, they should have accepted a String, URI or Hash of URI attributes
<postmodern> steveklabnik, and not do fancy things with arg splatting
<mksm> http://redmine.ruby-lang.org/issues/2567 <- this is a HUGE inconvenience in 1.9
<postmodern> slyphon, oh also RestClient is amazing
<slyphon> ehhh
<steveklabnik> i mean, ultimately, sure, whatever. I mean, i _use_ it.
<slyphon> there are cases where REstClient really blows
<steveklabnik> but that doesnt mean i agree
<slyphon> like, "error cases"
* steveklabnik is working on a rest gem atm.
<slyphon> where it returns a string instead of throwing an exception
<steveklabnik> right now, mechanize is powering it.
<steveklabnik> we'll see how long that lasts
<slyphon> hah
<slyphon> i like RestClient for particular things
<slyphon> but it violated my rule of "exceptional cases should raise exceptions"
Pip joined #ruby-lang
<slyphon> s/cases/conditions/
Pip_ joined #ruby-lang
Pip_ joined #ruby-lang
<slyphon> maybe they've fixed that
<postmodern> steveklabnik, i would use RestClient if your doing REST
<postmodern> steveklabnik, mechanize does way too much
<steveklabnik> too much?
<postmodern> like caching of content
<postmodern> and their whole Watir-escque DOM manipulation methods
<steveklabnik> that's not too much
<steveklabnik> that's _perfect_
<mksm> i was not aware of wycats work on net/http .... i'll probably send some pull requests
<steveklabnik> didnt he want to re-write it?
<steveklabnik> and they basically said no
<mksm> steveklabnik, mri devs?
<steveklabnik> i thought i remembered a ruby-core thread about that
<wuut_> hello
<wuut_> do you know a library like ActiveResource but for XML-RPC APIs ?
<slyphon> ouch
<wuut_> yeah :(
* slyphon feels your pain
<postmodern> technically no one truly maintains net/http
<postmodern> nor webrick
<shevy> hmm
<steveklabnik> activeresource is for xml-rpc apis
<steveklabnik> buuuuurn.
* steveklabnik makes REST jokes.
<shevy> hehe
<steveklabnik> that nobody gets
<shevy> we need more XML
<steveklabnik> XML is fine.
* slyphon starts bashing on a cowbell
* slyphon stops and looks around
<slyphon> sorry, wrong meme
<wuut_> :D
<mksm> well net/http can be easily replaced with a single require
<mksm> so it's not that critical to be merged into core
<postmodern> its not loaded by default either
<wuut_> oh wow found an updated actionwebservice for rails 3.x/ruby 1.9
<slyphon> woah
<slyphon> wuut_: nice
<slyphon> yeah, someone's gotta be stuck using that
<slyphon> "out there"
<wuut_> yeah :(
<mksm> wonder if i should be using/testing rbx
<steveklabnik> yes
<steveklabnik> yes you should.
<wuut_> and the API i'm working on doesn't even have a WSDL, to make things moar fun, I guess
<mksm> steveklabnik, for performance basicly?
<steveklabnik> mksm: for multiple reasons
<steveklabnik> performance is good
<slyphon> no GIL!
<steveklabnik> it's a fun project to help out with
<slyphon> well, soon
<steveklabnik> no GIL
<steveklabnik> the code is very clean
<slyphon> oh, now?
<steveklabnik> slyphon: today
<slyphon> yeah, it's nice
<steveklabnik> the team is super helpful
<slyphon> the stacktraces are a nice little addition too
<steveklabnik> the only thing is 1.9 stuff. encodings aren't there yet.
<slyphon> the formatting, i mean
<slyphon> hahahah
<slyphon> "SHAMELESS PLUG"
Banistertab joined #ruby-lang
<mksm> nice
<shevy> why aren't the encodings there yet?
<lianj> 1.9 stuff is still important
<steveklabnik> because it's like the last thing they were doing for 1.9 stuff
<mksm> encodings will blow everything up :D
sakamal2 joined #ruby-lang
<steveklabnik> ol
<mksm> like it did with all 1.8.x code
<shevy> how does encodings blow up 1.8.x
<mksm> well if you live outside of US-ASCII then it will blow up while reading the .rb file
<postmodern> rubinius still lacks full 1.9 support
<postmodern> but it's getting there
<postmodern> wait no
<postmodern> they completed that recently right?
<steveklabnik> no
<postmodern> ah they are still working on rubyspec coverage
<steveklabnik> well, not that i've heard of.
<postmodern> ha wow, rbx -X19 takes a while to load up
<mksm> hmm, the roadmap lists "full CPU concurrency" ... so even without GIL it's still limited?
<postmodern> jruby also has a lot of those nice features
<postmodern> although the JVM likes to eat your ram :)
<slyphon> bah
<slyphon> jruby is awesomesauce
<slyphon> the jvm also lets you limit the total ram usage
<slyphon> which is win
<postmodern> still waiting for a Client VM profile for linux-amd64
<shevy> slyphon reminds me of Steve Ballmer
* slyphon falls over
* slyphon stands up and hurls a chair at shevy
<shevy> :(
<slyphon> shevy: don't worry, the profuse sweating means i missed wildly and hit a TabletPC prototype
<shevy> yeah but now I am afraid
<slyphon> hah!
<shevy> he must be an intimidating person
<slyphon> yeah
<slyphon> he's a sweaty humunculous
<Banistertab> Isnt a humunculous the little man inside a man
<steveklabnik> mksm: the locks can be made even more fine-grained, iirc.
<slyphon> Banistertab: oh, is it?
sakamal1 joined #ruby-lang
<slyphon> Banistertab: like 'quato' from Total Recall?
<shevy> hmm
<Banistertab> en.wikipedia.org/wiki/Homunculus
<shevy> they used to think that a little man is sitting in sperm cells
<slyphon> i'm sure there's something in there that applies to ballmer
<slyphon> i'm just a little too tired to make the joke
<shevy> well his head is kinda round and bald
anjen joined #ruby-lang
[zaf]-Coral joined #ruby-lang
<jammi> any suggestions how to list all interface addresses with minimal effort (in a cross-platform way)?
<jammi> the intention is to list each address to the user when the server listens to 0.0.0.0
<jammi> like [ '127.0.0.1', '10.0.0.10', '10.0.0.11' ]
<jammi> parsing the output of something like ifconfig or ipconfig would be very crude
<mksm> jammi, 1.9?
<jammi> mksm: well, preferrably 1.8 too bug a fallback to just displaying 0.0.0.0 is fine if something isn't available
<jammi> *but
<mksm> not available in 1.8
<jammi> mksm: thanks, users will sooner or later get 1.9 (or 2.0) anyway. for 1.8 and some non-mri's a fallback mode is just fine
<mksm> jammi, this works in both, but adds a dep: https://github.com/bbcoimbra/system-getifaddrs
<jammi> mksm: thanks, but I think the Socket.ip_address_list will be fine. I'll just do a Socket.respond_to?(:ip_address_list) condition
<jammi> a C extension as an extra dependency will just cause problems for people without compilers, like many windows users
kitallis joined #ruby-lang
<mksm> yep
towski joined #ruby-lang
dr0id joined #ruby-lang
vauban joined #ruby-lang
twittard joined #ruby-lang
frangiz joined #ruby-lang
<postmodern> jammi, that C-extension will probably not work on Windows, even when pre-compiled
<postmodern> jammi, although you could copy it's logic and use FFI
<postmodern> jammi, maybe even research the equivalent calls necessary on Windows
<postmodern> if a C extension is less than 300 lines, generally it can be written in fewer lines with FFI
<jammi> postmodern: yeah, that's usually the case for non-trivial pieces of C
vauban_ joined #ruby-lang
<postmodern> jammi, and this code just introspects struct ifaddrs's
<jammi> anyway, this is just a nice-to-have feature
<jammi> nothing functionality depends on, just some nice status information to display
pabloh joined #ruby-lang
TheMoonMaster joined #ruby-lang
yxhuvud joined #ruby-lang
Banistergalaxy joined #ruby-lang
macmartine joined #ruby-lang
jredville joined #ruby-lang
Swimming_Bird joined #ruby-lang
s3mi0 joined #ruby-lang
s3mi0 joined #ruby-lang
kitallisii joined #ruby-lang
achamian joined #ruby-lang
ecin joined #ruby-lang
zmack joined #ruby-lang
edwardsharp joined #ruby-lang
tallship joined #ruby-lang
Asher joined #ruby-lang
amerine joined #ruby-lang
ilyam joined #ruby-lang
zerokarmaleft joined #ruby-lang
skipper joined #ruby-lang
burgestrand joined #ruby-lang
Tref joined #ruby-lang
michael_mbp joined #ruby-lang
dnjaramba joined #ruby-lang
JohnBat26 joined #ruby-lang
fridim_ joined #ruby-lang
heftig joined #ruby-lang
mytrile joined #ruby-lang
setmeaway joined #ruby-lang
[zaf]-Coral joined #ruby-lang
ddollar joined #ruby-lang
achamian joined #ruby-lang
TheMoonMaster_ joined #ruby-lang
robotmay joined #ruby-lang
sulo_ joined #ruby-lang
Tref_ joined #ruby-lang
burgestrand joined #ruby-lang
setmeaway joined #ruby-lang
michael_mbp joined #ruby-lang
dc5ala joined #ruby-lang
Manhose_ joined #ruby-lang
roadkith joined #ruby-lang
yorickpeterse joined #ruby-lang
<bnagy> just had a weird regex question... 'asdf:01:aaa9' how to match \d+ which is NOT preceded by :, ie it should match 9 not 1
<erikh> [^\d]\d+
<erikh> you get the idea if you want to add a + after the c-class or w/e
<erikh> ah, sorry: [^:]\d+
<zedUNDginger> what about my girl /(?!:)(\d+)/
<Ruthenium> that would still match 1
<bnagy> ? that totally fails to even try to do what I said :)
<erikh> ok
<erikh> have fun
<zedUNDginger> bnagy: do u like my girl
<zedUNDginger> this is my girl /(?!:)(\d+)/
<bnagy> that will match 1
<zedUNDginger> oh
twittard joined #ruby-lang
<bnagy> erikh: when I said it totally fails it referred to the first answer, the second one is the first obvious thing to try, followed by the negative lookbehind
ryanf joined #ruby-lang
Mchl joined #ruby-lang
thrcka joined #ruby-lang
Wardrop joined #ruby-lang
<bnagy> oh... maybe /[^:\d](\d+)/
<bnagy> I bet that's recursive to hell :S
solars joined #ruby-lang
<shevy> yeah
<shevy> that shows how many here understand regexes really well
molgrew joined #ruby-lang
<bnagy> not understanding regex is a defensive mechanism
<bnagy> yeah it's not recursive at all
Manhose_ joined #ruby-lang
hebz0rl joined #ruby-lang
<erikh> it backtracks
<erikh> that's not recursion.
gnufied joined #ruby-lang
<erikh> I never use zero-width and explicit negative stuff personally because it always breaks on me. backtracking is reliable and easy to read.
<erikh> (and also nice and posix compliant)
jasox joined #ruby-lang
mksm joined #ruby-lang
srbaker joined #ruby-lang
stepnem joined #ruby-lang
<bnagy> I don't think I have ever used negative assertions.. btu then from memory the ruby engine didn't support them once, right?
<bnagy> I have used positive lookahead, rarely
<bnagy> but in general I hate having to use regex :/ This was just a weird question because it wasn't immediately obvious how to do it
gix joined #ruby-lang
cyri_ joined #ruby-lang
<shevy> hehe
<shevy> I don't mind regexes as long as they stay simple!
zedUNDginger joined #ruby-lang
pcwormald joined #ruby-lang
benanne joined #ruby-lang
banaan joined #ruby-lang
robotmay joined #ruby-lang
zetesha joined #ruby-lang
mytrile_ joined #ruby-lang
dave_miles joined #ruby-lang
Indian joined #ruby-lang
Wardrop left #ruby-lang
Wardrop joined #ruby-lang
<Wardrop> f
<zedUNDginger> u
<ryanf> n
Wardrop left #ruby-lang
Wardrop joined #ruby-lang
Wardrop left #ruby-lang
Wardrop joined #ruby-lang
adambeynon joined #ruby-lang
yumike joined #ruby-lang
<ddfreyne> k
zmack joined #ruby-lang
havenn joined #ruby-lang
<dr0id> y
mytrile joined #ruby-lang
Manhose joined #ruby-lang
dave_miles joined #ruby-lang
abuiles joined #ruby-lang
sepp2k joined #ruby-lang
<shevy> lol
<shevy> you guys are crazy
heftig_ joined #ruby-lang
Manhose joined #ruby-lang
Manhose_ joined #ruby-lang
Manhose__ joined #ruby-lang
sirfilip joined #ruby-lang
thrcka joined #ruby-lang
heftig joined #ruby-lang
DotMH joined #ruby-lang
RomD`` joined #ruby-lang
heftig joined #ruby-lang
Manhose joined #ruby-lang
thone joined #ruby-lang
dave_miles joined #ruby-lang
dave_miles joined #ruby-lang
robotmay_ joined #ruby-lang
saLOUt joined #ruby-lang
gianlucadv joined #ruby-lang
plusk joined #ruby-lang
jkprg joined #ruby-lang
plusk joined #ruby-lang
fayimora joined #ruby-lang
dave_miles joined #ruby-lang
plusk joined #ruby-lang
zedUNDginger joined #ruby-lang
burgestrand joined #ruby-lang
tris joined #ruby-lang
uniqanomaly joined #ruby-lang
yorickpeterse joined #ruby-lang
QaDeS joined #ruby-lang
dr0id joined #ruby-lang
hexo joined #ruby-lang
zmack joined #ruby-lang
Neil joined #ruby-lang
dave_miles joined #ruby-lang
dave_miles joined #ruby-lang
huugsy joined #ruby-lang
fayimora joined #ruby-lang
apeiros_ joined #ruby-lang
Guedes joined #ruby-lang
Guedes joined #ruby-lang
wyhaines_ joined #ruby-lang
burgestrand joined #ruby-lang
wyhaine__ joined #ruby-lang
fayimora joined #ruby-lang
malev joined #ruby-lang
toretore joined #ruby-lang
mark_locklear joined #ruby-lang
rkk joined #ruby-lang
shevy joined #ruby-lang
imperator joined #ruby-lang
mytrile_ joined #ruby-lang
<kmmndr> hi all :-)
<kmmndr> does anyone have the same bug under linux ? http://www.ruby-forum.com/topic/2959893
tommyvy__ joined #ruby-lang
michael_mbp joined #ruby-lang
yfeldblum joined #ruby-lang
vauban joined #ruby-lang
Spooner joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
Spooner joined #ruby-lang
<RomyEatsDrupal> hi… rubynuby here with a a very brief ( less than 20 lines) testing script she wrote in an attempt to learn readers and writers… can someone help explain why my script ran into errors ?
<RomyEatsDrupal> it says "syntax error, unexpected ':', expecting keyword_end
<RomyEatsDrupal> attr_accessor :name :location :laptopfriendly :vibe"
<RomyEatsDrupal> but i had copied as best I could, from an online tutorial on accessors/readers/writers
<apeiros_> RomyEatsDrupal: you need , there
<apeiros_> attr_accessor :a, :b, :c, …
Sailias joined #ruby-lang
<RomyEatsDrupal> apeiros_: aaaaahhhhhh i see
<apeiros_> attr_accessor is a method too, :a, :b, etc. are the arguments to that method
ABK joined #ruby-lang
<j`ey> everything is a method!
<j`ey> or an object
<apeiros_> nope
<apeiros_> `alias` e.g. ain't a method
<apeiros_> neither is `class` (well, exists as both, syntax and method)
<j`ey> damn, true
<RomyEatsDrupal> yay! it worked :D thank you
<RomyEatsDrupal> thank you all for helping so early in the morning. well, it's 9AM here in NYC but all my roommates are asleep :)
<apeiros_> 15.05 here
<apeiros_> being home sick sucks, helping people at least feels good…
<RomyEatsDrupal> apeiros, where are you located?
<apeiros_> ch
<RomyEatsDrupal> switzerland?
<j`ey> apeiros_: since forever?
<apeiros_> RomyEatsDrupal: yupp
<apeiros_> j`ey: what?
* darix sends lebkuchen to apeiros_
<j`ey> apeiros_: have you always been in switzerland?
<apeiros_> haha, thanks
<RomyEatsDrupal> aww… that's neat… i dated a boy from Switzerland before, and I was always curious to visit the country :) danke, danke
<apeiros_> j`ey: I'm born swiss, if that's what you mean
<j`ey> apeiros_: ok, I just realised I never asked where you were from before.
<apeiros_> RomyEatsDrupal: yeah, overall it's a very nice country, and there aren't many other countries I'd want to substitute this with…
<RomyEatsDrupal> my favorite cheeses: appenzeller extra, tilsit miter, and… VACHERIN FRIBOURGEOISE (however you spell it)
<deryl> apeiros_: s/swiss/jamaica/ ;)
dv310p3r joined #ruby-lang
<shevy> the best thing about the swiss is that those living in the west speak french
yorickpeterse joined #ruby-lang
Pip joined #ruby-lang
<sj26> So does anybody know the story behind ruby-debug19?
<sj26> Why are there releases ready for 1.9.3 not on rubygems?
DotMH left #ruby-lang
<imperator> good morning
<apeiros_> moin
Defusal joined #ruby-lang
Defusal joined #ruby-lang
robbrit joined #ruby-lang
<imperator> anyone here ever started their own consulting company?
<roadkith> kinda
<imperator> kinda?
<shevy> sounds ambitious!
<roadkith> well freelance consulting
<apeiros_> it's the name of his company - "kinda"
<apeiros_> kinda consulting, ltd
macmartine joined #ruby-lang
<roadkith> nah, company name had to be firstname lastname :)
<apeiros_> my own consulting companys name is srsly
<apeiros_> srsly consulting, ltd
<roadkith> orly? consulting, ltd
<apeiros_> good name too
<apeiros_> maybe we should merge
<roadkith> make a bid
<roadkith> :D
<apeiros_> 0.1$
<roadkith> i accept EUR only
<imperator> roadkith, so it was just you then
<roadkith> imperator: yes
<apeiros_> roadkith: I can understand that
<apeiros_> tho, euro is down the hill too…
<apeiros_> a compame
<roadkith> yeah but i live there and wont have conversion issues
<apeiros_> *compaMe
<apeiros_> roadkith: where are you from?
<roadkith> germany
<roadkith> imperator: you gonna start your own consulting company?
slyphon joined #ruby-lang
krz joined #ruby-lang
<imperator> thinking about it
<imperator> ruby + windows
jwill joined #ruby-lang
<roadkith> with employees and all that?
<shevy> and kids?
<imperator> employees? yes. kids? no
<shevy> and at least one cute dog!
<shevy> awww :(
<imperator> hm, maybe a cat
<shevy> hehe
burgestrand joined #ruby-lang
jensn joined #ruby-lang
<roadkith> imperator: so you're just gonna consult or also write code?
<imperator> also write code
<imperator> create our own products
<roadkith> ah so yours is "kinda consulting" too then :D
io_syl joined #ruby-lang
io_syl joined #ruby-lang
MistyM joined #ruby-lang
kleech joined #ruby-lang
rippa joined #ruby-lang
diegoviola joined #ruby-lang
heftig joined #ruby-lang
RomD`` joined #ruby-lang
jbsan joined #ruby-lang
mksm joined #ruby-lang
[zaf]-Coral joined #ruby-lang
rayners joined #ruby-lang
fayimora joined #ruby-lang
leonL joined #ruby-lang
RickHull joined #ruby-lang
jensn joined #ruby-lang
nofxx joined #ruby-lang
burgestrand joined #ruby-lang
kyrylo joined #ruby-lang
melter joined #ruby-lang
tphummel joined #ruby-lang
kmeehl joined #ruby-lang
sirfilip left #ruby-lang
burgestrand joined #ruby-lang
sopheak joined #ruby-lang
fayimora joined #ruby-lang
<sopheak> hi all
<sopheak> i'm new to ruby
<sopheak> and want to ask something about ruby
<injekt> sopheak: ask away
<sopheak> can anyone help please
<sopheak> could you kindly tell me where can i ask?
<injekt> here
<injekt> just ask
<injekt> don't ask to ask
<MistyM> This is #ruby-lang. You can ask about ruby in #ruby-lang!
<sopheak> can i paste the code here?
<robbrit> sopheak: use pastie.org
darkf joined #ruby-lang
<sopheak> actually i design the inheritance
yorickpeterse joined #ruby-lang
<sopheak> class Animal then Dog and Cat extend from Animal
<robbrit> was STR2CSTR dropped from ruby 1.9?
<burgestrand> Might be RSTRING_PTR(ruby_string) now; long ago since I wrote C extensions
<sopheak> then i try to us Polymorphism
<injekt> robbrit: yes
achamian joined #ruby-lang
<sopheak> like animals = [Cat.new("Flossie"), Dog.new("Clive"), Cat.new("Max")]
<injekt> robbrit: StringValuePtr
<robbrit> injekt: thanks! i suppose i should have googled that first
<sopheak> then when i try to run this
<sopheak> animals.each {|animal| puts animal.class}
<sopheak> i got error
<injekt> sopheak: what error? and paste the full code
<injekt> well, paste the full code and the whole exception backtrace
RomD joined #ruby-lang
<sopheak> undefined method `+' for Cat:Class (NoMethodError)
<injekt> sopheak: can I get the code too?
<injekt> because you haven't shown it all
<sopheak> class Animal
<sopheak> attr_accessor :name
<sopheak> def initialize(name)
<sopheak> @name = name
<sopheak> end
<sopheak> class Cat < Animal
<sopheak> def talk
<sopheak> "Meaow!"
<sopheak> end
<sopheak> class Dog < Animal
<sopheak> def talk
<sopheak> "Woof!"
<burgestrand> hehe
<injekt> wow
<injekt> sopheak: pastie.org
<injekt> you were told to paste it there
<sopheak> oh sorry
<sopheak> just my first time, i dond't the policy here
<burgestrand> Don’t worry, just follow the directions
RickHull joined #ruby-lang
<sopheak> thz :)
Rene joined #ruby-lang
<sopheak> so the link is
<injekt> sopheak: you're trying to add a string and a class
<injekt> animal.class + ' : '
<injekt> you need that to be a string
<sopheak> ah so mean animal.class return as the class?
<injekt> yep
<injekt> animal.class.to_s
<sopheak> then i can use animal.class.to_s
<sopheak> correct?
<injekt> you got it
<sopheak> ah ok thanks
<injekt> or 'name'
<injekt> animal.name
<injekt> class.to_s is more descriptive, though :)
<sopheak> ok, it's work fine now
<sopheak> :)
<sopheak> in Polymorphism concept, the class of each animal should be Animal,correct?
[zaf]-Coral_ joined #ruby-lang
jasox joined #ruby-lang
kedare joined #ruby-lang
<injekt> it should act like an animal
<injekt> so if you mean should animal.class always be Animal? no
<sopheak> yep, i mean like that
<sopheak> like in java or something
<sopheak> but it's different here
havenn joined #ruby-lang
beiter joined #ruby-lang
<injekt> sopheak: how so? there are different types of polymorphism
<porcelina> uggghhhh .name is the worst named method ever. :|
<injekt> heh
<porcelina> it's like, "enjoy never being able to name a method name ever lolololol"
<injekt> you can
<injekt> it'll just override it
<sopheak> injekt, i think that's because of the language
<injekt> people (thankfully) rarely use name in place of class.to_s
<sopheak> like in java i create create animals through this
<sopheak> Animal animals[]={new Dog("toto"),new Cat("brak")};
<sopheak> that's why each animal class is Animal
<injekt> sopheak: each animal class is a subclass of Animal
<MistyM> sopheak: Dog.class == Dog, but Dog.superclass == Animal
<sopheak> yep, that's in ruby, right?
tomzx joined #ruby-lang
<injekt> that's in any language which implements inheritance
<MistyM> (Or rather, Dog.class.superclass)
<sopheak> ah i see, that's my confusion
<sopheak> thank for correcting :)
<porcelina> well, you'd be right in java tho
<porcelina> if you say Animal woggus = new Dog();
<porcelina> you couldn't call woggus.bark() because java would only know about the superclass
<porcelina> but in ruby you could call bark
<porcelina> and if it happened to be a cat it'd just throw an error
<sopheak> procelina, that's correct
<sopheak> unless the superclass has bark()
<porcelina> yea
<sopheak> ruby is better then :)
<porcelina> yea ruby is significantly easier to deal with
<robbrit> duck typing ftw
<sopheak> yeah, but i'm not yet familiar with all the sign
<porcelina> well, it's not quite duck typing, because there's no typesafety whatsoever
<sopheak> just start from last two days
<porcelina> unless you write x.methods.contains or whatever
<injekt> porcelina: that's what respond_to? is for
<injekt> perfect for duck typing
<porcelina> oh right i forgot about that. ^_^
<injekt> you dont care if your object is a Duck, you just care if it .quacks() :)
<porcelina> i'd still rather be able to overload params tho
<porcelina> that's the one thing i'm missing that true duck typing solves
<injekt> true duck typing?
<porcelina> like, actual typechecking
<porcelina> and not manual
<injekt> that's not duck typing then
<injekt> if you're type checking
<porcelina> you're checking that a type responds to something
<injekt> right
<porcelina> but the language does it for you
<injekt> you dont care about the type
<porcelina> ruby won't check for you
<porcelina> except to throw an error if it's wrong
<injekt> of course
<porcelina> so the only way to overload a method is to throw a ton of if's in it
<injekt> i dont understand what you'd want
<injekt> as an alternative
<injekt> if you want method overloading you already want a static type system
<porcelina> something like def make_noise (animal with quack); animal.quack; end
<porcelina> def make_noise (animal with bark); animal.bark; end
<injekt> ahh rather than checking for if respond_to? everywhere
<porcelina> yeah
<injekt> if you have a dog and a duck which is of type animal
<porcelina> i'm sure they'd be equivalent, just prettier syntax for it
<porcelina> doesn't really matter what type they are
<injekt> you should be using the same method to talk
kyrylo joined #ruby-lang
<injekt> this is where interfaces in java are nice
<porcelina> yea
<injekt> defining a spec
<sopheak> may i ask you what these statement mean?
<sopheak> def make_noise (animal with quack); animal.quack; end
<injekt> describing what porcelina would like
phlipper joined #ruby-lang
<porcelina> uhm, they're how i want ruby to be. ^_^;
<sopheak> ah :)
<porcelina> they're not actual ruby
<injekt> I like that there's only ever one method signature
solars joined #ruby-lang
<porcelina> i think it's actually necessary
<porcelina> since you can add methods at runtime
<porcelina> it wouldn't know whether you wanted to override or overload
<injekt> well, it would just always override
<porcelina> yea i guess
<porcelina> crap, i'm late for school. :\
<porcelina> tty
<porcelina> ttyl*
imajes joined #ruby-lang
<sopheak> thanks guys for all of your help
<sopheak> i'm 1AM here, ttyl*
<j`ey> np glad to help
io_syl joined #ruby-lang
io_syl joined #ruby-lang
srbaker joined #ruby-lang
outoftime joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
srbaker joined #ruby-lang
musl joined #ruby-lang
ivorybishop joined #ruby-lang
yorickpeterse joined #ruby-lang
srbaker joined #ruby-lang
necromancer joined #ruby-lang
<necromancer> hey guys
<necromancer> when shell-scripting with ruby, is it ok to just do "foo bar" when i want to print to screen, or do i have to use puts()?
RickHull joined #ruby-lang
<MistyM> No, it won't be printed to screen unless you explicitly print it. (Except in irb, of course.)
publicvoid_ joined #ruby-lang
RickHull joined #ruby-lang
<necromancer> MistyM: thanks
<MistyM> No problem!
<necromancer> MistyM: so one more...i'm basically writing an init.d script for this server called Red5. it is started by running a script called `red5.sh`, and outputs all of its logs to the terminal. so when i close my session, it kills the server.
butchanton joined #ruby-lang
<necromancer> MistyM: i'm writing an init.d script to launch on startup and also keep it running as a bg process. what i'd like to do is test whether my `exec` call to red5.sh worked. is there a way to capture the exit code using ruby's backtick syntax?
<MistyM> necromancer: Exit status is stored in the special global variable $? (until the next time a process is spawned, then it gets overwritten)
<necromancer> thanks
<MistyM> Also, are you capturing the stdout using the backtick syntax? If not, #system is probably the one you're looking for - it returns true for a zero exit status, false for non-zero. (Exit status is still available by $?)
<necromancer> ok
<necromancer> oh wow thanks workmad3
<necromancer> :)
<workmad3> necromancer: what are you doing with red5 then? :)
RickHull joined #ruby-lang
<necromancer> workmad3: you don't wanna know ;-)
<workmad3> necromancer: as long as it's not 'attempting to compile it' then it can't be too bad :P
<necromancer> workmad3: this client required me to build them a SWF that allows them to record voice to the Red5 server, then once the recording is done it adds to a queue which runs ffmpeg to convert the FLV to WAV, then sox to mix the WAV with another background music track, then ffmpeg again to transcode to MP3
<workmad3> necromancer: interesting :)
<necromancer> workmad3: all so people can eventually purchase these tracks in this music store-like environment, but it's for like spoken word over bg music for trauma therapy
<necromancer> oh yeah i can't imagine compiling it
<necromancer> i had to compile ffmpeg though that was a chore
<workmad3> necromancer: tbh, the biggest problem with red5 is that they can (and do) break anything and everything between versions... if you have a version that works with your app *save it somewhere and never delete it*
<workmad3> (hence why I forked that version specifically for the company repo :) )
saysjonathan joined #ruby-lang
<necromancer> workmad3: interesting...i'll have to keep that in mind
saysjonathan joined #ruby-lang
<necromancer> workmad3: how did you fork it from svn to git? i had to get my copy off svn i believe
<workmad3> necromancer: I just committed the version provided by the contractors who did the red5 stuff to git
<necromancer> workmad3: that looks just like my /usr/share/red5 dir actually...is it possible to just package that up in a git repo?
<necromancer> my thought is i can just clone the repo to /usr/share/red5 on any machine and it will "just work"
<necromancer> no sense building from ant if i don't have to right?
<workmad3> yeah :)
<workmad3> I build the red5 application with maven... I spent a couple of days with that at one point making sure all the dependencies built into the app didn't conflict with the stuff in the lib/ dir of red5
<workmad3> but the server... no way I'm going to touch that if at all possible
outoftime joined #ruby-lang
<necromancer> workmad3: yeah i was very confused by red5 and its lack of docs. having not touched java in almost 6 years now, it was very daunting. so we had to solve it in other ways. i would have rather just done all of this work using the Red5 app. i think it's possible to do everything i'm doing totally inside the Red5 app since it's java and it's got the stdlib
<necromancer> but right now the queue is handled by a PHP script (boss's orders unfortunately) and a series of shell scripts executed by php exec()
<necromancer> err shell commands*
achamian joined #ruby-lang
<href> haha, necromancer: epic nickname.
kitallis joined #ruby-lang
ecin joined #ruby-lang
kain joined #ruby-lang
<workmad3> necromancer: yeah, red5 is basically a java webapp (the default server runs embedded tomcat or jetty, not sure which). It can do all sorts of good long running service stuff
<necromancer> workmad3: oh cool. i think it runs tomcat iirc, since ant is part of the tomcat project
<necromancer> haha thanks href
towski joined #ruby-lang
[zaf]-Coral joined #ruby-lang
<workmad3> necromancer: ant is done by apache, same as tomcat yeah... but jetty is an apache project nowadays too ;)
<workmad3> oh wait, no, jetty is an eclipse project
<necromancer> hmm
<necromancer> how is eclipse doing these days? last i checked it was buggy and crashed a lot ;)
<workmad3> but still, red5 is neither and can make use of whatever it feels like :)
<workmad3> I don't use it... I use vim :P
edwardsharp joined #ruby-lang
benanne joined #ruby-lang
mrsolo joined #ruby-lang
sulo joined #ruby-lang
robbyoconnor joined #ruby-lang
brianpWins joined #ruby-lang
heftig joined #ruby-lang
amerine joined #ruby-lang
r0bby joined #ruby-lang
hahuang65 joined #ruby-lang
phlipper joined #ruby-lang
RickHull joined #ruby-lang
NemesisD joined #ruby-lang
<NemesisD> hi all. im trying to figure out how to sanely monkey patch a Module such that my method gets inserted into the call chain but can "super" into the module's method
<NemesisD> the only way i've found to do it is to instead target the class that the original module is included into, everything else outright replaces the original module's method
r0bby joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
jmontross joined #ruby-lang
RegEchse joined #ruby-lang
Squarepy joined #ruby-lang
sepp2k1 joined #ruby-lang
imperator joined #ruby-lang
Squarepy joined #ruby-lang
perryh_ joined #ruby-lang
Squarepy joined #ruby-lang
Squarepy joined #ruby-lang
twittard joined #ruby-lang
<macmartine> I downloaded the Ruby docs from http://ruby-doc.org/stdlib-1.9.3/ and there's no css so it looks like crap -- pretty unusable. Is there another source?
Indian joined #ruby-lang
<Mon_Ouie> You can generate the documentation from the source code with rdoc or yard
RomyEatsDrupal joined #ruby-lang
<macmartine> K, thanks. Weird the d/loads would be like this.
Swimming_Bird joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
RickHull joined #ruby-lang
RickHull joined #ruby-lang
r0bby joined #ruby-lang
RegEchse joined #ruby-lang
kitallis joined #ruby-lang
jmontross1 joined #ruby-lang
josh9 joined #ruby-lang
jkprg_ joined #ruby-lang
<josh9> can i use Ruby 1.9.3-p0 or will i face compatabilities isssues with gems?
<mihar> 1.9.3 works fine for me
<mihar> but i could be just lucky
Carnage\ joined #ruby-lang
<theconartist> read the release notes josh9 they aren't that long
<josh9> theconartist: sure. thanks
<theconartist> and it would be pretty hard to find any problems upgrading
<yxhuvud> josh9: ask again in a year when more people have tried upgrading :)
<lianj> nothing serious, but ruby -e 'p :a,:b,'; ruby -e 'p(:a,:b,)' in 1.9.3 is still strange. bug or intended?
robotmay joined #ruby-lang
<lianj> josh9: most of what works in 1.9.2, is fine. only this syntax change broke some of my libs :Ð
<josh9> lianj: got it.
<josh9> theconartist: where is the release notes? http://www.ruby-lang.org/en/downloads/
nofxx joined #ruby-lang
huugsy joined #ruby-lang
nuclearsandwich joined #ruby-lang
Jake232 joined #ruby-lang
jeffj_ joined #ruby-lang
<imperator> 1.9.3 is still in pre isn't it?
<imperator> seems to have caused some issues
<Mon_Ouie> No, 1.9.3 has been released already
<vauban> pre.
<deryl> no -p0 is out
outoftime joined #ruby-lang
<imperator> -p-uh-oh
<deryl> hehe
<deryl> i can't think of a single problem i've had with -p0 other than the debugging patch and the lack of _ruby_threadptr* exposure.
<deryl> that and the fact I have to take Zlib::GzipFile:: out of the debugging gem to get it to work
postmodern joined #ruby-lang
<deryl> had to follow this https://gist.github.com/1329273
apeiros_ joined #ruby-lang
io_syl joined #ruby-lang
RickHull1 joined #ruby-lang
Pip joined #ruby-lang
dejongge joined #ruby-lang
rpall joined #ruby-lang
rpall left #ruby-lang
MrPunkin joined #ruby-lang
Axsuul joined #ruby-lang
RickHull joined #ruby-lang
rpall joined #ruby-lang
ryanf joined #ruby-lang
twittard joined #ruby-lang
Silowyi joined #ruby-lang
<Silowyi> what is the most efficient way to escape quote marks in a string?
<apeiros_> probably gsub
<Silowyi> really? regexps?
<Silowyi> that seems counter-intuitive
<apeiros_> who said regex?
<apeiros_> read the gsub docs.
<Silowyi> I'm looking at them.
<robbrit> Silowyi: you can pass strings to gsub
<MrPunkin> are local variables local within an iteration if set initially within the iteration?
<MrPunkin> meaning the next object in the iteration will re-set the local var?
<apeiros_> but yes, technically (and iirc) a string argument passed to gsub will be converted to a regex internally.
twittard joined #ruby-lang
<robbrit> MrPunkin: yes
sulo joined #ruby-lang
<rpall> so here i am on 10.7.2, compiled 1.9.3 with clang and installed it .. and ruby -v still gives me 1.8.7
lsegal joined #ruby-lang
<rpall> what am i missing
<apeiros_> rpall: which ruby tells you probably that you're using /usr/bin/ruby
<rpall> yes
<apeiros_> which'd be the system ruby. which'd mean you should setup your $PATH
<MrPunkin> thanks
<rpall> right .. thanks
<rpall> i don't remember it being necessary on 10.6
havenn joined #ruby-lang
<rpall> then again .. who remembers
<apeiros_> if you compiled by hand, then it was necessary. if you used some tool, then that probably took care of the path as well.
<apeiros_> it may of course be, that you had your path set up for something else already.
<rpall> right, could be
dejongge joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
robbrit left #ruby-lang
cyri_ joined #ruby-lang
srbartlett joined #ruby-lang
curtism joined #ruby-lang
benanne joined #ruby-lang
y3llow joined #ruby-lang
s0ber_ joined #ruby-lang
ddollar joined #ruby-lang
burgestrand joined #ruby-lang
saLOUt joined #ruby-lang
sulo joined #ruby-lang
nofxx joined #ruby-lang
tenderlove joined #ruby-lang
amerine joined #ruby-lang
leonL joined #ruby-lang
plusk joined #ruby-lang
tokumine joined #ruby-lang
ryanf joined #ruby-lang
io_syl joined #ruby-lang
gix joined #ruby-lang
igotnolegs joined #ruby-lang
ecin_ joined #ruby-lang
<slyphon> is there a cross platform (i.e. native ruby) equiv to `uname -s` ?
<apeiros_> didn't erikh work on something to cover stuff like that?
<slyphon> oh, i meant something builtin
* slyphon looks through RbConfig strings
<apeiros_> was going to mention RbConfig
<slyphon> target_os looks promising
Carnage\ joined #ruby-lang
<erikh> rubygems-test makes an effort
<erikh> a minor one
<erikh> it's not its own lib though
<erikh> actually it might be gem-testers
<erikh> let me look.
* slyphon looks
<erikh> that's a parser from RbConfig values
<slyphon> what's gem testers?
<erikh> test.rubygems.org
<slyphon> ooh
<erikh> it's pretty dead, I need to find a maintainer that can spend time on it.
<slyphon> i'm working on a gem that will build zeromq for ffi-rzmq
<erikh> have you seen what lourens is working on?
<slyphon> it's called ffi-rzmq-lib, and the top-level module is FFIRZMQLIB
<erikh> (methodmissing)
<slyphon> i'm so tempted to call it OMGWTFRZMQ!!
<slyphon> er, nope
<erikh> a lean straight C zmq binding
<slyphon> oh, nice
<erikh> I can get you a repo tomorrow probably if you want, I think he's in bed or done for the day
<drbrain> "Oh My! Golly! What's This Fantastic Ruby øMQ‼"
<drbrain> slyphon: ^^ ?
<slyphon> :D
<erikh> haha nice
ryanf joined #ruby-lang
<slyphon> drbrain: i'll have to write that dwon as my cover story
<drbrain> I think FR could be improved
<slyphon> drbrain: so gem does ruby ./ext/extconf.rb && make && make install ?
<slyphon> when there's an extension?
<drbrain> slyphon: yes
<slyphon> ok
<slyphon> i'm gonna fake out the makefile
<drbrain> it sets some env variables to install the extension into lib/
<slyphon> ah
<drbrain> slyphon: are you doing bad things?
<drbrain> … lib in the gem
<slyphon> yeah
<slyphon> but
<slyphon> i'm not gonna push it to rubygems.org
<slyphon> it's gonna be for internal use
<drbrain> I will give you half a frown: :⎛
<slyphon> :)
* slyphon hangs his head half in shame
<drbrain> Unicode has EVERYTHING
<slyphon> :D
twittard joined #ruby-lang
<erikh> that could be one of those worms in LIMBO as well
<erikh> (Which was a great game that everyone should play)
* apeiros_ pondered abusing /ext/extconfig.rb as a faux install callback…
tokumine joined #ruby-lang
<drbrain> apeiros_: I personally frown at everyone who does that
<ryanf> do you go to their houses first
<ryanf> or just figure out which direction they're in
<apeiros_> telefrowning - the new e-sport
<drbrain> ryanf: the latter
hagabaka joined #ruby-lang
<slyphon> hrm
<slyphon> i can't figure out the search path
io_syl joined #ruby-lang
io_syl joined #ruby-lang
<postmodern> anyone know of a Ruby implementation of JSON Path
<postmodern> want XPath syntax for traversing JSON
<postmodern> or just XPath for traversing Ruby Arrays/Hashes
<postmodern> there's json_select, but it uses CSS path
hagabaka joined #ruby-lang
hagabaka joined #ruby-lang
<slyphon> well, that was total fail
<zenspider> postmodern: dude! just convert json to xml!
<postmodern> zenspider, why didn't i think of that :)
<rue> I heard someone'd hacked an XSLT processor to handle JSON
<postmodern> zenspider, although I have too much data to be converting to XML
<rue> “If you need JSON Path, you probably shouldn't be using JSON.”
<postmodern> ha
<postmodern> someday they will listen
<imperator> slyphon, gem install sys-uname
<rue> postmodern: How complex is the data?
<postmodern> rue, not that complex, usually +5 levels deep
<postmodern> rue, but there's more breadth to it, some files are +4Megs
<rue> Does it need to be processed realtime(ish)?
<imperator> fuck that os_translator shit, jesus
<slyphon> imperator: ah
<slyphon> imperator: eh, i gave up
<slyphon> trying to get libffi to look for stuff *where I tell it to* seems to be a losing battle
<postmodern> rue, nope, but it cannot become a bottleneck
<slyphon> i'll just make sure zeromq is installed
<rue> postmodern: Wondering if you could just import it into one of these fancy DBs
<imperator> slyphon, trying to make something work with jruby?
<postmodern> rue, kind of what im doing :)
<slyphon> nah, i was gonna have a gem that just built zeromq
<slyphon> and then mucked with the path so that ffi-rzmq could find it
<rue> I don't really like that conceptually
<rue> It's best to let package managers handle that
<slyphon> yeah, probably, it's damn convenient when it works, though
<imperator> a gem that built zeromq? i guess i don't follow
<slyphon> well, like my zookeeper gem
<slyphon> it builds the client-side C code from upstream
<slyphon> then links a bunch of ruby code against it
<imperator> oic
<slyphon> works on osx and linux
slackstation joined #ruby-lang
<imperator> hm, i know a guy doing something like that
<imperator> basically like bundler, but grabs and builds everything, not just ruby stuff
<slyphon> oh
<slyphon> interesting
<slyphon> i mean, i only really did it that way because i took it over from someone else
<imperator> he's got it in a private repo, got to get him to release it
<slyphon> we could use that for this big encoding project we have
<imperator> i've seen one perl module that did that, some math module, can't remember the name
<imperator> broke a lot
jsaak joined #ruby-lang
<imperator> oh yeah, the gmp module - would go download the source for you
dv310p3r joined #ruby-lang
sulo joined #ruby-lang
<slyphon> ooh!
<slyphon> imperator: good catch
<zenspider> damnit... where's charlie?
<imperator> charlie who?
Pip joined #ruby-lang
Pip joined #ruby-lang
jalljo joined #ruby-lang
<slyphon> charlie hotch
<zenspider> THE charlie... duh
<zenspider> you think ppl ask "Berger who?"
<zenspider> THE Berger
<slyphon> sorry
<slyphon> 'hodge'
Defusal joined #ruby-lang
Defusal joined #ruby-lang
zigidias joined #ruby-lang
nofxx joined #ruby-lang
<macmartine> params[:user]['service_ids'] ||= [] fails with "<IndexError: string not matched>". I see why, but how do I set it to an empty array if the key doesn't exist?
<zenspider> IndexError ?
<zenspider> meh. #rubyonrails
<macmartine> Yes, it's try to access the index 'service_ids' of a hash. But that key doesn't exist
<zenspider> real hashes return nil when they don't match the key
<zenspider> (or whatever default you give them)
<macmartine> There's a strictly Ruby version for ya
<erikh> imperator: Math::Pari
<erikh> used to break all the time for us, prereq of Crypt::RSA
<zenspider> macmartine: that's not a hash dude. so of course the key doesn't exist
<zenspider> ruby -e 'p Hash.new[:blah]' => nil
<macmartine> zenspider: it's the same error as with my hash
<zenspider> you DO NOT have a hash
* slyphon pops some corn
<erikh> macmartine: p params right before your line
<erikh> you'll see what kind of object you have.
<imperator> slyphon, http://i.imgur.com/iwg8n.gif
<erikh> dollars to donuts though zenspider is right
<slyphon> imperator: :D
<zenspider> damnit... now I want popcorn
<imperator> erikh, ah yes that's the one
WillMarshall joined #ruby-lang
<imperator> net-ssh for me, with its 3 bajillion prereqs
<erikh> heh
<zenspider> imperator: :((((
<imperator> zenspider, the perl module
<zenspider> then add some more ('s
<zenspider> ruby's is worth 4
<zenspider> perl is prolly 8? 9?
<macmartine> zenspider: ah, of course. params is a hash, but params[:user] isn't. long day. thanks
<imperator> i think the total prereqs for net-ssh-perl, with some of the optional stuff installed, came out to over 50 dependencies last time i checked
<macmartine> erikh: ^^ thanks
<imperator> one ( for each one, i say
<erikh> macmartine: enjoy
<zenspider> hah. that's a totally fair measure. someone should write a gem for that
<erikh> gem frown net-ssh
<zenspider> I'd love to see rspec's :((((
<rue> erikh: :D
<erikh> 2.0 feature
<zenspider> now I'm tempted