Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
ivorybishop has joined #ruby
<Hanmac> i think it should be methed in the topic that rails have own channel
briankbuckley has joined #ruby
<seanstickle> Yeah, like we need a longer topic.
phantomfakeBNC has joined #ruby
speerfissure has joined #ruby
ivorybishop has joined #ruby
apucacao has joined #ruby
nowthatsamatt has joined #ruby
<ElderFain> i sometimes ask rails questions in here when rails is less active =)
<tayy> hi everyone! how do i check if the HTTP header includes a refresh URL? (using rest_client)
tdubz has joined #ruby
<tayy> i tried .include? but it doesn't work
<tayy> (or i might hv just done it wrongly!) :)
nowthatsamatt has quit [#ruby]
kerframil has joined #ruby
josx has joined #ruby
ryannielson has joined #ruby
jmcphers has joined #ruby
clockwize has joined #ruby
pen has joined #ruby
looopy has joined #ruby
tatsuya_o has joined #ruby
scientes has joined #ruby
nari has joined #ruby
<scientes> why does ruby -e 'p "
banistergalaxy has joined #ruby
<startling> scientes: I'm not sure (ruby isn't my main language) but you probably need to declare the encoding in the file
<scientes> maybe it is reading C=en_US.UTF-8
<scientes> for the -e
<scientes> $ruby -e "p __ENCODING__"
<scientes> #<Encoding:UTF-8>
<scientes> # ruby enc.rb
<scientes> #<Encoding:US-ASCII>
<Hanmac> :P
phantomfakeBNC has joined #ruby
<scientes> ahh, does anyone else run into problem copying code from sites where the blog software automatically uses utf curly quotes instead of straight ones?
<scientes> it gets soooo annoying
<scientes> so ruby 1.9 is limited to ASCII unless defined otherwise?
<scientes> *unless encoding is defined?
iMe has joined #ruby
rramsden has joined #ruby
<davidcelis> scientes: # encoding: utf-8
<davidcelis> at the top of your file
<scientes> # -*- coding: UTF-8 -*-
<davidcelis> ew
<scientes> what does that also support?
<scientes> as ive seen that before
cbuxton has joined #ruby
senj has joined #ruby
<startling> scientes: emacs
<startling> scientes: vim can do it too, I think. python uses it too
tommyvyo has joined #ruby
hadees has joined #ruby
sizz has joined #ruby
jergason has joined #ruby
major_majors has joined #ruby
wyhaines has joined #ruby
jds has joined #ruby
chrxn has joined #ruby
tatsuya_o has joined #ruby
savage-_ has joined #ruby
robotmay has joined #ruby
ekaleidox has joined #ruby
mengu_ has joined #ruby
mengu_ has joined #ruby
havenn has joined #ruby
benwoody has joined #ruby
looopy has joined #ruby
badabim has joined #ruby
banister_ has joined #ruby
xjiujiu has joined #ruby
al3xnull has joined #ruby
savage- has joined #ruby
chimkan_ has joined #ruby
chimkan_ has joined #ruby
sizz has joined #ruby
incomprehensibly has joined #ruby
porco has joined #ruby
<startling> is there an easy way to make an attribute public? I'm sorta tired of `def myattribute\n @myattribute\n end`
<banister_> startling: use attr_accessor
<seanstickle> uh… attr_reader
<ElderFain> I'm confusing myself with classes.. say I declare a class, then my_class = MyClass.new; then I call an instance method like my_class.function and I want that function to return a class instance… so i can chain another class instance method off it..
<banister_> startling: class Hello; attr_accessor :my_attribute; end
<ElderFain> wouldn't i be doubling up my memory?
<ElderFain> could i just return something like "this" or "self" to force it into a class but still be 'the same thing, but with new data populated?'
execute has joined #ruby
<banister_> ElderFain: dup
S1kx has joined #ruby
<startling> banister_: perfect, thanks
rickmasta has joined #ruby
<banister_> startling: read a book on ruby ;)
<ElderFain> or let me backup. I want to be able to have a method that formats data, that can either be called off an instance of the class, like my_class.format_data(my_data) or I could say my_class.get_data.format_data
<startling> any suggestions for one that doesn't hold your hand? I'm new to ruby but not programming.
<banister_> startling: yes, 'the ruby programming language'
<banister_> startling: or, 'eloquent ruby'
<startling> banister_: thanks. I'll check those out.
<banister_> 'ruby programming language' is kind of a language reference, whereas 'eloquent ruby' teaches you to program idiomatic ruby
td123 has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<ElderFain> how can I structure the get_data method, and the format_data class instance methods in such a way that I can chain one into the other, or call them individually and pass in what i want formatted?
pdtpatr1ck has joined #ruby
<seanstickle> startling: or the Ruby Draft Spec http://www.ipa.go.jp/osc/english/ruby/
<seanstickle> startling: out of date, but interesting reading
rickmasta has joined #ruby
<ElderFain> I'm not even sure if I'm asking the right thing
sontek has joined #ruby
<sontek> If I get checking for ruby.h... no from extconf.rb but I have ruby.h in /usr/lib64/ruby/1.8/x86_64-linux/ruby.h what would cause that?
caiges has joined #ruby
<sontek> Is ruby looking only in 32bit folders?
<dark3rdre4ms> hm sontek
<dark3rdre4ms> why ruby 1.8?
manizzle has joined #ruby
<sontek> because thats what comes default in Fedora 16
<dark3rdre4ms> o_O
<sontek> and I just use ruby libraries, don't develop with it
<heftig> seriously? it's installed by default?
<sontek> ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
<dark3rdre4ms> Another reason why I dislike Fedora
kevinbond has joined #ruby
<sontek> is 1.8 pretty old?
<seanstickle> It's like using the 2.4 kernel
briankbuckley has joined #ruby
<sontek> F16 came out in November
<sontek> So 1.9 came out in 01 or so? (like a 2.4 kernel)
<seanstickle> It's a loose analogy
syamajala has joined #ruby
<sontek> when did 1.9 come out?
<seanstickle> It's considered old, yes.
<heftig> sontek: 2007
<seanstickle> sontek: Dec 2007
<sontek> hah, thats weird then
Ownatik has joined #ruby
<td123> seanstickle: the thing is, fedora is more oriented towards enterprise, because rhel is actually spinned off from fedora :P
<sontek> Yeah but they usually aren't that far behind
<seanstickle> I find nothing redeeming about any of the RH-related distros
<sontek> they ship python 2.7 which is the latest stable branch of Python
dagnachewa has joined #ruby
<td123> sontek: python 3.2 is latest stable :P
<sontek> and if it came out in '07 there is no reason to have
<sontek> td123: I should have put a *usable* in there
<td123> it is usable by some groups of devs also
<sontek> td123: A lot of important libraries have not been ported to 3 yet
<td123> major exception being web devs
<sontek> td123: web devs and scientists
pnegri has joined #ruby
<td123> sontek: which libs are you talking about?
<seanstickle> They're all moving to Perl 6 anyways
<td123> sontek: scipy has been ported to py3 for a while
<sontek> I'm not saying python3 is bad, I love it, just saying it makes you take a step back if you are used to things like SciPy, NumPy, boto, twisted,, etc
<td123> those all have py3 versions :P
<td123> never heard of boto though
<sontek> shenanigans!
mickn has joined #ruby
<sontek> boto is amazon integration library... s3, aws, turk, etc
<sontek> so, to fix my ruby problem... find a 1.9 rpm? :P
<td123> ah ok, ty
Apocalypse has joined #ruby
<sontek> that could be outdated though
<td123> sontek: that's way outdated then
werdnativ_ has joined #ruby
<td123> sontek: 0.9 already had py3 support which came out last year
andrewhl has joined #ruby
looopy has joined #ruby
<td123> only real group that still has an excuse to stick with py2 are the web devs :P
<dark3rdre4ms> ^
<td123> oh, and maintenance of course
<td123> friend still has to work w/ 2.4 sometimes because of that :(
<sontek> td123: I'm both a web dev and desktop dev and 3 is far from good for me, I can't find an announcement about numpy, scipy, or twisted supporting python3
banisterfiend has joined #ruby
<sontek> and pyqt/pyside don't support it
stephans has joined #ruby
<sontek> i'm sure there is a subset of devs who have very small needs that it works for but I rely on a lot of libraries
<sontek> I guess I need to learn to write more myself :P
Seisatsu has joined #ruby
johnn has joined #ruby
<td123> sontek: right, I said web devs still have an excuse not to use py3 :P
<sontek> and I started playing with kivy for desktop and it doesn't either
Ownatik has joined #ruby
<td123> pyside at least has a roadmap for py3 support last time I checked, I dunno what the current state is :/
<sontek> td123: everyone has a py3 roadmap, which is good
friskd has joined #ruby
<sontek> its just not there yet
shadoi has joined #ruby
wmoxam has joined #ruby
<sontek> but as soon as there is good support I'm jumping to it
<td123> sontek: if you need proof of py3 for twisted and scipy/numpy, check arch repos :P I'm sorry I can't find easily reachable content for that :P
tommyvyo has joined #ruby
mrtheshadow has joined #ruby
<td123> sontek: pyqt also has py3 bindings
<td123> pygtk doesn't from the looks of it though
QaDeS_ has joined #ruby
<sontek> Ruby 1.9.3 will be in Fedora 17 :)
<td123> sontek: ya :)
jergason has joined #ruby
pdtpatrick_ has joined #ruby
Araxia__ has joined #ruby
hadees_ has joined #ruby
waxjar has joined #ruby
Spockz_ has joined #ruby
lorenzo has joined #ruby
<sontek> Is there a way to figure out what extconf is looking for?
<sontek> with this error: http://paste2.org/p/1907780
al3xnull has joined #ruby
<sontek> since I don't have 1.9 easily available
Narcissu1 has joined #ruby
ekaleido_ has joined #ruby
<banisterfiend> sontek: are you using rvm
_musee has joined #ruby
<banisterfiend> sontek: if not you may need to install your system's ruby-deb package
<banisterfiend> ruby-dev
Gate_ has joined #ruby
<sontek> I have ruby-dev installed and have a ruby.h file
neurodrone_ has joined #ruby
<sontek> its just not finding it
<sontek> so I need to find out why
<swills> anyone here experienced with running rubyspec tests to test ruby?
sj26_ has joined #ruby
<swills> i'm running it and getting some failures, not sure why
savage- has joined #ruby
decentrality has joined #ruby
csexton has joined #ruby
alienven1m has joined #ruby
friskd_ has joined #ruby
affix_ has joined #ruby
tk_ has joined #ruby
i8igmac has joined #ruby
icrazyhack has joined #ruby
Emmanuel_Chanel has joined #ruby
<td123> sontek: oh, I think I read today on some oss news site that fedora 17 isn't going to use btrfs by default
nacengineer has joined #ruby
<td123> I was looking forward to a distro using btrfs, but the stupid fsck is missing
Shrink has joined #ruby
momo- has joined #ruby
codefriar has joined #ruby
stephans has joined #ruby
<sontek> Fedora is a little slower moving than other distros but still keeps fairly up to date
<sontek> in ruby, what does has_header() do? Thats whats failing on this extconf.rb file
<sontek> does has_header and missing
<sontek> is there a better way with 1.8?
<sontek> 1.8.7
chrxn has joined #ruby
darthdeus has joined #ruby
<sontek> I need to build an app in ruby at some point just so I have a better understanding of it
apucacao has joined #ruby
<td123> sontek: most ruby packages use gem now, it's super simple :)
jds has joined #ruby
samsonjs_ has joined #ruby
c0rn has joined #ruby
bhunt has joined #ruby
gen0cide_ has joined #ruby
apok_ has joined #ruby
speggey__ has joined #ruby
sand has joined #ruby
panthrodeb has joined #ruby
<swills> ok, neverminndhe chroot in the mspec tests are bogus
waxjar has joined #ruby
<a|i> def foo; return 1,2; end;
<a|i> is there a way to get a = foo as a = 1?
<swills> anyone running 1.9.3p125 and rue mspec tests?
<swills> err run, not rue
<RubyPanther> a|i: Ruby doesn't have a list context like Perl, you can't get both behaviors... you need something like a = foo.first
<a|i> RubyPanther: I just want to return 1 as default, and return more when using a.b= foo
<a|i> a,b = foo *
<a|i> guess have to implement an option :/
<RubyPanther> a|i: no need for golf though, a,b = *foo ; b ||= default
Hanmac1 has joined #ruby
Ttech has joined #ruby
<a|i> RubyPanther: nope. foo already returns 1 value which is the default behaviour. I want to keep the existing code a = foo happy, and add the second value when calling a,b = foo
<RubyPanther> a|i: you should add a foo_with_bar method that calls foo
philcrissman has joined #ruby
cbuxton has joined #ruby
samsonjs has joined #ruby
wmoxam_ has joined #ruby
pete989 has joined #ruby
marknyc has joined #ruby
chrxn has joined #ruby
tayy_ has joined #ruby
tommyvyo has joined #ruby
Paoc_ has joined #ruby
akem has joined #ruby
akem has joined #ruby
sdwrage has joined #ruby
Ttech has joined #ruby
cbuxton has joined #ruby
caiges has joined #ruby
filthynigge has joined #ruby
ed_hz_ has joined #ruby
mikepack has joined #ruby
dv310p3r has joined #ruby
stephenjudkins has joined #ruby
<iamafilthynigge> hi
gokul has joined #ruby
td123 has joined #ruby
idletom has joined #ruby
mrtheshadow has joined #ruby
jmcphers has joined #ruby
sythe has joined #ruby
joast has joined #ruby
Ttech has joined #ruby
crankycoder has joined #ruby
decentrality has quit [#ruby]
zomgbie has joined #ruby
igotnolegs has joined #ruby
caiges has joined #ruby
tommyvyo has joined #ruby
c0rn has joined #ruby
CannedCorn has joined #ruby
pac1 has joined #ruby
a_a_g has joined #ruby
trend has joined #ruby
danibx has joined #ruby
ttech_ has joined #ruby
dark3rdre4ms has joined #ruby
CannedCo_ has joined #ruby
nfluxx has joined #ruby
sizz_ has joined #ruby
sizz has joined #ruby
dnjaramba has joined #ruby
dnjaramba has joined #ruby
_|christian|_ has joined #ruby
dnjaramba has joined #ruby
ed_hz_ has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
ckrailo has joined #ruby
jds has joined #ruby
werdnativ has joined #ruby
pu22l3r has joined #ruby
c0rn has joined #ruby
matti has joined #ruby
matti has joined #ruby
sdwrage has joined #ruby
matthias_ has joined #ruby
flashuni has joined #ruby
hooper has joined #ruby
dagnachewa has joined #ruby
nixmaniack has joined #ruby
kwoodson|2 has joined #ruby
<kwoodson|2> I am parsing a file and converting a string into a symbol. I want to call that symbol which is a method on a class. Is that possible with send?
pdtpatr1ck has joined #ruby
rippa has joined #ruby
colint has joined #ruby
danibx has joined #ruby
Seisatsu has joined #ruby
banseljaj has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
pdtpatr1ck has quit [#ruby]
kinderman has joined #ruby
dark3rdre4ms has joined #ruby
pu22l3r has joined #ruby
porco has joined #ruby
c0rn_ has joined #ruby
imami has joined #ruby
looopy has joined #ruby
BrianJ has joined #ruby
manizzle has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
Banistergalaxy has joined #ruby
enherit has joined #ruby
marvin_ has joined #ruby
x0F__ has joined #ruby
banisterfiend has joined #ruby
rippa has joined #ruby
IAD has joined #ruby
havenn has joined #ruby
pdtpatr1ck has joined #ruby
i8igmac has joined #ruby
tomzx has joined #ruby
dark3rdre4ms has joined #ruby
stephenjudkins has joined #ruby
hkhalid has joined #ruby
<hkhalid> hi
nfluxx has joined #ruby
thone has joined #ruby
sterNiX has joined #ruby
csherin has joined #ruby
nfluxx has joined #ruby
gianlucadv has joined #ruby
xpot-arcturus has joined #ruby
rickmasta has joined #ruby
macmartine has joined #ruby
Helius has joined #ruby
Cicloid has joined #ruby
idletom has joined #ruby
stephenjudkins has joined #ruby
macmartine has joined #ruby
phantomfakeBNC has joined #ruby
zomgbie has joined #ruby
mxweas_ has joined #ruby
PhilK has joined #ruby
Morkel has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
16WAAA05L has joined #ruby
tuxdna has joined #ruby
dandean has joined #ruby
<dandean> Potentially totally stupid question for y'all. I'm coming from C#/ASP.Net, where I can do HttpContext.Current.Cache["key"] = someObject. Is the same sort of thing possible in ruby within Sinatra?
moshee has joined #ruby
havenn has joined #ruby
<dandean> Potentially totally stupid question for y'all. I'm coming from C#/ASP.Net, where I can do HttpContext.Current.Cache["key"] = someObject. Is the same sort of thing possible in ruby within Sinatra?
<dandean> Whoops - sorry for the double post...
wenbert has joined #ruby
nmoljm9e has joined #ruby
<nmoljm9e> ogkod
<nmoljm9e> kfo
<nmoljm9e> df
stayarrr has joined #ruby
Gekz has joined #ruby
Gekz has joined #ruby
kaiwren has joined #ruby
sterNiX has joined #ruby
chimkan has joined #ruby
Sliker has joined #ruby
bier has joined #ruby
punkrawkR has joined #ruby
<startling> how do I iterate backwards through an array?
phantomfakeBNC has joined #ruby
iocor has joined #ruby
jwmann has joined #ruby
mxweas_ has joined #ruby
sterNiX has joined #ruby
phantomfakeBNC has joined #ruby
<startling> never mind, my_array.reverse_each
crankycoder has joined #ruby
oposomme has joined #ruby
sterNiX has joined #ruby
jds has joined #ruby
davidcelis has joined #ruby
nemesit has joined #ruby
LMolr has joined #ruby
sat has joined #ruby
dnjaramba has joined #ruby
sat has quit [#ruby]
sat00 has joined #ruby
dnjaramba has joined #ruby
ryndor has joined #ruby
execute has joined #ruby
taapa has joined #ruby
taapa has quit [#ruby]
Myron has joined #ruby
Mechael has joined #ruby
Margueri has joined #ruby
Merat has joined #ruby
Presley has joined #ruby
Jenine has joined #ruby
Gregge has joined #ruby
Pierce has joined #ruby
<Myron> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Mechael> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Merat> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Margueri> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Presley> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Gregge> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Jenine> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Pierce> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<davidcelis> ...
dnjaramba has joined #ruby
spligak has joined #ruby
Nichael has joined #ruby
Agatha has joined #ruby
Jingbai has joined #ruby
Myrick has joined #ruby
Milner has joined #ruby
Barbra has joined #ruby
Christin has joined #ruby
Jayant has joined #ruby
Roxane has joined #ruby
Hotta has joined #ruby
Brandi has joined #ruby
Coleen has joined #ruby
Lorraine has joined #ruby
<Nichael> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Lorraine> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Brandi> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Milner> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Barbra> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Jingbai> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Myrick> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Christin> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Roxane> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<davidcelis> Really?
KindOne has joined #ruby
stephenjudkins has joined #ruby
execute_ has joined #ruby
nemesit has joined #ruby
KindOne has quit [#ruby]
Jackneill has joined #ruby
<spligak> I am attempting to remove duplicate chars from a string, and this seems to work well: http://pastie.org/3406743 -- but now what I'd like to do is as dupes are removed, append that interim result to an array. Having trouble making sure I'm writing polite Ruby while solving my problem :) Thoughts?
alex_x25 has joined #ruby
Alinnnn has joined #ruby
AiaRatat has joined #ruby
a3whut has joined #ruby
azn_chop has joined #ruby
Apph|s has joined #ruby
alexxx23 has joined #ruby
AvemPlac has joined #ruby
adinuutz has joined #ruby
Ad3varat has joined #ruby
[a-s]ani has joined #ruby
abelalot has joined #ruby
Al_TaU_D has joined #ruby
<Alinnnn> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<alex_x25> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<a3whut> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AiaRatat> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<azn_chop> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<adinuutz> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Apph|s> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AvemPlac> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<alexxx23> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Ad3varat> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<spligak> I guess I'd also like to know if I'm writing respectable ruby, too. Any pointers there would be great.
<davidcelis> Why this channel. Why.
<davidcelis> What do you mean interim result?
<davidcelis> can you be a bit more explicit/descriptive about what you want to do?
<spligak> Sure.
<spligak> Say we provide "ddderp" initially -- a single reduction would result in "dderp", which I'd like to save into an array, then continue and reduce further to "derp" and store that as well.
alloy` has joined #ruby
alyuoy has joined #ruby
ANCA_29 has joined #ruby
Antipati has joined #ruby
agent008 has joined #ruby
aex_x25x has joined #ruby
annusha has joined #ruby
AuAteriz has joined #ruby
Andreea} has joined #ruby
<alloy`> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<alyuoy> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<ANCA_29> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<agent008> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AuAteriz> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
ayzza has joined #ruby
<ayzza> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<spligak> Oh, my. This happen often?
tatsuya_o has joined #ruby
<davidcelis> ohhhh my fucking. god.
<davidcelis> nope
<davidcelis> i cant really think of a pretty way to do what you want
<davidcelis> i'd say what you're doing now is probably as close to that as you'd get
<spligak> Without saving the interim result, how does the code look thus far?
<davidcelis> without saving the interim result?
<spligak> right, just as-is
<davidcelis> "blahblahblah".split("").uniq.join("")
<davidcelis> would be better
<davidcelis> but obviously you wouldn't get any interim results
<davidcelis> you'd have to check each index against the next index
<davidcelis> which is what you're already doing in that loop
<davidcelis> well you seem to be checking the previous index
<davidcelis> which is odd
<looopy> lol
<spligak> Is it?
<startling> !ops
<davidcelis> yes
<davidcelis> looopy: hi
<davidcelis> did you know that 4000 jews did not go to work on sept. 11?
<davidcelis> I DIDN'T
alpacino has joined #ruby
Alexx_bu has joined #ruby
AirForce has joined #ruby
AnDr3Ea} has joined #ruby
axthrowe has joined #ruby
anotherd has joined #ruby
ady_no1 has joined #ruby
ady}{ has joined #ruby
arnold_l has joined #ruby
ashtarot has joined #ruby
Adi- has joined #ruby
Amenzi has joined #ruby
ayahuasc has joined #ruby
<alpacino> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Alexx_bu> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AirForce> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<axthrowe> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<ady_no1> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<ady}{> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<anotherd> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Adi-> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<arnold_l> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Amenzi> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<looopy> davidcelis: hey
<davidcelis> YOU DON'T SAY, SPAM BOTS!?
<startling> marienz: you there?
<looopy> davidcelis: i did! and the muslims didn't drive cabs in that area that day..
sevenseacat has joined #ruby
<spligak> So I've corrected the index I'm checking -- going to attempt to save off that result without resulting in an ungodly mess of a method here. Sec.
devlin has joined #ruby
<davidcelis> spligak: the index worked with what you were doing so far, but isn't good for saving those interim results, basically
architec has joined #ruby
andrea25 has joined #ruby
agassiz has joined #ruby
ALIN_22 has joined #ruby
AGeL34 has joined #ruby
`211` has joined #ruby
AlphaDud has joined #ruby
angel_4_ has joined #ruby
andr33a3 has joined #ruby
AlDraquL has joined #ruby
antonio1 has joined #ruby
<architec> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<andrea25> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
beernutty has joined #ruby
<agassiz> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<ALIN_22> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AGeL34> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<angel_4_> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<`211`> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AlphaDud> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<andr33a3> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<AlDraquL> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<antonio1> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<spligak> Right. I jive with that -- so thinking through this interim issue. I only care of something has been excluded, so I actually want to test for sameness in 2 consecutive chars and attempt to reconstruct the entire string (sans one of those chars) and append that to an array somewhere.
aasha has joined #ruby
<davidcelis> right
<spligak> I feel like I want to slice the string in place or something, and store a copy of it.
<spligak> Seems like that'd change the rest of what I was doing, with the whole each_index bit.
Ben64 has joined #ruby
<davidcelis> so if string[i] == string[i+1], interim_results << string[(i+1)..(i-1)]
<davidcelis> which is ugly
<davidcelis> but would work
<davidcelis> errr
<davidcelis> that last range is wrong
<spligak> str.slice!(i) wouldn't work?
<davidcelis> it'd have to go to the end
<spligak> oh
agboja has joined #ruby
astrozom has joined #ruby
Adynna_m has joined #ruby
arsator has joined #ruby
alexutza has joined #ruby
aleex24 has joined #ruby
<spligak> wait
ph^ has joined #ruby
<astrozom> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<Adynna_m> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<arsator> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<aleex24> http://www.jews.didw.tc/proof.php?evidence=4000 4,000 Jews Did Not Go To Work At WTC On Sept. 11
<davidcelis> string.slice(i) would give you a substring of one character
<spligak> Right, sorry. Does it modify str in-place though?
<spligak> So str would be what we'd want at that point?
<davidcelis> well
<davidcelis> you'd want str[i+1] to the end of str
eka has joined #ruby
atmosx has joined #ruby
akemrir has joined #ruby
krz has joined #ruby
jbhewitt has joined #ruby
senthil has joined #ruby
<spligak> In an each_char block (or an enumerator returned) - is there a way to reference the index of whatever you're stepping over in the block you provide? Some special local var, maybe?
<Mon_Ouie> each_with_index
<Hanmac1> spilgak whats your ruby version?
<Mon_Ouie> or just with_index (which is the same method)
<Hanmac> string.each_char.with_index {|char,index| ... }
<spligak> 1.9.3
<Hanmac> then i think my line should fit your request
maletor has joined #ruby
<shevy> sex with ruby
stephenjudkins has joined #ruby
<spligak> I don't like how this looks at all, but it does work sorta like I want: http://pastie.org/3406743 -- thoughts?
<spligak> Feels like there should be a more elegant way to do this?
looopy has joined #ruby
trivol has joined #ruby
rms-ict has joined #ruby
tvo has joined #ruby
tvo has joined #ruby
jbw_ has joined #ruby
<spligak> oh. you don't have to recurse here, I guess. you can just reset i=0 if you find a dupe and it'll start over.
<spligak> that seems a little wonky, but the result is legit
mayankkohaley has joined #ruby
<spligak> updated the pastie
Deele has joined #ruby
sat has joined #ruby
iocor has joined #ruby
sat has joined #ruby
arvindravi has joined #ruby
<Hanmac> hm .. spligak i have an idea for you .... "abbc".each_char.each_cons(2).with_index{|(a,b),i| p i if(a==b)} maybe you found it funny
araujo has joined #ruby
araujo has joined #ruby
execute__ has joined #ruby
execute__ has joined #ruby
<spligak> whoa.
mikepack has joined #ruby
<spligak> so, by each char - we're looking for 2 consecutive chars, looping over each with an index and... *head explodes* - let me fiddle with that last bit :)
<spligak> oh I see.
<spligak> hm.
yxhuvud has joined #ruby
<spligak> okay. so this can spew the first index of a duplicate pair, correct?
<spligak> that's how I'm reading it
araujo has joined #ruby
kreantos has joined #ruby
danishman has joined #ruby
execute has joined #ruby
etehtsea has joined #ruby
<Hanmac> spligak: i build an one-liner for you: "abbc".each_char.each_cons(2).with_index.with_object("abbc").map{|((a,b),i),o| (a==b) ? (o=o.clone;o[i]='';o) : nil }.compact
<Hanmac> hm but i tink this is better: "abbcdde".each_char.each_cons(2).with_index.with_object("abbcdde").map{|((a,b),i),o| (a==b) ? (o[i]='';o.clone) : nil }.compact
<spligak> both are really intense :)
<spligak> looking at those too
sacarlson has joined #ruby
Mekkis has joined #ruby
Squee-D has joined #ruby
Jrz has joined #ruby
<Squee-D> bit lazy web of me, but can anyone tell me how test::unit manages to define the construct: test "blah" do...end ?
<Squee-D> if i define a function that takes a param and block, i need to have a comma: test "blah", do..end
<Hanmac> spligak does the second line do what you want?
seanstickle has joined #ruby
adamjleonard has joined #ruby
arturaz has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
rms-ict has joined #ruby
dark3rdre4ms has joined #ruby
<spligak> Hanmac: I believe some variation of it will work really well -- I just can't see myself using something so dense in application code, ya know? I really, really appreciate the insight though. You all gave me some great ideas on how to handle it.
<spligak> Ruby one-liners are fascinating, truly.
stephenjudkins has joined #ruby
adambeynon has joined #ruby
jds has joined #ruby
<seanstickle> They have their place.
<seanstickle> Not quite as delightful as APL one liners
<seanstickle> But still
oposomme has joined #ruby
<burgestrand> Squee-D: no you don’t
<Squee-D> am i misremembering?
<burgestrand> Yup
<Squee-D> middle of the night and on anxiety meds so I can easily believe that :D
<burgestrand> In fact, you can’t have a comma like that it’ll syntax error on you
<Squee-D> oh i see
<Squee-D> i remember fine, im wrong about my own blocks
<burgestrand> You might misinterpret it for the block syntax using {}, where you’ll need parentheses
<Squee-D> and you are right
<burgestrand> test("hello") { puts "Hey" }
<Squee-D> and thats what happened when trying the ideas in IRB
<Squee-D> thanks
<burgestrand> :o
<Squee-D> you nailed it, it was using the braces for the block while testing, i wasn't comparing apples to apples
kirun has joined #ruby
spligak has quit [#ruby]
dark3rdre4ms has joined #ruby
trivol has joined #ruby
gianlucadv has joined #ruby
johndbritton has joined #ruby
<shevy> HE NAILED IT
<dark3rdre4ms> shevy: HOW?
Ben64 has quit ["Leaving"]
<shevy> by using his brain powah man
<dark3rdre4ms> good idea
<shevy> a block inside a block inside a block inside a block
<shevy> walking on a moebius strip!
<shevy> who needs haskell monads? ruby's blocks are a lot more fun
<dark3rdre4ms> ^^
<dark3rdre4ms> I've put blocks inside of blocks inside of blocks
<dark3rdre4ms> etc
<shevy> yay man!
<Hanmac> or combineing enumerators like a daisychain :P
fayimora has joined #ruby
trivol has joined #ruby
<shevy> hmm
<shevy> Enumerators walking inside blocks inside blocks of blocks around the moebius strip
marvin_ has joined #ruby
nemesit|osx has joined #ruby
Kambus has joined #ruby
trivol has joined #ruby
seitensei has joined #ruby
gartick has joined #ruby
QaDeS has joined #ruby
ChampS666 has joined #ruby
Eth4n has joined #ruby
erwanb has joined #ruby
ninor has joined #ruby
tayy has joined #ruby
<shevy> what is better ... foo.nil? or foo == nil
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<sevenseacat> i would use .nil?
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<Hanmac> .nil? should be faster
<shevy> yeah I prefer that too, I just came across old code of mine where I suddenly use "foo == nil" and it confused me
moted has joined #ruby
oposomme has joined #ruby
nari has joined #ruby
Foxandxss has joined #ruby
execute has joined #ruby
darthdeus has joined #ruby
Rounin has joined #ruby
<Rounin> Hello there! I'm wondering about the inability to add methods dynamically to Fixnum and certain other types... If I try class << 1 I get an error about singleton methods, right... But if I write class Fixnum explicitly, it works just fine
<Rounin> So technically, shouldn't it be trivial to add methods to those types as well? Just by trapping that singleton-whatever-error and detecting the type
<Hanmac> you can add methods to all fixnums but not to one alone#
<Rounin> Right... But I don't want that to begin with... That's Ruby saying that
remink has joined #ruby
phantomfakeBNC has joined #ruby
minh has joined #ruby
<Rounin> Ah! So the << object thing is just for adding class methods to a single object, Hanmac?
<Rounin> How about if I want to add a method to all objects of a certain class, but dont know or care about what type the object is
<Hanmac> yes, you can do it to all objects, except Fixnum and symbol
<minh> Hi there! Should one use '@foo' or just 'foo' when refering to instance-variables (_within_ their respective class)?
QaDeS has joined #ruby
<Rounin> So what if I want to add a method to all objects of the same class as an object, Hanmac? I know "class something.class" gives a syntax error
<Rounin> Maybe just class object, haha... Why limit oneself
<minh> Obviously my question in concerned with the _common idiom_ since '@foo' and 'foo' both will work from a technical perspective, right?
<Hanmac> do something.class.class_eval { }
<Rounin> Well, Object, anyway
<Rounin> Ah... Well, thanks a lot, Hanmac!
<Hanmac> minh, @foo is an instance_variable, and foo is an local variable
Helius has joined #ruby
<minh> Hanmac: Alright..but if there is no local variable named 'foo', then saying 'foo' will refer to the instance-variable '@foo', right? Personally, I feel more comfortable using '@foo' in every case (to make it explicit). As I'm very new to Ruby, I just wanted to know whether that is somewhat 'un-idiomatic' or not.
dark3rdre4ms has joined #ruby
<Hanmac> no, if local variable is not found, then it looks after a method named foo
<Hanmac> with is something an accessor for @foo if attr_accessor or attr_reader is used
<dark3rdre4ms> ^^
<minh> Hanmac: right, but my question was whether it is 'idiomatic' to use '@foo', no matter what (make it explicit). I've came across numerous books which omit the @ from time to time...Which way should I go? (again: I really more comfortable using the explicit @ even in cases where it _could_ be ommited)
<Hanmac> i would use @foo, it is more clean
<minh> Hanmac: alright, perfect! Thank you so much!!
<minh> Hanmac: well..one last question: If you have a file, which contains a certain ruby class 'Person' you would generally name that file 'person.rb', right? Is there a convention how to name a file that does contain the _module_ 'Person'? (I mean, is there a convention how to tell from the filename whether it's a class or a module?)
dark3rdre4ms has joined #ruby
<Hanmac> normaly no, sometimes i does not follow conventions
<minh> Hanmac: alright, so it's not uncommon that a file called 'person.rb' would either contain the _class_ 'Person' or the _module_ 'Person'
<minh> Hanmac: ?
ikaros has joined #ruby
<Hanmac> i prefer 'person.rb'
<minh> Hanmac: well...I just realized that my question was rather stupid, as modules generally are being defined in terms of _multiple_ files (due to the openness of modules), right?
<Hanmac> yeah i also use modules for namespacing
<minh> Hanmac: right now, I'm taking a quick look at the json-gem...
Deele has joined #ruby
<dark3rdre4ms> I've been playing with ruby-dbus
<dark3rdre4ms> I never realized the power of dbus until now
Talvino has joined #ruby
runeb has joined #ruby
fr0gprince_mac has joined #ruby
kreantos has joined #ruby
justinmcp has joined #ruby
bluOxigen has joined #ruby
rmorse has joined #ruby
fr0gprince_ has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
oposomme has joined #ruby
Sliker has joined #ruby
<shevy> dark3rdre4ms what power
<shevy> obscure syntax? no docu?
<dark3rdre4ms> there is a tiny bit of docs
<dark3rdre4ms> shevy: just enough
Foxandxss has joined #ruby
Nathandim has joined #ruby
berkes has joined #ruby
<shevy> ;(
<dark3rdre4ms> i love dbus though
<dark3rdre4ms> :|
<shevy> you could upload a bit code so that others can test the power of ruby-dbus?
<dark3rdre4ms> I never said ruby-dbus
<dark3rdre4ms> I said dbus in general
briankbuckley has joined #ruby
<shevy> lots of power
jds has joined #ruby
vraa has joined #ruby
hubub has joined #ruby
<Hanmac> what is the benefit when using dbus?
phantomfakeBNC has joined #ruby
glosoli has joined #ruby
<glosoli> Hey guys, what are packages used for ruby to make graphical interface ?
<oddmunds> shoes is one
<glosoli> oddmunds: Is there any designer for linux ?
<oddmunds> like a gui for making guis?
<glosoli> oddmunds: Yeah, like WYSIWYG For Shoes
<shevy> glosoli ruby-gtk
<oddmunds> i'm not sure, i don't know shoes
<glosoli> shevy: Ruby-gtk aint having designer too or does it ?
<arturaz> glae
<arturaz> glade
<glosoli> but glade is outdated and unstable as I heard, or I was misinformed ?
medik has joined #ruby
<shevy> glosoli it sucks even if it wouldn't
<shevy> using XML for layout is just terrible
<shevy> glosoli, I'd bite into the bullet and design via ruby-gtk without a designer tool
<glosoli> shevy: so you recommend writting everything by code ?
<shevy> well more or less yeah
<glosoli> shevy: What are ruby-gtk pros and cons agains shoes ?
<glosoli> against''
<shevy> you can combine things that you need into methods
<shevy> for instance I do
<shevy> _ = hbox
<shevy> no wait sorry
<shevy> _ = hbox(button1, button2)
<glosoli> in shoes you can't yes ?
<shevy> that does a horizontal box, with two buttons inside (which were defined earlier)
<shevy> no idea. I did not recommend shoes, you have to ask the guy who did
<shevy> ruby-gtk has an ok docu http://ruby-gnome2.sourceforge.jp/
hadees has joined #ruby
<glosoli> oddmunds: do you have any pros for Shoes against ruby-gtk ?
<oddmunds> nope
<oddmunds> as i said, i don't know shoes
<glosoli> aaa :)
<glosoli> shevy: are they any support for Gnome 3 ?
<glosoli> there''
emocake has joined #ruby
<shevy> glosoli it's currently worked on, see the forum interface of the mailing list
<emocake> shevy, a/s/l?
<shevy> ?
<Rounin> Hm... Ah, I have another one... I have an infinite sequence which yields values to a block, right... So how do I take n values from the infinite sequence?
<Rounin> A method which generates an infinite sequence
<Rounin> method.anything( ) gives a LocalJumpError, because there's no block... Do I put it inside the block, perhaps?
<Rounin> The actual code is diagonals {|a, b, c, d| puts a.to_s << "\t" + b.to_s << "\t" + c.to_s << "\t" + d.to_s}
<Rounin> It's executed an infinite number of times
porco has joined #ruby
zomgbie has joined #ruby
Morkel has joined #ruby
glosoli has joined #ruby
jamw has joined #ruby
Rounin has quit [#ruby]
luke-- has joined #ruby
CannedCorn has joined #ruby
<dark3rdre4ms> Those are GTK+ 3 bindings
<dark3rdre4ms> personally, I prefer Qt since it looks good everywhere
<glosoli> dark3rdre4ms: Why not Shoes ?
<dark3rdre4ms> I would if it was a gem.
<glosoli> dark3rdre4ms: Is Ruby Qt codes as long as Python having like PyQt4.QtGui.QPushButton?
<dark3rdre4ms> no
<glosoli> dark3rdre4ms: Would you mind writing the altrnative line for Ruby ?to that what I pasted ?
<dark3rdre4ms> plus, it has KDE bindings too
<dark3rdre4ms> glosoli: o.O
<dark3rdre4ms> what did you paste?
<arvindravi> hello all,so I have a String varialble myURL = ["http://www.google.com"], how do I remove the brackets and quotes from it and make it look like this myURL = http://www.google.com ? I'd appreciate any help!
<glosoli> dark3rdre4ms: "PyQt4.QtGui.QPushButton" for example how this would look like in Ruby ?
<dark3rdre4ms> Qt::PushButton("label", self)
<dark3rdre4ms> glosoli: ZetCode has a pretty decent tutorial on it
<glosoli> dark3rdre4ms:Is it hard to read text from multi line textbox ? or to restrict from entering numbers in multiline ?
<dark3rdre4ms> I dunno
<glosoli> dark3rdre4ms: And in btw, why it's so important for Shoes to be Gems ?
<dark3rdre4ms> glosoli: it would be nice for shoes to be a gem
<dark3rdre4ms> just for the sake of ruby
oposomme has joined #ruby
tatsuya_o has joined #ruby
glosoli has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
csavola has joined #ruby
iocor has joined #ruby
hukl has joined #ruby
stephenjudkins has joined #ruby
<glosoli> got problem can't install shoes on linux "./shoes-3.1.0.run: 1: eval: ./shoes: not found
<glosoli> "
<dark3rdre4ms> glosoli: run: chmod 755 shoes-3.1.*
<glosoli> dark3rdre4ms: I did chmod +x
<dark3rdre4ms> oh
|DM| has joined #ruby
<dark3rdre4ms> sh ./shoes*
<dark3rdre4ms> glosoli: what shell are you using?
<glosoli> hmm simple Terminal in Ubuntu
<dark3rdre4ms> so, bash
<glosoli> the problem consists
<dark3rdre4ms> let me try
<dark3rdre4ms> on my end
mengu_ has joined #ruby
mengu_ has joined #ruby
<dark3rdre4ms> glosoli: o.O
tayy has joined #ruby
<dark3rdre4ms> dunno
<glosoli> dark3rdre4ms: same problem huh ? :D
<dark3rdre4ms> thats odd
<glosoli> dark3rdre4ms: How nice ruby plays with MySql or Postre ?
<dark3rdre4ms> dunno
<dark3rdre4ms> SQLite is good
<glosoli> SQLite is for local apps
<glosoli> aint it ?
<dark3rdre4ms> um
<dark3rdre4ms> it could probably be used for networked apps
flimmern has joined #ruby
codefriar has joined #ruby
tvo has joined #ruby
tvo has joined #ruby
<glosoli> dark3rdre4ms: Ok, thanks for help :)
kidoz has joined #ruby
sat has joined #ruby
oposomme has joined #ruby
oposomme has joined #ruby
Keva161 has joined #ruby
samuelj has joined #ruby
ryndor has joined #ruby
<fayimora> pls is it reasonable to have a subclass of a class an inner class of its super class?
<samuelj> A library I'm working with requires that I pass it an IO stream - I'm comfortable passing an opened file, but how can I pass it the equivalent of stdout?
`brendan has joined #ruby
sacarlson has quit [#ruby]
rushed has joined #ruby
<samuelj> Does that make sense?
Jrz has joined #ruby
fr0gprince_mac has joined #ruby
ZenoArrow has joined #ruby
<canton7> samuel, pass it $stdout ?
danslo has joined #ruby
josephwilk has joined #ruby
<ZenoArrow> Hi, having real problems installing Ruby via RVM (I'm using Linux Mint). RVM is installed, and Ruby 1.9.3 is installed using it, but when I try to run ruby or irb, I get told I need to install Ruby via apt-get. Any ideas on how to fix this?
wenbert has joined #ruby
<arturaz> ZenoArrow, what shell?
<arturaz> try: rvm use 1.9.3
<ZenoArrow> arturaz: bash
<ZenoArrow> rvm use 1.9.3, ah yes that works, silly me! Is there a way to get ruby running without needing to enter this each time?
<arturaz> google: rvm set default ruby
<rushed> ZenoArrow: rvm use 1.9.3 --default
<ZenoArrow> thanks arturaz and rushed, that works now! One final nooby question, I'm trying to install gems and they're giving me errors. For example 'sudo gem install nokogiri' doesn't work. Is there anything I need to setup to get gem install support going?
<rushed> ZenoArrow: don't use sudo
<arturaz> sudo switches environment
wenbert has joined #ruby
<ZenoArrow> A gotcha, thank you both!
msuszczy has joined #ruby
<ZenoArrow> Got issues to get around as need to purge an old install of ruby gems, will read through documentation on how to do this...
etank has joined #ruby
Ownatik has joined #ruby
<rushed> ZenoArrow: rvm should isolate you from whatever is going on in your old install
trend has joined #ruby
<ZenoArrow> rushed, it should, but I'm getting the following error: "ERROR: While executing gem ... (Errno::EACCES)
<ZenoArrow> Permission denied - /home/tom/.gem/ruby/1.9.1/cache/nokogiri-1.5.0.gem"
<ZenoArrow> The 1.9.1 install was the one I installed via apt-get, I haven't installed 1.9.1 using rvm. Any ideas on what I can do?
gentz_ has joined #ruby
KL-7 has joined #ruby
<arturaz> sudo rm -rf ~/.gem
<arturaz> :)
si14 has joined #ruby
<arturaz> and 1.9.1 is ruby compatibility version, not actual ruby version
wenbert has joined #ruby
<arturaz> gems for rvm are put in ~/.rvm
<sevenseacat> rvm doesnt install gems in .gem
<arturaz> ~/.rvm/gems/
<ZenoArrow> Ah okay, well I tried sudo rm -rf ~/.gem , which executed without errors, attempting to install nokogiri still brings up the same error.
<ZenoArrow> Sorry about this! I really do appreciate the help I've had so far!
kreantos has joined #ruby
<flimmern> I can highly recommend using rbenv for ruby version management, and letting bundler take care of seperating gems
<arturaz> ZenoArrow, `which gem`
<arturaz> show the output
<sevenseacat> i hear mixed things about rbenv, whereas i know rvm works well
<ZenoArrow> arturaz, output of which gem is: /usr/bin/gem
<arturaz> rvm use 1.9.3 ;)
<arturaz> which gem
emocake has joined #ruby
<flimmern> sevenseacat: rbenv works very well for me, whereas rvm did not. I guess it's a matter of taste :)
<ZenoArrow> arturaz, output of rvm use 1.9.3 is "Using /usr/share/ruby-rvm/gems/ruby-1.9.3-p125" , output of which gem is the same.
<sevenseacat> flimmern: fair enough :)
<ZenoArrow> Same as before I mean, so it didn't make a difference.
<arturaz> Hm, weird...
<arturaz> echo your path
<ZenoArrow> It's quite frustrating! I'm at a hackday, I've got 3 hours to build something and I'm still setting up the tools!
<ZenoArrow> echo path?
<arturaz> echo $PATH
<arturaz> ZenoArrow, I've always thought that such events were unnecessary stressful ;)
<ZenoArrow> echo $PATH: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
linoj_ has joined #ruby
<ZenoArrow> arturaz, you're probably right! It's my first one, but I guess the stress is the same at them all!
<arturaz> arturas@zeus:~/work/spacegame/flex/src/utils$ echo $PATH
<arturaz> /home/arturas/.rvm/gems/jruby-1.6.6@nebulaserver/bin:/home/arturas/.rvm/gems/jruby-1.6.6@global/bin:/home/arturas/.rvm/rubies/jruby-1.6.6/bin:/home/arturas/.rvm/bin:/home/arturas/Software/phpfarm/inst/bin:/home/arturas/Software/android-sdk-linux_86/platform-tools/:/home/arturas/Software/android-sdk-linux_86/tools/:/home/arturas/bin/:/home/arturas/Software/flex_sdk_4.1.0.16076//bin:/home/arturas/Software/scala-2.9.1.final/bin:/bin:/home/arturas/bin:/usr
<arturaz> /local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/games
<arturaz> it looks like this for me :)
<arturaz> spot the difference?
<ZenoArrow> I do, yes! ; ) So what do I need to do to fix it? :-)
<arturaz> rvm should do that automatically :?
<arturaz> latest rvm version?
<ZenoArrow> Perhaps I didn't setup rvm properly.
xec has joined #ruby
<ZenoArrow> Output of rvm -v shows I'm using 1.10.2
<ZenoArrow> Is that the same version you had installed?
zomgbie has joined #ruby
diago has joined #ruby
<ZenoArrow> Perhaps I should use rvm implode and start again?
<sevenseacat> 1.10.2 is what i have
xec- has joined #ruby
robotmay has joined #ruby
Ownatik has joined #ruby
<ZenoArrow> Thanks sevenseacat. Okay, so I probably am running the latest version. I'll do rvm implode and start from scratch...
emocakes has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
nd___ has joined #ruby
<shevy> man arturaz that's a long PATH var
<arturaz> a bit :)
Sailias has joined #ruby
pen has joined #ruby
banseljaj has joined #ruby
kirun_ has joined #ruby
tayy has joined #ruby
eldariof has joined #ruby
punkrawkR has joined #ruby
<ZenoArrow> I created a RVM install script, but it seems to be taking forever to compile ruby-1.9.3-p125. Here's the script, anyone spot any errors in it? http://pastie.org/3408109
<sevenseacat> it does take a while
<ZenoArrow> Thanks sevenseacat, I'll just have to be patient!
<sevenseacat> :)
<Tasser> ZenoArrow, bash < <( curl -s https://rvm.beginrescueend.com/install/git ) # way to give a sysadmin back his religious feelings
savage- has joined #ruby
<banseljaj> ZenoArrow: A long while. :)
<Phlogistique> Tasser: at least it's using HTTPS!
<Phlogistique> some people do that with HTTP
<ZenoArrow> Okay, the script finally finished running. irb works, so that's good, but installing gems still doesn't work!! Dammit! I'm still getting told I don't have write permissions to the /var/lib/gems/1.9.1 directory, and the output of echo $PATH is the same as it was before. FML!
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<ZenoArrow> Tasser, I don't get it?!
<Tasser> ZenoArrow, ask Phlogistique
<ZenoArrow> Phlogistique, can you explain? :-)
<ZenoArrow> 145 minutes left to create a new website, I am f**cked!
<Phlogistique> ZenoArrow: It looks like a really good idea from a security perspective to execute an arbitrary script and actively make sure that there is absolutely no trace of what it did.
<Phlogistique> for exemple by piping curl directly into the interpreter.
pen has joined #ruby
<Phlogistique> If you can't read the script you just ran, it makes sure you don't feel like an idiot when you read the script and it actually installs a rootkit because it was replaced by a transparent proxy.
kstephens has joined #ruby
niklasb has joined #ruby
<Phlogistique> Also, it's better to run such scripts with maximum privilege; if you run them with few privilege, or worse, in a sandbox, the impact is lessened, which would be a very sad thing.
emocake has joined #ruby
<ZenoArrow> I sort of get it. To be honest, I just amended the bootstrap script from here (it's at the bottom of the page): http://beginrescueend.com/rvm/install/
fayimora has joined #ruby
<ZenoArrow> So I guess the RVM documentation might need to be updated?
<shevy> or removed
<ZenoArrow> At this moment in time, I'm reaching the point I may try rbenv instead, I do not understand what else I can try to fix RVM. Before I go through that, can anyone please point out what I can try to fix gem installations?
jwmann has joined #ruby
<arturaz> you could add to the path manually
<ZenoArrow> arturaz, you're right I could. Please understand I'm a noob here. What command to I need to enter to get the right paths setup?
<arturaz> export PATH="/some/dir:$PATH"
td123 has joined #ruby
waxjar has joined #ruby
<ZenoArrow> arturaz, yes, but which paths do I need?
<arturaz> bin of your ruby i guess
<ZenoArrow> Any way to find out where that is?
danibx has joined #ruby
<ZenoArrow> As I said before, I'm a noob!
<arturaz> ~/.rvm/rubies/ruby-1.9.3-p0/bin
<arturaz> replace -p0 with your actual patchlevel :)
<arturaz> ls ~/.rvm/rubies/ruby-1.9.3-*
<sevenseacat> i'm surprised rvm didnt set it up for you if you installed it right
<arturaz> perhaps a bug?
<arturaz> rvm get head
<arturaz> :)
MrGando has joined #ruby
<ZenoArrow> When I try rvm get head I get: /usr/bin/rvm: line 54: /usr/local/rvm/scripts/rvm: No such file or directory
<ZenoArrow> It just loops that output until I stop the process with Ctrl+Z.
<arturaz> try installing rvm as a local user
jds has joined #ruby
<ZenoArrow> sevenseacat, I'm surprised too. I got Ruby installed via RVM using Fedora, and it worked fine, but for some reason I'm having real issues here with Linux Mint.
wookiehangover has joined #ruby
<deryl> A) ZenoArrow don't attempt the "well you suck i'm going to use rbenv unless you solve my problem" with us. that 'tactic' doesn't work, and actually we're getting tired of it. B) rvm info and gist it, and show how you installed RVM in the first place
<deryl> Umm what do you mean you got ruby installvia via rvm using fedora?
<deryl> if you are using the ruby-rvm package, delte it
<deryl> we don't support it and the packaged versions of rvm are broken
seanstickle has joined #ruby
<deryl> if you're using OUR install process, what exactly did you do to install
<sevenseacat> lawl at installing a debian package D:
<sevenseacat> rvm or ruby from a debian package
<ZenoArrow> deryl, I'm not complaining about the help I've gotten here, I'm very grateful for it, but at the end of the day I just want a working Ruby install and I don't mind how I get it.
<deryl> sevenseacat: actually its not just debian.
<sevenseacat> that aint ever going to work
<deryl> ZenoArrow: then if you follow the instructions on the website to a T it will do exactly what you want. How do I know? *I* did the testing that wrote the docs, and *I* wrote the docs.
<deryl> so.. once again. what did you do, how did you do it, and what is it doing?
<ZenoArrow> deryl, regarding installing on Fedora, I mean that I used to run Fedora, and I used RVM successfully on that install. I'm now on Linux Mint.
<deryl> gist the *entirety* of what you did including commands ect.
<ZenoArrow> deryl, ah I see, you wrote the docs, that's cool.
<deryl> ZenoArrow: well you're using an edge distribution. not all distributions are 'equal'
<deryl> but, for the *very* last time..
<deryl> so.. once again. what did you do, how did you do it, and what is it doing?
<deryl> gist it
<ZenoArrow> In terms of what I did to install, this pastie shows the script I used: http://pastie.org/3408109
<sevenseacat> deryl: settle down :p
emocake has joined #ruby
<ZenoArrow> deryl, please point out the errors in the script, I'm not saying it was perfect, I just want to know where I'm going wrong.
<deryl> sevenseacat: umm, don't tell me to settle down, please. I know exactly what i;m doing here
<sevenseacat> deryl: i know, dood.
mikalv has joined #ruby
flimmern has joined #ruby
<sevenseacat> deryl: he's not shitting on all your work intentionally.
<shevy> so much hassle with RVM
<deryl> you're not doing this as root i sure hope
flimmern has quit [#ruby]
<deryl> shevy: 99% of it is PEBKAC
<shevy> in ancient days people used the source
<sevenseacat> the other 1% is OSX >_>
<ZenoArrow> deryl, no I didn't run the script as root.
<shevy> yeah deryl but that's almost always the case. I mean, people these days tend to sit in front of the computer 24/7, the next step will be a neural interface into the brain to replace the keyboard
<ZenoArrow> All I did was created the script, used chmod +x to make it executable, then ran it.
<deryl> ZenoArrow: then you have an /etc/profile.d/rvm.sh or /etc/rvmrc that exists that points $rvm_path to /usr/local/rvm or you already had an install in place and its picking it up, or something
<seanstickle> What's that user$ thing?
<shevy> sevenseacat did you know that they have homebrew written in ruby?
<deryl> because the installer, the rvm script itself, and other parts of it key off $rvm_path and that /usr/local/rvm stuff tells me you have that set already somewhere
<deryl> sevenseacat: simulated commandline status
<shevy> but due to their elitist nature it only works on osx
<sevenseacat> shevy: i did. i also know that it's still a pain in the ass to get ruby up and running, especially on lion
<shevy> they are like Apple cheerleaders
<deryl> shevy: actually i wouldn't complain for the neural interface :)
<ZenoArrow> deryl, thank you for your advice. What do you recommend I do next?
<deryl> shevy: in fact i'd volunteer to beta :)
<shevy> yeah deryl. If I could "type" faster and better with it, most definitely. I could produce more code in the same amount of time
<shevy> and when my hands hurt I could still spit out data from my brain
kevinbond has joined #ruby
<shevy> or if I lose my hands too :P
<deryl> ZenoArrow: I suggest you ensur eyou do not have rvm installed anywhere else, tear out what you already have (your mixing of locaitons will have screwed things up in the tracking files), and then you need to ensure you remove ALL RVM LOAD LINES from your .bash_profile, .bashrc, .profile, remove /etc/rvmrc /etc/profile.d/rvm.sh, and the /usr/local/rvm directory if you don't want that.
<deryl> then log out then back in and run: printenv | grep -i rvm
<deryl> make sure that NO rvm env vars still exist
<deryl> then AS A USER run the script one more time. also why are you using the rvm git package rather than your distrib's package? THAT should be under package management. NOT rvm
<deryl> especially since that is a PRErequisite for rvm
<sevenseacat> deryl: he just copied that part from a bootstrap script in the rvm docs.
<deryl> (that isn't a technical failing, i just don't see why you would use an untracked install of git since git gets updated
<deryl> )
<deryl> ahh mpapis must have put that one up.
<deryl> ok but ther est...
<deryl> err rest
<sevenseacat> bottom of the page -> http://beginrescueend.com/rvm/install/
* deryl pees on TimeMachine and how freakin slow it is to back up
Mohan_ has joined #ruby
<shevy> lol
<deryl> ahh i know why that was put there. that was for minimalistic users
<shevy> yay!
<shevy> lazy users!
<shevy> I like these the most
<deryl> i hate lazy users
<shajen> how can i add some days to my date in coffee script?
<shevy> coffee script ey
<shevy> use ruby man
<deryl> cause they get lazy and assume that means *I* have to be busy for them. not to mention then they give you attitude becuase THEY didn't read the docs or do any type of effort at all
* sevenseacat eats coffee
<deryl> *that* ticks me off. *that* makes me angry.
<shevy> 5 days in ruby ... Time.now + (24 * 60 * 60) * 5 # => Thu Feb 23 16:05:55 0000 2012
<shevy> deryl yeah understandable
<shevy> I try to pull the problem down to something that can be easily solved, otherwise I let others deal with it here :)
<shevy> I often avoid reading docs though ;P
emmanuelux has joined #ruby
<deryl> shevy: yeah but you don't go to the creator of the project or any of the main developers and tell them their shit's broken and busted without reading docs first right?
<shevy> haha
<deryl> i mean you DOO try to ensure you've done your homework
<shevy> not really
<ZenoArrow> deryl, okay, let me see if I have this right: 1. Clear out RVM entries from .bash_profile, .bash_rc, .profile
<ZenoArrow> 2. Remove /etc/rvmrc , /etc/profile.d/rvm.sh and /usr/local/rvm
<ZenoArrow> 3. Log out, log back in, run printenv | grep -i rvm , check no results
<shevy> but I prefer to ask people who use IRC + githubt here, that's a lot better IMO
<deryl> shevy: then yeah, i'd be yellin at ya ;)
<ZenoArrow> 4. Run my script again (removing the git section before, I can always install git separaely)
<ZenoArrow> 5. Success (hopefully!)
<shevy> *github
<sevenseacat> why do you need a script? its like three commands
<shevy> 6. Profit
<shevy> 7. Eat a cheeseburger
<deryl> ZenoArrow: between 2 and 2, make SURE yopu have NO RVM LOAD LINES in your .bashrc, .bash_profile, or .profile
<sevenseacat> the hard work is all done in rvm's installer script
<shevy> 3. << "kill kitten"
<sevenseacat> D:
<deryl> ZenoArrow: dude
<sevenseacat> not the kittens
<shajen> shevy: ic coffee script there is ho that function
<shevy> lol
<deryl> READ the troublehsooting page
<deryl> i GAVE yo guys a script to remove everything
<ZenoArrow> deryl, okay I'll look for that script, thanks.
<shevy> shajen, well, coffee script is just sugar around javascript, I would not know how to ask javascript for date... it seems like an incomplete language to me anyway, only popular because every browser is using it
<deryl> i mean please. just read the pages there. please? just once? come on you'll like it
<deryl> i mean it,r eally, please?
<ZenoArrow> deryl, I understand your frustration, but I can tell you, I have looked through that page.
<shevy> use the source man
waxjar has joined #ruby
<shevy> ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p357.tar.bz2
<shevy> LONG LIVE 1.8.7!!!
<Phlogistique> I never used RVM and I'm fine.
<deryl> ZenoArrow: then how is it you can't see the "How do I completely clean out all traces of RVM from my system, including for system wide installs?"
zomgbie has joined #ruby
<Phlogistique> (though I understand how it can be useful)
<shevy> Phlogistique I think the main problem starts when people stick to i.e. debian's ruby, then they want addons, then gems don't work, then they install RVM but also don't know what is going on. they kinda push behind what they should obtain in the first place (REAL KNOWLEDGE) and so they chase the rock (problem after problem after problem emerging for many of them)
<shevy> btw
<shevy> what ruby do you use Phlogistique? :)
dnjaramba has joined #ruby
<deryl> Phlogistique: not for *everyone* I understand. but it serves a purpose and we add pretty much whatever our userbase wants. rvm was first in the space and is very mature, so it *seems* to be bigger than what it really is.
<deryl> the biggest problem is people freakin overcomplicating the fuck out of everything :/
<Tasser> shevy, everyone's just meddling through, the difference is in the level ;-)
<deryl> Tasser++
<shevy> hehe
<shevy> wait until I learn nimrod !
<shevy> instant nirvana knowledge
<shevy> I think my brain is getting worse though, it takes me longer and longer to learn new things :(
<deryl> the biggest pet peeve i have is we live in a world of instant gratification, and its affected humans to the point they will do the *absolute minimum* and expect the *absolute most* and then get mad when they don't jhave it, or don't understand it, etc etc. Its supposed to be just dumped down their throats. like Knowledge-On-Demand
<Phlogistique> shevy: what's installed on my system by my package manager; I usually make a symlink or two so that the names for ruby 1.9 and ruby 1.8 are the same on my systems
<deryl> shevy: yeah i know that feeling. i'm 41 and i swear i learned shit a HELL of a lot faster when I was younger than I do now
<shevy> yeah
<seanstickle> I learn new things a hell of a lot faster these days than when I was younger
<seanstickle> More hooks to hang the information in.
<deryl> seanstickle: lol
<deryl> i like tht analogy
<shevy> well, I think it somehow depends in some ways, when I see a pattern, I try to fit it into my box and can learn it quickly... but take nimrod, the type system confuses my brain a lot
<Phlogistique> deryl: yeah I totally understand like the use of RVM when you have to host an app which needs a shitload of gems at a precise version
* deryl thinks he might calm a bit if he has a cig
<Phlogistique> and another app which needs another shitload of gems
<shevy> it's as if you stare at things and it just does not make "click"
<Phlogistique> and stuff
dagnachewa has joined #ruby
<deryl> Phlogistique: or do like I do and work with multiple versions of ruby and multiple versions of gems, and a huge matrix of those 2 things over and over in a day
<Phlogistique> yep
Jay_Levitt has joined #ruby
<deryl> rvm makes switching back and forth per project extremely simple, and isolates gems from other gems, rubies from other rubies, helps to crystalize and stabilize your environment whether development or production
<deryl> i'd go nuts if i didn't have rvm for the way i use rubies in a day. and then when i saw its worth i got involved in the project directly.
<seanstickle> No rvm would make me go crazy nuts
<deryl> heheh
<seanstickle> jruby, macruby, and matz ruby all in one day
<seanstickle> Would be a nightmare
<Tasser> I use rvm for jruby here, does its job
<Phlogistique> yeah, the thing is Ruby created an ecosystem where RVM has to exist
cashman has joined #ruby
<deryl> and while yes, i ama dev on the project, wayne, michal, and i will *all* tell you, no rvmisn't for everyone, and no you don't automatically *need* rvm *just* because you're working with ruby (like some zealots like to make it sound)
<seanstickle> I want to give money to rvm
<Phlogistique> and the fact that RVM exists contributes to this ecosystem
<seanstickle> And so I shall
<deryl> Phlogistique: exactly. and we do our bet to fulfil *that* neeed
<shevy> Phlogistique yeah, that is a nice realization
<shevy> it's a bit what I see with linux distributions - they create their own niche in the ecosystem, around their package managers
<seanstickle> Now, if only someone would make rperl
<seanstickle> So I can have 5.12 and 6 managed simply
ZenoArrow has quit [#ruby]
<Tasser> or python
<shevy> gosh
<shevy> the move to python 3 makes me angry
<shevy> I can't compile many things when it expects python < 3
<shevy> :(
<Phlogistique> yes; though at least Strings in python 3 are somewhat sane
<deryl> ok folks, gotta split. enjoyed the conversation. but i've an article due tomorrow and i'll be damned if i even have the outline completed hehe
chimkan has joined #ruby
<Phlogistique> have a good day
<deryl> you too
<ekaleidox> ubuntu seems to think i want gems 1.8 and not 1.9. how can i convince it to use 1.9.1?
<Tasser> shevy, some debian admins told me they had to rewrite scripts due to a minor ruby version...
Husel has joined #ruby
<shevy> hehe
<Tasser> shevy, their comment: "ruby is a nice language, but the ecosystem sucks"
<shevy> hmm
<shevy> they are not totally wrong here
<shevy> :)
<deryl> Tasser: was just gliding by the channel when i saw your comment. i hate to say it but debian brings MOST of its woes with ruby unto itself. the way they jack all the packages and split everything to hell and back as sub-dep packages.. its just stupid
<shevy> yup
Amirh has joined #ruby
<deryl> (another reason I left the Project several years ago. they couldn't get their asses out from around their heads)
<shevy> the blind man says the one-eyed man sucks ;)
<Tasser> what did I do...
<shevy> not you
<Tasser> shevy, I did feed the trolling ;-)
<shevy> you gotta keep the fire burning man
<shevy> and deryl has a LOT of that stuff inside!
<deryl> Tasser: and no you didn't do anything. was just commenting :)
<deryl> shevy: lol bite me ;)
<deryl> (just to help prove your case hehe)
<Amirh> We can use conditional structure in the beginning of a class definition and for example define a constant based on the condition. and it's all happening outside on any method. Is this only possible in Ruby? for example does Java support conditional structure outside a method?
<Tasser> shevy, trolling fire burns on everything
dnjaramba has joined #ruby
dibri has joined #ruby
<shevy> Amirh no real idea about whether java allows it... but I'd say java does not allow it
<Tasser> Amirh, the compiler has to understand it
<Phlogistique> ekaleidox: dunno, I'm pretty sure I have both on my ubuntu system
<Tasser> aka be able to execute it at compiletime
<Phlogistique> let me look into it
<Amirh> shevy: that's pure deconstruction in my opinion.
nemesit has joined #ruby
<ekaleidox> appreciate the help
<Phlogistique> no@neetwork ~ % which gem1.9.1
caiges has joined #ruby
<Phlogistique> /usr/bin/gem1.9.1
squidz has joined #ruby
<Phlogistique> it does look like it was installed by the distro
<seanstickle> I'm looking forward to the Cardinal project really taking off.
<Phlogistique> no@neetwork ~ % apt-file find /usr/bin/gem1.9.1
<Phlogistique> ruby1.9.1: /usr/bin/gem1.9.1
<seanstickle> Ruby on the Parrot VM!
<Phlogistique> ekaleidox: here you go
<deryl> Phlogistique: ekaleidox yeah you can have both onthe system at the same time. they make it gem|ruby18|19 packages and the bins the same name. to change to say 19 you hav eto use the update-alternatives system
<Tasser> seanstickle, ruby on the JVM does its job pretty well ;-)
<Phlogistique> ekaleidox: gem1.9.1 is in the ruby1.9.1 package
<deryl> or call then directly if you want to do it from say a script or something
<seanstickle> Tasser: the JVM is nice, but Parrot is niftier
<Phlogistique> (maybe they changed its name becayse it's *not* ruby 1.9.1, or maybe they didn't)
<shevy> isn't parrot like the 100 years project "perl 6 will soon be ready"
<ekaleidox> got it, perfect
<Phlogistique> ekaleidox: also you can use update-alternatives to choose which gem you want to use
<deryl> err didn't i just say that?
<squidz> does anybdy have a clue why ruby is printing out '-' as an a with an accent mark?
<Phlogistique> yes you did
<ekaleidox> how is update-alternatives accessed? sorry im a bit of a rookie
<Phlogistique> deryl: I was typing commands so I didn't look at what you said :) sorry
mayankkohaley_ has joined #ruby
<Phlogistique> ekaleidox: man update-alternatives :)
<deryl> ekaleidox: its been awhile even for me, I'd have to read man update-alternatives
<seanstickle> shevy: Parrot is the VM for one implementation of Perl 6.
<seanstickle> shevy: but it's a standalone dynamic VM project
<deryl> Phlogistique: speed typist ;)
<Phlogistique> ekaleidox: sudo update-alternatives --config gem
<Phlogistique> though...
<Phlogistique> it doesn't seem like gem1.9.1 is listed as an alternative
<Phlogistique> at least on my old ubuntu
<deryl> don't forget to change ruby as well so you don't try it with a ruby18
<Phlogistique> maybe it has been fixed on a more recent ubuntu
<deryl> Phlogistique: not sure. i think they stopped pushing 1.9.1 because it was so buggy
<ekaleidox> i caught that, thanks deryl and phlog
<Phlogistique> I'm stuck behind because of a Jabber server that I don't want to bother to update
<deryl> thats a total guess though
<Phlogistique> deryl: it's not actually 1.9.1
<Phlogistique> Debian and Ubuntu have the whole 1.9 series called 1.9.1 for some reason
<deryl> Phlogistique: i thought they had a 1.9.1 package and a 1.9 where 1.9 was 1.9.2
<Phlogistique> (if I got things right)
<deryl> i've been camped out for awhile on archlinux because the group i work with uses that the most, so I forgeet
<deryl> s/ee/e/
<Phlogistique> then again, my server is stalled on an old ubuntu
<squidz> wohoo archlinux
<deryl> osx lion for the desktop, arch for the servers
<Phlogistique> yeah, dunno how I got ruby 1.8 for arch, btw, I think I remember they don't have a package for it
blueadept has joined #ruby
<deryl> except the firewall. thats an ubuntu box but purposefully minimalistic
marvin_ has joined #ruby
marvin_ has joined #ruby
<dagnachewa> hi all
al3xnull has joined #ruby
mutewinter has joined #ruby
samsonjs has joined #ruby
virunga has joined #ruby
oposomme has joined #ruby
canton7 has joined #ruby
|DM| has joined #ruby
fayimora_ has joined #ruby
guillaum has joined #ruby
mxweas_ has joined #ruby
emmanuelux has joined #ruby
berkes has joined #ruby
chiel has joined #ruby
<chiel> hi guys, i want to set up a gemfile for my project, but i don't really know what versions my gems currently are. is there some command for that?
emmanuelux has joined #ruby
<deryl> gem search <gemname> -r
<td123> chiel: gem search
<chiel> ah okay, thank you :)
<deryl> also, bundler will create a Gemfile.lock which will store the versions you installed with bundle install
<chiel> ah
<deryl> which will start out at the most current version of the gems listed in Gemfile unless you specifically state a version in the Gemfile
<chiel> bundle install installs the stuff specified in the gemfile, I guess?
<chiel> hmm alright, yeah, I was planning to use -> to specify versins
<chiel> versions*
<deryl> see gembundler.com for the docs on bundler
<chiel> to ensure things will remain backwards-compatible
<chiel> yeah, was just looking at that. thanks :)
<deryl> np
nemesit|osx has joined #ruby
<chiel> if i haven't specified which gem source i want to use, does it simply default to http://rubygems.org?
iocor has joined #ruby
bstarek has joined #ruby
<chiel> anyone know the difference between the json and multi_json gems?
<Phlogistique> chiel: there is a json lib in the standard library
<Phlogistique> (no, I don't know)
<chiel> ah okay :)
<Phlogistique> that you can use like that:
<Phlogistique> require 'json'
<chiel> yeah, was just curious why i had a gem installed for it
<Phlogistique> JSON[a_json_string]
<chiel> but, apparently sprockets has it listed as a dependancy
<chiel> yeah, i've simply been using the .to_json methods
ikaros has joined #ruby
savage- has joined #ruby
<Amirh> does this create a singleton class-variable?   class << self
<Amirh>     attr_accessor :my_constant
<Amirh>   end
<Mon_Ouie> No
<Mon_Ouie> It creates two methods on the singleton class of self
oposomme has joined #ruby
Richmond has joined #ruby
<Mon_Ouie> my_constant and my_constant=, that name being quite weird since those methods are used to set access an instance variable
<Amirh> Mon_Ouie: those are singleton then?
<Mon_Ouie> The methods? Yes
<Amirh> thanks
<Phlogistique> btw, is there an idiom to create setters and getters for class variables?
<Amirh> attr_accessor?
<Phlogistique> Amirh: that's for instance variables
<Tasser> Phlogistique, cattr_accessor from active_support
<Tasser> Phlogistique, and why not use a constant?
<Phlogistique> Tasser: ok.
<Phlogistique> Tasser: because I don't want it to be constant, I suppose.
<Amirh> Phlogistique: look at my previous question above.
<Amirh> Phlogistique:
<Amirh>   class << self
<Amirh>     attr_accessor :my_constant
<Amirh>   end
<Amirh> it creates setter and getter for a class variable.
<Phlogistique> Amirh: that's an instance variable
<Mon_Ouie> No
<Phlogistique> of the singleton
<Amirh> no it's not
<Mon_Ouie> I mean Phlogistique is right
<Amirh> aHa
jetblack has joined #ruby
<Amirh> I really don't get it.
moshee has joined #ruby
moshee has joined #ruby
<Amirh> ok
tomzx has joined #ruby
rippa has joined #ruby
oposomme has joined #ruby
silky has joined #ruby
_|christian|_ has joined #ruby
Ownatik has joined #ruby
gokul has joined #ruby
samuelj_ has joined #ruby
<samuelj_> Hey guys, I have the following snippet, but I'm having difficulty getting my head around threads! I want to define a class that inherits from thread, so that when I create this class, it starts the thread running. However, when I instantiate the object, everything hangs! Like it's waiting for the thread to return or something. Am I missing anything? http://pastie.org/3408704 -- Thanks very much in advance!!!
davidpk has joined #ruby
<samuelj_> The thread is definitely starting, just nothing afterwards happens!
looopy has joined #ruby
<samuelj_> any suggestions anyone?
Ownatik has joined #ruby
trivol has joined #ruby
Knodi has joined #ruby
<Tasser> samuelj_, super(&:watch)
<samuelj_> thanks!
<samuelj_> Why is that?
<Tasser> ask someone else
Sailias has joined #ruby
chiel has quit [#ruby]
Mohan has joined #ruby
wroathe has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
zastaph has joined #ruby
<samuelj_> arm, ok. thanks though!
trivol_ has joined #ruby
v0yager has joined #ruby
BrianJ has joined #ruby
viuo has joined #ruby
headius has joined #ruby
npir has joined #ruby
incomprehensibly has joined #ruby
Mohan has joined #ruby
macmartine has joined #ruby
a_a_g has joined #ruby
speggey__ has joined #ruby
jds has joined #ruby
shtirlic has joined #ruby
maletor has joined #ruby
looopy has joined #ruby
Mohan has joined #ruby
pdtpatr1ck has joined #ruby
dhruvasagar has joined #ruby
adamjleonard has joined #ruby
CreativeEmbassy has joined #ruby
denysonique__ has joined #ruby
pu22l3r has joined #ruby
wroathe has joined #ruby
_|christian|__ has joined #ruby
_|christian|_ has joined #ruby
_|christian|_ has joined #ruby
codefriar has quit ["Linkinus - http://linkinus.com"]
thecreators_ has joined #ruby
v0yager_ has joined #ruby
remink_ has joined #ruby
remink_ has joined #ruby
ph^_ has joined #ruby
Azure|dc has joined #ruby
_kinderman has joined #ruby
milkshak1s has joined #ruby
robotmay_ has joined #ruby
robert___ has joined #ruby
colint_ has joined #ruby
luckman212_ has joined #ruby
Liothen_ has joined #ruby
<tayy> hi everyone.
pdtpatrick_ has joined #ruby
<tayy> i'm trying to do: Date.strptime('a', '%a, %d %b %Y %H:%M:%S %z')
amacgregor_ has joined #ruby
<tayy> with "Sat, 18 Feb 2012 16:17:30 GMT"
werdnativ_ has joined #ruby
<tayy> but i'm getting ArgumentError: invalid date
mrtheshadow has joined #ruby
Gekz_ has joined #ruby
<tayy> a being "Sat, 18 Feb 2012 16:17:30 GMT"
kstephens_ has joined #ruby
zastaph_ has joined #ruby
npir__ has joined #ruby
balgarath has joined #ruby
<seanstickle> Simple. Don't quote the a in strptime.
eregon_ has joined #ruby
<seanstickle> "a" is not a valid date.
ereslibre_laptop has joined #ruby
cb_ has joined #ruby
cHarNe2_ has joined #ruby
jshsu_1 has joined #ruby
somnium_ has joined #ruby
nwkr has joined #ruby
nw`_ has joined #ruby
xxi_ has joined #ruby
jbpros_ has joined #ruby
waxjar_ has joined #ruby
caveat-_ has joined #ruby
<tayy> seanstickle: but i'm trying to determine the datetime of a server from a HTTP header
Drakx_ has joined #ruby
S2kx has joined #ruby
Utkarsh has joined #ruby
epitron has joined #ruby
lorenzo has joined #ruby
Foxandxss has joined #ruby
Guest49438 has joined #ruby
cooper has joined #ruby
mattp_ has joined #ruby
danheberden has joined #ruby
omry_ has joined #ruby
d_roge has joined #ruby
samuelj has joined #ruby
ali_h has joined #ruby
ekaleido has joined #ruby
lobak has joined #ruby
johnduhart has joined #ruby
Schmidt has joined #ruby
nimred has joined #ruby
esmaxwill has joined #ruby
yugui_zzz has joined #ruby
crescendo has joined #ruby
epitron has joined #ruby
cooper has joined #ruby
crescendo has joined #ruby
aetaric has joined #ruby
chrismcgh has joined #ruby
mackid has joined #ruby
nimred has joined #ruby
sixteneighty has joined #ruby
linduxed has joined #ruby
silky has joined #ruby
si14 has joined #ruby
iouns has joined #ruby
dv310p3r has joined #ruby
_|christian|_ has joined #ruby
lavaman has joined #ruby
<seanstickle> tayy: that has nothing to do with anything
td123 has joined #ruby
MoMo has joined #ruby
scrogson has joined #ruby
<tayy> ahh.. ok i see it now!
<tayy> THANKS! :D
<seanstickle> Sure
dkannan has joined #ruby
<tayy> sry, new to coding
Nisstyre has joined #ruby
mythmon has joined #ruby
__class__ has joined #ruby
<hkhalid> hi
etank has joined #ruby
mephux has joined #ruby
affix has joined #ruby
hippyphysicist has joined #ruby
RichGuk has joined #ruby
sj26 has joined #ruby
danishman has joined #ruby
_root_ has joined #ruby
mikeycgto has joined #ruby
mikeycgto has joined #ruby
majoh has joined #ruby
mitchty has joined #ruby
dominikh has joined #ruby
stepnem has joined #ruby
apeiros_ has joined #ruby
Jck_true has joined #ruby
JStoker has joined #ruby
npir has joined #ruby
S1kx has joined #ruby
BrianE has joined #ruby
dnjaramba has joined #ruby
denysonique__ has joined #ruby
Sliker has joined #ruby
MetaCosm has joined #ruby
Amirh has joined #ruby
lohapuk has joined #ruby
yoklov has joined #ruby
<lohapuk> hi just wondering if anyone else can help when i run the following code http://pastebin.com/sQX75dQb
<lohapuk> i get the following warning (eval):1: Use RbConfig instead of obsolete and deprecated Config
<lohapuk> anyone got any ideas why
adamjleonard has joined #ruby
dnjaramba has joined #ruby
<lohapuk> or even if there is a nicer way of finding out all the classes that are a subclass of another
<shevy> lohapuk I think that is typical of the change to ruby 1.9.3x
hadees has joined #ruby
<lohapuk> shevy: so what is the new way of doing it in 1.9.3
ale` has joined #ruby
tommyvyo has joined #ruby
tommyvyo has joined #ruby
kirun has joined #ruby
dnjaramba has joined #ruby
<ale`> hi, can someone explain me why def f(x, options={}); puts [x,options]; end ; f (10, :asdf => 2) doesn't work while f (10) works? (please note the space between `f' and the open paren)
gen0cide_ has joined #ruby
<Phlogistique> ale`: because there is no space before the open paren for function calls in ruby
<Phlogistique> f (10, :asdf => 2) means f((10, :asdf => 2))
<Phlogistique> which also means f[3] is not the same as f [3]
<ale`> ahhh I see :-)
<ale`> thanks for the explanation
mlkarney has joined #ruby
dnjaramba has joined #ruby
<Phlogistique> (except f[3] seems to be the same as f [3])
<tayy> can someone help me out with regex? i can't seem to get this to work.
<tayy> the string is: [["Thursday 16 February"]]
fridim_ has joined #ruby
<tayy> i wanan remove the [[" "]]
<tayy> [a-zA-Z0-9\s] doesnt seem to work (but it works in rubular)
<tayy> (the / / at the start and end omitted. can't send msg with that in apparently)
wroathe has joined #ruby
jgrevich has joined #ruby
mlkarney has quit [#ruby]
<Phlogistique> tayy: /(?<=\[\[").+?(?>="]])/
<Phlogistique> or something like that
<Phlogistique> I have to check the syntax
emanu has joined #ruby
<Phlogistique> tayy: /(?<=\[\[").+?(?="\]\])/ should be better
<tayy> AWESOME! THANKS :D
<Phlogistique> or if you don't have 1.9, scan(/\[\["(.+)"\]\]/).flatten.first will give you what you want
Sliker has joined #ruby
kenperkins has joined #ruby
dnjaramba has joined #ruby
SamWhited has joined #ruby
swarley has joined #ruby
iband has joined #ruby
mxweas_ has joined #ruby
tatsuya__ has joined #ruby
18WABO2I9 has joined #ruby
ZachBeta has joined #ruby
DD1 has joined #ruby
ak0s has joined #ruby
nixmaniack has joined #ruby
matthias1 has joined #ruby
kenperkins has joined #ruby
minijupe has joined #ruby
workmad3 has joined #ruby
Mohan has joined #ruby
wroathe has joined #ruby
Nek has joined #ruby
<Nek> Hi
<Nek> I'm newbie with ruby
<Nek> I don't undersand all with ruby.
<Nek> For example at this moment I was trying to make a class
kushal has joined #ruby
<seitensei> hi nek
<kushal> .hrlp
<Nek> And use it in a terminal.
<Nek> How can I do that ? :/
<Nek> Hi seitensei :)
<seitensei> Did you use the tutorial?
kaneda has joined #ruby
<Nek> nop
minijupe has joined #ruby
<seitensei> What is your level of programming experience?
kidoz has joined #ruby
<Nek> I dev with cpp, php without any problem ^^
Mohan has joined #ruby
crankycoder has joined #ruby
kidoz has joined #ruby
dnjaramba has joined #ruby
glosoli has joined #ruby
jds has joined #ruby
davidpk has joined #ruby
friskd has joined #ruby
dnjaramba has joined #ruby
kinderman has joined #ruby
crankycoder has joined #ruby
sterNiX has joined #ruby
dnjaramba has joined #ruby
<linduxed> ok so i've got a problem
macabre has joined #ruby
bashdy has joined #ruby
<linduxed> i want to keep my step definitions for my cucumber featur DRY, but i don't know how
<linduxed> here's the feature file https://gist.github.com/1860645
fayimora has joined #ruby
<shevy> Nek you should write the class in a .rb file
<linduxed> and the step definitions are here https://gist.github.com/1860646
<shevy> Nek class Foo;def test;puts "hi from test";end;end; x = Foo.new; x.foo
<Nek> shevy my class is in a rb file
<shevy> save this into foo.rb, then call "ruby foo.rb"
<shevy> GOOD
<shevy> now you must call it
<linduxed> the problem is that when i run cucumber the last line (Then the total worth should be 700) fails
<shevy> you can use irb, or "ruby". I hope you are on linux :P
<linduxed> it instead gets "Total value: 500"
<Nek> I'm on windows.
<shevy> Nek use pastie.org
<shevy> awwww :(
<Nek> There is a difference ?
<shevy> windows is annoying
<linduxed> so my guess is that the Given /^I have mined (\d+) of that mineral$/ do |amount|
<Nek> haha
<shevy> but ruby works on windows too
<linduxed> is not actually saving
<linduxed> or something
<shevy> yeah, paste.org has nicer colours
td123 has joined #ruby
<Nek> okok if you want ^^
<linduxed> the point is that i thought that after @mineral was used for fill_in it could be filled with something else
<linduxed> or well i guess it can... but it looks like the "fill_in" part is cleared
dv_ has joined #ruby
<Nek> I can't use "require 'NekLogger'"
<Nek> Don't know why
<shevy> nonono
slippyd has joined #ruby
<shevy> (1) what is the name of the .rb file?
<Nek> NekLogger.rb
<Nek> I would like test in a shell, this is not possible ?
<shevy> ok, then, if you are in IRB, require 'NekLogger.rb' will work
<shevy> invoke irb
<Nek> ok
<shevy> I think its in C:\ruby\bin\irb.exe
robacarp_ has joined #ruby
<Nek> And in another file the dotrb is needed too ?
<shevy> or something like that
<shevy> windows sucks
<shevy> you can omit .rb
<shevy> ruby will find the file either way
<shevy> I like to keep .rb for local files
<shevy> in libraries, I omit it
dnjaramba has joined #ruby
<Nek> ok right.
<Nek> Thanks :)
<shevy> remember this part here:
<shevy> if __FILE__ == $PROGRAM_NAME
<shevy> it calls the file when you run it from the commandline (more or less)
<shevy> so you can use it it test it
<shevy> but if you use it in a library, that condition won't be true
<shevy> I use it for testing things quickly in .rb files
<shevy> you could write a second .rb file too
<shevy> content:
<shevy> require 'NekLogger.rb'
<shevy> hmm and then
<shevy> _ = NekLogger.new
<Nek> I hate that shit
<shevy> make a new class
davidpk has joined #ruby
Amirh has joined #ruby
<shevy> nono
<shevy> pastie.org
<shevy> not paste.org
<Nek> lol sorry
<shevy> ah
<shevy> try this:
<shevy> require './NekLogger.rb'
<shevy> if that does not work, we can try to append to the load path
<Nek> I look like it's okkkk
<Nek> It*
<Nek> I'm trying.
<shevy> $:.unshift File.dirname(__FILE__)
<Nek> Undefined method save.
<shevy> another error?
<Nek> I'm going to hate ruby :D
<shevy> can you show the full command at pastie.org
dv_ has joined #ruby
<shevy> I dont know what you are doing right now without context ;)
<glosoli> Are there any good manual for Shoes ? with detailed info ?
crankyco_ has joined #ruby
<Nek> shevy it was the simpliest command: log = NekLogger.new
<shevy> nonono
eldariof has joined #ruby
idletom has joined #ruby
<shevy> what did you do
banseljaj has joined #ruby
<shevy> log = NekLogger.new <-- this command WILL work IF you required the file before successfully
<shevy> so, you must not have required it properly.
eko has joined #ruby
wroathe has joined #ruby
nopper has joined #ruby
<Nek> shevy it seems that it was because I have a bad name on my save method
<Nek> I renamed to self.save and it's working
<Nek> What's the difference ?
<shevy> well ok if your black magic is working
<shevy> def self.save makes a class method
<shevy> class Foo
<shevy> def self.save
<shevy> Foo.save will now work
<shevy> otherwise, you'd have to tie it to an object
<shevy> foo = Foo.new
<shevy> foo.save
<shevy> you see?
<shevy> the .new part
<shevy> .new makes a new OBJECT
mrterribletech has joined #ruby
<Nek> hum
<Nek> I'm not sure
<shevy> you are sure now
<Nek> I'm going to make some test with this class ^^
<shevy> good
<Nek> oh
mrterribletech has quit [#ruby]
<Nek> shevy bad question but..
<Nek> How to make a "\n" ? :')
<friskd> whats a really good irc client for linux?
<Nek> friskd xchat ;)
<glosoli> friskd: I go for smuxi
<shevy> Nek what is that?
<shevy> Nek "your string with \n many \n inside \n"
diago has joined #ruby
<shevy> you make a "\n" by making... a "\n"
<shevy> :)))))
<Nek> of course
<shevy> I tend to do this usually:
<shevy> N = "\n"
<Nek> but I want to make many lines
<shevy> N = "\n"; N * 20 # => "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
<shevy> not sure where you have a problem
<linduxed> some pages ago i posted about some cucumber problem, but i've come to the conclusion that is HAS to be something that's got to do with whether fill_in is a persistent method
<Nek> I don't want just \n. I want a new line !
<friskd> Thanks guys!
<friskd> trying xchat. Looks simple.
<linduxed> and i mean persistent as in "i use fill_in, then i can move on to use it with some other variable and the previous one stays"
<friskd> also downloading xmuxi and the other, will try them all to see which ui i like
RomyRomy has joined #ruby
virunga has joined #ruby
chimkan_ has joined #ruby
tomzx has joined #ruby
<RomyRomy> Hello Rubyists…. I've always had a bit of difficulty trying to figure out how to learn / use Procs and Lambda… have there been some really lucid, awesome online tutorials/articles/videos that anyone here has seen and could recommend to me? Thank you.
<rippa> what exactly you don't understand?
zakwilson has joined #ruby
<shevy> Nek I do not understand what you want
<apeiros_> Nek: "\n" *is* a newline
<apeiros_> note that '\n' however is *not* a newline
<shevy> apieros!
<shevy> you are BACK!
<shevy> judofyr will be happy
nixmaniack has joined #ruby
<shevy> RomyRomy you can think of procs as objects without a real name
<Nek> apeiros_ shevy the windows shell disagree with you :D
<shevy> and you can .call to them
<shevy> Nek you must show code
<Nek> I'm trying in a file
<shevy> because I am sure the error is you, not the shell :P
<shevy> why dont you use pastie.org man
<rippa> without a real name?
<shevy> sure
<shevy> what is the name of a proc!!!
<apeiros_> Nek: then you're doing it wrong
<shevy> it's not joe, it's not fred!
muneeb has joined #ruby
<rippa> shevy: what is the name of a string?
<shevy> rippa foo!
<shevy> sometimes foobar if you append bar to foo
arctarus has joined #ruby
<shevy> usually I use _
<rippa> does a proc in the forest have a name if no one can see it?
<shevy> _ = ''; _ << 'bar'
<shevy> procs are the masters of the _
<shevy> I even do _._._
<shevy> but after a while it becomes a bit confusing
muneeb has joined #ruby
Mohan has joined #ruby
mayankkohaley has joined #ruby
<Nek> shevy thanks a lot :) .
<Nek> My famous logger is working !
<Nek> Let's make a websocket server x)
rms-ict has joined #ruby
Keva161 has joined #ruby
mikepack has joined #ruby
<shevy> good
iam has quit [#ruby]
nowthatsamatt has joined #ruby
nowthatsamatt has quit [#ruby]
dcarper has joined #ruby
glosoli has joined #ruby
hooper has joined #ruby
hukl has joined #ruby
dnjaramba_ has joined #ruby
emmanuelux has joined #ruby
Foxandxss has joined #ruby
Fretta has joined #ruby
trend has joined #ruby
workmad3 has joined #ruby
csavola has joined #ruby
crankycoder has joined #ruby
<tayy> another question :(
<tayy> why does it show up this way?
<tayy> ruby-1.9.2-p290 :013 > @f_places = @f_places.match(/[0-9]/)
<tayy> => #<MatchData "0">
<tayy> ruby-1.9.2-p290 :014 > @f_places == 0
<tayy> => false
<tayy> ruby-1.9.2-p290 :015 > @f_places == '0'
<tayy> => false
bluenemo has joined #ruby
bluenemo has joined #ruby
nightweaver_ has joined #ruby
<Nek> tayy use @f_place.to_s
<Nek> or @f_place.to_i
<Nek> ;)
<tayy> tried that. same result.
<tayy> .to_i gave NoMethodError: undefined method `to_i' for #<MatchData "0">
wroathe has joined #ruby
<Nek> shevy sorry but i have a new question. How to make a prompt with ruby ?
<rippa> tayy: @f_places[0] == '0'
<Nek> tayy in fact only to_a and to_s are available
<tayy> rippa: that worked! thanks.
<Nek> because MatchData can have many elements
<tayy> so MatchData is an array?
<Hanmac> no but it looks like one
rabbitear has joined #ruby
c__ has joined #ruby
banseljaj has joined #ruby
<shevy> Nek several ways
<shevy> if you have Readline library it is easiest
<shevy> otherwise, you can do
<shevy> loop { print @prompt; get_user_input }
netdog has joined #ruby
nightweaver_ has joined #ruby
eka has joined #ruby
fridim_ has joined #ruby
<Nek> shevy I tried with gets
<Nek> is it wrong ?
swarley has joined #ruby
<shevy> no gets is ok
<shevy> @user_input = gets.chomp
<shevy> case @user_input
<shevy> when 'q'
<shevy> exit
<shevy> end
<Nek> ok.
<Nek> I had a problem
<Nek> But it was not that
<Nek> x)
<Nek> I tried to make my first thread in ruby
<Nek> it was a big fail !
bier has joined #ruby
mxweas_ has joined #ruby
dhodgkin has joined #ruby
tommyblue has joined #ruby
<Nek> huhu
<Nek> No.
<Nek> It's working.
sterNiX has joined #ruby
<Nek> It was another problem.
<Nek> :D
<Nek> Just for threads, I looooove ruby
nyuszika7h has joined #ruby
dnjaramba has joined #ruby
dibri has joined #ruby
tatsuya_o has joined #ruby
<shevy> hmm
<shevy> Nek you have a strange way to go at things
<shevy> :\
<shevy> if you are already experienced though, I advice you do this:
<shevy> Nek: start here http://pine.fm/LearnToProgram/?Chapter=01 and work through it as quickly as possible once
baroquebobcat has joined #ruby
Paradox has joined #ruby
<Paradox> anyone here have any experience with mongomapper?
<Nek> shevy noway. I'm java/javascript/php/cpp developper
<Nek> x_x
<Fretta> what does this mean when installing a gem: ~>
nemesit has joined #ruby
<Paradox> specifically, i have a class that has the various mongomapper keys in it
<Nek> I already read some doc about ruby
<shevy> Nek isnt that damn confusing?
<Paradox> and i want to put some logic in this class that creates entries in the database, but also preforms some other tasks
<Fretta> what does this mean e.g. gem 'bcrypt-ruby', '~> 3.0.0'
<Paradox> the default way of doing this in mongo mapper is to just write your keys, then create an instance of the class with the keys passed to .create() as a hash
<Paradox> Fretta, use the bcrypt-ruby gem version 3.0.0
jergason has joined #ruby
<Paradox> but thats not practical for my needs, unfortunately
<banseljaj> Fretta: It probably means "approximately this version of gem"
<Nek> shevy what are you talking about ? o.o
<shevy> Nek to switch from language to language
<Fretta> Paradox banseljaj thanks
<Nek> shevy it is, but not too much ^^ .
<Paradox> "The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1. ~> 2.1 is identical to >= 2.1 and < 3.0. ~> 2.2.beta will match prerelease versions like 2.2.beta.12"
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
<Fretta> Paradox ah thank you :)
<banseljaj> Hmm. I need help with developing a GUI app for ruby. And I am still having trouble selecting the GUI toolkit
<Paradox> banseljaj, best thing to do: use webkit as a gui toolkit
<Paradox> lots of apps do that
<Paradox> Growl, Dashboard, Adium, Linkinus, etc
<banseljaj> I've never used Any GUI toolkit.
<banseljaj> and i need some way to help me visually design the UI first.
<banseljaj> Paradox: ^
<Paradox> what platform?
<banseljaj> Also, is there a problem with glade with ruby?
<Paradox> shoes seems to be the most popular
<banseljaj> i'm using linux
<Paradox> shoes is a nice clean DSL
<banseljaj> shoes is not working on my linux platform either.
<Paradox> what about wxruby?
<banseljaj> I'm on ubuntu 11.04
<banseljaj> Never tried it.
<banseljaj> i've done rails development, and ruby is my first language
<Paradox> well…
<Paradox> webkit is a html rendering engine
<Paradox> so…
startling has joined #ruby
<Paradox> if you can figure out a way to render a html view
<Paradox> then you can just css and html and js to make a view
<banseljaj> wxRuby looks promising
<Paradox> yeah
<Paradox> thing is…wxwidgets are UGLY
<Paradox> wish there was an interfacebuilder->ruby bridge
<Paradox> oh…
<Paradox> mac ruby does it
<banseljaj> But macruby isn't crossplatform.
<banseljaj> I think
dnjaramba has joined #ruby
<banseljaj> Paradox: that sounds ... difficult
wroathe_ has joined #ruby
<Paradox> meh, mac users have different standards for apps
<Paradox> they like them to look good and work well
<Paradox> the other platforms the first one isnt so much true
<Paradox> ah well
<Paradox> doesn't look like anyone here knows much about MongoMapper
<Paradox> thanks anyway
<Paradox> ciao
Paradox has quit [#ruby]
mattonrails has joined #ruby
<Hanmac> Paradox: do you have better indipent GUIs then wx?
minijupe has joined #ruby
<dark3rdre4ms> qtruby anyone
SamWhited has joined #ruby
wroathe has joined #ruby
Guest64125 has joined #ruby
CannedCorn has joined #ruby
<CannedCorn> hey guys if you have three functions that are essentially the same except for a couple lines between a begin->rescue should you make a new function that takes that section as a block or is it bad to yield between a begin->rescue?
igotnolegs has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
conor_ireland has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
jrist-afk has joined #ruby
<banseljaj> http://wxruby.rubyforge.org/wiki/wiki.pl?IntroductionToWxRuby -- is this normal? or has the page been defaced?
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
DrShoggoth has joined #ruby
Nathandim has joined #ruby
<Nek> What is better ? while condition code or loop { code break } ?
mxweas_ has joined #ruby
Guest___ has joined #ruby
<Hanmac> hm while is better, .. what is your break condition?
seanstickle has joined #ruby
Sigma00 has joined #ruby
macmartine has joined #ruby
stephenjudkins has joined #ruby
<apeiros_> to paraphrase my CS prof: if you break from your loop, you failed to formulate your loop condition properly.
<apeiros_> (and consequently, his own language doesn't even have anything like break for loops)
<seanstickle> Dijkstra would be proud.
<apeiros_> bertrand meyer too
<seanstickle> Can't reason about aberrant exiting loops
<apeiros_> we can. and the result should be what he said :)
<seanstickle> Ha
<apeiros_> one of the main arguments probably being an italian speciality.
swistak35 has joined #ruby
sjang has joined #ruby
hooper_ has joined #ruby
jordanstephens has joined #ruby
FlyingFoXy has joined #ruby
xec- has joined #ruby
warebec|hat has joined #ruby
ewag_ has joined #ruby
masterhumper has joined #ruby
Dezzimal_ has joined #ruby
pavelz_ has joined #ruby
`mx_ has joined #ruby
jeekl has joined #ruby
TheDeadSerious has joined #ruby
xoebus has joined #ruby
sontek has joined #ruby
looopy has joined #ruby
sontek has joined #ruby
sontek has quit [#ruby]
iocor has joined #ruby
colint_ has joined #ruby
heftig has joined #ruby
phantomfake has joined #ruby
Sailias has joined #ruby
mxweas_ has joined #ruby
nfluxx has joined #ruby
rushed has quit [#ruby]
simao has joined #ruby
_|christian|_ has joined #ruby
mahlon has joined #ruby
banseljaj has joined #ruby
havenn has joined #ruby
colint has joined #ruby
Azure|netbook has joined #ruby
zixiz has joined #ruby
saidin has joined #ruby
jds has joined #ruby
andrewhl has joined #ruby
dibri has joined #ruby
bhunt has joined #ruby
dnjaramba has joined #ruby
apeiros_ has joined #ruby
frontendloader has joined #ruby
bhunt has joined #ruby
mxweas_ has joined #ruby
minijupe has joined #ruby
dnjaramba has joined #ruby
acts_as_david has joined #ruby
kevinbond has joined #ruby
apeiros_ has joined #ruby
bhunt has joined #ruby
baniseterfiend` has joined #ruby
Azure has joined #ruby
dnjaramba has joined #ruby
Sliker has joined #ruby
briankbuckley has joined #ruby
apeiros_ has joined #ruby
mxweas_ has joined #ruby
dnjaramba has joined #ruby
adeponte has joined #ruby
enherit has joined #ruby
<linduxed> any reason for why i get "Could not find email_spec-1.0.0 in any of the sources" when i run bundle install?
* linduxed is using rbenv btw
<banseljaj> Anybody knwo what's wrong with shoes for linux binary?
btanaka has joined #ruby
jsick3 has joined #ruby
<jsick3> is it possible to pass a thor command line script an argument without an option (task name)?
dipix has joined #ruby
Ttech has joined #ruby
stephenjudkins has joined #ruby
apeiros_ has joined #ruby
<Nek> Hanmac sorry for no answer. My break is "break unless on != false"
mikepack has joined #ruby
raluxgaza has joined #ruby
<apeiros_> urgs
<banisterfiend> Nek: double negative..wtf
<apeiros_> that's a fugly condition
<apeiros_> break if on == false # <-- slightly better
<apeiros_> break unless on # <-- better
<apeiros_> and better yet: while on; …; end
raluxgaza has joined #ruby
ribayr has joined #ruby
silky has joined #ruby
ikaros has joined #ruby
Knodi has joined #ruby
Knodi has quit [#ruby]
Kn|t3_ has joined #ruby
<Kn|t3_> Hi
<Kn|t3_> I am trying to use rails.vim
<Kn|t3_> along with rvm
<apeiros_> Kn|t3_: you probably want #rubyonrails
<Kn|t3_> I get segmentation fault
<Kn|t3_> apeiros_: rite thanks
tatsuya_o has joined #ruby
mxweas_ has joined #ruby
ryannielson has joined #ruby
justfielding has joined #ruby
Jrz has joined #ruby
Kn|t3_ has joined #ruby
ChampS666 has joined #ruby
emocake has joined #ruby
dipix has joined #ruby
briankbuckley has joined #ruby
skaczor has joined #ruby
namidark has joined #ruby
banisterfiend has joined #ruby
adamjleonard has joined #ruby
jordanstephens_ has joined #ruby
workmad3 has joined #ruby
eeadc has joined #ruby
akem has joined #ruby
akem has joined #ruby
iocor has joined #ruby
<CannedCorn> hey guys, in 1.8.7 can you not check the raised exception's text?
<apeiros_> I can.
<apeiros_> why can't you?
<shevy> CannedCorn rescue Exception => error; pp error
dnjaramba has joined #ruby
senthil has joined #ruby
senthil has quit [#ruby]
senthil has joined #ruby
<CannedCorn> ah but you can't do assert_raise Error.new "blah"?
<CannedCorn> in test-unit
<apeiros_> since there's no class called 'Error', no, you can't.
lavaman has joined #ruby
<apeiros_> also, you might want to read the docs on assert_raise. iirc it works not quite like that.
<CannedCorn> well lets say i had a class called error
kirun_ has joined #ruby
<CannedCorn> assert_raise works just fine when you do that
<CannedCorn> it's actually pretty slick
<CannedCorn> but just doesn't work in 1.8.7
<apeiros_> now we have an *entirely* different question than what you initially asked
<apeiros_> 23:50 CannedCorn: hey guys, in 1.8.7 can you not check the raised exception's text?
<apeiros_> that question had like *nothing* to do with assert_raise.
<CannedCorn> umm
<CannedCorn> don't you check raised exceptions with assert_raise
<apeiros_> no
<apeiros_> assert_raise is a tool from unit testing
<apeiros_> you don't use it in normal code.
<CannedCorn> right, im doing unit testing
<CannedCorn> i should have said: when doing unit testing in 1.8.7 can you not check the raised exception's text?
incomprehensibly has joined #ruby
<apeiros_> you know, when you want help, you may want to give the relevant context…
<CannedCorn> sorry apeiros_
workmad3 has joined #ruby
<apeiros_> meh, no source_location in 1.8.7 :-S
<CannedCorn> I apologize, but is there a way to test the class and text of a given exception when unit testing in ruby 1.8.7
<apeiros_> and no absolute path in $"… teh suck
<banisterfiend> CannedCorn: just rescue it and check it there
idletom has joined #ruby
<banisterfiend> CannedCorn: begin; code_that_raises; rescue => ex; ex.message.should =~ /what you expect/; ex.is_a?(YourException).should == true; end or whatever
<CannedCorn> right...
<CannedCorn> the assert raise way seems much cleaner, and this seems lame when I'm using the test-unit gem that has the capability, it should essentially remove the dependency on 1.9 for that sort of thing no?
<apeiros_> assert_raise RuntimeError, "foo" do raise "foo" end
cespare has joined #ruby
<apeiros_> doesn't seem to check the message, though
<CannedCorn> yes
<apeiros_> ah, the last one is considered the message to display
<CannedCorn> it does if you say assert_raise RuntimeError.new "this barfed" do raise "this barfed" end though
<CannedCorn> but just not in 1.8.7
<apeiros_> you'll have to either build your own assertion (not that hard) or do what banisterfiend recommended
<CannedCorn> yah, ok
<CannedCorn> i'll do that, thanks guys
<CannedCorn> but what i don't get is that if i require 'test-unit' shouldn't test-unit assertions be ruby agnostic
<CannedCorn> seeing as it would be using the very same gem in both rubies
<apeiros_> I assume you mean you require 'test/unit'?
<CannedCorn> yes, whoops
<apeiros_> no
<CannedCorn> ok then
<apeiros_> puts $LOAD_PATH
c0rn has joined #ruby
<dominikh> not a gem but stdlib.
<apeiros_> compare on the different rubies.
<apeiros_> stdlib is part of ruby, and hence not ruby agnostic.
<apeiros_> if you use rvm, then neither are gems ruby agnostic.
<CannedCorn> then what if you did require 'rubygems' require 'test-unit'
<CannedCorn> i actually did mean test-unit
<CannedCorn> which is a gem
<apeiros_> do a `gem env` in your shell, change the ruby by rvm, then run `gem env` again.
<CannedCorn> not a library
<apeiros_> make sure you do actually load the gem then.
<apeiros_> stdlib/load_path has precedence over gems
<apeiros_> so if you do `require 'test/unit'` and something in stdlib/load_path fits, it'll be that which is being required. use the gem method to activate the gem.
<CannedCorn> so i should gem 'test-unit' then require 'test/unit' yeah?
<apeiros_> yes
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
conor_ireland has joined #ruby
dark3rdre4ms has joined #ruby
Kn|t3_ has joined #ruby
Whizzy has joined #ruby
norex has joined #ruby
danslo has joined #ruby
headius has joined #ruby
<RubyPanther> is there some new thing that is more active/relevant than the Ruby Reflector?
<RubyPanther> was everything there is to blog about Ruby already written by 2006?
snearch has joined #ruby
senthil has joined #ruby
<seanstickle> Ruby Inside, of course
<apeiros_> they wrote that ruby 1.9.3p125 was released in 2006? wow…
<apeiros_> nice troll, tho
Jay_Levitt has joined #ruby
waxjar has joined #ruby
justinmcp has joined #ruby
dnjaramba has joined #ruby
banisterfiend has joined #ruby
ryanf_ has joined #ruby
akem has joined #ruby
<RubyPanther> apeiros_: translation: "I don't know" lol
<apeiros_> translation: "on and on I troll"… lalala… /ignore RubyPanther
<RubyPanther> You don't actually need to use the /ignore command in order to stop trolling, you could also just not do it.
<RubyPanther> In any case, I'll just renew the question, is there anything that replaced the "Ruby Reflector" or is this really... it.
gen0cide_ has joined #ruby
<seanstickle> also Ruby Flow
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
dagnachewa has joined #ruby
swarley has joined #ruby
yoklov has joined #ruby
emocakes has joined #ruby
werdnativ has joined #ruby
hron84 has joined #ruby
<startling> are blocks not first-class?
<startling> and neither are functions?
<banisterfiend> startling: in wat sense
<startling> you can't pass them around or assign them names or return them, can you?
<matled> startling: sure. a = proc { ... }; b = self.method(:foo); return [a,b]
<banisterfiend> startling: in the case of blocks you just use procs instead
<CannedCorn> is the proper way to create a generator in ruby to use the generator class?
<CannedCorn> or is an enumerable also considered to be a generator?
<banisterfiend> blocks/procs are reallly two sides of the same coin, a block is just sugary syntax for proc when passed to a method
<CannedCorn> there must be some distinction right?
<banisterfiend> CannedCorn: you mean Enumerator?
<startling> matled: banisterfiend: ah, I didn't know about procs.
<CannedCorn> right, enumerator
<CannedCorn> startling: what about the difference between lambda's and procs
<banisterfiend> CannedCorn: Enumerator and generator are the same thing i guess: e = Enumerator.new { |y| (1..100).each { |v| y << v } }; e.next; e.next
<banisterfiend> startling: dont confuse him
<banisterfiend> :)
shevy has joined #ruby
<banisterfiend> CannedCorn* even
<startling> what are lambdas in ruby?
<swarley> startling, they are like procs
<swarley> except, using a return in a lambda returns from the lambda itself
<swarley> where as a proc would return from its scope of calling as well
<startling> oh, so they have their own scope?
<swarley> in a way
<banisterfiend> startling: no
<banisterfiend> it's just local vs non-local returns
<banisterfiend> but yeah they do have their own scope in the sense that a local defined inside a lambda is not accessible outside it
<banisterfiend> but they are also closures
<CannedCorn> banisterfiend are Enumerators and Generators the same internally though?
<startling> banisterfiend: that makes sense. thanks!
<banisterfiend> CannedCorn: They are all applications of fibers
<banisterfiend> CannedCorn: internally they're both fibers yeah, and when u say Generator what do u mean? whta class are you referring to?
<banisterfiend> CannedCorn: afaik a Generator class doesnt exist in 1.9
<banisterfiend> it was a 1.8 phenomenon
<banisterfiend> 1.9 just uses Enumerators
<CannedCorn> oh really
<CannedCorn> wow
<CannedCorn> ok
<swarley> any comments or ideas for improvement on this, i just made it to stall working on my real project http://pastie.org/3410945
<CannedCorn> yeah, you are right
<apeiros_> swarley: you reinvented openstruct?
<banisterfiend> swarley: isnt that like OpenStruct
<banisterfiend> hehe
<swarley> didnt know it exists lol
<swarley> just got bored
Sailias has joined #ruby
<apeiros_> also, I think nobody uses =begin/=end
<swarley> im just using it because i didnt know i could a few days ago
<swarley> just playing with it
<seanstickle> Sure they do.
<seanstickle> Along with __DATA__
<seanstickle> :P
<apeiros_> seanstickle: it's DATA
<seanstickle> I know
<seanstickle> That was me setting it off in IRC
<apeiros_> o0
ZachBeta has joined #ruby
<seanstickle> What? You mean your IRC doesn't have support for Markdown?
<swarley> i do enjoy a god old __FILE__
Foxandxss has joined #ruby
<swarley> xD
<apeiros_> seanstickle: no. and I hope that's not widespread. emoticons was bad enough.
<seanstickle> Ha
<apeiros_> smiling code… zomgponies!
<seanstickle> Trying to chat about APL is hard enough.
<seanstickle> Without IRC turning my APL code into smilies
<apeiros_> swarley: god old means as old as god? :)
ziggles has joined #ruby
<apeiros_> swarley: btw., DATA is from $0, not __FILE__