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/
ckrailo has joined #ruby
mikeric has joined #ruby
Knodi has joined #ruby
emocake has joined #ruby
_obiJuan has quit [#ruby]
_obiJuan has joined #ruby
yekta has joined #ruby
milkpost_ has joined #ruby
jbhewitt has joined #ruby
Russell^^ has quit [#ruby]
snip_it has joined #ruby
Knodi has quit [#ruby]
Sailias has joined #ruby
jergason has joined #ruby
h4mz1d has joined #ruby
stephans has joined #ruby
Husio has joined #ruby
fayimora_ has joined #ruby
adeponte has joined #ruby
randym has joined #ruby
al3xnull has joined #ruby
CreativeEmbassy has joined #ruby
adeponte has joined #ruby
RedWar has joined #ruby
danielpcox has joined #ruby
davidcelis has joined #ruby
Foxandxss has joined #ruby
headius has joined #ruby
wroathe has joined #ruby
dotnull has joined #ruby
etank has joined #ruby
heftig has joined #ruby
havenn has joined #ruby
peterhil has joined #ruby
Aaaarg has joined #ruby
fayimora has joined #ruby
mikepack has joined #ruby
thoradam has joined #ruby
popsch has joined #ruby
<yoklov> So wait.
<yoklov> Why does ruby have separate classes for Time, DateTime, and Date?
tobyo has joined #ruby
<yoklov> That's quite straightforward.
<yoklov> thanks
seanstickle has joined #ruby
al3xnull has joined #ruby
snip_it has joined #ruby
fayimora has joined #ruby
kinderman has joined #ruby
looopy has joined #ruby
a215 has joined #ruby
<a215> what's the method to ask "is bla in array foo"
<danielpcox> foo.include?(bla)
jergason has joined #ruby
enherit has joined #ruby
DuoSRX has joined #ruby
bstarek has joined #ruby
stringoO has joined #ruby
macmartine has joined #ruby
denom has joined #ruby
sythe_ has joined #ruby
seitensei has joined #ruby
Jooka has joined #ruby
pdtpatr1ck has joined #ruby
liluo has joined #ruby
chimkan__ has joined #ruby
incomprehensibly has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
mattonrails has joined #ruby
nari has joined #ruby
DrShoggoth has joined #ruby
Knodi has joined #ruby
shadoi has joined #ruby
ezkl has joined #ruby
pvh has joined #ruby
wroathe has joined #ruby
_obiJuan has joined #ruby
_obiJuan has quit [#ruby]
wroathe has joined #ruby
pu22l3r has joined #ruby
indstry has joined #ruby
yan_ has quit [#ruby]
milkpost_ has joined #ruby
seivan has joined #ruby
_|christian|_ has joined #ruby
_|christian|_ has joined #ruby
seivan_ has joined #ruby
shtirlic has joined #ruby
kenperkins has joined #ruby
samsonjs_ has joined #ruby
RomyRomy has joined #ruby
seivan has joined #ruby
rushed has joined #ruby
td123 has joined #ruby
sdwrage has joined #ruby
thebope has joined #ruby
replore has joined #ruby
excel542 has joined #ruby
albemuth has joined #ruby
davidcelis has joined #ruby
noyb_ has joined #ruby
DuoSRX has joined #ruby
ieo has joined #ruby
looopy has joined #ruby
Hanmac1 has joined #ruby
crankycoder has joined #ruby
bier has joined #ruby
IceD^ has joined #ruby
<IceD^> I have some gems list and I want to expand them into full list (with deps) just like bundler do Gemfile -> Gemfile.lock but programmatically
Jooka has joined #ruby
<snip_it> IceD^: look how bundler does it?
<IceD^> snip_it, weird code there
<snip_it> ha
<banisterfiend> IceD^: use the rubygems api
<IceD^> banisterfiend, it doesn't have it
<banisterfiend> IceD^: doenst' have what?
<IceD^> necessary api
<banisterfiend> IceD^: are you 100% sure?
<IceD^> let me show you want I want
Fezzler has joined #ruby
<IceD^> say, I have gems foo-1.0, foo-2.0 and bar-1.0 installed. bar-1.0 depends on foo <1.1
<IceD^> I have following reqs - [gem('foo', '>= 0'), gem('bar', '>= 0')]
waxjar has joined #ruby
<IceD^> I want to have back array with [gem('foo', '>= 0,< 1.1'), gem('bar', '>= 0')]
pu22l3r has joined #ruby
samsonjs has joined #ruby
<banisterfiend> IceD^: doesnt bundler itself have an api for this
dipix has joined #ruby
<IceD^> banisterfiend, can't find any official api link - assume api isn't public and subject to change
<banisterfiend> IceD^: why dont you ask them? before you reinvent the wheel
<IceD^> asked already ;]
<banisterfiend> IceD^: and they said?
<IceD^> I reallly, really don't want new wheel over here
<IceD^> nothing yet, but according to my experience it's always better to ask in more "general" source as well
CannedCorn has joined #ruby
kenperkins has joined #ruby
stephenjudkins has joined #ruby
ceej has joined #ruby
waxjar has joined #ruby
iamjarvo has joined #ruby
zach__ has joined #ruby
<IceD^> but I have feeling I'll end up writing lib for that
dv310p3r has joined #ruby
philcrissman has joined #ruby
<khem_> anybody knows what's wrong with this?
<IceD^> khem_, it writes all clearly
<ged> IceD^: pry(main)> Gem::Specification.find {|spec| spec.name == 'rspec' }.dependencies.map( &:to_s )
<ged> => ["rspec-core (~> 2.8.0)", "rspec-expectations (~> 2.8.0)", "rspec-mocks (~> 2.8.0)"]
<IceD^> ged, yes, of course
RomyRomy has joined #ruby
<ged> It won't do the dependency-mapping for you, but there are graph libraries for that.
<IceD^> there is also .find_all_by_name
Knodi has joined #ruby
friskd has joined #ruby
<IceD^> I wrote https://gist.github.com/1873325 this baby even
epochwolf|2 has joined #ruby
<IceD^> and it works good enough for 99% cases (which was good enough for us) but now I want to cover all 100%
carlyle has joined #ruby
Guest34256 has joined #ruby
alexparker has joined #ruby
<khem_> IceD^: Yes, but I don't know how to resolve the dependency problem.
Nathandim has joined #ruby
<IceD^> khem_, simplies way - uninstall rack-1.4.1
<alexparker> greetings
startling has joined #ruby
al3xnull has joined #ruby
liluo has joined #ruby
<Shin-LaC> if I raise an exception, catch it, and raise it again, does the backtrace "point" to the original raise, or to the reraise?
<Shin-LaC> ok, it seems to point to the original location
metalbot has joined #ruby
radic_ has joined #ruby
c0rn has joined #ruby
<khem_> IceD^: gem uninstall rack -v '1.4.1' ?
<IceD^> yeah
<IceD^> actually, I hate gems SO much, I don't resolve such conflicts
<IceD^> I just delete / recreate gemset and run bundle (which in 99% of cases solves the problem)
<IceD^> hate gems -> hate rubygems
<khem_> yeah, real gems aren't too bad. if you own them ;)
<khem_> It seems common with conflicting versions / dependency problems when using Ruby gems.
<IceD^> rubygems is curse on ruby world
<khem_> It seems nicer than CPAN that I used for Perl, even though more complex and easier to break.
banisterfiend has joined #ruby
<IceD^> I hate perl, I do really, really hate perl and all madness it brought to world, but compared to rubygems cpan is brilliant
<IceD^> I mean it - you always need both rvm with gemsets and bundler to be able to use rubygems
<khem_> :-)
incomprehensibly has joined #ruby
sterNiX has joined #ruby
cpruitt has joined #ruby
matthias_ has joined #ruby
caiges has joined #ruby
<banisterfiend> IceD^: yeah it would be good to fold those into rubygems itself
sleetdrop has joined #ruby
blueadept has joined #ruby
<IceD^> I'd vote for unfolding rubygems from this and replacing it by smth sane
<banisterfiend> IceD^: what dont u like about rubygems
<IceD^> everything :)
<IceD^> no proper dependency handling for start
<banisterfiend> apart from the fact it doesnt have gemsets and bundler's functiaonlity
<banisterfiend> IceD^: but i said apart from not having bundler's functionality
<IceD^> well - it tends to break things, built by bundler and rvm
dwwoelfel has joined #ruby
<IceD^> you have your precious gemset with gemfile
nyrb has joined #ruby
<IceD^> and you accidentially run gem update there
<IceD^> baaam
rohit has joined #ruby
dwwoelfel has quit [#ruby]
Sigma00 has joined #ruby
<IceD^> I actually end up removing `gem` from path
matthias2 has joined #ruby
<IceD^> alias gem=no
<IceD^> ahh yes, don't forget nice fact they break api here and there each few years
<banisterfiend> IceD^: s/each/every :)
<IceD^> :)
<banisterfiend> IceD^: hmm, interesting points
<IceD^> and I'm dealing with them in our product
v0yager has joined #ruby
<IceD^> basic idea - it packs your code and gems sends them to remote server and executes
igotnolegs has joined #ruby
<IceD^> https://github.com/iced/iron_worker_ruby_ng or this one (under heavy development)
pu22l3r has joined #ruby
bgupta has joined #ruby
pseud0cod3r has joined #ruby
Araxia has joined #ruby
bhunt has joined #ruby
gen0cide_ has joined #ruby
zixiz has joined #ruby
aces1up has joined #ruby
gokul has joined #ruby
bigkm has joined #ruby
chessguy has joined #ruby
Guest58739 has joined #ruby
CannedCorn has joined #ruby
iaj has joined #ruby
regedarek has joined #ruby
bob_f has joined #ruby
<a215> am i completely insane
sixteneighty has joined #ruby
<a215> or does ruby not let you do
<a215> if (blah == blay) && (foo = bar)
alanp has joined #ruby
jbpros has joined #ruby
rippa has joined #ruby
<epochwolf|air> a215: that should work
anoNxeRo has joined #ruby
cespare has joined #ruby
sythe has joined #ruby
ryanf has joined #ruby
thebope has joined #ruby
chimkan_ has joined #ruby
banister_ has joined #ruby
milkpost_ has joined #ruby
gianlucadv has joined #ruby
friskd has joined #ruby
ajsie has joined #ruby
ajsie_ has joined #ruby
chrxn has joined #ruby
<td123> a215: ruby does short circuiting
kenperkins has joined #ruby
<epochwolf|air> whoops, forgot about that.
<epochwolf|air> a215: foo is only set if (blah == blay) is true
ajsie has joined #ruby
ajsie has joined #ruby
ajsie has quit [#ruby]
anoNxeRo has joined #ruby
ElitestFX has joined #ruby
ElitestFX has joined #ruby
dootdoot has joined #ruby
stepnem has joined #ruby
ajsie_ has joined #ruby
<IceD^> a215, most famous side effect of that -- a ||= b
ed_hz_ has joined #ruby
nyrb has joined #ruby
nyrb_ has joined #ruby
Seisatsu has joined #ruby
bgupta has joined #ruby
hooper_ has joined #ruby
Kn|t3_ has joined #ruby
gouranga has joined #ruby
<gouranga> hello, I am just wondering, when creating a form such as <form action="">.... is the use of an empty action value a standard and reliable way to indicate the current page?
anoNxeRo has joined #ruby
<waxjar> it's not really a ruby question. but no, i don't think that would be a (semantically) correct way of doing that.
<gouranga> do you know what the correct way would be?
nfluxx has joined #ruby
<waxjar> actually put the correct url there?
Mekkis has joined #ruby
<RubyPanther> gouranga: I think you can omit the action
stenno_ has joined #ruby
<gouranga> waxjar: i want to avoid that, because the file will be included in multipile files, each which should point to itself.
<gouranga> RubyPanther: thank you, i will try that
anoNxeRo has joined #ruby
<waxjar> omitting might work yea, leaving it empty seems just weird (though that might work as well).
<gouranga> it does work on firefox, but there is no way i can test all browsers in a practical way :)
<ryanf> I have a feeling just putting action="." might be the standard way, but I'd want to look it up to be sure
rohit has quit ["Leaving"]
<RubyPanther> I don't remember doing that, but I remember leaving it out
mattonrails has joined #ruby
<gouranga> ryanf, "." seems to indicate the directory base, or "index.html", not the current page. at least in Firefox, that is how it is working for me
<ryanf> oh, interesting. I guess that makes sense
<ryanf> I'm used to working with pages that don't have extensions, so it might behave differently (or I'm just wrong)
zakwilson has joined #ruby
c0rn has joined #ruby
<RubyPanther> in the old days we had cgi scripts that didn't know their own name
Deele has joined #ruby
khakimov has joined #ruby
ckrailo has joined #ruby
<khakimov> hi. is anybody know how to puts only 10 last YAML from load_document (here is puts all YAML.load_documents(File.open("temp")) { |x| p "#{a['date']} - #{a['url']} #{a['description']} #{a['tags']}" })
guns has joined #ruby
adamjleonard has joined #ruby
gouranga has quit [#ruby]
philcrissman_ has joined #ruby
<guns> Is Hash#store threadsafe in MRI 1.9? I vaguely remember that concurrent hash insertion was problematic at some point.
anoNxeRo has joined #ruby
looopy has joined #ruby
idletom has joined #ruby
baroquebobcat has joined #ruby
<guns> Well, 100 threads mutating a single hash in a tight loop works just fine. I suppose this is the point of the GIL.
<heftig> guns: it's probably executed with the VM lock held, so you won't have any parallel execution anyway
<guns> heftig: So it seems. Thanks.
<banister_> heftig: sup heft
chimkan has joined #ruby
<heftig> banister_: i'm nocturnal
<banister_> heftig: oh it's very late/early in germany
gvt has joined #ruby
mikeric has joined #ruby
<guns> Interesting. The VM lock synchronization means that Hash[ary.map{}] is slightly faster than building a new hash in an ary.each{}
looopy has joined #ruby
JewMcBaggins has quit ["WeeChat 0.3.2"]
sterNiX has joined #ruby
looopy has joined #ruby
kerframil has joined #ruby
mxweas_ has joined #ruby
andrewhl has joined #ruby
btanaka has joined #ruby
Mekkis has joined #ruby
macmartine has joined #ruby
davidtspf has joined #ruby
davidtspf has joined #ruby
rramsden has joined #ruby
davidtspf has joined #ruby
nemesit has joined #ruby
csprite has joined #ruby
jwang has joined #ruby
18WABQPGE has joined #ruby
rdw200169 has joined #ruby
Eth4n has joined #ruby
Guest37701 has joined #ruby
madmax_ has joined #ruby
x0F_ has joined #ruby
stevefink has joined #ruby
<stevefink> Is there a tool out there that takes an existing directory (already laid out as a gem should be) and writes a gemspec for it?
havenn has joined #ruby
khakimov has joined #ruby
Indian has joined #ruby
JohnBat26 has joined #ruby
skipper has joined #ruby
Shin-LaC has joined #ruby
<banister_> stevefink: bundler
<banister_> hm
<banister_> stevefink: well the gemspec's generated by bundler are pretty general
musl has joined #ruby
adman65 has joined #ruby
<rippa> this is a pretty general
sdwrage has joined #ruby
utkobot has joined #ruby
djdb has joined #ruby
zomgbie has joined #ruby
stephenjudkins has joined #ruby
werdnativ has joined #ruby
<Shin-LaC> hmm
<Shin-LaC> this is weird
<Shin-LaC> hm, nm
akem has joined #ruby
akem has joined #ruby
<werdnativ> Is method name #call recommended, it's not a reserved word, right? I'm thinking of a way to inject a "translator" function, and make it work whether it's a class or a lambda...
<banister_> werdnativ: yeah thats standard practice
<rippa> duck typing ftw
<rdw200169> we all know that here, you should go to #java and say that, rile up some of those guys ;)
<werdnativ> cool, thanks.
musl has joined #ruby
musl has joined #ruby
musl has joined #ruby
your_nick has joined #ruby
libertyprime has joined #ruby
yxhuvud has joined #ruby
thone has joined #ruby
hukl has joined #ruby
tonini has joined #ruby
<werdnativ> I heart ruby sooo much. https://gist.github.com/1874478
aces23up has joined #ruby
krz has joined #ruby
havenn has joined #ruby
alek_b has joined #ruby
_kinderman has joined #ruby
scalebyte has joined #ruby
<werdnativ> is there a convention for pluralizing module names, e.g. MyModule::Adapters vs. MyModule::Adapter, strong opinions or don't care?
<werdnativ> (As a namespace for multiple classes if that's not obvious)
philcrissman_ has joined #ruby
musl has joined #ruby
wallerdev has joined #ruby
xxtjaxx has joined #ruby
xxtjaxx has joined #ruby
eighty4 has joined #ruby
philcris_ has joined #ruby
akem has joined #ruby
Indian has joined #ruby
madmax_ has joined #ruby
stephans has joined #ruby
Eth4n has joined #ruby
dhruvasagar_ has joined #ruby
philcrissman has joined #ruby
abstrusenick has joined #ruby
your_nick has joined #ruby
banseljaj has joined #ruby
QaDeS has joined #ruby
musl has joined #ruby
and1_ has joined #ruby
and1_ has quit [#ruby]
senny has joined #ruby
your_nick has joined #ruby
csherin has joined #ruby
ph^ has joined #ruby
chrxn has joined #ruby
tyman has joined #ruby
Morkel has joined #ruby
zommi has joined #ruby
mafolz has joined #ruby
KL-7 has joined #ruby
<scalebyte> Radar: need a help mate
virunga has joined #ruby
kstephens has joined #ruby
randym has joined #ruby
havenn_ has joined #ruby
dhruvasagar has joined #ruby
iocor has joined #ruby
bier has joined #ruby
jfelchner has joined #ruby
<banister_> anyone here have a deep knowledge of linking and LD_PRELOAD and friends?
sterNiX has joined #ruby
flippingbits has joined #ruby
briankbuckley has joined #ruby
pen has joined #ruby
Richmond has joined #ruby
Eth4n has joined #ruby
Spockz` has joined #ruby
<pen> :o
ttm has joined #ruby
fortysixandtwo has joined #ruby
p0y has joined #ruby
pi3r has joined #ruby
<p0y> how do you extract a gemspec from a .ge
<p0y> *.gem
Helius has joined #ruby
<cespare> p0y: gem specification thingy.gem
havenn has joined #ruby
jfelchner has joined #ruby
bluOxigen has joined #ruby
ukwiz has joined #ruby
evenix has joined #ruby
<evenix> hi all anyone can help me with this http://pastebin.com/vUqcWcGH ?
<scalebyte> can this be implemented in a better way since it gives me bug sometimes... https://gist.github.com/1875186
<evenix> I wasn't able to figure out exactly why my test is failling but the paste bin shows whats I've tried so far.
segora has joined #ruby
apeiros_ has joined #ruby
<scalebyte> apeiros_: can this be implemented in a better way since it gives me bug sometimes... https://gist.github.com/1875186
sterNiX has joined #ruby
<apeiros_> scalebyte: sorry, at work
Excureo has joined #ruby
banseljaj has joined #ruby
<scalebyte> RubyPanther: can this be implemented in a better way since it gives me bug sometimes... https://gist.github.com/1875186
<apeiros_> scalebyte: btw., why ask specific people? there's 591 people in the channel - just ask the channel…
arturaz has joined #ruby
<scalebyte> apeiros_: i asked the channel first so response... so.. and by the way if u remember we have interacted with each other b4 :)
<scalebyte> apeiros_: i asked the channel first no* response
Talvino has joined #ruby
iocor has joined #ruby
<RubyPanther> it is movie time, my gf would kick my butt if I looked at your code right now
Kangen_mks has joined #ruby
Kangen_mks has quit [#ruby]
imami has joined #ruby
<scalebyte> RubyPanther: this is something challenging since the code is behaving strange.. thought u liked challenging stuff.. atleast panthers do :)
Kangen_mks has joined #ruby
Kangen_mks has quit [#ruby]
iocor has joined #ruby
trivol has joined #ruby
<scalebyte> iocor: can this be implemented in a better way since it gives me bug sometimes... https://gist.github.com/1875186
Barzogh has joined #ruby
jlebrech has joined #ruby
cobragoat has joined #ruby
Shrink has joined #ruby
burgestrand has joined #ruby
<jlebrech> are there any ruby dsl's similar to the unix command 'ed'
trivol has joined #ruby
ephemerian has joined #ruby
davidpk has joined #ruby
Helius has joined #ruby
thone has joined #ruby
banseljaj has joined #ruby
Kambus has joined #ruby
theishi has joined #ruby
<shevy2> jlebrech what is ed doing?
eka has joined #ruby
<shevy2> I dont know one offhand though... you probably want to use ruby to modify text?
<jlebrech> it's a line editor, ie. edits line 20 and replaces one word with another for example
<shevy2> yeah probably no finished solution as-is
<jlebrech> i was thinking of building one
<jlebrech> a text editing dsl
<shevy2> dont forget to put it on github :)
<jlebrech> just making sure it doesn't already exist
<shevy2> the basics should be simple, load a file, modify the buffer, save the file, all in ruby
<jlebrech> with search and replace and snippet support
tayy has joined #ruby
nixmaniack has joined #ruby
<jlebrech> it'll be the first component of a meta text editor
nemesit has joined #ruby
<theishi> Can someone help me debug this please? I am trying to run a full screen ascii based game (dungeon crawl) and control input and output to the program. At the moment I cannot read from the buffer until the program exits. http://pastebin.com/5uR3Y9PY
david_w_sprysoft has joined #ruby
Ammar01 has joined #ruby
startling has joined #ruby
<scalebyte> shevy2: can this be implemented in a better way since it gives me bug sometimes... https://gist.github.com/1875186
gyre007 has joined #ruby
<shevy2> looks like rails madness
<shevy2> that madness is usually found in #rubyonrails
imami has joined #ruby
adambeynon has joined #ruby
johndbritton has joined #ruby
nik0 has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
havenn has joined #ruby
tvw has joined #ruby
BiHi has joined #ruby
<scalebyte> shevy2: this is less of rails and more of ruby code :)
* banister_ sets mode: +b scalebyte
<shevy2> dunno
<shevy2> I see a lot of complexity in that code
<shevy2> "named_scope in the model login_record"
<scalebyte> shevy2: yes
<shevy2> "model"... that word is typical rails propaganda
<shevy2> they are trying to javafy the ruby world
<scalebyte> shevy2: model in rails is nothing but class in ruby :)
<tayy> is there a way to set an operation to run at a certain time? (in sinatra)
<scalebyte> shevy2: y javafy? both ruby on rails and java differ completely dnt they ?
<Tasser> scalebyte, why should they?
<shevy2> java is famous for creating patterns on top of patterns on top of more patterns
<shevy2> and
<shevy2> it is always growing bigger. the more code you throw at it, the larger it gets
<shevy2> I remember a post by a game developer who stopped maintaining his old game in java when it reached 500k lines of code
<scalebyte> shevy2: Tasser i love java :)
<Tasser> scalebyte, I'm not sure if I do
<shevy2> and in conclusion he said that the amount of lines of code is a big problem
<shevy2> you always should strive to go to minimum amount of lines required to solve a particular problem, when that is doable
IceD^ has joined #ruby
<shevy2> if you look at the code at https://gist.github.com/1875186 you will see one big question:
<IceD^> https://gist.github.com/1875350 - back to my deps question
<shevy2> What is the problem there?
<IceD^> if you consider this normal, well
<Tasser> shevy2, reminds me of some project euler stuff with 300 char lines
<shevy2> hehe
<scalebyte> shevy2: Tasser ; https://gist.github.com/1875186 the count generated is always not corect... something wrong with query b/w dates selected
<shevy2> I am rewriting 10.000 lines of ruby code (including comments though)
<shevy2> yeah and have you given people enough data to solve that problem scalebyte ?
<shevy2> because I know with the available data I could not solve it
<shevy2> perhaps Tasser can, he is smart
<Tasser> scalebyte, why the variable assignment?
<shevy2> ruby 1.9.x will warn you with that I think
<Tasser> shevy2, blub
<shevy2> "unused variable login_count"
<scalebyte> Tasser: shevy2 i use ruby 1.8.
<shevy2> or will it just return? I am not sure
<shevy2> I do too
<shevy2> I just know because I am slowly porting my code to 1.9.x
<Tasser> 1.8? that's like ancient
<shevy2> and when I run with -w it shouts about unused variable names
jbw_ has joined #ruby
<shevy2> Tasser, yeah but all my encodings work nice in 1.8, 1.9.x chokes on my german umlauts when I insist on storing in non-UTF8 :(
<shevy2> (in yaml files)
<shevy2> (where apparantly yaml is only valid in UTF8 anyway, and another encoding, but syck didnt complain about it, and psych complains inconsistently)
<scalebyte> shevy2: Tasser : i work on rails essentially with ruby to build webapps but i always had the curiosity to know what ppl worked to develop with ruby alone
<scalebyte> something standalone?
<Tasser> scalebyte, I did a research project with jruby and lucene
<shevy2> yes
<shevy2> right now I am rewriting my build scripts in ruby
<Tasser> it's nice for glue code if you don't want all that boilerplate from java :-)
<shevy2> another project I have is to replace bash/zsh in ruby
<shevy2> and yet another project is a webframework
<Tasser> yet another one? :D
<shevy2> yup
<scalebyte> Tasser: shevy2 i always wanted to something system programming oriented or standalone kernel kind of challenging stuff u know unlike these webapps which doesnt intrigue me much
remink has joined #ruby
<scalebyte> shevy2: i need a job on ruby for some 10k $ pm :)
<shevy2> Tasser, I use it since about 7 years. The problem is ... to make it usable for other people, I'd have to improve documentation, add examples, more explanation etc.. etc.. and this is a lot of work, so I use it mostly for myself :\
<shevy2> hehe
remink has joined #ruby
rohit has joined #ruby
<scalebyte> shevy2: u r a girl :)
<pen> what do you guys think of rubinius?
<Tasser> scalebyte, and some english grammar?
<Tasser> pen, matz called it the "most promising alternative implementation of ruby"
<pen> is it better than mri?
<shevy2> pen dunno ... it goes on like forever. I was more interested in it years ago
<shevy2> it still has not 1.9.x support
<pen> oh
<scalebyte> Tasser: i have no idea what the hell are my mates talking abt !! lol
<shevy2> I still like matz ruby the most by far
<pen> you mean the 1.8.x?
<shevy2> either way, 1.8.x or 1.9.x. for me the matz ruby is the one matz is working on the most in his time :)
<shevy2> I guess he abandoned 1.8.x though ;(
<pen> but isn't 1.8.x slower?
<pen> that's why people upgrade to 1.9.x isn't it?
<rippa> pen: it is
<pen> but I saw this rubinius and I was wondering about the adoption rate or usage
odinswand has joined #ruby
<rippa> and rubinius doesn't have 1.9
<shevy2> pen ruby is always slow
<shevy2> I dont understand the "speed reason"
<pen> 1.9 is "faster"
<pen> not "the fastest"
<pen> and speed is important too isn't it?
<shevy2> really
<shevy2> we could use C
<shevy2> it's faster
<shevy2> it's the Lamborghini among programming language
<Eth4n> shevy2: you need to figure out if you want a interpreted language or a compiled.
<shevy2> I?
<shevy2> but I never used the speed argument!
<pen> looks like you don't understand the implication
<shevy2> oh sure
<shevy2> 1.9.x is faster than 1.8.x
<shevy2> use it
<drizz> the only reason people still use 1.8 is because they're hipsters
<drizz> nothing else
<pen> :D
<Eth4n> 1.9 is just better then 1.8
<Eth4n> drizz: :D
<Eth4n> I am so elite I use ruby legact
iocor has joined #ruby
<Eth4n> legacy*
tatsuya_o has joined #ruby
<shevy2> Eth4n no surprise. 1.8.x does not evolve anymore
visof has joined #ruby
etehtsea has joined #ruby
tvo has joined #ruby
Indian has joined #ruby
dju has joined #ruby
etehtsea_ has joined #ruby
<banister_> shevy2: a new version came out the other day ;)
<banister_> along with 1.9.3p125
<shevy2> yeah
<shevy2> oh wait
<banister_> there was a new patchlevel for 1.8.7
<shevy2> you mean 1.8.x?
<banister_> Yeah
etehtsea_ has joined #ruby
<shevy2> oh cool, didnt notice that... only noticed the new 1.9.x
iocor has joined #ruby
pp01bit has joined #ruby
<banister_> shevy2: fowl is in #pry right now
<shevy2> stat testrb
<shevy2> File: `testrb' -> `/etc/alternatives/testrb'
<shevy2> I hate debian
ZachBeta has joined #ruby
<shevy2> I removed /etc/alternatives in ultimate rage. but now when I did "make install" in the newly compiled ruby 1.8.x, it failed
<banister_> shevy2: join #pry and talk to him
<shevy2> ./instruby.rb:191:in `initialize': No such file or directory - /usr/bin/testrb (Errno::ENOENT)
<shevy2> because /usr/bin/testrb is a symlink which no longer exists
<shevy2> who the hell came up with this whole /etc/alternatives madness!
<shevy2> or version symlinked binaries... ruby -> ruby1.8
<shevy2> and of course a testrb1.8 also exists
<shevy2> wtf
<omry_> hi, I`m trying to use CGI::unescape and I get this : NoMethodError: undefined method `tr' for nil:NilClass
<omry_> /usr/lib/ruby/1.8/cgi.rb:352:in `unescape'
<omry_> any idea?
<shevy2> finally, it installed
<shevy2> ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
<shevy2> omry_ sounds as if you have a nil object
<omry_> shevy2, could be. checking. thanks
<shevy2> because with string objects it works
<shevy2> "abc".tr "b","c" # => "acc"
<shevy2> nil.tr "b","c" # => NoMethodError: undefined method `tr' for nil:NilClass
<shevy> btw I think CGI.unescape looks better than CGI::unescape
<scalebyte> thanks for the help !
<omry_> shevy, it does. I`m new to ruby. just copy pasted from some random example
<omry_> (CGI. )
<shevy> yeah always keep in mind that people do not always go to show the best example
tayy has joined #ruby
<shevy> I used to be very excited about metaprogramming
<shevy> I even used method_missing to delegate to another class when a method call was not found
<shevy> but that just sucked
virunga has joined #ruby
Mekkis has joined #ruby
<banisterfiend> shevy: are you ignoring fowl
<banisterfiend> scalebyte: java was designed so mediocre programmers could work together
zomgbie has joined #ruby
<scalebyte> banisterfiend: java is more stronger than ruby !!
<banisterfiend> scalebyte: that's not even grammatical ;)
<rohit> Define stronger in terms of a programming language
<scalebyte> java is more powerful than ruby as a language !!
<virunga> scalebyte, do you know what's meta-programming?
senny has joined #ruby
<kapowaz> is this the definitive mustache library for Ruby? https://github.com/defunkt/mustache — are there any competitors? is it as fast as it could be?
ikaros has joined #ruby
<kapowaz> in the JavaScript space there are quite a few competing implementations, so I'm curious to see if that's true in the Ruby world too
<banisterfiend> scalebyte: by 'more powerful' you mean it's faster?
<scalebyte> yes in terms of performance and scalability
<scalebyte> virunga: yes
<banisterfiend> scalebyte: performance has nothing to do with anything these days, you realize assembly and C are faster than java?
<banisterfiend> (well, depending on the application)
<pp01bit> what'
EddieS has joined #ruby
<pp01bit> wha's the point of comparing performance when it doesn't really count anymore
<banisterfiend> scalebyte: and when people talk about 'power', it's not really performance they mean. Lisp is considered to be powerful because you can define new language constructs using macros
kerframil has joined #ruby
<banisterfiend> scalebyte: but lisp is not as fast as C, yet most people would consider lisp more powerful than C
<scalebyte> banisterfiend: ryt
charnel has joined #ruby
<charnel> I need to increment 2 variables in a code block is there an easier or better looking way to do it ?
<banisterfiend> charnel: show what code you have already homie
<kapowaz> is this channel just for arguing about languages?
<kapowaz> or do people here actually do stuff with Ruby?
<kapowaz> also: see question above, which relates to practical usage.
<kapowaz> btw banisterfiend you realise that the widely-held belief about C and assembler being fastest is actually a myth?
shtirlic has joined #ruby
<kapowaz> I read a great article about it recently.
* kapowaz tries to find the URL
tyman has joined #ruby
<shevy> light is faster than assembly
<banisterfiend> kapowaz: i fail to believe that hand-coded assembly by an expert in the field, using cutting edge features that many compiler dont even use could be slower than 'java' or whatever language you're about to tell about ;)
mikepack has joined #ruby
Araxia has joined #ruby
<kapowaz> without any deeper knowledge, I'd tend to agree with you. But it turns out that isn't the case.
dhruvasagar has joined #ruby
<kapowaz> the performance advantage is negligible, and the cost of using a language like C makes it a worse overall choice.
Mekkis has joined #ruby
<banisterfiend> kapowaz: well then i'd suspect you read the article wrong, do you have a link?
<kapowaz> that was the conclusion it came to. I'm still trying to dig it out.
davidpk has joined #ruby
<banisterfiend> kapowaz: btw when i said C i meant C++ too, if what you're going to link to is just a C++ vs C argument ive heard them before and they're probably true
gvt has joined #ruby
eko has joined #ruby
eko has joined #ruby
mike has joined #ruby
<kapowaz> I can't actually remember if it was specifically talking about C or C++, but I think the crux of it was more to do with assembler, so it's not a flavour of C argument; it's a nature of the beast type thing.
ElderFain has joined #ruby
mxweas has joined #ruby
at5l has joined #ruby
zomgbie has joined #ruby
jhunter has joined #ruby
jwang has joined #ruby
soulcutter has joined #ruby
kerframil has joined #ruby
palcu has joined #ruby
<shevy> kapowaz you are like a prophet promising new lands man :(
<shevy> but there are two questions:
<shevy> - can you deliver?
<shevy> - will it blend?
<kapowaz> heh.
liluo has joined #ruby
<kapowaz> I can't find the link. I'm sorry.
<shevy> in case things fail, we have to blend you :>
<kapowaz> ANYWAY, can anyone answer my earlier question about mustache?
<shevy> I gots one
<shevy> unlike hipsters
gen0cide_ has joined #ruby
<Tasser> shevy, me trollin' you hatin'?
<banisterfiend> Tasser: hey
<banisterfiend> Tasser: have oyu used plymouth yet?
<Tasser> banisterfiend, does it work with jruby?
<banisterfiend> Tasser: no
<Tasser> I've used it => it does
<Tasser> banisterfiend, make a truth table and you'll know the answer ;-)
<banisterfiend> Tasser: why are you using jruby?
<Tasser> banisterfiend, because of lucene
<banisterfiend> Tasser: wat
<Tasser> ferret is kinda out of date and the guys were using java anyway
<Tasser> so what ^^
<Tasser> aaaaand you can parallelize stuff
<banisterfiend> Tasser: what kind of software are you writing?
<Tasser> banisterfiend, a research project
<banisterfiend> Tasser: that does what
<Tasser> banisterfiend, rank a given set of documents
randym has joined #ruby
<banisterfiend> Tasser: based on what criteria
<Tasser> ... and those guys don't have any freakking idea of html/http. The server broke net/http because of lacking response code and their format for table display in the browser is tab-separated -.-
wenbert has joined #ruby
tk__ has joined #ruby
<Tasser> banisterfiend, wherever it should be looked at, how important it is to the term.
<Tasser> banisterfiend, the documents were a set of abstracts of papers.
<banisterfiend> Tasser: and you look at keywords in the papers to work out importance?
mikekelly has joined #ruby
<Tasser> banisterfiend, yep. I already had the keywords recognized, which made stuff easier. Not all chemicals that sound similar are. If you use a standard analyzer, the results are kinda average
at5l has joined #ruby
<banisterfiend> Tasser: is htis for a university project?
Eth4n has joined #ruby
<Tasser> indeed
thisirs has joined #ruby
johndbritton has joined #ruby
ukwiz has joined #ruby
dhruvasagar has joined #ruby
<banisterfiend> hehe i was going to say, it sounds kind of impractical, well not so much impractical, but not of immediate use
<Tasser> :D
<banisterfiend> Tasser: but interesting, and you coudl learn a lot
<banisterfiend> which is the point
<Tasser> banisterfiend, I mostly learned what you can do with bare lucene and that I probably won't use that again... but I now know of SAX XML parsers :-)
berkes has joined #ruby
micheloc has joined #ruby
micheloc has quit [#ruby]
virunga has joined #ruby
tayy has joined #ruby
Foxandxss has joined #ruby
akemrir has joined #ruby
sterNiX has joined #ruby
<scalebyte> banisterfiend: so whats the deal with ruby now !!
<banisterfiend> scalebyte: ask an actual question
<shevy> scalebyte you must bring the problem down to a solvable level
tayy_ has joined #ruby
odinswand has joined #ruby
odinswand has joined #ruby
Eth4n has joined #ruby
RubyPanther has joined #ruby
<scalebyte> ok guys so here's my problem as in it's disintegrated form !! http://stackoverflow.com/questions/9376336/right-way-implement-this-namedscope-rails-2-1/9376443#9376443
odinswand has joined #ruby
odinswand has joined #ruby
waxjar has joined #ruby
<RubyPanther> rails 2.1 wtf
elliot__ has joined #ruby
<scalebyte> RubyPanther: yes bt i guess namedscopes are there in ruby too.. its got something to do with that
tayy has joined #ruby
<RubyPanther> if it doesn't even work, that takes away any argument not to upgrade it
ReTFEF has joined #ruby
nari has joined #ruby
rdw200169 has joined #ruby
briankbuckley has joined #ruby
Natch| has joined #ruby
<pen> rails 2.x
fridim_ has joined #ruby
<pen> is old
n25 has joined #ruby
ZachBeta has joined #ruby
akem has joined #ruby
david_w_sprysoft has joined #ruby
rizzy_ has joined #ruby
ReTFEF has joined #ruby
emocake has joined #ruby
IAD has joined #ruby
elliot98 has joined #ruby
<ukwiz> rvm won't co-operate! rvm use 1.9.3 gives: RVM is not a function, selecting rubies with 'rvm use ...' will not work.
sterNiX has joined #ruby
<heftig> ukwiz: source /path/to/rvm
<heftig> then try that again
<banisterfiend> heftig: have you slept yet
<heftig> no
<banisterfiend> wow, when do u sleep?
Eth4n has joined #ruby
rohit has joined #ruby
<heftig> hopefully, i won't nod off until evening
<banisterfiend> heftig: haha, why do u want to live a nocturnal life
<heftig> i don't
<heftig> it just happens :(
Debnet has joined #ruby
<Hanmac> because he can
Debnet has quit [#ruby]
<banisterfiend> heftig: dont u miss your lectures then? (i assume you're in college:P)
Shrink has joined #ruby
wenbert has joined #ruby
<heftig> banisterfiend: i seem to build up sleep deficit during the week and sleep a lot on the weekends
<heftig> which usually ends up with me not sleeping at all on the night from sunday to monday
<banisterfiend> heftig: it's def. an interesting world, i've done that too
workmad3 has joined #ruby
<ukwiz> heftig: what will that do?
<heftig> ukwiz: you're supposed to source rvm so it's in defined in your shell and can alter your environment
p0y has joined #ruby
<ukwiz> does that mean that I have to do that every time I want to use it?
stenno has joined #ruby
<heftig> yes
stenno has quit ["Leaving"]
<heftig> so stick the source command into your bash profile
<heftig> or bashrc
<hron84> someone asked me and I just interested... what is the difference between Benchmark.benchmark and Benchmark.realtime ? I am not too familiar with that stuff.
<ukwiz> I thought that was what the line [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" in my bash_profile was supposed to do
<heftig> indeed
lucios has joined #ruby
<ukwiz> so it gets me back to the original question - why doesn't rvm work
TaTonka has joined #ruby
<heftig> does that file exist and does it have a size > 0?
<lucios> lucios
lucios has quit [#ruby]
<ukwiz> yes and yes
<heftig> are you in a login shell?
<ukwiz> I am using yakuake terminal
<ukwiz> so yes, I suppose I am
<TaTonka> Hey, can anyone help me? I am requiring a file, but i get "no such file to load", even if i add the full absolute path…and i have no more ideas what to do.
<eka> TaTonka: that file is in the same folder?
<TaTonka> yes.
<TaTonka> a friend who cloned the git repo has no problems
senthilnayagam has joined #ruby
<eka> TaTonka: did you tried require_relative? what version of ruby you using?
<TaTonka> in detail: i am trying to use https://github.com/bmizerany/sinatra-activerecord. The rakefile requires both the app file, and the gem. The gem is no problem, but the app file.
<eka> TaTonka: what version of ruby?
<TaTonka> 1.9.2p290
<eka> TaTonka: did you try require_relative for the local file?
mengu has joined #ruby
<TaTonka> nope, i didn't know this existed. But i have tried it now, and it works.
<TaTonka> I assume ruby 1.9.2 needs require_relative when requiring a local file?
<eka> TaTonka: yes... ruby >= 1.9.2 AFAIK
<TaTonka> okay, i worked with 1.8.x for now, but i wanted to give 1.9.2 a try.
<TaTonka> thank you very much
e|f has joined #ruby
<eka> TaTonka: np
wenbert has joined #ruby
mdw has joined #ruby
<mdw> guys new to ruby
<mdw> but hmm
<mdw> I'm doing some file IO
<mdw> I get the error :
<mdw> /Users/matthewwilkinson/Desktop/images/10 - Sardanelli
<mdw> No such file or directory
<mdw> but this file exists
<mdw> !
<Eth4n> it doesn't exist
<Eth4n> there is a picture in Desktop/images/ called '10'
<mdw> `rename': No such file or directory - /Users/matthewwilkinson/Desktop/images/10 - Sardanelli or /Users/matthewwilkinson/Desktop/image/10 (Errno::ENOENT)
<Eth4n> are you sure it isn't '10.png' or '10.jpg'
<heftig> ukwiz: declare -f shows the rvm function?
<mdw> Eth4n: I'm just trying to rename it from the folder name "10 - Sardanelli" to "10"
<heftig> ukwiz: sorry, declare -F is better
<Eth4n> oh
<Eth4n> mdw: can I see your code?
<mdw> is there some issue with the file path ?
<mdw> in the terminal it would be considered:
<ukwiz> heftig: no, it doesn't
<mdw> cd /Users/matthewwilkinson/Desktop/images/10\ -\ Sardanelli/
iocor has joined #ruby
<heftig> ukwiz: source ~/.rvm/scripts/rvm
<heftig> ukwiz: is it defined now?
<mdw> Eth4n: any ideas? i'm going insane >.<
niklasb has joined #ruby
<shevy> mdw did you verify that you work on the proper files?
<shevy> for debugging, do "puts bla" to show you the file path
<shevy> or entries = Dir.entries('images'); pp entries # just for debugging
edu_ has joined #ruby
jlebrech has joined #ruby
Willejs_ has joined #ruby
<shevy> yeah but what does not work?
<mdw> well, I can't rename those files
<mdw> (folders)
<shevy> why not, what is the error you get?
<mdw> it says they don't exist
<shevy> well that can't be the true error
<shevy> because they exist
<shevy> so your input to that method must be wrong
<mdw> plist_gen.rb:13:in `rename': No such file or directory - /Users/matthewwilkinson/Desktop/images/10 - Sardanelli or /Users/matthewwilkinson/Desktop/image/10 (Errno::ENOENT)
<shevy> fire up irb and do:
<shevy> File.stat "/Users/matthewwilkinson/Desktop/images/10 - Sardanell"
<shevy> i mean
<shevy> File.stat "/Users/matthewwilkinson/Desktop/images/10 - Sardanelli"
<shevy> need to have the proper name :D
<shevy> if that is a file?
<mdw> File.stat "/Users/matthewwilkinson/Desktop/images/10 - Sardanell" Errno::ENOENT: No such file or directory - /Users/matthewwilkinson/Desktop/images/10 - Sardanell from (irb):1:in `stat' from (irb):1
<shevy> it seems to have no file ending??
<mdw> it's a directory
<Willejs_> Hi want to run a shell command in a ruby script, and i just want a true or false value returned, what will do this? system outputs the std output too
<shevy> mdw, something is wrong
<mdw> :-(
<shevy> It is a directory which contains ' ' right?
<mdw> this works
<mdw> >> File.stat "/Users/matthewwilkinson/Desktop/images/10\ -\ Sardanelli/" => #<File::Stat dev=0xe000002, ino=584540, mode=040777, nlink=20, uid=501, gid=20, rdev=0x0, size=680, blksize=4096, blocks=0, atime=Tue Feb 21 12:16:32 +0000 2012, mtime=Mon Feb 20 10:41:34 +0000 2012, ctime=Tue Feb 21 10:49:20 +0000 2012>
<shevy> the \ should not be needed
<shevy> I just tested here on linux
<shevy> in bash:
<shevy> mkdir "abc def"
<mdw> 1.8.7
iamjarvo has joined #ruby
<shevy> now I have a directory called "abc def"
<mdw> this is a Ruby issue then?
<shevy> yup, I have this ruby version too
<shevy> nope
<shevy> then, I fire irb and do:
<mdw> argh
<shevy> File.stat("abc def")
<shevy> and it works
<shevy> go into a test dir and try the same
<mdw> >> File.stat "/Users/matthewwilkinson/Desktop/abc def" => #<File::Stat dev=0xe000002, ino=589989, mode=040755, nlink=2, uid=501, gid=20, rdev=0x0, size=68, blksize=4096, blocks=0, atime=Tue Feb 21 12:38:38 +0000 2012, mtime=Tue Feb 21 12:38:38 +0000 2012, ctime=Tue Feb 21 12:38:38 +0000 2012>
<mdw> hmm
<shevy> ah ok
<mdw> is it an issue with these folders?
<shevy> so we now know that directories with ' ' work on your system too
<shevy> even without \
<mdw> yeah
<ukwiz> heftig: I did and it then works. I think that points to the line in .bash_profile not working
<shevy> hmm not sure yet why it works for you when you use \ but not without
<shevy> I am a bit lost here
<Willejs_> can anyone help with running a shell command and returning only true or false and not stout?
<Willejs_> *stdout
<shevy> willb, return_result = system("ls") ?
<shevy> or
<shevy> return_result = `ls`
<shevy> hmm
<shevy> use the first I think
Helius has joined #ruby
<Willejs_> system returns stdout?
<shevy> hmm
<shevy> good question
<Willejs_> popen4?
<shevy> hmmmm
<shevy> system() returns only either true or false
<mdw> shevy: weird
<shevy> not sure if it is the right bool you need though ;)
<mdw> I just renamed it
<shevy> cool mdw
<shevy> perhaps it was a special ' ' ?
<mdw> not in code
<mdw> yeah, something about the folder name
<shevy> perhaps something in UTF8 or like that
<shevy> never fully trust any data :)
<mdw> the folders were copied using Apple File Transfer :-)
<shevy> hehe
<mdw> probably something to do with that
<mdw> shevy: thank-you
<shevy> cool
<shevy> one problem less in the world!
<shevy> 62363262389638790676767603976374585527895278925 more to go before the universe is gone
tehhobbit has quit [#ruby]
DrForr has joined #ruby
andyl has joined #ruby
dibri has joined #ruby
ElitestFX has joined #ruby
fr0gprince_mac has joined #ruby
lateau__ has joined #ruby
albemuth has joined #ruby
provideal has joined #ruby
<provideal> Hey folks, is there a way to decide whether I'm currently running inside a rake task?
`brendan has joined #ruby
<Tasser> provideal, caller
ryannielson has joined #ruby
<Tasser> but it's not really considered OO
crankycoder has joined #ruby
graybeard has joined #ruby
<provideal> Tasser: Ah, OK. Grep through the call stack and search for rake...
<provideal> That's a kinda... hack :) But thanksalot.
<provideal> 
seitensei has joined #ruby
ZachBeta has joined #ruby
<Tasser> provideal, yes, it's a hack
<Tasser> if you want caller-aware, use tcl
<provideal> :) It's s/th I do miss sometimes... But it's not OO at all, I suspect...
Foxandxss has joined #ruby
<jlebrech> is it possible to combine 'each' with an alternate loop if the object returns nil? like "@obj.each_or_loop(5) do |o|"
fermion has joined #ruby
<Hanmac> jlebrech, what is the 5 for?
<jlebrech> 5 times
<banisterfiend> Tasser: how is tcl caller-aware
<Tasser> banisterfiend, +/- with upvar
<Hanmac> jlebrech "@obj.cycle(5) do |o|"
sdwrage has joined #ruby
<Tasser> banisterfiend, but I suppose I'm on the idiot hill :-)
johndbritton has joined #ruby
<banisterfiend> Tasser: interetsing, tell me more
<Tasser> banisterfiend, can't tell you much, I only know they somehow pass variables up the stack via upvar
<banisterfiend> Tasser: sounds cool
<jlebrech> Hanmac: i'm lookin at cycle now, but I want it to either loop @loop.count or if count == 0 then n.times. not loop through @loop.count n times
<jlebrech> s/loop/obj
<banisterfiend> jlebrech: create the block before-hand using proc, my_block = proc { |i| puts i }
wenbert_ has joined #ruby
<banisterfiend> jlebrech: if blah; @var.each(&my_block); else; 5.times(&my_block); end
tilde` has joined #ruby
<banisterfiend> Tasser: haha that's messed up
Husel has joined #ruby
<banisterfiend> Tasser: that looks liked it'd create really tight and strange coupling
<banisterfiend> which would make refactoring a nightmare ;)
<jlebrech> so then it would be, my_block = proc { |i| html-here }. then the iterator. would look a bit backward :)
<Hanmac> jlebrech: (@obj.count == 0 ? 5.times : @obj.each).each do |o|
<Hanmac> but only if enumerator is present (1.9)
<banisterfiend> Hanmac: tht's nicer
<jlebrech> yeah it's not upside down :)
jcromartie has joined #ruby
<jcromartie> this sucks https://gist.github.com/1876548
<Tasser> banisterfiend, why coupling? you couple the variable names
<Tasser> banisterfiend, it's the same as with python, only it's the return variable names, not the keyword names
Ownatik has joined #ruby
<banisterfiend> Tasser: because you can specify the actual parent frame
<Tasser> aaaaaand?
<banisterfiend> Tasser: well, then that requires that parent frame exists and has that variable
<banisterfiend> Tasser: what if u want to refactor the call chain
<Tasser> banisterfiend, it doesn't need to have that variable
<Tasser> and as you see in the example, you should pass the variabl name ;-)
<Tasser> it's kind of a macro
pu22l3r has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
<banisterfiend> Tasser: ok, assumg you have the following call chain: x -> y -> z and in z you define a variable 'adam' that contains the value of an 'adam' in method x
<banisterfiend> Tasser: as far as i understand it, you've fixed the call chain so that in order for your code to work the x method has to be 2 stack frames higher than z
lorenzo has joined #ruby
linusoleander has joined #ruby
linusoleander has quit [#ruby]
<Tasser> banisterfiend, why so? upvar gives you access to the frame _one_ further
<banisterfiend> Tasser: but say i refactor the x method so that its now decomposed into 2 helper methods
<banisterfiend> so the call chain becomes: x -> x_helper -> y -> z
<banisterfiend> Tasser: it says it takes any 'level'
<banisterfiend> where 'level' can be any frame higher u want
lorenzo_ has joined #ruby
<Tasser> oh
<Tasser> I suppose that's where good coding style comes into play :-)
<Tasser> banisterfiend, or actually, you could define yet another upvar in x_helper which redirects the variables
<banisterfiend> as far as i understand it anyway, i might have read it wrong. but it could mean that you cant then easily refactor methods higher up the call chain
<banisterfiend> Tasser: i ran into this exact problem when i wrote binding_of_caller too :)
nanderoo has joined #ruby
<banisterfiend> i originall just specified fixed levels, like '6', where i wnated it to grab stuff from a stack frame 6 levels higher up the stack
<Tasser> banisterfiend, hum, you actually wrote code with that? ^^
randym has joined #ruby
<banisterfiend> Tasser: Yeah, i needed it for exception_explorer
<banisterfiend> Tasser: but i ended up making it more intelligent, so instead of fixed levels
<banisterfiend> it coudl dynamically find the stack level it needed
Eth4n has joined #ruby
Eth4n has joined #ruby
<Tasser> why do you need to jump the stack?
<banisterfiend> by running a predicate against each stack frame until it found the one i wanted
randym has joined #ruby
<banisterfiend> Tasser: because when pry starts it puts all its own methods on the stack
<banisterfiend> Tasser: but i wanted to access the methods *before* the pry session started
<Tasser> banisterfiend, ahh, right
<banisterfiend> Tasser: so i had to jump over all pry's internal methods
<Tasser> banisterfiend, so you check wherever it's a pry method?
abstrusenick has joined #ruby
<banisterfiend> well there's a bunch of methods that could be pry methods, since i coudl refactor the fuck out of it
<banisterfiend> so i just keep skipping frames until i find the initial method of the pry session
<banisterfiend> and once ive found it, i drop that too
rfloriano has joined #ruby
<Tasser> banisterfiend, why not just mark it in the caller somehow?
<banisterfiend> Tasser: so i had a helper method like skip_until { |frame| frame.self == Pry && frame.method_name = "start" }
yalue has joined #ruby
v0yager has joined #ruby
akem has joined #ruby
akem has joined #ruby
danielpcox has joined #ruby
<banisterfiend> Tasser: well i thought about marking it by defining a local in there or something, is that what u mean? stop_here = true
<banisterfiend> hehe
<banisterfiend> Tasser: but i didnt need to in the end
sterNiX has joined #ruby
<banisterfiend> just checking the method name + class was enough
<Tasser> banisterfiend, I'd add something defined, just in case
var1 has joined #ruby
<Tasser> banisterfiend, what you do is kind of a goto
<Tasser> ... but without a label on the target
Mekkis has joined #ruby
<Tasser> debugger_jump_until_here
pu22l3r_ has joined #ruby
<banisterfiend> Tasser: well the condition is more complicated than i say, i also check some other things, but i know it's watertight
<Tasser> you won't change the method and/or call another method start?
iocor has joined #ruby
workmad3 has joined #ruby
<jlebrech> 5.times returns a Fixnum rather than a blank object, but i've found this http://www.ruby-forum.com/topic/138534
danielpcox has joined #ruby
<Tasser> 5.times should return an Enumerator
<banisterfiend> Tasser: it doesnt matter if i call another method start, i also check the class
dibri has joined #ruby
<banisterfiend> Tasser: Pry.start will _always_ be used to start pry ;) and it will always be the entrypoint
<banisterfiend> i ensure that the receiver is Pry too
<Tasser> banisterfiend, safe enough
<Hanmac> jlebrech: times with block returns the last value of the block ... times without an block returns an enumerator
kaspernj has joined #ruby
banseljaj has joined #ruby
s14 has joined #ruby
mdw has joined #ruby
<mdw> i want to do something like:
<mdw> arr = ['1','2','3']
<mdw> and return
<mdw> ['2','3']
Jackneill has joined #ruby
<Tasser> mdw, arr[1..-1]
<mdw> Tasser: nice
ecolitan has joined #ruby
<mdw> what does the -1 mean?
<jlebrech> I want times to return a specified new object rather than a fixnum
<Tasser> Hanmac, Kann etwas leerer sein als die Schublade wo du dein Opium aufbewahrt hast?
<Hanmac> nö, ich hatte nie welches
<jlebrech> i've got it ;)
abstrusenick has joined #ruby
<Tasser> mdw, last element
stepnem has joined #ruby
xargs_ has joined #ruby
<jlebrech> thanks Hanmac
<jlebrech> and Tasser
<Tasser> Hanmac, banisterfiend glaubt das nicht, du scheinst auf Drogen zu sein
<Hanmac> "5.times.map { Message.new }" works too
tommyvyo has joined #ruby
Sailias has joined #ruby
justfielding has joined #ruby
iocor has joined #ruby
david_w__ has joined #ruby
sterNiX has joined #ruby
wroathe has joined #ruby
<kapowaz> anyone aware of issues with rvm installing ruby 1.8.2? mine seems to want to grab a broken URL
<kapowaz> ERROR: The requested url does not exist: 'ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.2-.tar.bz2'
<Sailias> kapowaz, you just did rvm install 1.8.2
<Sailias> ?
nyrb has joined #ruby
<kapowaz> yeah
<kapowaz> presumably if I did rvm install 1.8.2-pXXX it'd work
<kapowaz> what's a later patch version ?
<Hanmac> do you REALY mean 1.8.2?
<kapowaz> what was the last version of 1.8 ? was it not 1.8.2 ?
td123 has joined #ruby
bbttxu has joined #ruby
Natch| has joined #ruby
<Tasser> 1.8.7
bbttxu has joined #ruby
<kapowaz> oh, so it was. been so long since I did anything with 1.8
<banisterfiend> kapowaz: 1.8.7
<banisterfiend> kapowaz: you lolcat
<banisterfiend> ;)
<shevy> kapowaz man you are 50 years in the past
<shevy> come to the present man
<shevy> or die in the past :(
<Hanmac> < 1.8.7 should be buried
<kapowaz> when I say that I don't mean I did anything with 1.8.2 — just that I'd forgotten the specific point release ;)
<kapowaz> I'm obviously mixing up my 1.9.2 with it
cantbecool has joined #ruby
<Hanmac> or you can go directly to 1.9.3
cantbecool has quit [#ruby]
<shevy> use 1.9.4
tayy has joined #ruby
<kapowaz> usually I would, the project I'm trying to test out hasn't been updated since 1.8 and isn't working. I haven't the time to figure out why and fix it.
workmad3 has joined #ruby
<shevy> hehe
<shevy> I am porting my oldest and still running project slowly
p0y has joined #ruby
<shevy> and get rid of "circular requires" warning craps
popsch has joined #ruby
<kapowaz> yeah, it's mostly due to require path problems
stef_204 has joined #ruby
emocake has joined #ruby
Karayusuf has joined #ruby
p0y has joined #ruby
geekbri has joined #ruby
peterhellberg has joined #ruby
mattonrails has joined #ruby
<shevy> there were so many new warnings in 1.9.x
<kapowaz> okay, this is odd. I get this when I try to install bundler: https://gist.github.com/bb3111f65fd3a45f8075
drknus has joined #ruby
<shevy> haha bundler
<shevy> this piece of crap
<banisterfiend> Tasser: also look at my regex-based frame leaping :P https://github.com/pry/pry-stack_explorer/wiki#wiki-Up
briankbuckley has joined #ruby
thone has joined #ruby
<shevy> layers on layers of crap
mkscrg has joined #ruby
<kapowaz> I'm not sure why you'd think that has anything to do with bundler. That's a gem install command triggering the error.
Natch| has joined #ruby
<kapowaz> I get the same error no matter which gem I try to install
_obiJuan has joined #ruby
Natch| has joined #ruby
_obiJuan has quit [#ruby]
enroxorz has joined #ruby
enroxorz-work has quit [#ruby]
<banisterfiend> kapowaz: did u look at like 60 of timeout.rb?
<Tasser> banisterfiend, hehe
<banisterfiend> line*
<kapowaz> banisterfiend: nope, but given that it's part of the bundled ruby libraries, I'm not sure I should go fiddling around in there
<banisterfiend> kapowaz: you wont be fiddling, you'll be looking :)
<kapowaz> I've googled and apparently it's a problem with compiling ruby with an LLVM-version of gcc
<banisterfiend> ah ok
Hanmac has joined #ruby
dkr has joined #ruby
pen has joined #ruby
<Tasser> kapowaz, hihi
stepnem has joined #ruby
<shevy> hahaha
<Tasser> kapowaz, upgrade is only 99$
<kapowaz> you think I'm running Snow Leopard out of choice?
<banisterfiend> kapowaz: why are you running SL
<shevy> so guys
<shevy> is OSX really that cool
<shevy> or do the alternatives just suck more
<kapowaz> bit of both.
<shevy> :(
<kapowaz> banisterfiend: it's the only version they support at the company I currently contract at
tuxaddicted has joined #ruby
shellox has joined #ruby
<kapowaz> personally I love OS X. Yes it has its faults, but as a web developer's OS, I think it's the best by a long way.
<shellox> hi
Foxandxss has joined #ruby
<deryl> that 4.2 and 4.3 would not install on < OS X Lion has been known for quite some time. to include prior to release
<deryl> so.. how is this a suprise again?
<shellox> whats the best way to set a default value for a method in a ruby class?
<Tasser> shellox, def(foo = :bar) there is no other way
<shevy> shellox def foo(i = 'Default value here')
<shevy> hey Tasser too much nimrod? ;)
fudanchii has joined #ruby
tomzx has joined #ruby
<shellox> shevy: yep, I just want to set the value if foo is empty ;)
<Tasser> shevy, hum? that's not valid nimrod syntax either
<shevy> shellox, or in def initialize() if you need to use your Class.new("bla") or Class.new()
<kapowaz> deryl: fair point, but the full XCode installation is a lot more than just gcc and some libraries
<shevy> haha Tasser ok
<Tasser> shevy, I could implement symbols in nimrod with ! syntax - : is already used
<shevy> shellox yes, check for the input within your method... input = DEFAULT_VALUE if input.empty?
<Tasser> so I could finally make that !sex t-shirt without the : reference
<deryl> kapowaz: umm not much more unless you acccount for the Accessibility package and the _fill_in_name_here package Apple just split 4.3 into
<shevy> and DEFAULT_VALUE = 'boo'
xargs_ has joined #ruby
<shevy> yeah Tasser I unfortunately only understand 5% of what nimrod is capable of :(
<kapowaz> deryl: anyway, point is, the package I'm trying to install is Apple's official version of this: https://github.com/kennethreitz/osx-gcc-installer — which *does* support 10.6
<deryl> and you can do anything you need in the ruby world with *just* the osx-gcc-installer (or now the commandline tools package from apple) *except* for Node.js because it needs the Carbon headers
<shevy> wait what
<shevy> a javascript package that has per-OS specific solutions?
<deryl> shevy: to build on OS X it needs the Carbon headers
<shevy> ah, to build. ok
asobrasil has joined #ruby
<deryl> right
<shevy> thought the www is becoming <insert one OS here> finally hehe
<shellox> shevy: lets say we have a class Person. x = Person.new('foo') => x.name is 'foo' ; y = Person.new => y.name is 'unknown'
<kapowaz> deryl: that's part of the goal of the command line tools package — it includes the headers that were needed for node.js
<deryl> kapowaz: you can install the osx-gcc-installer and it works.
<shellox> is empty? a good solution for this purpose?
gabeh has joined #ruby
<shevy> shellox, well. depends on the input
<kapowaz> and yeah, I'm going to
ed_hz_ has joined #ruby
<shevy> but you could do ... input.to_s.empty?
<deryl> kapowaz: err? node.js has NOTHING to do with why apple included carbon headers in the commandline tool package
<deryl> they built that as a response to kenneth's package actually
<shellox> ok, i will use this then. I thought there is a better way to do it ;)
<kapowaz> okay, no need for that strident tone.
<deryl> you're reading into it
<kapowaz> your contributions are noted. thanks for your time.
<deryl> if i was being strident NO ONE in the channel would miss it.
sterNiX has joined #ruby
<deryl> THAT was me being strident.
<shevy> shellox, http://pastie.org/3427322
<deryl> I'm attempting to understand what the issue is. Xcode 4.2/4.3 have always had the requirement to be installed on OS X Lion or higher. Xcode 4.1 is still available for Snow Leopard, and os-gcc-installer is as well.
<kapowaz> talking in all caps and prefixing responses with ‘err?’ = strident
<shellox> shevy: thx
<kapowaz> it's patronising and unnecessary.
<kapowaz> also, for the record
<deryl> what I'm not understanding and you can call me strident for it all you want is why you're attempting to install that particular package when the docs, the dev site, and Appe themselves have stated that it needs 10.7 but your complaining becuase it needs 10.7
<shevy> awww he has not even started
<shevy> say that RVM sucks and you'll see
<shevy> :)
<deryl> shevy: piss off ;)
* deryl grins
<kapowaz> that's the about dialog for my installation of Xcode. Under 10.6.
<shevy> cool dialog
<kapowaz> so, what was it you were saying about the requirement for Lion?
<shevy> but just so you guys dont think linux is better
<deryl> kapowaz: yep because you already had 4.1 installed. So, unless APPLE has changed that 4.1 can be upgraded because of the way that Apple does their upgrade.
<shevy> trying to compile gcc, ... /usr/bin/ld: cannot find -lppl_c
<deryl> you can NOT tell me that you installed 4.2 without having 4.1 installed
tayy has joined #ruby
<deryl> you even try I'll give a strident tone by laughing in your face
nemesit has joined #ruby
<kapowaz> now you're arguing semantics about how it got installed. Point is, it works under 10.6, so dismissively sneering that it's absurd to expect the command line tools to work under 10.6 is rather a bit much.
<kapowaz> there is no good reason they couldn't.
<deryl> (especially after the hours and hours spent with Apple debugging issue after issue with rvm under osx and it coming down to their compiler package)
<deryl> no its NOT semantics
<deryl> it GREATLY impacts usability
<shevy> let's all be friends and agree that Apple sucks!
<deryl> but (and here is the attitude part so you don't miss it) its ok dear, you just think what you want. we'll not disturb you
<kapowaz> so, if you upgrade 4.1 -> 4.2 it has different functionality?
<kapowaz> is that what you're saying?
<Hanmac> shevy you are 120% right
<kapowaz> because if that's true then fair enough.
<deryl> wow you're thick
john______ has joined #ruby
<dagobah> Given the array [{:foo=>"bob}, {:bar=>"alice"}, {:foo=>"bill"}], how can I return an array of hashes only containing a certain key, say :foo
<kapowaz> wow, you're rude.
<shevy> Hanmac I dont think they come to terms ;)
<kapowaz> all done now.
<deryl> oh no, trust me. i haven't even started being rude yet.
<deryl> this is just early warning signals
gianlucadv has joined #ruby
<shevy> dagobah I think array.select should work
<shevy> inside the block, probably something like ... {|key| key == :foo }
CannedCorn has joined #ruby
<shevy> hmmm
<Hanmac> dagobah: array.select {|h| h.include?(:foo) }
<shevy> oh
<shevy> :(
<shevy> I suck
<dagobah> Excellent, thanks
<Hanmac> iSuck is an registered Name from Apple
<john______> I have an ordered hash which I want to separate the keys and value into 2 arrays, array.keys works fine to get the keys, however, array.values gives me stuff that looks like: <BigDecimal:3e180b8,'0.125E1',18(18)> how can I get the actual values?
a215 has joined #ruby
<deryl> hamsuprised they're not suing everyone over iThis or iThat
gabeh has joined #ruby
<shevy> wheeeee gcc continues to compile, it found -lppl_c
<deryl> someone has a project on GH thats an iSomethingOrOther that came into one of the other dev's priv channels. apple was sending him emails trying to get him to rename the project
* deryl wonders if michal remembers the gist of it all
<shevy> what is apple doing if emails fail
<shevy> send the iStormtroopers?
<deryl> hah!
<deryl> probably back it with Cease And Desist orders, and then file an injunction
<deryl> :shrug;
<shevy> though, I myself try to name projects in ways as that they make sense
<shevy> even if it is boring.
<shevy> "build tools" ... "web foundation" ...
<deryl> same
<shevy> "ruby ftp" # very creative ... hehehehe
<deryl> rftp4u!
hashpuppy has joined #ruby
chilversc_ has quit [#ruby]
<shevy> yeah hmm
<shevy> I do have one exception at least
<shevy> "diamond shell" ... wonder if I should rename it to "ruby shell"
<shevy> but there's like 100 of those...
<deryl> the ruby world dump tons of similar stuff to the wild? never ;)
<shevy> well yeah, and sometimes uses odd names
<shevy> unicorn ... god ... sinatra ...
<shevy> see, pry has a good name. "to pry" into something. that is short and descriptive
<shevy> "ruby-on-rails" I dunno ...
<deryl> lol, ruby community doesn't have a fixation on deities or mythical creatures. not at all hehe
<shevy> oh
<shevy> Thor
<shevy> I always imagine a lightning throwing hammer
carlyle has joined #ruby
<deryl> hey would make a great logo
<shevy> indeed
<shevy> I am kinda stealing my logos :P
<shevy> lemme find some of em
<deryl> heh, i have zero skills with an image editor hehe
<hashpuppy> given l = [1, 2, 3, 4, 5]. i want a function, f(l, 3), that will return [[1, 2, 3], [4, 5]] (can be an array of arrays or iterator of arrays). is there something like this in ruby?
<deryl> i made my logo using one of those step-by-step pick this or that and meld them all together and see what you got type programs.
<deryl> came out pretty decently actually. totally suprised
<shevy> wow omg
<shevy> did imageshack recently require registration?
<hashpuppy> basically it chunks the arrays into sizes of 3, but if it's less than 3 at the end, we just return the remainder
<deryl> shevy: see msg
<shevy> grrrr
<shevy> that annoys me so much that I dont want to use it
<deryl> they changed yet again huh?
rdw200169 has joined #ruby
enherit has joined #ruby
<shevy> "Registration is required."
theRoUS has joined #ruby
<shevy> anyway
v0n has joined #ruby
<hashpuppy> sweet, found it
<shevy> I tried to find a picture of a ruby and started to colourize some black-white picture
<shevy> but I never finished
<deryl> lol, puppets on a string
<deryl> niice
<apeiros_> hashpuppy: each_slice
rippa has joined #ruby
incomprehensibly has joined #ruby
<hashpuppy> apeiros_: thanks! that was what i was looking for
<shevy> I have a better example though, a moment
<apeiros_> ah, what did you find? (didn't see)
neurodrone has joined #ruby
neurodrone has joined #ruby
mattonrails has joined #ruby
xargs_ has quit ["Leaving..."]
<shevy> http://www.pictureupload.de/originals/pictures/210212155647_RUBY_HYDRA.png <--- tried to colourize that too, also stopped when it wasn't fun enough
<shevy> should put a dead python down below its legs
<shevy> CRUSHED python
<deryl> hah
RedWar has joined #ruby
dv310p3r has joined #ruby
gabeh has joined #ruby
cpruitt has joined #ruby
<wroathe> Whats this shorthand about? ::Feed
<wroathe> I've never seen that before.
yekta has joined #ruby
iocor has joined #ruby
<shevy> wroathe scoping
<shevy> I think to the parent namespace or something like that
incomprehensibly has joined #ruby
<wroathe> Ahh
<deryl> hrmm, ok. octopress definitely not responding the way i thought it would. changed the blog entry title size to h3 and it makes it *bigger*? how's that work
<deryl> ?
abyme has joined #ruby
<rippa> shevy: top namespace
nemesit has joined #ruby
soulcutter has joined #ruby
<shevy> hmm
<shevy> what is the top namespace? module Foo; module Bar; class Ble ... inside Ble, the top namespace is Foo ?
<rippa> top
<rippa> one where self is main
<rippa> where the top-level constant run free
wyhaines has joined #ruby
strife25 has joined #ruby
<shevy> hmm
seitensei has joined #ruby
<john______> I have an ordered hash which I want to separate the keys and value into 2 arrays, array.keys works fine to get the keys, however, array.values gives me stuff that looks like: <BigDecimal:3e180b8,'0.125E1',18(18)> how can I get the actual values?
<rippa> they are actual values
tayy has joined #ruby
Primpod has joined #ruby
<Jck_true> Why didn't i find ruby earlier - It's pretty epicly actually :)
<john______> hmm
<john______> why is this shit not working
<john______> then
MrGando has joined #ruby
<Hanmac> John can you pastie what do you try to want?
glosoli has joined #ruby
<john______> it works fine for the @picks.keys
jcromartie has joined #ruby
<john______> but the @picks.values doesn't work
<john______> if i replace @picks.values with [1,1,1,1,1] that works fine
<waxjar> what does f.series expect its second argument to be?
<john______> its expecting an array
<shevy> Jck_true u used another language before?
<john______> single dimension array
<john______> this works as expected: http://pastie.org/3427600
<waxjar> it might expect an array of integers, maybe floats. i'm not familiar with the library you're using
adambeynon has joined #ruby
<waxjar> @picks.values.map { |value| value.to_i } # or .to_f
KristianDK has quit ["Linkinus - http://linkinus.com"]
jcromartie has joined #ruby
QKO_ has joined #ruby
<john______> wow
<john______> perfect
<Jck_true> shevy: PHP - And embedded C
<Hanmac> or .map(&:to_i) for short
<john______> if you are ever in sydney, australia you can have a night with my sister
<shevy> Jck_true cool combination hehe
triptec has joined #ruby
<Jck_true> john______: Can he trade it with me?
<shevy> ruby should be able to replace PHP fully, including the www
<john______> no
<john______> just him
* waxjar books tickets
<shevy> I think he hates his sister
<Jck_true> shevy: Well - I like PHP aswell - But it feels wrong for scripting purposes - - And so far i really like the std.lib in ruby
<john______> she's pretty ugly
<shevy> careful
<shevy> I used to use PHP
<shevy> I can't stand it anymore
<shevy> return before it is too late Jck_true :)
<john______> good night all
<john______> thanks again
havenn has joined #ruby
aibo has joined #ruby
iamjarvo has joined #ruby
virunga has joined #ruby
excel542 has joined #ruby
hoelzro has joined #ruby
caiges has joined #ruby
fudanchii has joined #ruby
spanner has joined #ruby
denom has joined #ruby
jgarvey has joined #ruby
wallerdev has joined #ruby
excel542 has joined #ruby
alek_b has joined #ruby
ed_hz_ has joined #ruby
baroquebobcat has joined #ruby
gmcinnes has joined #ruby
ph^ has joined #ruby
berkes has joined #ruby
<gmcinnes> ladies and gents: is there any way to see what libraries my build of ruby has linked against?
<hoelzro> gmcinnes: what OS are you on?
<gmcinnes> linux
<td123> gmcinnes: readelf -d
<hoelzro> gmcinnes: ldd
<gmcinnes> ah. excellent. thanks.
<td123> ldd is fine also, but it displays a recursive list of libs
<hoelzro> oh?
* hoelzro did not know that
<td123> hoelzro: I learned that myself like 2 weeks ago :P
<gmcinnes> hmm.
<td123> hoelzro: after wondering how can something be linked against 2 versions of the same lib :)
<hoelzro> haha
<td123> hoelzro: that answer was, it can't
<gmcinnes> so I'm having this weird issue where an app I'm running is getting wedged in a select() in Net::HTTP.
<hoelzro> td123: so readelf only prints the direct dependencies?
<td123> yes
alex__c2022 has joined #ruby
<gmcinnes> Any advice on how to debug?
<td123> hoelzro: readelf -d
fudanchii has quit [#ruby]
<gmcinnes> I've traced it down to there by attaching with gdb, but I'm kinda at the end of my gdb fu.
<hoelzro> gmcinnes: have you tried strace?
<gmcinnes> No. I should have started that before the weekend. (It takes a few hours / days for the process to wedge).
<hoelzro> interesting
<gmcinnes> The app is opscode's chef-client btw.
<Hanmac> hm question about ldd and readelf ... is it bad if my lib requires libgcc_s.so.1 ?
<shevy> hmm
<gmcinnes> And it wedges on both Ubuntu 10.04 and Centos 6.1 running under 1.9.2 p290 and 1.9.2 p180 respectively.
<shevy> Hanmac linux only?
`brendan has joined #ruby
ckrailo has joined #ruby
pu22l3r has joined #ruby
PaciFisT has joined #ruby
<shevy> hmm cant find libcc_s.so.1 here
michaelh has joined #ruby
<Hanmac> its libgcc not libcc
cobragoat has joined #ruby
hukl_ has joined #ruby
mikepack has joined #ruby
<Hanmac> shevy, i used readelf on my c++ gem
<gmcinnes> hoelzro: but by attaching with gdb I can see clearly it's stuck in select() and that the select is coming from Net::HTTP. It's not timing out for some reason. Just staying wedged in there forever.
<hoelzro> gmcinnes: would it have a reason to be waiting for a response that's not coming?
RedWar has joined #ruby
jlogsdon has joined #ruby
<gmcinnes> hoelzro: well, I could speculate that perhaps the chef server is doing something stupid in the middle of the response stream. But I would expect in that case that Net::HTTP would time out eventually and raise an exception.
<hoelzro> gmcinnes: do you happen to know what the timeout parameter to select() is?
byronb has joined #ruby
<gmcinnes> hoelzro: but that's not happening. It's just wedging there forever in sleep state waiting for IO.
TaTonka has joined #ruby
<hoelzro> gmcinnes: well, if the timeout is forever, it will never timeout
<gmcinnes> hoelzro: no. do you have any clues on how to grep that out with gdb?
<hoelzro> sorry, no =(
<hoelzro> strace -p might tell you, though
<gmcinnes> ah. yes.
<gmcinnes> select(7, [6], NULL, NULL, NULL
* gmcinnes goes to grep select man page
<hoelzro> I think that means "no timeout"
<hoelzro> which is kind of silly.
kf8a has joined #ruby
emmanuelux has joined #ruby
SegFaultAX|work has joined #ruby
ukwiz has joined #ruby
skitrees has joined #ruby
glosoli has joined #ruby
<gmcinnes> hoelzro: yup: "If timeout is NULL (no timeout), select() can block indefinitely."
<gmcinnes> off to #chef to beat them with a cluestick.
werdnativ has joined #ruby
Evixion has joined #ruby
kidoz has joined #ruby
aibo_ has joined #ruby
dibri has joined #ruby
macmartine has joined #ruby
snip_it has joined #ruby
tayy has joined #ruby
theRoUS has joined #ruby
krz has joined #ruby
kreantos has joined #ruby
daniel_hinojosa has joined #ruby
MrGando has joined #ruby
ed_hz_ has joined #ruby
<hashpuppy> stupid question. how do i [1, 2] ? [3, 4] ==> [[1, 2], [3, 4]]?
<hashpuppy> what operator is that
<hashpuppy> thought it would be ::
alek_b has joined #ruby
<rippa> hashpuppy: [] << [1,2] << [3,4]
<hashpuppy> eww
<hashpuppy> ok
<hashpuppy> thanks
<hashpuppy> oh
<hashpuppy> that's not bad
<hashpuppy> thanks
<rippa> hashpuppy: also
<rippa> Array[a,b] == [a,b]
davidcelis has joined #ruby
kenperkins has joined #ruby
dn2k has joined #ruby
lkba has joined #ruby
lkba has joined #ruby
TheTFEF has joined #ruby
canton7 has joined #ruby
<dagobah> Trying to 'group by' on an array of hashes such that arr = [{:id=>1,:foo=>"bar"},{:id=>2,:foo=>"bar"},{:id=>3,:foo=>"qux"}], when grouped by a hash key of :foo returns: [[{:id=>1,:foo=>"bar"},{:id=>2,:foo=>"bar"}],[{:id=>3,:foo=>"qux"}]] (grouped by the hash values of a given key)
<rippa> what's wrong?
<dagobah> Any ideas?
samsonjs has joined #ruby
<rippa> dagobah: ideas about what?
<dagobah> How I could achieve the above elegantly.
<rippa> you wrote it yourself
<rippa> [{:id=>1,:foo=>"bar"},{:id=>2,:foo=>"bar"},{:id=>3,:foo=>"qux"}].group_by {|h| h[:foo]}.values
<dagobah> group_by?
<rippa> yes
DrShoggoth has joined #ruby
<dagobah> holy.
<rippa> I thought you referred to that method
<rippa> and wondered why you weren't satisfied with its output
<dagobah> No.
<dagobah> That's amazing, never knew group_by existed.
<rippa> read up on Enumerable methods
<rippa> they are way cool
<Hanmac> hm at this point i would prefer "sort_by {|h| h[:foo]}"
incomprehensibly has joined #ruby
<hashpuppy> ok, i'm stumped. why am i getting a 0 for 3 argument on the following: http://paste.pocoo.org/show/4XGCG6YxpEZsdYD4Fes4/
<hashpuppy> believe it's the recursive call
blueadept has joined #ruby
<Hanmac> hashpuppy on what line do you get the error?
<hashpuppy> oh, i see it now
<hashpuppy> sorry
gmcinnes has quit [#ruby]
<virunga> Hi
<virunga> what's introspection?
<Hanmac> hashpuppy: what was it? you confuse me :P
<virunga> in Ruby. I know the word meaning
<virunga> :P
<hashpuppy> i was using cols when it was undefined
<hashpuppy> it should be m - n and not cols - m
geekbri has joined #ruby
<hashpuppy> i had it all on paper and changed the variable names in the code
fr0gprince_mac has joined #ruby
<hashpuppy> yay. logic error now
<Hanmac> virunga: do you search after this? http://en.wikipedia.org/wiki/Type_introspection#Ruby
hukl has joined #ruby
apeiros_ has joined #ruby
madmax_ has joined #ruby
CreativeEmbassy has joined #ruby
<jlebrech> how do you pop an item from an array but return the array
burgestrand has joined #ruby
<apeiros_> ary.tap(&:pop)
banseljaj has joined #ruby
<apeiros_> you could probably use slice! too
cjs226 has joined #ruby
cook1es has joined #ruby
looopy has joined #ruby
vmatiyko has joined #ruby
<virunga> Hanmac, i read it thanks, but i dont understad what does introspection fit with interfaces
<virunga> can you explain to me this sentence "If an interface supports introspection you can get an interface definition off the dbus wire itself, otherwise you need to know the interface a priori"
<Hanmac> do you have a code sample for that?
apeiros has joined #ruby
<virunga> Hanmac, no, i wouldn't know what write :)
<Hanmac> typececking in ruby is not one of the best ways ... the ruby way is to check after methods like obj.respond_to?(:each)
zomgbie has joined #ruby
<dagobah> How does [{:id=>1,:foo=>"bar"},{:id=>2,:foo=>"bar"},{:id=>3,:foo=>"qux"}].group_by {|h| h[:foo]}.values work fine, but when I create a group_by(key) method in enumerable to do this for me, I get, undefined method `values' for "bar":String (NoMethodError)?
<Hanmac> and currently i dont know about interfaces in ruby ... maybe it means modules? like Enumerable extend an Class or Object with many interesting functions, but depends on :each
symb0l has joined #ruby
<virunga> Hanmac, ok, maybe i'm starting to undestand. I'm learning how to use... Yes, he's talking about DBUS module i think
provideal has quit [#ruby]
cloke has joined #ruby
<virunga> Hanmac, ok, thank you very much
<Hanmac> an fuunny and interessting excample: i write bindings , for wxWidgets, or other ... and i define the EvtHandler as module ... and why should i do this? because so you can include it even in non wx classes or other objects, and so even pure ruby objects can be extended with C++ classes
* Hanmac giggles because this is something swig never can do
gvt has joined #ruby
Primpod has quit [#ruby]
Kn|t3__ has joined #ruby
<ukwiz> I am trying to debug a ruby program, and when I run through my debugger I get an error as in http://pastebin.com/2WspJByJ
eregon has joined #ruby
<ukwiz> can anyone please explain what I need to do to get this working?
jaywastaken_ has joined #ruby
dfr has joined #ruby
phantomfakeBNC has joined #ruby
<burgestrand> ukwiz: looks like the ruby-debug you are using is not compatible with ruby 1.9.3
ReTFEF has joined #ruby
caveat- has joined #ruby
kloeri_ has joined #ruby
vandemar_ has joined #ruby
altivec has joined #ruby
akemrir has joined #ruby
jds_ has joined #ruby
madmax_ has joined #ruby
ryannielson has joined #ruby
<ukwiz> burgestrand: I installed ruby-debug-base19x via rvm
oddmunds has joined #ruby
patronus has joined #ruby
uxp has joined #ruby
Sigma00 has joined #ruby
thebope has joined #ruby
thebope has joined #ruby
tymelx has joined #ruby
<burgestrand> ukwiz: no
Elfix has joined #ruby
redjack1964 has joined #ruby
bbttxu_ has joined #ruby
crazed_ has joined #ruby
Tick-Tock has joined #ruby
CK_afk has joined #ruby
fortysixandtwo has joined #ruby
<ukwiz> burgestrand: No?
alex__c2022 has joined #ruby
snapcase has joined #ruby
bbttxu has joined #ruby
eywu has joined #ruby
gokul has joined #ruby
kaichanvong has joined #ruby
crankycoder has joined #ruby
elrzn| has joined #ruby
elrzn| has quit [#ruby]
SirFunk has joined #ruby
hkhalid has joined #ruby
<burgestrand> ukwiz: rvm does not install gems, rubygems installs gems, and sometimes you can use rvm to install a gem over all rubies through rubygems for each ruby, but rvm did not install ruby-debug for you
<hkhalid> sup
<hkhalid> f jquery mobile
gianlucadv has joined #ruby
<burgestrand> ukwiz: but still, does not change that the ruby-debug you are using appears to not be compatible with ruby 1.9.3
coucher has joined #ruby
<burgestrand> ukwiz: you could try out pry instead, which works with 1.93
<burgestrand> ukwiz: http://pry.github.com/
<burgestrand> if you need step and such, there is https://github.com/nixme/pry-nav
<burgestrand> ukwiz: or you could use 1.9.2 and try again, because there I know ruby-debug ought to work
geekbri has joined #ruby
coucher has joined #ruby
DuoSRX has joined #ruby
davidcelis has joined #ruby
carlyle has joined #ruby
crankyco_ has joined #ruby
v0yager has joined #ruby
glosoli has joined #ruby
sonkei has joined #ruby
<Eiam> or use rubydebug1.9
<burgestrand> Eiam: it’s what he is using
iocor has joined #ruby
<Eiam> ah
ak0s has joined #ruby
* hkhalid slaps Eiam around a bit with a large trout
<ukwiz> I am trying 2 ides - komodo and rubymine, and they both choke over the same thing
mrsolo has joined #ruby
<deryldoucette> which is why most of us don't use IDEs
Fretta has joined #ruby
btanaka has joined #ruby
<shevy> IDEs means that your brain stops to think
<deryldoucette> more trouble than they're worth, and RubyMine has been working on their RVM integration since early 3.x and *still* can't get it right
<hkhalid> deryldoucette what do you use
<deryldoucette> hkhalid: vim or textmate
<shevy> I use bluefish
maletor has joined #ruby
<deryldoucette> vim+snipmate or TextMate+GetBundles
thebope has joined #ruby
Willejs_ has joined #ruby
crankycoder has joined #ruby
<Eiam> sublime text 2
CannedCorn has joined #ruby
eldariof has joined #ruby
* deryldoucette kicks the crap out of octopress for not honouring the source/custom/_colors.scss changes on rebuild
setient has joined #ruby
tvo has joined #ruby
<hkhalid> cool
Silowyi has joined #ruby
<hkhalid> fuck I hate java
csherin has joined #ruby
<tymelx> lol why?
<deryldoucette> you and I both
Kageroc has joined #ruby
<Silowyi> what's the best way to iterate over an array 10 items at a time?
<hkhalid> its hell, making a simple 2d game on Android is total wtf
<burgestrand> Silowyi: Enumerable#each_slice
<Silowyi> burgestrand: thx
briankbuckley has joined #ruby
<tymelx> I had to program a maze that random generated and solved itself a few years ago in school...that sucked
robacarp_ has joined #ruby
JonnieCache has joined #ruby
<JonnieCache> yo
<JonnieCache> does anyone know how/if Array.slice changed in 1.9?
<shevy> no idea
<robacarp> I feel like there might be a question behind the question
alfism has joined #ruby
crankycoder has joined #ruby
bluOxigen has joined #ruby
<shevy> I dont
<shevy> tymelx, did you redo that maze in ruby? :)
fayimora has joined #ruby
undersc0re has joined #ruby
bluOxigen has joined #ruby
<JonnieCache> bother.
dootdoot has joined #ruby
zomgbie has joined #ruby
minijupe has joined #ruby
<hkhalid> This is me after getting doen my side work and firing up Ruby http://i.imgur.com/2yY3a.gif
eignerchris has joined #ruby
DukeDave has joined #ruby
<Kageroc> Hey guys :)
headius has joined #ruby
workmad3 has joined #ruby
<Kageroc> I have a very ammature programing question as I am new to the worl for prog...
<DukeDave> So, I have some code, where it appears that you can only override a parent class's method, if you explicitly specify the 'self', in the subclass's "def self.override_me"; is this true?
statarb3 has joined #ruby
<JonnieCache> DukeDave: yes, because without the self you are overriding an instance method
<JonnieCache> def self.foo is the standard way of defining class methods
<DukeDave> Wow, I did not know what
<Kageroc> i am trying to builc somewhat of a script and I want to do it in ruby: If I have an output of "Routing entry for 159.202.161.0/25" and I just want to pull '159.202.161.0' from that out put and assigne to a VAR what wold be the best way to accomplish?
<DukeDave> JonnieCache: Thanks :)
<DukeDave> JonnieCache: Although, on this site, they demonstrate overriding without using self in the subclass: http://rubylearning.com/satishtalim/ruby_overriding_methods.html
<DukeDave> Is that ^ incorrect?
<JonnieCache> yeah there are several ways to do it
<JonnieCache> although glancing at that code it doesnt look like there are any class methods in there just instance methods
zakwilson has joined #ruby
kpshek has joined #ruby
<BrianE> Got a ghost validation that's strangely started breaking things
<BrianE> There's no "validates_presence_of :foo" in the model, but I'm getting "Foo can't be blank" when it's nil/etc.
<BrianE> How can I go about debugging this?
andrewhl has joined #ruby
marcamilly has joined #ruby
<marcamilly> hrmm
matthias_ has joined #ruby
<marcamilly> I am trying to determine if a variable contains a particular string
cjlicata has joined #ruby
<marcamilly> why does this not work: https://gist.github.com/1877694
<marcamilly> I get a Type Error: TypeError: type mismatch: String given
<Eiam> design question, i have an initializer like this, https://gist.github.com/62a9127ce088c73911b2
shadoi has joined #ruby
<Eiam> and in almost all cases "release" is required, but for two instances, it has to be left off.
apok has joined #ruby
Excureo has joined #ruby
<Eiam> should it be moved into the options array then, or is there some other mojo I can do?
sterNiX has joined #ruby
alex__c2022 has joined #ruby
banseljaj has joined #ruby
<Eiam> i had release=nil, org, opt={} but that won't work for cases like init("MyOrg")
<Eiam> (no options, no release specified)
jgrevich has joined #ruby
ryan0x2 has joined #ruby
RobbieAB has joined #ruby
Araxia has joined #ruby
workmad3 has joined #ruby
<burgestrand> marcamilly: =~ takes a /regexp/
nfluxx has joined #ruby
<marcamilly> so how would I check to see if the particular array element contains a static string like I am trying to do?
axl_ has joined #ruby
adamkittelson has joined #ruby
<Silowyi> marcamilly: you want link[:href].to_s perhaps
<Silowyi> oh
<Silowyi> regexp
PragCypher has joined #ruby
<Silowyi> marcamilly: you want link[:href].to_s =~ /http:\/\/www.google.com\//
flippingbits has joined #ruby
khakimov has joined #ruby
<marcamilly> Silowyi: thnx
<rippa> Regexp.escape("http://google.com/")
Russell^^ has joined #ruby
<apeiros> Silowyi: %r{} to avoid sawteeth
<Silowyi> marcamilly: rippa's solution is better
<Silowyi> Mine actually also incorrectly matches www_google_Com
<Silowyi> err
<Silowyi> yeah
<apeiros> also .'s are special, so yeah, rippa
<rippa> also
<rippa> link[:href].to_s["http://google.com/"]
theRoUS has joined #ruby
<Silowyi> I just took the lazy way :P
soulcutter has joined #ruby
soulcutter has joined #ruby
carlyle has joined #ruby
<marcamilly> hrmm
<marcamilly> rippa: will link[:href].to_s["http://google.com"], find it if it is anywhere in the string?
<Silowyi> yes
* waxjar is listening to Balance Her In Between Your Eyes by Nicolas Jaar (2:02/3:45)
<waxjar> fuck. i keep doing this in the wrong channels D:
setient has joined #ruby
Dreamer3 has joined #ruby
<apeiros> waxjar: I can help you not doing it…
<Silowyi> wait, there is an appropriate channel for that? :P
<Silowyi> cause I was under the general impression that no one really cares what you're listening to :D
<marcamilly> btw, is there a more 'Ruby' way of writing what i am trying to do
nemesit has joined #ruby
<waxjar> it's my client. i do /np in a music channel, then check out the new messages here, but the lag makes it so that it executes it here :/
<shevy> marcamilly seems you are railsing
<marcamilly> doing if <expression matches>, then put it in another array seems a bit weird
<marcamilly> shevy: what do you mean railsing?
cook1es has joined #ruby
Jake232 has joined #ruby
ceej has joined #ruby
<shevy> link, url, href checking seems very much a Rails thing
<marcamilly> oh..nah, just writing a lil script
<marcamilly> to help me do some scraping
ada2358 has joined #ruby
johndbritton has joined #ruby
iocor has joined #ruby
madmax_ has joined #ruby
havenn has joined #ruby
<khem_> can rails act like a web/app server?
<apeiros> no, but rails ships with a command that does
<apeiros> `rails s`
<apeiros> but you want #rubyonrails
kjellski has joined #ruby
billy_ran_away has joined #ruby
<billy_ran_away> What do I put at the top of a ruby script to run it?
<billy_ran_away> I have ruby installed with rvm...
<apeiros> billy_ran_away: always, no matter what: #!/usr/bin/env ruby
<billy_ran_away> apeiros: That doesn't work for me, it just echos out the script.
CannedCorn has joined #ruby
<apeiros> and usually # encoding: utf-8 on the line after ;-)
<apeiros> billy_ran_away: what does `which ruby` give?
<billy_ran_away> apeiros: /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
<apeiros> what does `which env` give?
<billy_ran_away> apeiros: /usr/bin/env
<apeiros> billy_ran_away: and how do you try to run the script?
ciopte7 has joined #ruby
<billy_ran_away> ./script_name.rb
<mackid> chmod u+x script_name.rb
<mackid> ^ run that
<billy_ran_away> mackid: already chmod 755'd it
CreativeEmbassy has joined #ruby
<apeiros> your code doesn't happen to be: puts File.read(__FILE__) ? :)
<billy_ran_away> omg i'm retarded!
<mackid> (lol, it is? XD)
<billy_ran_away> File.open("auction_list.rb", "r").each_line do |vin|
<billy_ran_away> was supposed to be auction_list.txt
mackid has joined #ruby
samsonjs has joined #ruby
<shevy> ruby code in .txt files?
<shevy> ah
<shevy> you meant to read in that .txt file, in your ruby code, and you used .rb instead of .txt
<billy_ran_away> shevy: Yep
<billy_ran_away> apeiros: Thanks for your help!
<billy_ran_away> mackid: And thanks for your suggestion too.
<shevy> I usually use an UPCASED_CONSTANT it makes reading things easier... THIS_FILE = 'auction_list.txt' and then File.open(THIS_FILE). Although usually, I wrap it into a method, and the first argument default parameter is assigned to THIS_FILE
<Silowyi> there's a proverb for that "bad input, bad output" :D
<shevy> haha yeah
<shevy> or like the old saying
<shevy> shit goes in, shit comes out
<Kageroc> i am trying to build a script and I want to do it in ruby: If I have an output of "Routing entry for 159.202.161.0/25" and I just want to pull '159.202.161.0' from that output and assign to a VAR what wold be the best way to accomplish?
<kjellski> can someone give me a hint where to find a good json tutorial?
<shevy> Kageroc many ways.
<shevy> if your input is always like "Routing entry for 159.202.161.0/25" you can do...
<shevy> x = "Routing entry for 159.202.161.0/25"; y = x.split(' ')[-1]
<shevy> now y holds "159.202.161.0/25"
<shevy> another way is to use a regex
nowthatsamatt has joined #ruby
incomprehensibly has joined #ruby
<shevy> something like ... your_regex = / (\d+)$/... and the captured group is stored in $1
<apeiros> billy_ran_away: rofl
<apeiros> and there I thought I was making a joke :D
<marcamilly> rippa: or Silowyi how would I find all the attributes for that particular hash
<billy_ran_away> apeiros: I know! haha
<marcamilly> as in, i know how to get at the [:href] attribute, but i want to get at other attributes, how do I see what other attributes are there
<marcamilly> e.g. link[:title], link[:name], etc.
minijupe has joined #ruby
v0yager has joined #ruby
<rippa> you can iterate through them with #each
<rippa> or get them in array with #keys
<shevy> marcamilly require 'pp'; pp link
<Silowyi> marcamilly: api docs, each, keys might work
<marcamilly> yes, but i don't know what they are called
<marcamilly> hrmm
<shevy> you dont know your own hash structure? but anyway, use pp to output it
v0yager_ has joined #ruby
<Kageroc> Thank you very much Shevy. I will try the split method :)
<billy_ran_away> apeiros: Do you see anything wrong with this? http://pastie.org/3428760
<marcamilly> shevy: i am using NokoGiri
<billy_ran_away> The commands all work on irb...
<shevy> ewww XML
<marcamilly> and don't know the hash structure it returns
<Hanmac> Kageroc: /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/.match(your_string)
* hkhalid slaps marcamilly around a bit with a large trout
<marcamilly> so trying to figure it out
<shevy> I am sure it is documented somewhere
<marcamilly> hkhalid: sup
<Silowyi> marcamilly: I strongly would recommend looking up the documents :)
<marcamilly> shevy: the docs are not helping me much, kinda confusing :|
<apeiros> billy_ran_away: yes, use block form of File::open, or use File.foreach
<shevy> but I also recommend to throw XML into /dev/null
nowthatsamatt has quit [#ruby]
<marcamilly> not xml, html
<marcamilly> i am parsing an html doc
<shevy> marcamilly, no surprise. XML sucks, nokogiri sucks. but if it is a hash you can output its content. this is ruby after all
<billy_ran_away> That parts seems to be fine, it's as if the xpath isn't working...
<hkhalid> marcamilly do you make gui ruby stuff or just cli
Sailias has joined #ruby
<billy_ran_away> But I just tested it on several VINs and it works fine.
<hkhalid> fuck xml, it breaks my android apps
<billy_ran_away> In irb.
<shevy> html sucks too. it just sucks less than a huge bloated XML file
<marcamilly> hkhalid: well, by gui u mean a game?
<billy_ran_away> But I'll switch to the foreach too.
<marcamilly> that type of guy?
<shevy> glade-builder with XML to describe a GUI... that is the biggest suck in history
<marcamilly> *gui
jlebrech has joined #ruby
<marcamilly> or like an html file?
<hkhalid> marcamilly whats the word? uses a gui toolkit?
<billy_ran_away> apeiros: Here's my list of VINs to test with if you're interested: http://pastie.org/3428774
skipper has joined #ruby
<marcamilly> hkhalid: nah, cli by hand
<marcamilly> the old-fashioned way
<marcamilly> heh
<marcamilly> that sounds like a slight, but i will ignore it ;)
* hkhalid gives marcamilly nihari with roti and some alu bangan
Morkel has joined #ruby
<marcamilly> whatever that means :|
gokulnath has joined #ruby
stephans has joined #ruby
<hkhalid> goku!
<marcamilly> ok using pp, i get something like this: https://gist.github.com/1877694
havenn has joined #ruby
nyrb has joined #ruby
<marcamilly> how do I access the text in children?
btanaka has joined #ruby
glosoli has joined #ruby
<marcamilly> link[:href] gave me 'http://google.com'
flippingbits has joined #ruby
<billy_ran_away> Chomp I have to chompe
<billy_ran_away> apeiros: I have to chomp the vins… duh
iamjarvo has joined #ruby
hooper_ has joined #ruby
<Silowyi> marcamilly: I cannot stress the importance of reading the documentation here, you will save yourself at least a dozen more questions in this channel
<marcamilly> Silowyi: heh, have you taken a gander at the docs yourself?
<Silowyi> marcamilly: yes, I used Nokogiri before
<Silowyi> marcamilly: it will be difficult if you do not have a basic familarity with XML though
hadees has joined #ruby
<marcamilly> Silowyi: i am not parsing XML
adeponte has joined #ruby
<billy_ran_away> Still doesn't work even with the chomp...
<billy_ran_away> But it works in irb...
<Silowyi> true, but as far as nokogiri is concerned, it's more or less the same
<kjellski> I have an array of hashes, how can I find the index of a hash with a particular key?
Willejs_ has joined #ruby
v0yager has joined #ruby
<marcamilly> look at how poorly these docs are written
<marcamilly> wtf!!!
<rippa> kjellski: Array#find
<Silowyi> anyway that children array has as its first element a Nokogiri::XML::Text object
<marcamilly> that tells me nothing
<rippa> I mean
madmax_ has joined #ruby
<rippa> Array#index
DukeDave has quit [#ruby]
<kjellski> rippa, thanks for the hint!
<marcamilly> Silowyi: yeh, i got it already
<marcamilly> i am just saying, the docs
<marcamilly> they suck ass
<kjellski> rippa, wait, index is what I tried, but I would need to stick the whole hash in to find that element
<deryldoucette> no different than ruby's API pages
<rippa> kjellski: index takes a block
<Silowyi> marcamilly: It's not bad for API docs, it could be more descriptive, but it says what it needs to
<rippa> .index {|hash| hash[key] == value}
<deryldoucette> and they show you the source which a lot of API docs do NOT do
<marcamilly> but it doesn't tell you how to use it
<marcamilly> so for instance, .css("a") will get all a elements in that object
fayimora has joined #ruby
<Silowyi> there's also the tutorials and "get help" section
<deryldoucette> umm parse('header') or something
<marcamilly> but the docs don't tell you that
<kjellski> marcamilly, Actually I'm right now into pretty much exactly the same, my tip for you, get pry, place binding.pry in your code, and explore the node tree from nokogiri yourself when you struggle
<marcamilly> pry..hrmm
<kjellski> marcamilly, and not to mention, it helps you understanding xpath pretty much too...
<marcamilly> so you write your code at the command line, rather than in a file?
<marcamilly> then run it in the IRB?
<kjellski> marcamilly, yep, it lets you jump into your code with ruby -r pry yourfile.rb to the "binding.pry" in your script
<kjellski> marcamilly, just give it a shot...
<marcamilly> ok thnx
hubub_ has joined #ruby
ghanima has joined #ruby
<kjellski> marcamilly, and no, that's the fun, you have a much nicer irb with included debugging ;) you write your script and when you run it like above, it stops right where you placed the "binding.pry" IN the scrip...
<kjellski> +t
<marcamilly> ahh, i c
<marcamilly> watching screencast now
<kjellski> marcamilly, have fun!
crankyco_ has joined #ruby
<kjellski> banisterfiend, looking at you! I've already found two things I like other than colors! :P
hubub has joined #ruby
crankyco_ has joined #ruby
CodeZombie has joined #ruby
werdnativ has joined #ruby
jwang has joined #ruby
thebope has joined #ruby
SegFaultAX|work has joined #ruby
setient has joined #ruby
Jay_Levitt has joined #ruby
strife25_ has joined #ruby
idletom has joined #ruby
flu- has joined #ruby
<flu-> <3 ruby. that is all :)
KL-7 has joined #ruby
<kjellski> flu-, /signed
hukl has joined #ruby
alex__c2022 has joined #ruby
cloke_ has joined #ruby
badabim has joined #ruby
Jrz has joined #ruby
madmax_ has joined #ruby
<billy_ran_away> Can anyone explain why Mechanize would get different pages from irb and debug's irb?
btanaka has joined #ruby
SegFaultAX|work has joined #ruby
havenn has joined #ruby
Kn|t3_ has joined #ruby
Azure has joined #ruby
<shevy> billy_ran_away evil black magic
<billy_ran_away> shevy: The server is returning a page that says something about timing out...
tatsuya_o has joined #ruby
coucher has joined #ruby
gokulnath__ has joined #ruby
<khem_>  root /usr/local/snorby/public; # <--- be sure to point to 'public'! passenger_enabled on;
designated has joined #ruby
johndbritton has joined #ruby
tvw has joined #ruby
jwang has joined #ruby
imsplitbit has joined #ruby
banseljaj has joined #ruby
stega_ has joined #ruby
cloke has joined #ruby
carbncl has joined #ruby
panthrodeb has joined #ruby
crankycoder has joined #ruby
ElitestFX has joined #ruby
ElitestFX has joined #ruby
johndbritton has joined #ruby
<billy_ran_away> Can anyone help me with Ruby Mechanize?
<billy_ran_away> I can't figure out why this isn't working for me...
workmad3 has joined #ruby
<billy_ran_away> http://pastie.org/3429109
<billy_ran_away> and inputs here: http://pastie.org/3428774
berserkr has joined #ruby
<kjellski> if I do a each for an array, is it save to << into it while looping and it will do these elements at last?
tangledhelix has joined #ruby
popsch has joined #ruby
CannedCorn has joined #ruby
<rippa> lul
<shevy> wtf
<shevy> let's use english guys
<shevy> let's also try to remain sane
<shevy> insanity goes to #java and #lisp please
tilde` has joined #ruby
<shevy> hipsters to #php
dzhulk has joined #ruby
<apeiros> hipsters?!?
<apeiros> oh, right, that's the euphemism for retards…
jxpx777 has joined #ruby
Sailias has joined #ruby
<burgestrand> I think most often we‘re the hipsters D:
<apeiros> that's just how others see us because of the hipsters among us
adambeynon has joined #ruby
dzhulk has quit [#ruby]
stephenjudkins has joined #ruby
dzhulk has joined #ruby
emptyflask has joined #ruby
crazed has joined #ruby
<shadoi> Hipster Litmus Test: Ask someone under 35 if they are a hipster, if this causes a fit of apoplexy, they are a hipster.
* workmad3 has a fit of apoplexy
<shadoi> *makes a note*
<apeiros> …wow
elliot98 has joined #ruby
<apeiros> channel record? 671 people…
<burgestrand> 672!
<apeiros> only 16 less than #ror
<shevy> RUBY IS GROWING!
kirun has joined #ruby
<shevy> OUT WITH THE CHAMPAGNER AND DOWN WITH THE PANTS!
<oddmunds> i don't want to be a part of this
oddmunds has quit [#ruby]
<shevy> #bash has about the same amount of people though :(
* apeiros turns around and closes his eyes
enroxorz has joined #ruby
<shadoi> lol
<workmad3> oh wait, I can't be a hipster... I don't take crap photos and apply vintage filter effects to them
<apeiros> you mean you don't use instagram?
<apeiros> y u so old man?
<workmad3> apeiros: I could... but I don't :P
zakwilson has joined #ruby
andremaha has joined #ruby
dzhulk has joined #ruby
ameba has joined #ruby
gabeh_ has joined #ruby
<kjellski> banisterfiend, if I might add a suggestion, it would be nice to be able to quit pry with a crtl-c or is that reserved for another functionality?
snearch has joined #ruby
<td123> kjellski: send EOF (C-d)
axl_ has joined #ruby
swills has joined #ruby
swills has joined #ruby
<kjellski> td123, but that is reserved already ba stepping through debugging right?
<td123> kjellski: then C-\
<td123> sends a sigquit
andrewhl has joined #ruby
alfism_ has joined #ruby
badabim_ has joined #ruby
dom96 has joined #ruby
Araq has joined #ruby
glosoli has joined #ruby
musl has joined #ruby
nobitanobi has joined #ruby
graft has joined #ruby
senthil has joined #ruby
dom96 has quit ["Leaving"]
justinmcp has joined #ruby
xoebus has joined #ruby
d3vic3 has joined #ruby
apok_ has joined #ruby
odinswand has joined #ruby
<graft> okay, here is a weird thing: x = Hash.new({}); x[:blah][:blah] = 1; x; => {}; x[:blah][:blah]; => 1
<graft> wth?
Faris has joined #ruby
Eiam has joined #ruby
glosoli has joined #ruby
skim1776 has joined #ruby
thebope has joined #ruby
<workmad3> graft: x[:blah] returned the hash you passed as the default value
<Eiam> if I have two optional parameters to a method, is there some way to make ruby assign the value i sent based on the default parameter
<Hanmac> graft, because it changes the default value
<workmad3> graft: which doesn't prompt a change to the internal structure
<Eiam> like if i say def test(a,b=:hello, c={}) end, then test("sup",{my=>hash}) would assign a and c and ignore b?
Willejs has joined #ruby
PragCypher has joined #ruby
<workmad3> Eiam: no
<Eiam> okay, any design recommendations to solve this problem?
<graft> ah, hmm
<Eiam> i don'tw ant to incldue b as a k=>v in c
<graft> well, i don't understand why x returns {}, while x[:blah][:blah] returns the stored value
<workmad3> graft: x is still a reference to an empty hash
<workmad3> graft: but an empty hash that will return another hash instead of nil when you dereference with an unknown key
<graft> where is x[:blah][:blah] stored then?
d3vic3 has joined #ruby
<workmad3> graft: hopefully that will make it a bit clearer
ikaros has joined #ruby
<Kageroc> how to do write a regex to match "/**" from somthing like 159.202.161.0/25 or 10.1.2.0/23
marvin_ has joined #ruby
<Hanmac> graft: you need this: x = Hash.new {|h,k| h[k]={} }
<Hanmac> but be carefull ... an hash created like this is not maschalable anymore
punkrawkR has joined #ruby
Araq has quit [#ruby]
<apeiros> x = Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) } # <-- for more funs
ephemerian has joined #ruby
ReTFEF has joined #ruby
<Hanmac> but sometimes in that cases i make a subclass from hash, because i need the marshal feature
atlantaman has joined #ruby
sawjig has joined #ruby
btanaka has joined #ruby
jfelchner has joined #ruby
johndbritton has joined #ruby
tatsuya_o has joined #ruby
headius has joined #ruby
<apeiros> Hanmac: yeah, it's sad that ruby doesn't have Proc#to_s
<apeiros> akin javascripts' Function#toString
<apeiros> though, the closing scope would be lost. which is probably the reason.
incomprehensibly has joined #ruby
<hoelzro> apeiros: wouldn't the closing scope also be lost for JS?
<apeiros> hoelzro: of course
<apeiros> IMO it's good enough
<hoelzro> apeiros: so wouldn't it be good enough for Ruby? =)
<apeiros> once again my opinion is to stop babysitting devs
glosoli has joined #ruby
<apeiros> hoelzro: IMO? absolutely. ^
diffkid has joined #ruby
atmosx has joined #ruby
shadoi has joined #ruby
<Hanmac> apeiros: i think ruby needs an proc variant without closing scope ... that can be turned into a string or be saved & loaded with marshal ... :/
munx has joined #ruby
<hoelzro> hmm...Lua has a library for persisting functions, even with their closing scope
<hoelzro> I don't see why Ruby couldn't have that (at least for a binary format)
<apeiros> Hanmac: don't get me started…
<Hanmac> in 90% of cases i dont need a closing scope, and in the cases of closing scope, there are not saved
<apeiros> Hanmac: the solution in my own language is that you have to use a sigil to mark variables taken from "outer-scope"
<apeiros> which means it can infer whether it's actually a closure or not
<apeiros> and therefore a) apply optimizations and b) provide serialization if applicable
<Hanmac> hm maybe you can get the ruby developers to impl that
<apeiros> yeah, sure…
munx has quit [#ruby]
<apeiros> (for sure not the sigil I used *g* - for added drama, I chose "!", so !var is an enclosed var)
radic has joined #ruby
flippingbits has joined #ruby
cobragoat has quit ["Leaving"]
badabim has joined #ruby
cobragoat has joined #ruby
Azure has joined #ruby
<shevy> hmm
glosoli has quit [#ruby]
<shevy> apeiros you are still working on your own language?
zomgbie has joined #ruby
<Hanmac> or an optional parameter to like Proc.new(false) {|h| ... } ... with false you say you want an closed proc without access to outside varables ...
adeponte has joined #ruby
rizzy has joined #ruby
RobertoGiacobbo has joined #ruby
Willejs_ has joined #ruby
mengu has joined #ruby
gokulnath has joined #ruby
shobhitg has joined #ruby
Russell^^ has joined #ruby
supergiantrobot has joined #ruby
<shevy> the good thing by certain links is
<shevy> if the one who posted it, disappears, I am not going to click on it
<shevy> hmm
<shevy> is a hash with 2515 keys big?
<shevy> each key points to another hash, which then has content like: http://pastie.org/3429574
munx has joined #ruby
flippingbits has joined #ruby
ryannielson has quit [#ruby]
Divinite has joined #ruby
<Divinite> Anyone here know how to tell ruby not to use all of the memory and crash when compiling native extentions?
red13 has joined #ruby
Pcboy____ has joined #ruby
<Hanmac> Divinite: i dont think so ... but if that happens then something is very wrong with the native extention
<Divinite> Alright... I'll rephrase that. Can anyone tell me how to input custom gcc variables when compiling native extentions.
<Divinite> Hanmac: I get an out-of-memory error.
glosoli has joined #ruby
<Hanmac> what native extention did you use? (or an own write?)
<Divinite> Eventmachine.
johndbri_ has joined #ruby
<Hanmac> hm i dont know ... maybe you use it wrong? ...
spanner has joined #ruby
<Divinite> Nope. gem install eventmachine.
<Divinite> *without the dot.
atlantaman has joined #ruby
trend has joined #ruby
khakimov has joined #ruby
<mksm> you can pass flags to the compiler with CFLAGS and such
<Hanmac> you mean it breaks when you try to install it?
<Hanmac> have you the right for installing gems?
waxjar has joined #ruby
segora has quit [#ruby]
jxpx777_ has joined #ruby
fridim_ has joined #ruby
tyfighter has joined #ruby
kerframil has joined #ruby
nobitanobi has joined #ruby
qianen has joined #ruby
minijupe has joined #ruby
waxjar has joined #ruby
<waxjar> When writing an API wrapper with HTTParty, would it be best to rescue SocketErrors and raise my own exceptions or not touch the SocketErrors raised by HTTParty at all, despite being kind of vague (example: "SocketError: getaddrinfo: nodename nor servname provided, or not known" for DNS not resolving / the connection actually being offline)?
chrxn has joined #ruby
<apeiros> shevy: of course
Divinite has joined #ruby
looopy has joined #ruby
ilyam has joined #ruby
gen0cide_ has joined #ruby
Sigma00 has joined #ruby
remink has quit [#ruby]
<graft> Hanmac: what do you mean by maschalable?
jamw has joined #ruby
<shevy> apeiros nice. you dont happen to run it on github? :>
baroquebobcat has joined #ruby
apok has joined #ruby
atmosx has joined #ruby
Boohbah has joined #ruby
enroxorz has quit [#ruby]
briankbuckley has joined #ruby
<Hanmac> graft: i meaned mashalable ... with the mashal module you can turn ruby objects into bytestring, and back
<graft> man, the thing that messes me up more than anything else in ruby is that 0 is not false
<graft> Hanmac: oh... not a problem, but thanks for the caveat
popsch has joined #ruby
<Hanmac> its important as sample if you want to save the objects for save game files
<workmad3> Hanmac: marshalable?
<workmad3> Hanmac: a.k.a. serializable?
dootdoot has joined #ruby
<workmad3> graft: stop thinking in C terms :P
trivol has joined #ruby
<graft> workmad3: it's been 20 years, it's hard!
<Hanmac> yes ... sometimes the current word does not come into my mind
<workmad3> Hanmac: it's the 'r' you missed out that also didn't help ;)
<workmad3> graft: :)
<Hanmac> graft do: unless (i.zero?)
<workmad3> graft: in all honesty, I frequently get thrown by that when I'm doing something like a project euler problem and want to do 'if i % 2'... I always forget about .even? :)
jlogsdon has joined #ruby
stkowski has joined #ruby
tectonic has joined #ruby
emocake has joined #ruby
flagg0204 has joined #ruby
pen has joined #ruby
mxweas_ has joined #ruby
<apeiros> shevy: I do, but the one on github is rather outdated
<apeiros> iirc most ideas are already in it, though
<apeiros> and for your purposes - the one on github is not running iirc
pen has joined #ruby
tommyvyo has joined #ruby
evenix has joined #ruby
Foxandxss has joined #ruby
blooberr has joined #ruby
nate has joined #ruby
asobrasil has quit [#ruby]
Stelpa has joined #ruby
ramiyengar has joined #ruby
seitensei has joined #ruby
shadoi has joined #ruby
startling has joined #ruby
fudanchii has joined #ruby
denom has joined #ruby
SlVrSmRi has joined #ruby
<SlVrSmRi> anyone here?
PragCypher has joined #ruby
<SlVrSmRi> i have a question...can i have private method defined inside a Module, and then call that function from within that module, from another funtion? my tests show that its undefined when it gets called..
madmax_ has joined #ruby
<apeiros> SlVrSmRi: pastie code
<SlVrSmRi> i dont see why i shouldnt be able hide a function in a Module
<apeiros> SlVrSmRi: remember that in order to call instance methods, you must be in an instance of the same class
<apeiros> that's equally true for modules
Murr has joined #ruby
<apeiros> but to answer the base question: yes, you can have private instance methods in modules and still be able to use them
<apeiros> there's even a special form, see Module#module_function - that's for stuff like Math.sin(x), which can also be used as: include Math; sin(x)
<SlVrSmRi> i want to design the module so you cannot all the function from outside the class in the module
etehtsea has joined #ruby
<SlVrSmRi> all=call
thebope has joined #ruby
<SlVrSmRi> so moduleX.function_call would not work..
<SlVrSmRi> thanks for the comments all
<SlVrSmRi> appreciate it..
carlyle has joined #ruby
moshee has joined #ruby
<banseljaj> Hi. I need a bit of dubugging
<banseljaj> My code isn't doing what it's supposed. to. It gets stuck in an infinite loop
* hkhalid plays Rick Ross
<hkhalid> banseljaj link
nate has quit [#ruby]
<blooberr> how do I ensure that only one instance of a process with unique flags can run? I'll be launching tasks from a single script, but passing in flags.
<Hanmac> i need to raise an Errno::EACCES from C side how is the best way to do that?
<banseljaj> # A Memorizing Program. It is made on the express request of my dear
<banseljaj> # friend selpa`i to help him memorize "lo cmalu noltru".
<banseljaj> #Ask for the file and save it.
<banseljaj> print "Enter name of file you want to load: "
<banseljaj> filename = gets.chomp
<banseljaj> #Read the file and split it into sentences.
<banseljaj> sentences = File.read(filename).split('.i ')
<banseljaj> #Loop through the sentences and ask the user to type them.
<banseljaj> sentencesDone = []
Stelpa has joined #ruby
<banseljaj> sentences.each do
<banseljaj> |sentence|
<banseljaj> if sentence == ""
<banseljaj> next
<banseljaj> else
<banseljaj> puts sentencesDone.join(".i ")
<banseljaj> print "Type the next sentence: "
<banseljaj> typedSentence = gets.chomp
<banseljaj> redo until typedSentence == sentence.strip
<banseljaj> sentencesDone << sentence
<banseljaj> end
<banseljaj> end
<banseljaj> Sortry
<hoelzro> banseljaj: link?
<banseljaj> hoelzro: ^
Stelpa_ has joined #ruby
atlantaman has joined #ruby
Divinite has joined #ruby
<banseljaj> hkhalid: https://gist.github.com/1879355
havenn has joined #ruby
pentesticles has joined #ruby
zomgbie has joined #ruby
andrewpthorp has joined #ruby
pentesticles has quit [#ruby]
tayy has joined #ruby
<canton7> banseljaj, you probably want "unless" instead of "until"
<banseljaj> canton7: Ahhh.
<canton7> banseljaj, "until" is a loop, like "while"
<banseljaj> canton7: I get it. It's facepalm worthy
Willejs has joined #ruby
<Kageroc> I have a class that looks fro the following argument "Dump_log" => "/dev/stdout".... if executing from a whindows OS what would be the equivalent?
incomprehensibly has joined #ruby
<canton7> Kageroc, any reason you're not using $stdout ?
<Kageroc> not really sure :) Im new to to Programing
<Hanmac> you can use STDOUT too
<shevy> Kageroc I dont get the question
<shevy> where does argument come from?
<Kageroc> s = Net::SSH::Telnet.new(
<Kageroc> "Dump_log" => "/dev/stdout",
<Kageroc> "Session" => ssh
symb0l has joined #ruby
h4mz1d has joined #ruby
<shevy> ok, so it is an argument passed to Telnet.new
<shevy> still not sure what you need though. :)
<Kageroc> Yes and to be honest im not sure what the arguemnt is there for...
<Kageroc> well IM running this from a windows OS
<shevy> havent seen it so far either
ndee has joined #ruby
RomyRomy has joined #ruby
<Kageroc> so when I run this from a windows PC i get: No such file or directory - /dev/stdout (Errno::ENOENT)
ndee has joined #ruby
<ndee> how can I create an array which contains regex patterns?
<Kageroc> i was wondering what I change to allow this to work from a windows environment
<Hanmac> Kagroc, replace "dev/stdout" with STDOUT
liluo has joined #ruby
<Kageroc> ok I will try that
<Kageroc> thanks
nonotza has joined #ruby
luckyruby has joined #ruby
<Hanmac> has someone enough native extension expdience to know what s the best way to raise Errno exeptions from C?
carlyle has joined #ruby
_obiJuan has joined #ruby
Stelpa has quit ["butts"]
medik has joined #ruby
Helius has joined #ruby
CannedCorn has joined #ruby
<apeiros> Hanmac: there's Errno errors in core already. use the same mechanism?
nfluxx has joined #ruby
AndroUser2 has joined #ruby
flagg0204 has joined #ruby
<Hanmac> currently i dont know how ruby does that internal ...
arturaz has joined #ruby
bigkm has joined #ruby
nari has joined #ruby
drojas has joined #ruby
yoklov has joined #ruby
<drojas> I need to implement a weighted graph using the Ruby Graph Library RGL and I'm having some problems..
statix has joined #ruby
<nobitanobi> Given something like this: @recent_activity.each do |activity| .......... end - How can I have an iterator (integer) to use inside the block?
<nobitanobi> for each activity, starting from X
carlyle has joined #ruby
<apeiros> nobitanobi: each_with_index
<nobitanobi> sweet
<nobitanobi> but that will make the index to start at 0 I assume
<apeiros> add X, or implement your own if you need another start value
<nobitanobi> ok
<nobitanobi> thanks
zomgbie has joined #ruby
<nobitanobi> ruby is the most beautiful language I've ever seen
<nobitanobi> for god's sake
<drojas> I need to implement a weighted graph using the Ruby Graph Library RGL and I'm having some problems..
dwon has joined #ruby
musl has joined #ruby
<nobitanobi> apeiros: I can't add X at the index in the declaration
<apeiros> I didn't mean in the "declaration", I meant in the iteration.
havenn has joined #ruby
<arturaz> Drojas, use jruby abd jgrapht.
<nobitanobi> ok...
<apeiros> but: module Enumerable; def each_with_index_from(x); each do |ele| yield(ele, x); x+=1; end; end
<apeiros> now you can just do: foo.each_with_index_from(5) do |ele, idx| …
<drojas> arturaz, I'm using rails.. can I use jgrapht?
<arturaz> If you run jruby you can use any java lub
<arturaz> Lib
musl has joined #ruby
randym has joined #ruby
<drojas> arturaz the problem is I'm developping a ruby on rails app.. so I need a ruby solution
thebope has joined #ruby
<arturaz> Jruby is ruby :)
<drojas> So.. can I install jruby as a gem and use any java library?
<arturaz> No, jruby is a ruby version
<banseljaj> drojas: No. But you can install jruby and install any gem you like on it
<deryldoucette> jruby isn't a gem its a full ruby
<banseljaj> plus you can use any java library
pdtpatr1ck has joined #ruby
<arturaz> Regular ruby is writteb in c. Jruby is written on java and runs on jvm.
flagg0204 has joined #ruby
<drojas> ok thanks I'll do some research
sythe has joined #ruby
sythe has joined #ruby
MasterIdler_ has joined #ruby
vjacob has joined #ruby
carlyle has joined #ruby
<linduxed> slightly off-topic, but what would one call an entire indentation level inside a cucumber file? i mean all of the Given, When, Then in a Scenario for instance. A block?
<linduxed> mainly wondering because when i read about higher level testing all these fancy words pop up like "stories" and "scenarios"... "events" and other stuff i can't remember now
justfielding has joined #ruby
etank has joined #ruby
matthias3 has joined #ruby
looopy has joined #ruby
nobitanobi has joined #ruby
evenix_ has joined #ruby
<davidcelis> i would call it the scenario
<Hanmac> apeiros: i searched through io.c ... i does not found how ruby get the currect Errno class
zulax has joined #ruby
_Vi has joined #ruby
_Vi has quit [#ruby]
pu22l3r has joined #ruby
<apeiros> Hanmac: I think it comes from error.c
idletom has joined #ruby
pu22l3r has joined #ruby
ikaros has joined #ruby
peterhil has joined #ruby
seanstickle has joined #ruby
hasrb has joined #ruby
<Hanmac> hm the only thing i found is get_syserr but it is not avalable from the outside ...
akem has joined #ruby
kinzze1 has joined #ruby
ninor has joined #ruby
johnduhart has joined #ruby
f00fSteR has joined #ruby
<f00fSteR> hey chan
<f00fSteR> i get the followingerror Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.5.4.gemspec]: invalid date format in specification: "
<banisterfiend> Hanmac: Und.
<f00fSteR> something about invali date specification
a215 has joined #ruby
<f00fSteR> Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/json-1.5.4.gemspec]: invalid date format in specification: "2011-08-31 00:00:00.000000000Z"
<f00fSteR> can someone open up their /Library/Ruby/Gems/1.8/specifications/json-1.5.4.gemspec
<f00fSteR> and tell me their date format real quick
<f00fSteR> please
<f00fSteR> :)
iocor has joined #ruby
matthias7 has joined #ruby
<Hanmac> apeiros: ok nevermind found the currect function
redjack1964_ has joined #ruby
<f00fSteR> ..
<f00fSteR> /Library/Ruby/Gems/1.8/specifications/json-1.5.4.gemspec <-- someone give me their date format from this file plz
tomzx has joined #ruby
<tshirtman> f00fSteR: ↑
<tshirtman> http://www.pkimber.net/howto/deploy/vagrant/issues.html → Edit /var/lib/gems/1.8/specifications/json-1.5.4.gemspec and remove 00:00:00.000000000Z on the s.date line.
<seanstickle> Once again, the simple skill of *typing words into Google and pressing enter* succeed in answering the unsolvable questions.
<tshirtman> in less time than it takes to ask the question
<f00fSteR> tshirtman: i did... but you were faster
<f00fSteR> tshirtman: thanks a millions :)
<tshirtman> i started searching like 5 minutes after you asked, and found in less than a minute, having absolutly zero knowledge about the problem, i don't even know how ruby gems works/are installed/managed…
twelvechairs has joined #ruby
<tshirtman> but, hey, it happens, sometime i too, forget about google and just ask :)
PaciFisT has joined #ruby
<kinzze1> sometimes the problem is to find the correct keywords, i think
twelvechairs has joined #ruby
shevy has joined #ruby
zachc has joined #ruby
<zachc> anyone here familiar with ruby/gtk?
<zachc> quick stupid question
<shevy> zachc yea
<zachc> shevy: ok maybe I'm focusing too much on frontend before building up the backend, but can you tell me, why my about dialog launches at program launch?
<shevy> zachc depends when you trigger it
<shevy> u use Gtk::AboutDialog ?
<shevy> about_dialog.run # <-- this is usually the way to run it
<shevy> I'd put it into a method, and call that method when an event happens, like click on a button
<zachc> #BEGIN HELP MENU
<zachc> abouti = Gtk::ImageMenuItem.new Gtk::Stock::ABOUT
<zachc> aboutdialog = Gtk::AboutDialog.show (window, {})
<zachc>
<zachc> helpmenu.append abouti
<zachc> mb.append helpm
<zachc> #END HELP MENU
<zachc> ignore the Is
<shevy> gtk2/sample/misc/aboutdialog.rb
<zachc> where is that?
<shevy> zachc the source distribution of ruby-gnome
<luckyruby> what's the preferred ruby style for method returns? "return value" or just "value"?
<shevy> zachc, you should always download the latest ruby-gnome2 source distribution. there are about 200 different .rb files, examples
<shevy> I learned a lot from studying them
kenperkins has joined #ruby
milkpost_ has joined #ruby
<shevy> that is this aboutdialog.rb example
<shevy> you see the .run method called
<shevy> trigger it in your method
<zachc> find / -name aboutdialog.rb worked to bring it up
mythmon has joined #ruby