pastjean has quit [Remote host closed the connection]
<Paradox>
y no hex
TPFC-SYSTEM has joined #ruby
perryh is now known as perry
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
tintin has joined #ruby
<tintin>
Where is the webrick ? I knew webrick is integreted with ruby?
<jumpingcloud>
is this something I can call from a linux command line?
tds_ has joined #ruby
ichilton has quit [Ping timeout: 245 seconds]
<jumpingcloud>
I'm new to ruby and my background is more of a scripting one
<learc83>
you could write a script and call it from the command line
<jumpingcloud>
hm yeah that's what i thought...
cherrypeel has joined #ruby
<jumpingcloud>
and i've been trying, but all i get is errors back, and i'm getting to the point where i'm thinking i must be doing something wrong from the get go.
ichilton has joined #ruby
tds has quit [Ping timeout: 246 seconds]
tds_ is now known as tds
macmartine has joined #ruby
<learc83>
can you get the examples to work?
<jumpingcloud>
no =( and it seems so simple, server name, password etc , i'm freaking out =)
<tintin>
data << "#{tmp}: #{value}" << CRLF
<tintin>
What is CRLF ?
<cherrypeel>
CRLF is a newline (I think a Windows newline, specifically)
<jumpingcloud>
i'm also getting a bunch of deprecated errors for one of the gems it relies on but.. it should still work, no?
<learc83>
what version of ruby are you running?
<tintin>
line[3,1] == '-'
<tintin>
What is line variable type?
<jumpingcloud>
with rvm i've tried in both 1.9.3 and 1.9.2 , and on the github site it says that it's verified to work in 1.9.2
<tintin>
a map/array/ ?
<learc83>
wow this thing really has a lot of dependencies
<jumpingcloud>
i shouldn't have to do anything with rake, should I?
Progster has quit [Read error: Operation timed out]
nari has quit [Ping timeout: 248 seconds]
tonini has quit [Remote host closed the connection]
brianpWins has joined #ruby
Neil_ has joined #ruby
greyEAX has quit [Read error: Connection reset by peer]
schickung has joined #ruby
Rochefort has quit [Remote host closed the connection]
<bigsky>
shevy: which kind of comile chain?
<bnagy>
why do you want to build yourself rather than use rubyinstaller (mingw build) or jruby?
abionic has quit [Ping timeout: 245 seconds]
execute has joined #ruby
execute has quit [Client Quit]
<shevy>
bigsky: everything that you need in order to compile C programs from source
<shevy>
or use linux :P
oz has quit [Ping timeout: 246 seconds]
* Hanmac
still wonder why windows is not shipped with some small c(++) compiler ... :/
oz has joined #ruby
<bnagy>
same reason decent server distros for linux don't ship with build tools
<shevy>
Hanmac: microsoft tries to impose corporation agenda onto users. the main notion is - average joe won't need this, so we won't ship it by default
<hoelzro>
but installing the tools is trivial
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
mucker has joined #ruby
banseljaj is now known as imami|afk
heftig has quit [Quit: leaving]
prtksxna has quit [Remote host closed the connection]
berserkr has joined #ruby
heftig has joined #ruby
pk1001100011 has joined #ruby
<Spooner>
Hanmac : More importantly, why aren't the Ruby windows installers shipped including the devkit? It is pretty much required...
liuchong has quit [Quit: Leaving]
<shevy>
hmm perhaps a substantial size increase?
lkba has quit [Quit: Bye]
prtksxna has joined #ruby
prtksxna has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
<Spooner>
Well, true, it would double the size, but unless you are on dial-up, I don't see that as an issue (17 -> 40mb)
<Spooner>
Although a lot of extensions are pre-compiled on Windows, a sizeable chunk aren't.
abionic has joined #ruby
freeayu has quit [Quit: 离开]
ABK_ has joined #ruby
manizzle_ has joined #ruby
gorpon has quit [Remote host closed the connection]
<gogiel>
i've got two tables with the same size. how can i iterate over both in the same time?
abionic has quit [Ping timeout: 249 seconds]
<gogiel>
something like (join_tables_somehow).each do |t1_var, t2_var|
<bnagy>
try #zip
<heftig>
gogiel: tables?
Foxandxss has joined #ruby
<gogiel>
bnagy: thanks! it's what i'm looking for
<shevy>
Spooner: well not sure... I lately downloaded the haskell ghc and I was really shocked that it was around 110 MB in size
mrkhat has joined #ruby
<shevy>
python 2.4.5 sits at 7.8M, python 3.3.x at 14M
<heftig>
gogiel: it's not lazy, though
<heftig>
if it has to be lazy:
<shevy>
boost 1.49 at 47M
<heftig>
e1, e2 = [1,2,3].each, [:a,:b,:c,:d].each; loop do i1, i2 = e1.next, e2.next; puts "#{i1}, #{i2}" end
<gogiel>
bnagy: rememberd the function from erlang but couldn't recall name :)
wrapids has joined #ruby
<Spooner>
Ack, I often want to do that, but I never thought about zip being useful for that :$
<gogiel>
heftig: yeah, but it's just for test purpose and table has <10 elements
<wrapids>
I got a rake failed! cannot load active support. I ran gem install active support. Now I'm getting:
<wrapids>
bundle install is telling me it can't locate gems
<Spooner>
[[1,2,3,4], [:a,:b,:c,:d]].zip.each do |i1, i2| puts "#{i1}, #{i2}" end # Considerably shorter - and surely the zip is an iterator, so the cost isn't significant, regardless of the array sizes?
<shevy>
I think you are in a world of pain from where escape will be hard wrapids
<mrkhat>
Can anyone explain why the after.each loop in this code: http://pastebin.com/LrbAJXb5 only gets ran the first time through the before.each loop then never gets ran again
<wrapids>
shevy: -.- why's that?
<shevy>
wrapids because you use several layers around layers. bundle is one of those things that should die as quickly as possible. rake as well
<shevy>
what is the output of "gem list"
<shevy>
and how comes you have old activesupport anyway
<wrapids>
shevy: I don't know. First time using ruby, moving from gitlab to redmine
<Hanmac>
Spooner i think you mean [1,2,3,4].zip([:a,:b,:c,:d]) do |i1, i2| puts "#{i1}, #{i2}" end
<mrkhat>
So is it possible to nest each do loops?
vlad_starkov has joined #ruby
<Spooner>
Hanmac: Oh yes, sorry.
<bnagy>
mrkhat: yes, although calling them loops leads to confusion
<shevy>
redmine demands rails, bundler originated from the rails community too. they should give instructions how to clean up the mess they made in the first place
thecreators has quit [Quit: thecreators]
<mrkhat>
What should I call them to be more clear?
az7ar has quit [Ping timeout: 240 seconds]
<Spooner>
Oh no, #zip produces an array, not an iterator. I really suck at remembering what does arrays and what does iterators for some reason (though it really isn't complicated :D).
<bnagy>
iterators I guess
perry is now known as perryh_away
<mrkhat>
ok so can anyone look at this http://pastebin.com/LrbAJXb5 and explain why the after.each iterator only gets called the first time through the before.each iterator
<mrkhat>
hanmac: hrm ok, that does seem like a better function to use
<mrkhat>
thanks for the lead
<shevy>
you know what is one of those things I hate the most?
ramblex has quit [Quit: ramblex]
<bnagy>
grammar?
<shevy>
nope!
<shevy>
libtool
jimeh3 has quit [Ping timeout: 240 seconds]
king313 has quit [Ping timeout: 246 seconds]
<shevy>
there is some check that is done during configure stage, where it'll report something like "pkg-config returned glib version 2.28.3 but version 2.33.1 was found". And I still have not found out where precisely that old version is stored... but when I compile that version into the same prefix again, and then compile another version, suddenly things work
jimeh3 has joined #ruby
<Hanmac>
shevy maybe you installed glib 2.28 into usr/local ?
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
ciopte7 has quit [Quit: ciopte7]
<shevy>
Hanmac nope, I dont even have /usr/local
<Hanmac>
i am sorry for you :(
flype has joined #ruby
<mrkhat>
hrm unfortunately find is an available method for mysql results
polysics has quit [Remote host closed the connection]
<shevy>
why sorry - /usr/local is entirely useless. installing into versioned directories is much better everywhere
<shevy>
libtool however is a stopper for this
jimeh3 has quit [Ping timeout: 244 seconds]
<shevy>
I'll replace its functionality in ruby one day
jimeh3 has joined #ruby
az7ar has joined #ruby
d3vic3 has joined #ruby
neku has joined #ruby
king313 has joined #ruby
mpereira has quit [Quit: leaving]
thecreators has joined #ruby
irrationalfab has joined #ruby
banisterfiend is now known as travis-ci
travis-ci is now known as banisterfiend
chrismdp has joined #ruby
Juul has quit [Ping timeout: 248 seconds]
chrismdp has quit [Client Quit]
chrismdp has joined #ruby
king313 has quit [Ping timeout: 248 seconds]
tatsuya__ has joined #ruby
arturaz has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 264 seconds]
arturaz has joined #ruby
imami|afk is now known as banseljaj
[Neurotic] has quit [Quit: Leaving]
workmad3 has joined #ruby
wrapids has quit [Ping timeout: 264 seconds]
tatsuya_o has quit [Ping timeout: 245 seconds]
Kesava has joined #ruby
reedz has joined #ruby
niklasb has joined #ruby
<Neil_>
In the app directory RVM is currently set to 1.9.2, however, when I boot rails server a vendor/cache for ruby 1.9.1 is created and Rails seems to be using that. Is there a config setting that I need to change for this? I'm assuming that Rails 3.0.6 doesn't insist on ruby 1.9.1
<JonnieCache>
HAHAHAHA my friend says that his mother has started telling him he should use rails instead of PHP
<JonnieCache>
his mother can barely operate a computer apparently
mutewinter has joined #ruby
<JonnieCache>
that is humuliating
_root_ has joined #ruby
<shevy>
lol
chrismdp has quit [Quit: chrismdp]
<Tasser>
JonnieCache, muahahaha
emmanuelux has joined #ruby
<JonnieCache>
he also said some random drunk guy in the street, also a non programmer, was telling him to drop PHP for rails
<JonnieCache>
its really starting to annoy him apparently
kjellski has joined #ruby
<JonnieCache>
hahahaha
dekroning has quit [Ping timeout: 264 seconds]
<shevy>
bigsky: whatever version you use is the wrong version you use as it requires a base ruby installed
<shevy>
bigsky: so you use the wrong ruby sources
mvangala_home has joined #ruby
mvangal__ has joined #ruby
<shevy>
rails is so big that it is killing ruby :(
<ij>
What do you mean?
<shevy>
people come here with rails specific problems that only rails-savvy guys can solve. if you "just know" ruby alone, you can't help like 50% of the people here on #ruby anymore
<shevy>
I mean just look at Neil_'s question
<shevy>
then take activerecord and bundler, both originating from the rails community
<Hanmac>
shevy i think the problem is that why are to dumb to read the channel topic :P
mvangala_home has quit [Ping timeout: 246 seconds]
<workmad3>
shevy: Neil_'s question can be answered easily - 'the 1.9.1 is about binary compatibility versions within a gem repository... don't worry about it'
<workmad3>
shevy: the context might be a rails environment, but it's really just a question about a gem repo containing a directory for 1.9.1 even in ruby 1.9.3 :)
<Hanmac>
workmad3 i think 1.9.series is abi compatible but i dont think they are binary compatible
<workmad3>
Hanmac: that's what I meant, sorry
liluo has quit [Remote host closed the connection]
<shevy>
Hanmac: btw I just found out why the wrong glib was found... there was sneakily a glib version in /lib/x86 ... for god knows why this path is used...
seanstickle has joined #ruby
<workmad3>
Hanmac: still, the answer 'it's nothing to do with actual versions, just part of the internal organisation, don't worry about it' applies :)
<Hanmac>
shevy the /lib/x* path is used to make sure that multible architectures are co-installable
<Neil_>
workmad3: shevy: RVM and bundler are used. When I run "rails server" webrick says it's running on 1.9.2, but rake commands are referencing a cache of 1.9.1 in the /vendor/cache dir and I'm not sure why.
<workmad3>
Neil_: as I said... it's part of the internal organisation, nothing to worry about
<Neil_>
workmad3: Running "rake tests" breaks because of the rdoc version referenced in the cache of 1.9.1.
<workmad3>
Neil_: unless you happen to know about abi compatibility or care enough to dig into it, just ignore it as part of the path :)
<bigsky>
shevy: what is a bbase ruby ?
<workmad3>
Neil_: no, that'll be broken because of a different issue
<workmad3>
Neil_: and I'd suggest you go to #rubyonrails and give them a stack trace of the error along with your Gemfile in a gist
<Neil_>
workmad3: Will do, thanks for the help.
<workmad3>
Neil_: and try not to assume that, because you don't understand why something is there, it must be the source of your problems ;)
<Hanmac>
shevy today is a good day because acta died :D
<workmad3>
Hanmac: at least, it died in the EU
<Hanmac>
the next enemy will be IPRED
<vectorshelve>
What a boring day it's been :-/
<workmad3>
Hanmac: hopefully that will kill it completely, but will need to wait and see I guess :)
irrationalfab has quit [Remote host closed the connection]
<workmad3>
Neil_: well, it would help if you said they were warnings, not errors
<workmad3>
Neil_: and neither of them have anything to do with the 1.9.1 stuff, as I said... one is telling you about a deprecation , the other is telling you that nokogiri was built against one version of the library 'libxml' but when it loaded it got loaded with a different version
<ij>
shevy: what Hanmac said -- therre's #rubyonrails for that.
<workmad3>
ij: and there's those of us that exist in both channels :P
<Hanmac>
and there is a spam free channel #ruby-lang :P
<ij>
Yup. :] I come with ruby issues and topic here, all-rails goes where it belongs.
<ij>
#ruby > #ruby-lang
* Hanmac
makes advertising: "#ruby-lang : where tintin is banned"
<bnagy>
:D
<bnagy>
now we just need to get vectorshelve banned there and life will be good
<workmad3>
Hanmac: :D
<shevy>
lol tintin is banned on #ruby-lang ?
<workmad3>
shevy: yeah, I think he lasted 2 hours there
<vectorshelve>
shevy: hai :)
<bnagy>
yeah he trolled zenspider
<vectorshelve>
bnagy: STFU :)
<Neil_>
workmad3: Thanks again, will stop by #rubyonrails, bye for now
<shevy>
hehe
<JonnieCache>
was tintin that guy who was arguing about compilers last week?
<vectorshelve>
shevy: who is tintin ? the vintage comic character ? :)
<bnagy>
among other retardedness, yeah
<JonnieCache>
that was funny tbh
<shevy>
vectorshelve: no idea really. I think I saw him here sometimes
<shevy>
RubyPanther is also banned from #ruby-lang
<vectorshelve>
shevy: the name in irc sounds quite familiar... in and around channels.. banned unbanned... :)
<bnagy>
all of this is running counter to ij's assertion
<vectorshelve>
shevy: oh god.. RubyPanther is banned there ? :-/ that's wierd.. he has always been a cool guy
<shevy>
you'll get banned when egospider doesn't like ya
<vectorshelve>
when is bnagy gonna be banned ? :)
<vectorshelve>
shevy: will update the IP ;)
<shevy>
bnagy behaves on #ruby-lang
<shevy>
pffft... you aren't sufficiently lazy then
fbernier has joined #ruby
ph^ has quit [Remote host closed the connection]
<vectorshelve>
shevy: he better does... has been trying to piss me off since the past few days.. ;)
<workmad3>
hmm, it sounds like you're suggesting that zenspider runs some sort of dictatorship in #ruby-lang :P
krusty_ar has joined #ruby
<shevy>
yeah he does
ben_alman has quit [Excess Flood]
<vectorshelve>
shevy: I am lazy abt everything else except for fighting insult and hitting ego :)
justinmcp has joined #ruby
<shevy>
vectorshelve: with IRC, not only comes idling to power but laziness to nothingness
<shevy>
it is only bad when you want or need to code something
<bnagy>
vectorshelve: mainly I'm trying to see how many repetitions it takes before you can comprehend basic etiquette
<vectorshelve>
shevy: just like how radar runs his dictatorship in the rubyonrails channel... workmad3
dekroning has joined #ruby
<bnagy>
but if you die in a fire I admit I won't be sad
<JonnieCache>
lol oh no you di'nt
<shevy>
like right now, I try to finish this one project, but it is so hot... and a lot of work... it is not even complicated, just a few hundreds line of code that I have to actively think for in order to write
<vectorshelve>
bnagy: go have a cup of coffee... and get enlightened.. :)
<shevy>
it is hot *outside
<shevy>
I don't move at all, yet I am sweating. it is no fun at all
<vectorshelve>
shevy: get a got lady inside ... :)
<bnagy>
shevy: yeah come down to the subcontinent for a while
<shevy>
man, it would still be hot
<shevy>
perhaps!
<vectorshelve>
shevy: it is... in India.. humidity is high here too...
<shevy>
I plan to retire on shining beautiful beaches
<vectorshelve>
shevy: like hawaii.. ?
<shevy>
where it may be hot but also ocean + a lot of water
<ij>
IRC dictatorships suck.
<shevy>
something like that... but I think there is too much wind on hawaii
sailias has joined #ruby
<shevy>
the humidity is awful, I almost died in malaysia
<vectorshelve>
you know whats one thing common in twitter and IRC? any guesses// ??
<bnagy>
nothing like a benevolent dictatorship for getting things done
<rking>
ij: Do people sing the "You can ask ij" song to you all the time?
<bnagy>
shevy: I was there for almost 3 years
<JonnieCache>
vectorshelve: they both consist of endless nerds whining into the void forever?
<shevy>
whoa 3 years
<shevy>
how can you stand the temperature
<ij>
rking: wat
<bnagy>
once the water to our apartment was out for 3 days :(
Dratir has quit [Remote host closed the connection]
Shahor has joined #ruby
<ij>
banisterfiend: See, when I tell my code to load stuff, the pry prompt is where it is. Pry's code is alright, it's just that I want to prompt rewrite itself when I tell it to. Possible?
<banisterfiend>
ij: i still dont know what you're saying sorry
<banisterfiend>
anyone have an idea what ij is talking about ? :)
sam113101 has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 246 seconds]
sam113101 has joined #ruby
wallunit has joined #ruby
wvms has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
kjellski has joined #ruby
<wallunit>
I have a mixin, that defines the initialize method and is supposed to call the parent's initialize method (which might be provided from another mixin or be the default object's initialize method and therfore doesn't take any arguments). So How can i detect whthere i need to pass arguments or not to base()?
<hoelzro>
wallunit: even if you knew if you had to pass arguments, what arguments would you pass?
<hoelzro>
if your mixin's initialize doesn't need arguments, I would just make its signature this:
<wallunit>
Note that it is just an unfinished example. But there are supposed to be multiple mixins that take the same arguments and should be possible to be combined in any way and order.
<hoelzro>
wallunit: if you're not using options in the mixin's initialize method, I would declare it as I suggested above and invoke super(*args)
<apeiros_>
hoelzro: just plain super
<apeiros_>
passes on all args
<bnagy>
doesn't super always pass *args?
<apeiros_>
def initialize(*); super; end
<hoelzro>
apeiros_: ah, thanks for the tip!
<apeiros_>
valid initialize which doesn't do anything but pass on all args
* hoelzro
hasn't covered classes in TRPL yet
<apeiros_>
matz' book? (TRPL)
tk___ has joined #ruby
RainbowDashh has joined #ruby
king313 has quit [Ping timeout: 264 seconds]
<hoelzro>
"The Ruby Programming Language"
Markvilla has quit [Ping timeout: 245 seconds]
Markvilla_ is now known as Markvilla
<apeiros_>
wallunit: note, ruby convention is 2 spaces indent
<hoelzro>
Daniel Flanagan I think? (sp?)
<apeiros_>
hoelzro: yes, flannagan & matz
<hoelzro>
apeiros_: oh, matz co-authored it?
<hoelzro>
I wasn't sure
<apeiros_>
it says so on the cover, yes :)
<hoelzro>
*really* good book
<hoelzro>
=)
<JonnieCache>
that book is great i highly reccommend it
<apeiros_>
oh, Flanagan actually
<JonnieCache>
its the k&r of ruby
mxweas has joined #ruby
<apeiros_>
"Flanagan & Matsumoto" on the side (lying on the desk)
lisporu has left #ruby [#ruby]
<hoelzro>
it's one of the best programming books I've read, honestly
<hoelzro>
very thorough
<wallunit>
But as I said the mixins needs the argument in their initialize method.
Spooner has quit [Ping timeout: 250 seconds]
<apeiros_>
I missed the problem - what's the problem?
<apeiros_>
blindly calling super in modules is fragile btw. - it's not guaranteed that there is a super…
<wallunit>
There are supposed to be multiple mixins that take the same arguments and should be possible to be combined in any way and order.
<apeiros_>
wallunit: yes, that's what you want to do. now where do you hit a problem?
<wallunit>
In order to call the other mixins initialization, each mixin calls super(...) in its initialize method. But when the last mixin's initialize method, calls super(...) it will call Object.initialize which doesn't take any arguments.
<JonnieCache>
put a conditional on self.superclass perhaps
<JonnieCache>
does that work in the context of mixins?
<wallunit>
apeiros_: That won't work. super is defined.
tzvi has joined #ruby
<apeiros_>
hm, wonder what that case was where that worked for me… might be that it just wasn't initialize…
kvirani has quit [Remote host closed the connection]
<banisterfiend>
apeiros_: Yeah
schickung has quit [Quit: schickung]
<apeiros_>
wallunit: make a module specific initialize. let the including class call that instead of super
<apeiros_>
relying on initialize in a module is brittle anyway
bwlang has joined #ruby
<wallunit>
that module is only used as mixin.
<apeiros_>
…unlike all other modules?
<banisterfiend>
wallunit: cant you rescue ArgumentError
andrewhl has joined #ruby
mohits has quit [Ping timeout: 264 seconds]
jumpingcloud has quit [Ping timeout: 250 seconds]
<banisterfiend>
wallunit: since all other ancestors are guaranteed to have the right number of args then ArgumentError will represent Object#initialize
<apeiros_>
an expected exception is fishy
<banisterfiend>
heh heh
bluenemo has quit [Remote host closed the connection]
king313 has joined #ruby
<wallunit>
banisterfiend: That is the best suggestion i got so far. Thanks.
<wallunit>
However I was hoping that there is a better way.
schickung has joined #ruby
jfoley has joined #ruby
Ionic` has joined #ruby
<Hanmac>
wallunit use an extra method for the module methods ... like init_modules(*args)
<hoelzro>
coderhs: there may be an FFI lib, or you can write your own binding
Progster has quit [Ping timeout: 264 seconds]
nachtwandler has joined #ruby
user__ has quit [Ping timeout: 246 seconds]
sam113101 has joined #ruby
<Gadgetoid>
coderhs: Look into SWIG, handy for wrapping up c libs
<coderhs>
i c...
<Gadgetoid>
It's copy & paste easy once you grok the basics, but there can be some gotchas in the difference between C types and those of Ruby
bosphorus has joined #ruby
<Hanmac>
swig? oO if you choice it, you will not get support from me
<Gadgetoid>
Hanmac: are you allergic to convenience? :D
tds has joined #ruby
<hoelzro>
Gadgetoid: he's probably allergic to things working almost, but not quite, right.
tds has quit [Remote host closed the connection]
tds has joined #ruby
<Hanmac>
no i am only allergic against swig
<hoelzro>
and spending more time f'ing around with the binding generator than it would have taken to write the bindings by hand in the first place
<hoelzro>
</rant>
<hoelzro>
oops
<hoelzro>
not the XML channel
<hoelzro>
end # rant
Axsuul has quit [Ping timeout: 250 seconds]
mohits has joined #ruby
<Gadgetoid>
Guess your mileage may vary, depends whether you want to be writing Ruby or C, generating worked a treat for the IO library I needed
bwlang has quit [Ping timeout: 246 seconds]
<Hanmac>
do you prefer an generated one hat fails in 50% of cases or an handwritten that works perfectly?
RainbowDashh has joined #ruby
<JonnieCache>
generated code kinda sucks anyway
<JonnieCache>
lol guess on that basis i shouldnt be using rails...
<seanstickle>
JonnieCache: or any compiler
<Gadgetoid>
Hanmac: I'd notice if it failed in 50% of cases, given that it's called in frequencies of kHz :D
<Gadgetoid>
Yay, write everything by altering the fabric of the universe so cosmic rays flip the desired bits!
sam113101 has quit [Remote host closed the connection]
dekroning has quit [Ping timeout: 250 seconds]
<Hanmac>
i saw wxRuby with is written with Swig ... it has massive problems with rubies GC
emmanuelux has quit [Ping timeout: 248 seconds]
<JonnieCache>
seanstickle: thats transformed code, not generated code ;)
savage- has joined #ruby
sam113101 has joined #ruby
<seanstickle>
JonnieCache: depends on the compiler
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
magewhopper has quit [Quit: This computer has gone to sleep]
bwlang has joined #ruby
stefanp_ has joined #ruby
stefanp has quit [Read error: Connection reset by peer]
sonkei has quit [Quit: WeeChat 0.3.8]
sonkei has joined #ruby
tatsuya__ has quit [Remote host closed the connection]
Markvilla has quit [Quit: Markvilla]
dkissell has quit [Ping timeout: 240 seconds]
dkissell has joined #ruby
jfoley has quit [Quit: jfoley]
plastics has quit [Ping timeout: 246 seconds]
tk___ has quit [Quit: ばいばい]
hoelzro is now known as hoelzro|away
pk1001100011 has left #ruby ["I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run"]
Spooner has joined #ruby
pk1001100011 has joined #ruby
Flock_ has quit [Ping timeout: 245 seconds]
erahul has joined #ruby
erahul has quit [Quit: Leaving]
amaus has quit [Ping timeout: 248 seconds]
erahul has joined #ruby
dv_ has quit [Quit: No Ping reply in 180 seconds.]
maxmmurphy has joined #ruby
bwlang_ has joined #ruby
minijupe has joined #ruby
mjb2k has joined #ruby
bwlang has quit [Read error: Operation timed out]
bwlang_ is now known as bwlang
gilead has quit [Quit: This computer has gone to sleep]
<ij>
local_var = 3; def object.new_singleton_meth; how can I use local_var here?; end
hoelzro|away is now known as hoelzro
liluo has quit [Remote host closed the connection]
dv_ has quit [Read error: Operation timed out]
<ij>
I actually need it static, like unquoted in lisp, if that makes sense.
Kesava has quit [Quit: Leaving]
<ij>
Okay, nevermind. Got a new solution. >:)
bwlang has quit [Ping timeout: 244 seconds]
psmolen has joined #ruby
Kesava has joined #ruby
Harzilein has joined #ruby
Harzilein has left #ruby [#ruby]
Criztian has quit [Ping timeout: 246 seconds]
amaus has joined #ruby
baroquebobcat has joined #ruby
cpruitt has joined #ruby
mnaser has joined #ruby
sqbell has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
cpruitt has quit [Client Quit]
sqbell has joined #ruby
<ij>
Can I define method aliases for only one instance?
<seanstickle>
Sure
schovi has quit [Remote host closed the connection]
<seanstickle>
Same as any other singleton method
wvms has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
savage- has quit [Remote host closed the connection]
sqbell has quit [Client Quit]
twock has quit [Quit: Lost terminal]
apeiros_ has quit [Remote host closed the connection]
mengu has joined #ruby
wvms has quit [Ping timeout: 264 seconds]
wallunit has quit [Quit: Leaving.]
wobr has quit [Ping timeout: 264 seconds]
bwlang has joined #ruby
zemanel has joined #ruby
Chryson has joined #ruby
Travis-42 has joined #ruby
subbyyy has joined #ruby
atmosx has joined #ruby
dv_ has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
<atmosx>
Hello, any ideas on why here the foption logfile = options[:log] is never accepted? http://pastie.textmate.org/private/7tjhvjqfsnz6lf1zasvgqg (I addedd the .to_s in order to make some tests but doesn't work anyway… there must something else which is completely out of place here)
Progster has joined #ruby
mvangal__ has quit [Ping timeout: 250 seconds]
carloslopes has quit [Ping timeout: 244 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
mjb2k has quit [Quit: Leaving.]
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
d3vic3 has quit [Quit: leaving]
Progster has quit [Ping timeout: 260 seconds]
d3c has joined #ruby
<ramblex>
atmosx: presumably you call optparse.parse! somewhere?
Houdini has quit [Quit: Leaving.]
cpruitt has joined #ruby
Spooner_ has joined #ruby
<atmosx>
ramblex: uhm...
dekroning has joined #ruby
<ramblex>
try changing '--log' to '--log FILE'
<atmosx>
ramblex: thanks
<atmosx>
works
<atmosx>
I was about to switch to trollop
Spooner has quit [Ping timeout: 248 seconds]
hoelzro is now known as hoelzro|away
jxpx777 has quit [Quit: Mac is sleeping…]
bwlang has quit [Read error: Operation timed out]
bwlang has joined #ruby
Eldariof-ru has quit [Ping timeout: 265 seconds]
<atmosx>
ramblex: thanks mate, both changes are needed for this to work.
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
<learc83>
mrhass did they raise the limit or did you find a bug?
ilyam has joined #ruby
subbyyy has quit [Max SendQ exceeded]
<learc83>
mrhaas*
subbyyy has joined #ruby
wmoxam has joined #ruby
TPFC-SYSTEM has joined #ruby
crankycoder has joined #ruby
Beoran_ has joined #ruby
tewecske has joined #ruby
hoelzro|away is now known as hoelzro
quest88 has joined #ruby
kvirani has quit [Remote host closed the connection]
elux has joined #ruby
zacstewart has left #ruby [#ruby]
mnaser has quit [Ping timeout: 240 seconds]
mengu has quit [Quit: Konversation terminated!]
<ij>
Mmmm, git HEAD version is cool, when it works, but usually it doesn't. :<
tewecske has quit [Read error: Operation timed out]
bbttxu has joined #ruby
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
sailias has quit [Ping timeout: 244 seconds]
Markvilla has joined #ruby
jimeh3 has quit [Read error: Operation timed out]
oholiab has left #ruby [#ruby]
cbuxton1 has quit [Quit: Leaving.]
reedz has quit [Read error: Connection reset by peer]
reedz has joined #ruby
Spooner has quit [Ping timeout: 245 seconds]
reedz has quit [Read error: Connection reset by peer]
maxmmurphy has quit [Quit: maxmmurphy]
reedz has joined #ruby
vlad_starkov has joined #ruby
jumpingcloud has joined #ruby
cbuxton has joined #ruby
Markvilla has quit [Quit: Markvilla]
Cache_Money has joined #ruby
RainbowDashh has quit [Disconnected by services]
RainbowD_ has joined #ruby
RainbowD_ is now known as RainbowDashh
jfoley has joined #ruby
myth17 has joined #ruby
tayy has joined #ruby
carpediembaby has joined #ruby
<carpediembaby>
hi, is there a way to run some javascript on a webpage and obtain results, using ruby? i know of mechanize which can process forms etc but not javascript
exchgr has joined #ruby
mockra has quit [Remote host closed the connection]
fridim_ has joined #ruby
Houdini has joined #ruby
Bosma has quit [Ping timeout: 244 seconds]
schaerli has joined #ruby
blinkies has quit [Quit: Lost terminal]
<jumpingcloud>
hey
flexd_ is now known as flexd
Bosma has joined #ruby
<ramblex>
carpediembaby: selenium might do what you want
myth17 has quit [Changing host]
myth17 has joined #ruby
<JonnieCache>
carpediembaby: yep selenium is what youre after
<JonnieCache>
carpediembaby: however if you go to the main selenium website it will confuse the shit out of you with its talk of IDEs and suchlike
<JonnieCache>
carpediembaby: so take a look at capybara, which is a ruby wrapper for selenium
<JonnieCache>
ignore the fact that its a testing lib, you dont actually have to test anything with it
erahul has quit [Ping timeout: 265 seconds]
<carpediembaby>
JonnieCache, ramblex okay! thanks. didn't know selenium does js as well
<JonnieCache>
selenium just controls firefox
<JonnieCache>
so it can do whatever
bosphorus has quit [Remote host closed the connection]
carloslopes has joined #ruby
carloslopes has quit [Client Quit]
carloslopes has joined #ruby
amaus has quit [Ping timeout: 265 seconds]
<carpediembaby>
okay! thanks JonnieCache !
<burgestrand>
capybara is more than a ruby wrapper for selenium
plastics has joined #ruby
<JonnieCache>
yes i know but for the purposes of this conversation it is that
oposomme has joined #ruby
<burgestrand>
can't have somebody wrong on the internet, but the balance appears to be restored
<JonnieCache>
it is the most convenient way to drive selenium from ruby. the selenium-webdriver gem has an ugly api
shevy has joined #ruby
iocor has joined #ruby
graspee has joined #ruby
mockra has joined #ruby
<JonnieCache>
no offence to the people who put lots of work into it but i find it ugly :)
<shevy>
what is ugly... just joined
* burgestrand
…
saschagehlich has quit [Quit: saschagehlich]
<JonnieCache>
nothing of concequence
Fezzler has joined #ruby
carpediembaby has quit [Ping timeout: 245 seconds]
Spooner has joined #ruby
saschagehlich has joined #ruby
<graspee>
"no offence but you're ugly"
wallerdev has joined #ruby
<graspee>
that's like saying "this doesn't hurt" and punching someone
<shevy>
perhaps if you punch only very very ... gently
<JonnieCache>
there is a difference between "i find your work aesthetically lacking" and "youre an asshole"
<JonnieCache>
thats what i was trying to make clear
<shevy>
ok so they are nice people
<shevy>
but they suck
<shevy>
you are such a meanie JonnieCache
timonv has quit [Remote host closed the connection]
* atmosx
listening to Greek commercial one-season-shitty music and enjoying really really much
<shevy>
atmosx! whatcha coding on lately
samuel02 has joined #ruby
<atmosx>
shevy: a script to help me read fail2ban.log properly… sorts per country, show's me which IP's brute-forced my little server more than once and so on...
cpruitt has quit [Quit: cpruitt]
<shevy>
cool
<atmosx>
shevy: if that's done I'll get back to my words-grabbing-counting-matching script
<JonnieCache>
who comes out on top? the chinese?
<atmosx>
ah not really, I bet you could write it down in a couple of hours...
<atmosx>
JonnieCache: Korea
<JonnieCache>
interesting
<shevy>
hehe dunno. I now find that the thinking part takes longest when writing ruby code as of late
<JonnieCache>
are the korean attacks coming from one specific entity though?
<shevy>
and here I thought they have no time for anything else but taekwondo, bboying and winning game competitions like starcraft 2
<atmosx>
I think it's not "the koreans" it's professional spammers/etc getting korean servers because of their specific laws
<shevy>
I see
<atmosx>
they allow porn, virus, pedophile websites, etc.
<JonnieCache>
somehow i think that lead would disappear with more analysis
<atmosx>
and they do not "cooperate" on a state level, so you're basically free to hack/attack anyone from there… (which makes a good target for skileld hackers also, to use them as a bouncer)
<atmosx>
johnduhart: yeah probably
<JonnieCache>
really? i thought south korea was the USA's bitch?
<wmoxam>
congrats on the anniversary of betraying your king day, people
<atmosx>
which made me think that I need a statis function, in order to know how many ip's I have catched to far...
oposomme has quit [Ping timeout: 252 seconds]
<shevy>
JonnieCache: probably only when it is something of importance
<atmosx>
562 ip's catched.. so it's not much
<atmosx>
a website/service tha collects logs would good idea also, if there was some sort of monitoring over who is sending the data...
<atmosx>
anyway I'm off to shower the trees
tayy has quit [Remote host closed the connection]
* atmosx
lives in a big house with many trees on the front yard
mockra has quit [Remote host closed the connection]
<shevy>
lol
<shevy>
here I thought he takes his trees into the shower
jxpx777 has joined #ruby
mnaser has quit [Ping timeout: 246 seconds]
<ramblex>
how do you know he doesn't?
<JonnieCache>
LOL TREES GET HIGH EVERY DAY OMG 420
<shevy>
ramblex: yeah good point
<shevy>
my mom used to put plants into the washing up... when I want to go and wash my hands, I'd then have to put the plants down first... which was annoying
mnaser has joined #ruby
mockra has joined #ruby
amaus has joined #ruby
My_Hearing is now known as Mon_Ouie
qwerxy has quit [Ping timeout: 252 seconds]
elhu has quit [Read error: Operation timed out]
kpshek has quit []
<shevy>
if I have project called foo2, that depends on foo1, both are gems... anyone knows what should be specified in the .gemspec file?
<shevy>
of foo2.gemspec
gmci has quit [Ping timeout: 240 seconds]
<shevy>
hmm
<JonnieCache>
s.add_dependency "foo1"
<JonnieCache>
or
<shevy>
oh cool that seems simple
<JonnieCache>
s.add_dependency "foo1", "0.0.1"
<shevy>
and "gem install foo2" would then install foo1 if this was not yet installed, right?
<vlad_starkov>
Hello everybody! I'm wondering is there any special text-editing software which helps programmers writing REST API guides and other documentation? Thank you for an answer :-)
<JonnieCache>
shevy: `bundle gem <GEMNAME>` at the commandline spits out a nice gem skeleton for you, including the gemspec and the versionfile and so on
<Ionic`>
or do I have to do this explicitly via string[range[0]..range[1]]?
mockra has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
<carloslopes>
Ionic`: my_str[0, 100] works
crankycoder has quit [Ping timeout: 244 seconds]
<canton7>
note that the second arg is the length, not the end index. Obviously when the start is 0, it doesn't matter, but...
Fezzler has quit [Quit: Leaving]
<Ionic`>
nope, doesn't
<carloslopes>
canton7 : yeah :)
<Ionic`>
TypeError: can't convert Array into Integer
Travis-42 has quit [Quit: Travis-42]
<Ionic`>
ok, bummer
crankycoder has joined #ruby
<canton7>
you can also do Range.new(*range)
<Ionic`>
but ok
<Ionic`>
hmm
<canton7>
also string.slice(*range)
<carloslopes>
Ionic`: you are doing something wrong.. try 'foobar'[2, 3] ... you will see how it works
bwlang has quit [Ping timeout: 244 seconds]
<Ionic`>
yeah
jxpx777 is now known as jxpx777|afk
jxpx777|afk is now known as jxpx777
<Ionic`>
carloslopes: yes, this works, but is not what I expect to get and it's not working with an array either
<shevy>
Ionic`: "foobarbarfoo"[2..-3]
<Ionic`>
shevy: sure, but I don't know 2 or -3
<Ionic`>
:)
<Ionic`>
really, doesn't matter
<Ionic`>
I'll use range[0]..range[1]
baroquebobcat has quit [Quit: baroquebobcat]
pkhamre has joined #ruby
<pkhamre>
how can I assign content of variable A to variable B, but if not variable A exists, set "default" to variable B?
<pkhamre>
in one line
<pkhamre>
?
straind has joined #ruby
<ramblex>
pkhamre: B = A || "default";
anth0ny has joined #ruby
<d-snp>
die Ionic` you do realize [0,100] selects 101 characters, not 100 right?
<gogiel>
ramblex: only if A is defined
<canton7>
d-snp, incorrect?
<pkhamre>
ramblex: thanks
bwlang has joined #ruby
<d-snp>
incorrect?
ttilley is now known as ttilley_off
<canton7>
"hello"[1,3] # "ell"
etehtsea has quit []
<anth0ny>
This is my first time ever trying to use Ruby. I've installed Gollum via rubygems, fired it up, and got this: http://i.imgur.com/axy54.png?1 Not sure how to trouble shoot this, where should I start?
<d-snp>
eh oh that is weird
ph^ has quit [Remote host closed the connection]
ttilley_off is now known as ttilley
<canton7>
d-snp, in the string[a,b] form, a is the start and b is the length
fantazo has quit [Remote host closed the connection]
<Ionic`>
d-snp: why do you want me to die? :( yes, this does select 101 characters, so what?
<d-snp>
wtf, why did I say die?
<d-snp>
I don't want you to die, you're probably an ok person :P
<fowl>
lol
otters has quit [Quit: WeeChat 0.3.8]
<Ionic`>
figured that, :)
<Ionic`>
argh, off by one
<fowl>
1245 <d-snp> die Ionic` you do realize [0,100] selects 101 characters, not 100 right? <- eh?
<Ionic`>
hell, I wonder if this code works once it's done
<Ionic`>
fowl: 0 to (including) char 100
<fowl>
in array and string case, 0, 100 would start at 0 and be length 100
<Ionic`>
I've written 350 loc and didn't even test it once (but for parse errors)
<Ionic`>
I wonder if it just magically works once I'm done)
<d-snp>
it won't
Eldariof-ru has joined #ruby
<Ionic`>
you never know :p
<ramblex>
it'll have plenty of surprise features
<Ionic`>
I'm surprised how many bugs I find by just glancing over it
<d-snp>
I once won 3 crates of beer
<d-snp>
from someone who 'glanced over it' for 3 hours
JStoker has quit [Excess Flood]
crankyco_ has joined #ruby
<d-snp>
and that was in a statically typed language
<Ionic`>
heh
<Ionic`>
for i in foo..bar; ...; end unless foo = -1 should work, right?
<Ionic`>
irb to the rescue
burgestrand has quit [Quit: Leaving.]
<d-snp>
if you want a good chance of something actually working after directly after you wrote it, learn haskell :)
<Ionic`>
bah, haskell
<Ionic`>
no thanks
<d-snp>
:S
<d-snp>
did you just say bah haskell? why would you say that? :D
<Ionic`>
I don't like it
crankycoder has quit [Ping timeout: 265 seconds]
<d-snp>
did you ever code in it?
<Ionic`>
ha, works like a charm
brianpWins has joined #ruby
<Ionic`>
yes, die to university requirements
crankycoder has joined #ruby
<d-snp>
hmm
baroquebobcat has joined #ruby
fearoffish has quit [Ping timeout: 245 seconds]
<Ionic`>
not my language at all
designated has quit [Remote host closed the connection]
crankyc__ has joined #ruby
crankyco_ has quit [Ping timeout: 246 seconds]
<d-snp>
I've grown to like it to the point I'm doubting wether I should build my next web application in ruby or in haskell
moshee has quit [Ping timeout: 244 seconds]
selvakumaran has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
crankycoder has quit [Ping timeout: 246 seconds]
nachtwandler_ has quit [Ping timeout: 244 seconds]
ramblex_ has joined #ruby
ramblex_ has quit [Client Quit]
sam113101 has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
sam113101 has joined #ruby
joch_n has joined #ruby
ramblex has quit [Ping timeout: 246 seconds]
digitalcakestudi has quit [Quit: Leaving.]
kinginky has joined #ruby
<kinginky>
g
JStoker has joined #ruby
sailias has joined #ruby
rbanffy has joined #ruby
kvirani has joined #ruby
bwlang has quit [Ping timeout: 246 seconds]
twinturbo has quit [Ping timeout: 244 seconds]
twinturbo_ has joined #ruby
kvirani has quit [Remote host closed the connection]
kvirani has joined #ruby
kinginky has left #ruby [#ruby]
<shevy>
ghc download is 110 mb in size
<shevy>
that is insane compared to ruby
kvirani has quit [Remote host closed the connection]
kvirani has joined #ruby
<rking>
shevy: Now try running some basic thing. For extra fun, you can't talk on IRC until the Haskell code is done compiling.
mnaser has quit [Ping timeout: 244 seconds]
bwlang has joined #ruby
<rking>
TIL: The "g" in "ghc" doesn't stand for "GNU".
mikeycgto has quit [Ping timeout: 246 seconds]
workmad3 has joined #ruby
mnaser has joined #ruby
manizzle_ has quit [Read error: No route to host]
jimeh3 has joined #ruby
manizzle has quit [Read error: No route to host]
jxpx777 is now known as jxpx777|afk
<anth0ny>
Can someone shed some light on what "Grit::InvalidGitRepositoryError at /" means?
zommi has quit [Remote host closed the connection]
Niamkik has joined #ruby
gizmore has joined #ruby
manizzle has joined #ruby
manizzle has quit [Read error: No route to host]
bwlang_ has joined #ruby
Tricks has joined #ruby
jxpx777|afk is now known as jxpx777
<Tasser>
anth0ny, / isn't a git repo
<Tasser>
anth0ny, and probably your PWD sux
manizzle has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
krz has quit [Quit: krz]
Cache_Money has quit [Ping timeout: 245 seconds]
mnaser has quit [Ping timeout: 246 seconds]
kirun has joined #ruby
manizzle_ has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
bwlang has quit [Ping timeout: 248 seconds]
bwlang_ is now known as bwlang
<anth0ny>
Tasser, so, how would I go about fixing that? I'm running gollum, does the directory where I run it from matter? I assumed it would run from it's installed directory?
marcosmlopes has joined #ruby
mnaser has joined #ruby
<marcosmlopes>
Hello guys, someone can help me with faye? Is there a way to mount faye as /faye in the same rack app as rails?
Vendethiel has joined #ruby
cbuxton has joined #ruby
coderhut has quit [Ping timeout: 245 seconds]
kjellski has joined #ruby
g0bl1n has joined #ruby
CaptainJet has joined #ruby
<fowl>
Ionic`, using the for loop..thing..is discouraged in ruby
bfig has joined #ruby
cantonic_ has joined #ruby
mikeycgto has joined #ruby
philips has quit [Excess Flood]
<marcosmlopes>
fowl: why would you use for if u have interators instead?
<Ionic`>
fowl: why?
king313 has quit [Quit: .]
<fowl>
marcosmlopes, if you came from a different language
baphled has joined #ruby
savage- has joined #ruby
<Hanmac>
for loops are unneeded in 90% of cases
<Ionic`>
hmm
<Ionic`>
in this case I guess it's ok
<fowl>
Ionic`, you have a range (foo..bar)
<fowl>
you can iterate over it with #each or #map
philips has joined #ruby
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
<Ionic`>
hmmmmm well yeah
<Ionic`>
let me finish this part and I'll have a look
<Hanmac>
and if foo and bar are both ints you could do foo.upto(bar) { ... }
baphled has quit [Quit: leaving]
<fowl>
with the postfix unless foo == -1
<marcosmlopes>
or foo.times { bar }
wallerdev has quit [Quit: wallerdev]
baphled has joined #ruby
hydrozen has joined #ruby
<marcosmlopes>
ops... nevermind... that's wrong
baphled has quit [Client Quit]
Poapfel has quit [Ping timeout: 265 seconds]
<fowl>
puts "sup" unless false if true
baphled has joined #ruby
manizzle_ has quit [Read error: No route to host]
manizzle_ has joined #ruby
baphled has quit [Client Quit]
baroquebobcat has joined #ruby
baphled has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
tvw has joined #ruby
Neil_ has joined #ruby
tyfighter has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
reedz has quit [Quit: Leaving]
baphled has quit [Client Quit]
josefig has quit [Ping timeout: 246 seconds]
jxpx777 is now known as jxpx777|afk
baphled has joined #ruby
<Ionic`>
ok
<Ionic`>
replaced for with (range).each
jxpx777|afk is now known as jxpx777
mikeycgto has quit [Ping timeout: 246 seconds]
imami|afk is now known as banseljaj
ananthakumaran has left #ruby [#ruby]
baphled has quit [Client Quit]
<Hanmac>
Ionic` did you get the Range from a variable or from numbers? if numbers try foo.upto(bar) {
baphled has joined #ruby
baphled has quit [Client Quit]
manizzle has quit [Ping timeout: 246 seconds]
<Ionic`>
Hanmac: variables
savage- has quit [Remote host closed the connection]
workmad3 has quit [Read error: Operation timed out]
Xerife has joined #ruby
<Xerife>
hello!
<CaptainJet>
hey
bwlang_ has joined #ruby
baphled has quit [Client Quit]
<Xerife>
does anyone here know how to programmatically define a method that receives a block?
baphled has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
baphled has quit [Client Quit]
<CaptainJet>
def foo(&block); block.call; end
<CaptainJet>
like that?
user__ has joined #ruby
<Xerife>
yes, but the name is on a variable
baphled has joined #ruby
<Xerife>
maybe using define_method ?
rbanffy has quit [Ping timeout: 246 seconds]
<CaptainJet>
how do you mean on a variable?
<CaptainJet>
like the name of the method is set as a variable
<Xerife>
on a string
<Hanmac>
Xerife do you look for yield?
<Xerife>
yes
bwlang has quit [Ping timeout: 265 seconds]
bwlang_ is now known as bwlang
<Xerife>
i need to store the block
<Xerife>
not call it
ramblex has joined #ruby
baphled has quit [Client Quit]
<CaptainJet>
well you can store a block as you could anything else
baphled has joined #ruby
<Hanmac>
but you cant Marshal.dump it
<CaptainJet>
yeah
user__ has quit [Client Quit]
<Xerife>
humm… never heard of that, will investigate
baphled has quit [Client Quit]
baphled has joined #ruby
<CaptainJet>
def foo(&block); @bar = block; end
<CaptainJet>
that's basically it
<CaptainJet>
you can @bar.call after that
<any-key>
@bar.last_call
<Xerife>
yes, but don't forget, the name is on a variable
plastics has joined #ruby
wobr has joined #ruby
xpot-station has joined #ruby
<Xerife>
the only way I know to define a method whose name depends on a value is with define_method
anth0ny has quit [Quit: This computer has gone to sleep]
<CaptainJet>
well there's also the evil
<CaptainJet>
oh sorry i mean eval
Araxia has quit [Quit: Araxia]
<CaptainJet>
:P
<Xerife>
lol
<Xerife>
yes...
<Xerife>
there's always that
<Spooner>
Xerife : Do you mean define_method meth do |*args, &block| ... end
<Xerife>
yes Spooner
<Spooner>
You weren't using clear wording, which is what was confusing us :$
timonv has quit [Remote host closed the connection]
<Xerife>
the only bummer there is I'm not being able to pass a block to a proc
<Xerife>
sorry for the confusion Spooner, what wording?
<Spooner>
Since when can't you? Please give an example/context, because it is hard to second-guess what you need rather than what you seem to be asking for.
<deryl>
err? Proc.new {|n| n*factor } isn't that passing a block?
baphled has quit [Client Quit]
baphled has joined #ruby
<Xerife>
p = Proc.new {|block| .. use proc ... }
<Xerife>
p { ... calling a proc passing a proc .. }
<deryl>
and define_method method { &block } doesn't work? (going off the ri page for define_method)
<deryl>
no &block not |block|
<deryl>
|&block| isn't it? (Spooner correct me if I'm wrong)
<CaptainJet>
using just block would pass an argument
<CaptainJet>
not a block
<CaptainJet>
untill the block was the argument
<CaptainJet>
unless*
<deryl>
right. needs &block not block
<Xerife>
yes, sorry missed the &
ringotwo has quit [Remote host closed the connection]
baphled has quit [Client Quit]
<deryl>
hahaha sitting outside, and got a set of chipmunks chattering to each other. I swear to the world it sounds like a rap concert. got the timing and everything hahaha
baphled has joined #ruby
<deryl>
musical timing from chipmunks. awesome
<Xerife>
lol
bluenemo has quit [Ping timeout: 246 seconds]
baphled has quit [Client Quit]
<Hanmac>
deryl but when you saw cats chattering something is very wrong :P
<deryl>
Hanmac: hah! true that
baphled has joined #ruby
mikepack has joined #ruby
<Hanmac>
and there face when they notic that you saw them :P
<deryl>
they still going at it. got my own free concert
selvakumaran has quit [Ping timeout: 245 seconds]
baphled has quit [Client Quit]
<deryl>
Hanmac: <chuckle>
seanstickle has joined #ruby
ciopte7 has joined #ruby
baphled has joined #ruby
RubyPanther has joined #ruby
Gavilan has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
selvakumaran has joined #ruby
bradhe has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
selvakumaran has quit [Read error: Connection reset by peer]
KevinSjoberg has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bigsky>
which kind of ide do u use when programming ruby?
mimay has joined #ruby
<CaptainJet>
i don't get an error with it?
<Xerife>
none
baphled has joined #ruby
<Spooner>
bigsky : I use RubyMine, but it isn't free for commercial projects.
<apeiros_>
def self.define_me_a_method(name) -> def self.define_me_a_method(name, &block) <-- get the block that was passed
baphled has left #ruby [#ruby]
<apeiros_>
self.send(:define_method, name, proc { |&block| <-- this would make the new method that you define accept a block, doesn't seem to be what you want, therefore:
<apeiros_>
self.send(:define_method, name) { # <-- drop it
<Spooner>
The difference is that #inject makes sense where you are passing a new object from iteration to iteration, but #with_object makes sense if you are just altering the same object (especially if you don't always alter it, as you are doing).
sam113101 has quit [Remote host closed the connection]
<Mon_Ouie>
All the examples about building a hash or an array would be better with #each_with_object
Morkel has joined #ruby
<mimay>
fowl: nice, you call Spooner newbie but you don't you anything :-)
erikwb has joined #ruby
Eldariof-ru has quit []
<mimay>
Spooner: thanks for the explanation
<erikwb>
hey, what's best practice for "system globals" for a system with multiple classes? Make a config object and pass it to everything you make?
<erikwb>
paths to config directories, etc
banseljaj is now known as imami|afk
uris has quit [Read error: Connection reset by peer]
<fowl>
mimay, then you missed the point, and more importantly the link
<Spooner>
Use class instance variables on a Config module?
ciopte7 has quit [Quit: ciopte7]
<erikwb>
Spooner: yeah, that's my intuition
<erikwb>
i don't know if that's generally accepted good practice is all :)
<mimay>
looking at it. But people also learn from other's code as I'm doing from Spooner's code.
<mimay>
Thanks for the link though
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<Spooner>
Both methods are very useful, but they are subtly different and are useful in different circumstances.
<Hanmac>
i uses class instance variables to store the instances of that class
<Spooner>
I thnk that #with_object is newer in Ruby than #inject (and you can mimic #with_object with #inject, but it is just a little less elegant). Think that is why that article suggests building hash/array with inject quite reasonably.
<mimay>
Spooner: I like the data #with_object solution
azm has quit [Quit: Leaving]
<Spooner>
Example 1 is very much a correct inject application though.
<mimay>
though I will continue reading the article and learning. Also thanks for the improvement on the reg-ex
<Spooner>
And you can shortcut that example with the very terse: [1, 2, 3, 4].inject &:+
baphled has quit [Quit: leaving]
<Hanmac>
Spooner inject works without & too
<mimay>
so no need for the self on the normlize method... I guess it is referred implicitly?
baphled has joined #ruby
<Spooner>
There you go, even terser (thanks hanmac).
mjb2k has joined #ruby
mjb2k1 has joined #ruby
mjb2k has quit [Read error: Connection reset by peer]
mjb2k1 has quit [Client Quit]
<Spooner>
You rarely need an explicit self, except with self.x = 12, since x = 12 would be setting a local variable.
<mimay>
aha
<mimay>
how about that [1, 2, 3, 4].inject &:+ ?
<Hanmac>
its returns a sum
baphled has quit [Client Quit]
<Hanmac>
Spooner did you know why inject has a default value?
yoklov has quit [Quit: computer sleeping]
baphled has joined #ruby
<mimay>
[1, 2, 3, 4].inject &:+ doesn't work on irb
<Tasser>
Hanmac, ehm, it doesn't iirc
<Spooner>
Does for me - are you using an old Ruby?
<mimay>
1.9.2p290
<Gavilan>
erikwb: Each object (And class) should have exactly what it needs... Not a thing more...
cantonic has quit [Quit: cantonic]
<Hanmac>
you need () around &:+
<mimay>
should I switch to 1.9.3?
tewecske has joined #ruby
<fowl>
mimay, you should switch to pry
bwlang has quit [Read error: Operation timed out]
<Spooner>
Yes, it is mainly an efficiency patch to 1.9.2, so is safe.
<mimay>
I did, but new setup and didn't install it yet. Thanks for the suggestion
bwlang has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
<mimay>
ok, switching
ph^ has quit [Ping timeout: 245 seconds]
<Hanmac>
mimay it was only a little parsing bug in irb
<mimay>
1.9.3-rc1, is it ok?
<Spooner>
No :)
<mimay>
oops
Poapfel has joined #ruby
<mimay>
which one then?
<Spooner>
We are on 1.9.3p194
<Spooner>
Well, the rc is probably ok, but no reason to use it.
<mimay>
on ruby-build (rbenv), I have the 1.9.3-dev, 1.9.3-p0, 1.9.3-p125, 1.9.3-preview1, 1.9.3-rc1
<mimay>
no p194 though
oktapodi has joined #ruby
neersighted is now known as neersighte[d]
<Spooner>
Hanmac : Sorry, yes, if there isn't a default, then it will just pass first and second elements into the |memo, value|, but in cases where that won't evaluate properly, you'd want to use a starting value. However, as far as I can see, if you need a default, then you probably want #with_object
<Spooner>
mimay 1.9.3-p125 is the latest of that bunch.
<mimay>
ok, thanks
neersighte[d] is now known as neersighted
<Hanmac>
Tasser look at [1,2,3,4].inject(0,:+). [].inject(0,:+) , [].inject(:+)
Axsuul has joined #ruby
<Tasser>
[].reduce(:+)
<Tasser>
=> nil
<Tasser>
... no default
<Spooner>
Ah, with empty arrays, yeah, I hadn't considered that one. Thanks.
ph^ has joined #ruby
<fbernier>
higgs boson mofocka
<fbernier>
oops wrong window
<yxhuvud>
defaultvalue also helps when the accumulator and the elements have different types.
<Hanmac>
"higgs boson appears and acta dies" ... or is it "acta dies and higgs boson appears" :P
<Hanmac>
yxhuvud and its also good when you cain injects
workmad3 has joined #ruby
Niamkik has quit [Ping timeout: 246 seconds]
schaerli has quit [Remote host closed the connection]
Criztian has joined #ruby
<shevy>
oh man finally I finished writing 2241 yaml files
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
subbyyy has quit [Max SendQ exceeded]
perryh_away is now known as perryh
<tds>
this is a long shot
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
baphled has quit [Quit: leaving]
yoklov has joined #ruby
<tds>
but is there any way to get the full constant name being referenced in const_missing
subbyyy has joined #ruby
<tds>
like if I reference A::B::C
<tds>
and I have const_missing in A
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<tds>
is there any way to determine that I want B::C, not just B?
<mimay>
Guys, thanks for all the help!
baphled has joined #ruby
<CaptainJet>
tds?
Lars_ has joined #ruby
<CaptainJet>
as in the rm tds
<CaptainJet>
?
bwlang_ has joined #ruby
<tds>
not sure what rm is so probably no
<tds>
t
Xerife_ has joined #ruby
baphled has quit [Client Quit]
<CaptainJet>
ah damn
<CaptainJet>
mistaken username i suppose
<tds>
i've been using this name on freenode for a while
Xerife_ has quit [Client Quit]
baphled has joined #ruby
<tds>
i originally started using it in 2005
<fowl>
tds, maybe you could override const_missing in a meaningful way
<apeiros_>
tds: your receiver is the container
<apeiros_>
const_missing is called on A::B, so self is A::B
yxhuvud has quit [Ping timeout: 265 seconds]
<Spooner>
tds I doubt it, since A is asked for constant B before B gets asksed about C
larissa has joined #ruby
<apeiros_>
meh, I still fail at reading today
<apeiros_>
what Spooner said
<tds>
apeiros_, how Spooner has it described is right
Xerife has quit [Ping timeout: 246 seconds]
<apeiros_>
you're never asked for B::C, it's always a single level
<apeiros_>
so you'd need const_missing in B too
<tds>
yeah
<tds>
but i don't have a B
bwlang has quit [Ping timeout: 245 seconds]
<Spooner>
So, make one.
bwlang_ is now known as bwlang
<tds>
but I don't want to ;)
Cache_Money has joined #ruby
baphled has quit [Client Quit]
<tds>
I guess I will have to though
<Spooner>
No, I mean create a catcher class that just has const_missing on it and pass that back if you find const_missing on A.
baphled has joined #ruby
<Spooner>
Make sense?
<fowl>
better yet, dont have dynamic constants, and dont call a constant that doesnt exist
<tds>
somewhat
<tds>
but I want to have dynamic constants
<fowl>
rororo
otters has joined #ruby
<tds>
Spooner: create a catcher class, and pass control back to A if I get a const_missing call on B?
ph^ has quit [Ping timeout: 255 seconds]
<tds>
basically what you're saying, yeah?
<Spooner>
Yes, since you are guaranteed to get const_missing on B since it is just a dummy.
<tds>
k, that makes sense
<tds>
thanks for the help :)
<Spooner>
It is horrid though.
<tds>
haha, I may re-evaluate my strategy here
<Spooner>
But it should work in theory.
ph^ has joined #ruby
<Spooner>
The question is more why you need to know that the user is calling A::B::C, when you know there is a problem by the time they call A::B
<tds>
I am doing some really weird shit with modules
s0ber has quit [Read error: Connection reset by peer]
RudyValencia has quit [Quit: My IRC client doesn't advertise in /quit messages.]
baphled has quit [Quit: leaving]
baphled has joined #ruby
werdnativ has joined #ruby
s0ber has joined #ruby
bwlang has quit [Ping timeout: 240 seconds]
RudyValencia has joined #ruby
pkhamre has left #ruby [#ruby]
RudyValencia has quit [Client Quit]
EstanislaoStan has joined #ruby
RudyValencia has joined #ruby
Natch has quit [Ping timeout: 250 seconds]
ciopte7 has joined #ruby
bwlang has joined #ruby
mdszy has joined #ruby
<EstanislaoStan>
Most of my code can run in a single method, but the few things I've had to reuse I've made their own methods. The same goes for classes, I don't have to have very many classes so far for what I'm trying to acheive. But my main question is, should I actually be putting more of my code in methods? I'm somewhat tempted to just because I think it would make the code look a little better. But I'm also
<EstanislaoStan>
worried that by displacing all the code to other methods and then using those methods I might be making it harder to see and remember what's actually going on, because I'll have to navigate away to that method if I have a question about it instead of just looking at a long line of code that is already where I'm looking. I guess I can't find much benefit in stuffing all my code into separate
<EstanislaoStan>
methods at this point other than making it look a little neater. Could you guys give me advice on this? Thanks, ^-^.
fayimora has joined #ruby
<tds>
I am of the belief that it is generally better to have many small methods
<mdszy>
I always try to move stuff between methods. You shouldn't be worried about not finding stuff, unless you're using an editor without a search feature.
<tds>
and I think it would be easier to see what is going on
<tds>
if your code is at a higher level of abstraction, it's cleaner to remember what the process is
sepp2k has quit [Ping timeout: 246 seconds]
bwlang_ has joined #ruby
jxpx777 has quit [Quit: Mac is sleeping…]
dnyy has quit [Remote host closed the connection]
jxpx777 has joined #ruby
bwlang has quit [Ping timeout: 252 seconds]
bwlang_ is now known as bwlang
bthesorceror has quit [Quit: bthesorceror]
dnyy has joined #ruby
mimay has quit [Remote host closed the connection]
<EstanislaoStan>
What do you mean by higher level of abstraction? That if I have a simple conception, say from a method name, of what my code is doing I can focus on what I'm trying to acheive easier than if I have to look at lines of code and remember what those lines do?
Cache_Money has quit [Ping timeout: 252 seconds]
Xerife has joined #ruby
<Houdini1>
Guys, I can't find a book about how to build api? Price was 20$. A week ago there was anounce about this book.
<Houdini1>
Pls help me find this site
<tds>
EstanislaoStan: yeah exactly
dekroning has quit [Quit: leaving]
<tds>
EstanislaoStan: some people call it the 'composed method' pattern
<workmad3>
EstanislaoStan: lots of small methods may seem like you have to spend time drilling down to find what exactly is happening, but as long as you have good method names and you can trust that the code isn't going to surprise you, you quickly discover that you don't need to drill down... just look at the method name and it tells you all you need :)
manizzle has joined #ruby
manizzle has quit [Read error: No route to host]
manizzle has joined #ruby
robbyoconnor has quit [Ping timeout: 265 seconds]
oktapodi has quit [Remote host closed the connection]
<workmad3>
EstanislaoStan: and never underestimate the power of neat, tidy code... it's orders of magnitudes faster to find something in a code base organised into methods than in one 'big ball of mud' method that does everything
fbernier has quit [Ping timeout: 264 seconds]
<workmad3>
EstanislaoStan: the same is true of objects... with a good organisation, you know that you don't need to look at the Widget class when something is wrong with a Doohickey :)
bluOxigen has joined #ruby
bwlang_ has joined #ruby
benson has joined #ruby
sepp2k has joined #ruby
manizzle has quit [Ping timeout: 246 seconds]
amaus has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Ping timeout: 245 seconds]
bwlang has quit [Ping timeout: 252 seconds]
bwlang_ is now known as bwlang
<EstanislaoStan>
Ok, thanks tds and workmad3! That does make sense; it really seems like that will save me time. ^-^.
Bonkers has quit [Ping timeout: 246 seconds]
sailias has quit [Quit: Leaving.]
workmad3 has quit [Read error: Operation timed out]
brianpWins has quit [Quit: brianpWins]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
withnale has quit [Read error: Connection reset by peer]
Vukk has joined #ruby
ph^ has quit [Remote host closed the connection]
<EstanislaoStan>
Oh, and thanks to you mdszy too!
<mdszy>
np
werdnativ has quit [Quit: werdnativ]
dkissell has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
dkissell has joined #ruby
Vukk has left #ruby [#ruby]
Cache_Money has joined #ruby
atmosx has joined #ruby
robbyoconnor has joined #ruby
bwlang_ has joined #ruby
S2kx has quit [Ping timeout: 250 seconds]
sam113101 has joined #ruby
Cache_Money has quit [Ping timeout: 244 seconds]
Bonkers has joined #ruby
bwlang has quit [Ping timeout: 250 seconds]
bwlang_ is now known as bwlang
Natch has joined #ruby
mikepack has quit [Remote host closed the connection]
r0bby has joined #ruby
carloslopes has quit [Quit: Leaving.]
<shevy>
the problem with long methods is that it makes it hard to break it into logical smaller things
<shevy>
when you have a class with 20 small methods and one huge method doing most of the logic, that can be one annoying thing to maintain
<shevy>
unless that long method just calls the other methods
robbyoconnor has quit [Ping timeout: 246 seconds]
<EstanislaoStan>
Right.
<EstanislaoStan>
I'm coming to see that now.
ringotwo has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
r0bby has quit [Ping timeout: 246 seconds]
s0ber has joined #ruby
notjohn has joined #ruby
baphled has quit [Ping timeout: 265 seconds]
zemanel has quit [Read error: Operation timed out]
baphled has joined #ruby
mikepack has joined #ruby
wrapids has joined #ruby
tatsuya_o has joined #ruby
ben_alman has quit [Excess Flood]
mikepack has quit [Remote host closed the connection]
EstanislaoStan has quit []
teratoma has quit [Quit: leaving]
r0bby has joined #ruby
ph^ has joined #ruby
ryanf has joined #ruby
r0bby_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
<shevy>
identifying what part of the code could be made simpler
wvms has joined #ruby
xyi has quit [Quit: Ухожу я от вас]
Steppen has quit [Quit: Leaving]
chrismcg is now known as zz_chrismcg
EstanislaoStan has joined #ruby
bwlang has quit [Ping timeout: 255 seconds]
lxsameer has quit [Quit: Leaving]
Morkel has quit [Quit: Morkel]
Berglund has quit [Quit: Computer died.]
yannis has quit [Quit: yannis]
<wrapids>
lol 11 hours and not a single word spoken in #rails
jamesaxl has quit [Ping timeout: 246 seconds]
<atmosx>
shevy: my code is messed up that I always find ways to make it look better, smaller and sometimes even more readable
<atmosx>
*so messed up*
jamesaxl has joined #ruby
<atmosx>
wrapids: it's because I don't write code for rails :-P
<ryanf>
#rails isn't the actual room for rails anyway
<ryanf>
what is it with ruby people and having two distinct rooms for the same thing
<wrapids>
sh** seriously?
<wrapids>
What's the room?
<ryanf>
#rubyonrails
<ryanf>
also you might like to know about #ruby-lang
<avandenhoven>
ryanf: you wouldn't want rails talk confusing ruby talk.
<ryanf>
avandenhoven: yes, that's not what I meant
<avandenhoven>
ryan: I know… it _is_ silly.
<avandenhoven>
oh I get it ..
<avandenhoven>
man I'm slow today.
<avandenhoven>
:(
<erikwb>
ryanf: TMTOWTDI (but they all aren't very pretty)
dnyy has quit [Remote host closed the connection]
EstanislaoStan has quit [Ping timeout: 255 seconds]
ph^ has quit [Remote host closed the connection]
bwlang has joined #ruby
<ryanf>
haha
<ryanf>
good point
<wrapids>
lol #rubyonrails was just like, oh redmine? Dont wanna.
sailias has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
myth17 has quit [Quit: Leaving]
<wmoxam>
wrapids: most of the #ror crowd doesn't use an IDE
r0bby_ is now known as robbyoconnor
bwlang_ has joined #ruby
cirwim has joined #ruby
* boobah
wonders why anyone would use anything besides vim
oddmunds has joined #ruby
<wmoxam>
oh wait
<cirwim>
boobah: I use an IRC client and a web browser beside vim..
<wmoxam>
Redmine
<wmoxam>
I'm thinking of Rubymine
<wrapids>
boobah: Because IDE's are nice.
<boobah>
cirwim: i thought we were talking about editors
[Neurotic] has joined #ruby
<boobah>
wrapids: s/nice/cumbersome/
<boobah>
:)
<shevy>
atmosx: yeah... but here is the thing. I am trying to simplify code I wrote years ago... and even though I started from 0, my brain just has a really hard time finding what really could be made simpler. and more elegant
tzvi has quit [Remote host closed the connection]
<cirwim>
boobah: I only just arrived, didn't realise the focus was so razor-sharp
<shevy>
I wonder if this is because my brain is dysfunct... or perhaps my editor does not help me sufficiently well... or there is something I have not yet learned
<wrapids>
boobah: So much they have to offer that vim doesn't.
apok has joined #ruby
bwlang has quit [Ping timeout: 265 seconds]
shadoi has joined #ruby
bwlang_ is now known as bwlang
<atmosx>
shevy: maybe there is not much to add/delete then… and you're all set
<shevy>
that could be too, yeah
<atmosx>
what editor do you use anyway?
<shevy>
bluefish
<atmosx>
you're on linux right?
<shevy>
:)
<shevy>
yeah
<shevy>
something annoys me about the editors
<shevy>
I'd like to have them tell me things
neersighted is now known as neersighte[d]
<shevy>
something like an IDE... without being an IDE though
robbyoconnor has quit [Ping timeout: 255 seconds]
r0bby has joined #ruby
<atmosx>
oh, I'm on mac… there are something like 200 "really fancy editors"
<wrapids>
What do you mean you'd like to have it tell you things?
<atmosx>
that - if you wanna configure them properly - do all the sorts of good staff for you… but I'm stuck with vim lately
<shevy>
wrapids: like, in this class I am writing on right now... I have about 10 methods. 9 methods are super simple, the current longer one I am working on, and it kinda keeps on growing... and now my brain needs to decide on how to make it smaller... and I just keep on staring at the screen without doing anything else... :\
<atmosx>
although I can't get used to comments in/out and copy/paste seems pretty crappy to me.. compared to textmate (or other editors)
wmoxam has quit [Quit: leaving]
r0bby is now known as robbyoconnor
<atmosx>
shevy: but you've tried other editors and didn't help a lot… right?
<wrapids>
shevy: Have you looked at rdt at all?
<shevy>
well. with other editors it was mostly small things that I did not like. I tried geany lately and I think I will replace bluefish with it eventually. sublime looks very neat too
alanp_ has joined #ruby
balki_ has joined #ruby
<shevy>
rdt?
fayimora has quit [Quit: Busy…..zzzzz]
subbyyy has quit [Read error: Connection reset by peer]
<shevy>
geany default highlighting for .rb is awful, but there are plugins, which are nice, including much better colours
balki has quit [Read error: Operation timed out]
subbyyy has joined #ruby
<wrapids>
:( I've surrendered to rails broken-ness.
ukd1 has joined #ruby
<shevy>
haha
<shevy>
textmate I wanted to try out one day
<shevy>
but just getting a mac for an editor alone seems odd
Neil_ has quit [Remote host closed the connection]
<wrapids>
Eclipse has some very nice plugins for syntax highlighting and such. I know at least for php it can easily be turned into a full blown php IDE
<cirwim>
shevy: skip straight to sublime
<ukd1>
Is there a good way to curry functions in Ruby?
<atmosx>
sublime… does it work under linux?
<cirwim>
ukd1: no
<ij>
How does ruby's GC work?
<cirwim>
you can use lambdas or w/e, but it's ugly
<cirwim>
ij: mark and sweep
<ukd1>
cirwin, ok thanks
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
<Paradox>
whichisbetter, map or inject
<atmosx>
ukd1: what do you mean by 'curry'?
<Paradox>
trick question, the answer is 4
<cirwim>
Paradox: each_with_object, duh
alanp has quit [Ping timeout: 250 seconds]
<Paradox>
4
<ij>
cirwim: Do you hve any deeper knowledge of ruby's GC?
<Paradox>
gc?
<Paradox>
giant cornmuffin?
<ryanf>
ukd1: when you say curry do you mean partially apply?
<cirwim>
ij: not massively, but what are you wanting to know?
CaptainJet has quit []
<ryanf>
because partial application is easy to set up
<flu->
Hello all, I've found what I consider a bug in Ruby 1.8.7, I'd like some validation before I post it to the issue tracker. The behavior of the OR operator with arrays does not function as expected. When either of the arrays has duplicate elements within, those dupes are lost with the OR. For instance, [1,1,1,1] | [] == [1] - in this case I would expect the result to be [1,1,1,1], since the union operation should not destroy dup
<flu->
This issue causes subtle problems in lots of Ruby code out there in the wild
mwilson_ has quit [Excess Flood]
<tds>
flu-: my hunch is that it treats it like a set
<tds>
sets aren't allowed to have duplicates
<Tasser>
tds, totally correct
<cirwim>
flu-: it's still like that in ruby 1.9
<flu->
tds: The C implementation checks for dupes after combining the two arrays
mwilson_ has joined #ruby
<Tasser>
Set Union---Returns a new array by joining this array with
<Tasser>
other_ary, removing duplicates.
<tds>
yeah
<tds>
that makes perfect sense
<flu->
So that isn't an OR, it's a destructive OR like operator :P
<Tasser>
flu-, reading may prove advantageous
<tds>
it's a set union operator
dkissell has quit [Read error: Connection reset by peer]
liluo has joined #ruby
<flu->
One would expect that the duplicates it says it removes are items that occur in both arrays, yielding one occurance of them; which is how people think of unions working
<flu->
not convert my array into a set automatically
<tds>
so then [1,1,1,1] | [1] == ?
<tds>
given your logic
EstanislaoStan has joined #ruby
EstanislaoStan has left #ruby [#ruby]
<flu->
eh, yeah that's tricky
dkissell has joined #ruby
<tds>
yeah
<tds>
sets aren't allowed to contain duplicates, period
EstanislaoStan has joined #ruby
<tds>
so it makes sense to me that set algebra operators would enforce the constraint, even if one of the operands is the empty set
berserkr has joined #ruby
<flu->
so the thing I'm ultimately trying to fix is the 'DeepMerge' operation that chef uses. From the user's point of view, there is no reason that their array of attributes that may contain duplicate entries would get mangled
<tds>
just like if you did S(1,1,1,1) U S() in math, you would get S(1)
r0bby is now known as robbyoconnor
<Tasser>
flu-, use a freakking struct
<flu->
tds: right, but my arrays aren't sets. I guess what you're saying is that the set-like operations implicitly treat incoming arrays as sets
<flu->
which makes sense with what I'm seeing
<Tasser>
flu-, yes, they do.
<flu->
guess I'll file this bug against chef after all
<tds>
yes
<tds>
it seems to be a bug of chef
<Tasser>
flu-, basic solution: don't map semantical structs to ruby arrays. that's what structs are for
<flu->
Tasser: A list of items is not a struct
<flu->
it's a list of items
<Tasser>
flu-, why were you talking about attributes then?
<flu->
for instance, weights for some algorithm, perfectly valid to have dupes there
<tds>
flu-: a.each { |item| b << item }
<tds>
for a merge that preserves duplicates
<Tasser>
tds, a + b
<tds>
oh
<flu->
Tasser: The attributes I was talking about is a chef thing
<tds>
much better
<flu->
Tasser: specifically, a list of weights :)
<Tasser>
flu-, uh, oke
<Tasser>
what's chef?
<flu->
deployment automation
<flu->
like puppet
<Tasser>
less ugly code? :-)
<raz>
hm
<tds>
are you sure that the authors of chef want to allow duplicates?
<flu->
well, it's ruby ;)
<tds>
seems like they would have just used array concatenation
<tds>
if they wanted to do allow duplicates
<flu->
tds: No, they don't in all cases. It's just more complicated than the code they use for merging attributes
<tds>
yeah, i only have a superficial familiarity w/ chef, so not sure