apeiros_ has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
jmrepetti has quit [Ping timeout: 250 seconds]
toretore has quit [Ping timeout: 265 seconds]
cleopatra has joined #ruby-lang
tejas-manohar has joined #ruby-lang
<tejas-manohar>
anyone know how to write the sequence alignment/dna matching algo in rb? like just the function that gets the score, specs - http://i.imgur.com/HYJxWaH.png
imkmf has quit [Ping timeout: 245 seconds]
<tejas-manohar>
btw, i have line 1 and line 2 as two different strings and passed in as params to my function
David_H_Smith has quit [Remote host closed the connection]
rahul_j_ has joined #ruby-lang
rahul_j has quit [Ping timeout: 272 seconds]
rahul_j_ is now known as rahul_j
tharindu has quit [Ping timeout: 255 seconds]
GarethAdams has joined #ruby-lang
fclausen has joined #ruby-lang
NoNMaDDeN has quit [Remote host closed the connection]
cornerma1 has joined #ruby-lang
rickyrickyrice has quit []
NoNMaDDeN has joined #ruby-lang
cornerman has quit [Ping timeout: 272 seconds]
cornerma1 is now known as cornerman
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt_ has joined #ruby-lang
ledestin_ has joined #ruby-lang
ledestin has quit [Ping timeout: 264 seconds]
ledestin_ is now known as ledestin
oak has joined #ruby-lang
shubhamgoyal has quit [Remote host closed the connection]
parzzix has quit [Ping timeout: 240 seconds]
rahul_j has quit [Ping timeout: 258 seconds]
parzzix has joined #ruby-lang
kyb3r_ has joined #ruby-lang
gix has quit [Ping timeout: 265 seconds]
jimbach has joined #ruby-lang
gix has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
jimbach has quit [Ping timeout: 258 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
cleopatra has quit [Ping timeout: 250 seconds]
j4cknewt_ has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby-lang
<bcardarella>
womble: sorry I'm on a plane and internet keeps crapping out. I would like the binding so I can call it
hahuang61 has joined #ruby-lang
marcdel has quit []
<womble>
bcardarella: You don't call bindings, you evaluate code in the context *of* the binding. I'm pretty sure you want to get a Method, which would be... tricky to get "the method that would be called if this method called super"
<bcardarella>
gotcha
<bcardarella>
womble: I can get it in UnboundMethod form but that doesn't really help me
<womble>
If you want to execute the method in the current context, you could pass the method and the binding and have the receiver combine the ingredients
<womble>
(Salt to taste)
<bcardarella>
ah, yes that should work
hahuang61 has quit [Ping timeout: 272 seconds]
AKASkip has joined #ruby-lang
David_H_Smith has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
David_H_Smith has quit [Ping timeout: 250 seconds]
skade has quit [Read error: Connection reset by peer]
<apeiros_>
crankharder: I mean since it's plain ruby, just write that 1 line of code to read it from the .ruby-version file.
<apeiros_>
trivial, no?
skade has joined #ruby-lang
<apeiros_>
ruby File.read('.ruby-version').chomp
<crankharder>
true, yes, I could do... `cat .ruby-version`.strip (and I have)
q_leonetti has quit [Quit: q_leonetti]
<apeiros_>
cat? shell out? seriously? :D
<crankharder>
always shell out :p
<crankharder>
yea, was just looking for something more 'official' looking to help pawn the idea off on my larger org
jmrepetti has quit [Remote host closed the connection]
jmrepetti has joined #ruby-lang
pablocantero has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
<apeiros_>
btw., seems `rails c` evaluates the Gemfile 3 times :D
<apeiros_>
I wonder why…
GBrawl_ has joined #ruby-lang
<darix>
apeiros_: because they can!
<darix>
:p
<apeiros_>
then they should evaluate it 9 times!
David_H_Smith has joined #ruby-lang
<darix>
crankharder: why would it need to read a ruby version file? it is already read by a ruby script and could just ask ruby about the version, platform and stuff?
GBrawl_ has quit [Client Quit]
loincloth has joined #ruby-lang
GBrawl has quit [Ping timeout: 258 seconds]
GBrawl has joined #ruby-lang
elimS has joined #ruby-lang
David_H_Smith has quit [Ping timeout: 255 seconds]
klmlfl has joined #ruby-lang
<workmad3>
darix: the 'ruby' directive a Gemfile is saying what version of ruby is allowable
nelsonsa_ has joined #ruby-lang
<workmad3>
darix: so it can't just read the RUBY_VERSION variable from the current runtime
klmlfl has quit [Read error: Connection reset by peer]
<workmad3>
*directive in a
<apeiros_>
and the Gemfile is read, whether you use a version manager or not. the .ruby-version is only read if you use a version manager (which supports it - but by now that's probably all)
klmlfl has joined #ruby-lang
<workmad3>
darix: so the idea would be that, rather than repeating the contents of your .ruby-version again in your Gemfile (and remembering to update both places if you update), you instead specify it once and are done with it
<workmad3>
personally, I'd prefer to see a version manager that parsed the version out the Gemfile though :)
<apeiros_>
I still think Gemfile being ruby code is a bad idea.
<darix>
workmad3: so you want "bundle exec rails c" rails if bundler is called with the wrong ruby version?
<apeiros_>
but what do I know…
elimS has quit [Ping timeout: 244 seconds]
nelsonsar has quit [Ping timeout: 244 seconds]
<apeiros_>
(same for gemspec)
<darix>
fails if ...
<apeiros_>
darix: yes, correct. that's the point of the ruby directive in the Gemfile.
<workmad3>
darix: that's exactly what happens currently if you've got a 'ruby' directive in your Gemfile and you try to run anything
j4cknewt has quit [Read error: Connection reset by peer]
<darix>
well
j4cknewt has joined #ruby-lang
<darix>
File.read(...).strip
<darix>
will work well enough
<darix>
anyway
slawrence00 has joined #ruby-lang
<workmad3>
darix: I've done that a couple of times :)
<workmad3>
darix: I think crankharder's point was more that he'd like it to be more automatic
<apeiros_>
and official :)
nelsonsa_ has quit [Ping timeout: 250 seconds]
<workmad3>
(mostly, I don't bother with a ruby directive in my Gemfile... I just put in a .ruby-version, if someone wants to ignore that and use a different version, fair enough :) )
<darix>
apeiros_: i think having a ruby based DSL for it ... otherwise you end up implementing a lot of wrapper function for base functionality. which is sometimes annoying e.g. in puppet
<darix>
workmad3: what reads ".ruby-version" normally?
<apeiros_>
darix: just use yaml.
ZaRDaK has quit [Quit: Leaving]
<apeiros_>
no need for any wrapper function.
<apeiros_>
and it's immediately readable by other languages.
<apeiros_>
and if yaml doesn't cover what you need, you're probably trying to stuff too much into it
<apeiros_>
workmad3: yupp. misses groups, but otherwise, something to that avail.
<darix>
and platform specific groups
<darix>
also limit it to just certain ruby platform versions
klmlfl_ has joined #ruby-lang
<apeiros_>
honestly, the platform specific should be handled on gem level.
<apeiros_>
but yes, realistically it probably needs to be in the gemfile too, since some gems don't handle it.
<darix>
and even then you write much more code to express the same which could be much easier expressed with e.g. some ruby dsl
<apeiros_>
um, no
solars has quit [Ping timeout: 255 seconds]
<apeiros_>
the code part is probably even less.
<darix>
apeiros_: how would you handle it to load jdbc on jruby and plain pg on mri?
<darix>
i mean on gem level
<crankharder>
oh man, I've missed so much chatter
<darix>
bundle needs to know to install them fore you
<darix>
for you..
<workmad3>
darix: you'd have both gems in there, with the suitable platform for each
<darix>
workmad3: yes. totally awesome
sarkyniin has joined #ruby-lang
<darix>
have bundler unused gems which might have lots of fun with build dependencies when you dont even need them.
<darix>
...
<workmad3>
not saying I'm in preference of a yaml Gemfile... it reminds me too much of maven POM files :)
<workmad3>
darix: that's what bundler already does... and it's good that it does so
<workmad3>
darix: because it means that it'll resolve the rest of the dependencies with both versions in mind, so you don't end up with versions that can be used with one gem and not the other
<bcardarella>
Is there a way to access the original method that a module has prepended over? I have a failing test case here that demonstrates (I hope) what I'd like to do: https://gist.github.com/bcardarella/b38fe97bade7d4ac097e
klmlfl has quit [Ping timeout: 256 seconds]
<apeiros_>
darix: I'd have to search for that. but I'm sure drbrain can fill you in on how to build multi platform gems
<darix>
apeiros_: you are playing stubborn today?
<apeiros_>
as for how I'd express it in a yaml gemfile: probably through metadata per group
<darix>
apeiros_: you can be pretty sure i am well aware of packaging
<apeiros_>
darix: no. but it might surprise you that I actually do work too…
<apeiros_>
also, asking me to reinvent bundlers gemspec on the spot is a tad unrealistic.
<workmad3>
a yaml format would certainly handle 90% or more of normal Gemfile use though, IMO... and the other small %age are the Gemfile uses that tend to cause headaches, problems and other issues too :)
<apeiros_>
"see! you can't come up with how to do a replacement of something grown within ~4y within 5min! so it can't be replaced!"
<darix>
apeiros_: i really hate people who claim "this handles 90% of the use cases most people have and i dont give a shit what the rest 10% needs"
<apeiros_>
darix: feel free to hate me :-p
<apeiros_>
though, my line reads differently
<godd2>
hey, if he thinks he can build a better bundler, more power to him
<workmad3>
apeiros_: give me another 10m and I'll probably have gotten bored enough to write a Gemfile that can parse a Gemfile.yml and splat it into bundler's DSL :)
<apeiros_>
"this handles 90% of the cases at present, and 99.9% of the legitimate cases. the 9.9% illegitimate cases can go screw themselves, or do it properly, and the effort to cover 100% is never worth it"
<darix>
apeiros_: yes
<darix>
just like yorick's claim that entities are not a thing a proper xml/html parser has to handle.
<apeiros_>
workmad3: that'd probably be a viable way to replace it :)
<workmad3>
darix: the times I've encountered people doing conditionals and other normal ruby stuff in a Gemfile, they've generally managed to completely screw things up so they end up with an undeployable Gemfile.lock
<workmad3>
darix: so yeah... screw them :)
<darix>
workmad3: people will also screw them self up with yaml files.
<apeiros_>
of course. but they'll screw a tad bit less.
slawrence00 has joined #ruby-lang
<godd2>
darix the ability for a tool to be misused does not negate the benefits of the tool
<apeiros_>
it's impossible to get people not to screw up. essential truth in life.
<apeiros_>
anway, as I said, I actually got work to do.
sarkyniin has joined #ruby-lang
<darix>
apeiros_: which you could also use to argue, that this means limiting the valid uses cases, that the ruby dsl brings because of people screwing themself up, is not the best idea.
<darix>
apeiros_: so stop chatting and more coding! :p
<apeiros_>
YOU DON'T LET ME!!!! :D
benlovell has quit [Ping timeout: 264 seconds]
<darix>
pfff
<apeiros_>
we shall talk again in 2027, when my language is finished. (10y ago I said 2017… time passes far too quickly :-S)
<darix>
apeiros_: just switch to 12hour days... then you got twice as many days at your disposal :p
<whitequark>
darix: arguably, this is because yaml is crap :]
imkmf has joined #ruby-lang
|jemc| has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
<workmad3>
apeiros_: waste 2 weeks training your body into polyphasic sleep patterns, then relish the extra 6 hours a day you gain? :D
<workmad3>
whitequark: could be worse... I could have done an XML file :D
<workmad3>
and, thinking about it, I'd probably prefer a JSON file than a YAML file...
<darix>
workmad3: SGML please. more fun to parse :p
sarkyniin has quit [Ping timeout: 240 seconds]
centrx has joined #ruby-lang
imkmf_ has joined #ruby-lang
<whitequark>
btw, there is a project using parser to parse gemfiles
<whitequark>
I think
<whitequark>
and if there is not, you can actually do that easily
imkmf has quit [Ping timeout: 264 seconds]
cornerma1 has joined #ruby-lang
amsha_ has joined #ruby-lang
RitterJack has quit [Remote host closed the connection]
yourabi has quit [Remote host closed the connection]
pricees has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
iTrace has quit [Quit: (null)]
jimbach has quit [Remote host closed the connection]
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
GBrawl has joined #ruby-lang
caseydriscoll has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
clauswitt has joined #ruby-lang
sarkyniin has quit [Remote host closed the connection]
jkad1 has joined #ruby-lang
lektrik has quit [Quit: Leaving]
banister is now known as banisterfiend
clauswitt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gianlucadv_ has quit [Ping timeout: 258 seconds]
tenderlove has joined #ruby-lang
ruby-lang269 has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
cmhobbs has quit [Quit: Leaving]
bmichelsen has joined #ruby-lang
malconis_ has joined #ruby-lang
chussenot_ has joined #ruby-lang
chussenot_ has quit [Client Quit]
loincloth has joined #ruby-lang
jkad1 has quit [Quit: WeeChat 1.0.1]
chussenot has quit [Ping timeout: 258 seconds]
malconis has quit [Ping timeout: 272 seconds]
<ruby-lang269>
I'm not able to figure out what i'm doing wrong here. Can someone clear up why i'm not getting [5, 4, 3, 2, 1] back from the method. https://paste.fedoraproject.org/151987/51054141/ - thanks
<centrx>
ruby-lang269, Wouldn't it be array.sort(yield) ?
<centrx>
aka array.sort(&block)
tenderlove has quit [Remote host closed the connection]
<ruby-lang269>
centrx - with an explicit block it works. Trying to figure out why the implicit block doesn't. Doing array.sort(yield) gives me - wrong number of arguments (1 for 0) (ArgumentError)
tenderlove has joined #ruby-lang
<centrx>
ruby-lang269, Looks like it has to be done with the &block syntax
<centrx>
ruby-lang269, So &block would be the last parameter of the sortarray_sort method, and the parameter passed to array.sort
tenderlove has quit [Remote host closed the connection]
<ruby-lang269>
centrx: thanks. Any docs/references you could point me to on why the yield doesn't work. This was just an exercise for me but curious in knowing why. Thanks again for your help.
<centrx>
ruby-lang269, It ought to work perhaps, but "yield" does not pass the block, it calls it
<centrx>
ruby-lang269, So yield is analogous to block.call, but there is no yield.uncall or whatever
loincloth has quit [Remote host closed the connection]
<ruby-lang269>
centrx - good stuff. array.sort(&Proc.new) works with an implicit block. Anyhoo i've spent 2 hours on this and wasn't any closer to understanding. Thanks for the help.
j4cknewt_ has quit [Ping timeout: 240 seconds]
j4cknewt has joined #ruby-lang
AKASkip has quit [Ping timeout: 258 seconds]
pricees has quit [Ping timeout: 255 seconds]
spuk has joined #ruby-lang
shambrarian has quit [Quit: bye!]
jgpawletko has quit [Quit: jgpawletko]
Averna has joined #ruby-lang
djbkd has joined #ruby-lang
nofxx has quit [Ping timeout: 265 seconds]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
whippythellama has quit [Quit: whippythellama]
tenderlove has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
j4cknewt has quit [Read error: No route to host]
workmad3 has joined #ruby-lang
j4cknewt has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
j4cknewt has quit [Read error: No route to host]
j4cknewt has joined #ruby-lang
workmad3 has quit [Ping timeout: 250 seconds]
skade has joined #ruby-lang
j4cknewt has quit [Read error: Connection reset by peer]
j4cknewt has joined #ruby-lang
spuk has quit [Ping timeout: 240 seconds]
solars has quit [Ping timeout: 264 seconds]
ta has quit [Remote host closed the connection]
ta has joined #ruby-lang
spuk has joined #ruby-lang
ta has quit [Ping timeout: 272 seconds]
chussenot has joined #ruby-lang
shennyg____ has quit []
shennyg has joined #ruby-lang
ruby-lang269 has quit [Ping timeout: 246 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jmrepetti has quit [Remote host closed the connection]