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/
<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
<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 ;)
<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
<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
<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
<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?
<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"
<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)
<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?
<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
<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?
<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.
<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?
<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
<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 }
<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
<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 ?
<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?
<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.
<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
<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?
<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: 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
<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...
<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
<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 ...
<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.
<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
<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