<benlangfeld>
Evening gents. I'm struggling to find any info on how to match a string against a regex in a Ruby C extension. I want to do the equivalent of this in C: "foo".match(/^f(\w*)/
<theRoUS>
has anyone ever tried to document code with *both* rdoc *and* yard?
tomzx has joined #ruby
<davidcelis>
why
<davidcelis>
why would you do such a thing
<fowl>
benlangfeld, do show-source String#match
cdepue_ has quit [Ping timeout: 264 seconds]
dnyy has quit [Remote host closed the connection]
saschagehlich has quit [Quit: saschagehlich]
neiZ has quit [Quit: Lost terminal]
<benlangfeld>
fowl: That helps only if I create the regex in Ruby code. I want to create it in C.
tomzx has quit [Client Quit]
<benlangfeld>
It's not performing the match that's difficult, I can just use rb_funcall. Creating the regex is more difficult, because it's not a C language primative
<benlangfeld>
fowl: I'm sorry, I don't think you're following what I'm saying.
<benlangfeld>
The regex doesn't come from calling Ruby code. I have to create it in C.
cherrypeel has quit [Ping timeout: 252 seconds]
<offby1>
benlangfeld: isn't there some generic way, from C, to create a new Ruby object, then invoke methods on it?
benson has quit [Quit: Leaving]
<benlangfeld>
I'm really not sure I can do that here.
<benlangfeld>
Aha. rb_reg_initialize_m might be what I was looking for
<offby1>
I've never done any C stuff in Ruby, but I'd be surprised if there weren't a way to do that
adamkittelson has joined #ruby
cdepue has quit [Remote host closed the connection]
<benlangfeld>
I really struggle with imperative languages
chson has joined #ruby
jimeh has quit [Ping timeout: 240 seconds]
nari has quit [Ping timeout: 248 seconds]
davidcelis has quit [Ping timeout: 248 seconds]
tatsuya_o has quit [Read error: Connection reset by peer]
<theRoUS>
davidcelis: because some people like yard and some like rdoc
tatsuya_o has joined #ruby
<theRoUS>
whoops, he's gone
<benlangfeld>
theRoUS: You're suggesting inconsistent doc formats in one codebase? Madness.
<theRoUS>
plus, they each have pros and cons. primarily cons.
<theRoUS>
yay madness
<benlangfeld>
Inconsistent anything is a bad idea, but doc formats are an obvious one.
<offby1>
A foolish hobgoblin is ... uh ...
beneggett has joined #ruby
Markvilla has joined #ruby
<theRoUS>
well, if either one (or a third one) recognised the other's syntax -- or if there were a doc system that didn't have their drawbacks, i'd be happy to switch
erichmenge has quit [Quit: erichmenge]
monkegji_ has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
etehtsea has quit []
dbe has quit [Remote host closed the connection]
<theRoUS>
all right, let's consider me chastened. :-) if you set up a gem working tree with jeweler, is there any way to conveniently change the options without having to manually edit things?
wunz has quit [Ping timeout: 250 seconds]
emmanuelux has joined #ruby
<theRoUS>
i imagine that 'rdoc vs yard' is a lower-energy form of 'vi vs emacs', but is there an emerging canon?
wunz has joined #ruby
<benlangfeld>
theRoUS: YARD
zomb1e has joined #ruby
<theRoUS>
mmph. which points to my last question. when i set up my gem wd, i told jeweler to support rdoc, but if i want to switch to yard, is there a way short of finding out what jeweler *would* have done (Rakefile, etc.) and manually making those changes?
kevinbond has quit [Ping timeout: 240 seconds]
<theRoUS>
benlangfeld: thanks for your patience and help, btw.
Targen has quit [Ping timeout: 245 seconds]
<benlangfeld>
theRoUS: I would suggest not using jeweler, putting yard in your gemspec, and adding a rake task for yard.
<benlangfeld>
theRoUS: I have quite a strong hatred for Jeweler and Hoe ;)
<theRoUS>
benlangfeld: i already did use jeweler, worse luck.
<benlangfeld>
theRoUS: It's not too late. You can escape it within minutes ;)
<theRoUS>
benlangfeld: /me is largely ears
lockweel has quit [Ping timeout: 255 seconds]
Peregrinu5 has joined #ruby
<benlangfeld>
theRoUS: Just create a gemspec, and remove all of the jeweler junk from your Rakefile
justsee has joined #ruby
andrewhl has quit [Remote host closed the connection]
quotemstr has joined #ruby
tiripamwe has quit [Ping timeout: 245 seconds]
cherrypeel has joined #ruby
<quotemstr>
Does ruby have a good repl?
<quotemstr>
Just running "ruby" by itself produces something very Perl-like.
ephemerian has quit [Quit: Leaving.]
<benlangfeld>
Yes, there's irb which is built-in (stands for Interactive Ruby), or Pry
Jaxel has joined #ruby
<quotemstr>
Ah, cool. Thanks.
<Jaxel>
okay so
<Jaxel>
i think i figured out my ocra problem a bit
<Jaxel>
this line: @of << [OP_CREATE_FILE, Ocra.dospath(tgt), str.size, str].pack("VZ*VA*"), the file descriptor there is 'OP_CREATE_FILE', which is defined as '2' in the module
<Jaxel>
i looked up bad file descriptor errors and somebody said that it happens if the numeric value is invalid
Markvilla has quit [Ping timeout: 264 seconds]
g_rotbart has quit [Read error: Connection reset by peer]
Peregrinu5 has quit [Ping timeout: 250 seconds]
trend has quit [Quit: trend]
quotemstr has left #ruby [#ruby]
zomb1e has quit [Quit: I'm tired. Real tired.]
g_rotbart has joined #ruby
jsilver has quit [Remote host closed the connection]
Lachryma has quit [Read error: Operation timed out]
btanaka has quit [Remote host closed the connection]
mdpatrick has joined #ruby
<Jaxel>
I feel like this should be a problem with either my system backup grabbing the file as soon as it's created or me not running as admin, but it's neither
ZachBeta has joined #ruby
mahmoudimus has joined #ruby
jameshyde has quit [Quit: Page closed]
freeayu has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
<Jaxel>
oh what
<Jaxel>
what
<Jaxel>
awwww damn installing 1.3.0.rc1 worked
<Ontolog>
[1,2,3][3,0] == [] while [1,2,3][4,0] == nil, I don't get it
<benlangfeld>
Ontolog: What don't you get?
<Ontolog>
benlangfeld: [1,2,3][3] == nil and [1,2,3][4] == nil, which makes sense
<Ontolog>
benlangfeld: so why this inconsistency with [start,end] ?
<benlangfeld>
Oh, good question. 'fraid I don't know the answer
kenperkins has quit [Ping timeout: 264 seconds]
LBRapid has quit [Quit: Computer has gone to sleep.]
piotr has quit [Ping timeout: 245 seconds]
yoklov has quit [Quit: computer sleeping]
subbyyy has joined #ruby
stephenjudkins has joined #ruby
yoklov has joined #ruby
bigoldrock has quit [Quit: Leaving.]
hynkle has quit [Quit: Computer has gone to sleep.]
daniellutz_ has quit [Quit: daniellutz_]
dnyy has joined #ruby
bradhe has quit [Remote host closed the connection]
syamajala has quit [Remote host closed the connection]
kevinbond has joined #ruby
Aaton is now known as Aaton_off
mahmoudi_ has joined #ruby
daniel_hinojosa has quit [Ping timeout: 245 seconds]
mahmoudimus has quit [Ping timeout: 246 seconds]
ukd1 has joined #ruby
Lachryma has joined #ruby
healpay has joined #ruby
stewart_ has quit [Quit: Leaving.]
<ukd1>
hi guys i'm having some issues with a hash and map - could someone have a look? https://gist.github.com/3080256 I'm expecting the constant to not be modified, but it is being changed
Ontolog has quit [Remote host closed the connection]
Markvilla has joined #ruby
<seanstickle>
Constants aren't constant
hynkle has joined #ruby
<ukd1>
seanstickle, yep - but still why is it being modified if I'm cloning it?
<seanstickle>
Shallow copy
daniel_hinojosa has joined #ruby
<ukd1>
seanstickle, is there a smarter way of doing this?
justsee has quit [Quit: Leaving...]
<seanstickle>
Deep copy.
freeayu has quit [Ping timeout: 240 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
<ukd1>
seanstickle, and that's the best way of modifying an array and getting the output?
tiripamwe has joined #ruby
zodiac1111 has joined #ruby
tiripamwe has quit [Read error: Connection reset by peer]
mohits has joined #ruby
tiripamwe has joined #ruby
<fowl>
b = browsers.map { |browser| b = browser.clone; b[:enabled] = ... }
<seanstickle>
Or just YAMLize and then de-YAMLize
<seanstickle>
Which is how we do deep copies when we really need them
<seanstickle>
Or JSONize and de-JSONize
<seanstickle>
As you prefer
<benlangfeld>
Or use ruby's Marshall, which might be faster
shadoi has quit [Quit: Leaving.]
<fowl>
don't you want to make BROWSERS into a hash like { 'ie8' => true, .. anyways, it seems saner
shadoi has joined #ruby
<Jaxel>
man happy wheels has been dying lately
<fowl>
or define the behavior of a browser in a class
Peregrinu5 has joined #ruby
<seanstickle>
True
<seanstickle>
bar = Marshal.load(Marshal.dump(foo))
stewart_ has joined #ruby
<seanstickle>
Works right nice
<fowl>
seanstickle, is there a deep copy method in ruby? i write one every time i need it ._.
mahmoudi_ has quit [Quit: Computer has gone to sleep.]
<seanstickle>
fowl: I pretty much just wrote it
mrsolo has quit [Quit: Leaving]
thecreators has quit [Ping timeout: 265 seconds]
dinkytoy has joined #ruby
banisterfiend has quit [Remote host closed the connection]
Synthead has joined #ruby
shadoi has quit [Ping timeout: 244 seconds]
banisterfiend has joined #ruby
ringotwo has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
banisterfiend has quit [Read error: Connection reset by peer]
hynkle has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
nateberkopec has joined #ruby
<offby1>
fowl: I use Marshall.load(Marshall.dump(whatever))
mahmoudimus has joined #ruby
benlangfeld has quit [Quit: Leaving.]
freeayu has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
Spooner has quit []
g_rotbart has quit [Remote host closed the connection]
dinkytoy has quit []
<theRoUS>
bleh. how on earth do i specify inline italic, bold, or monospace (or combinations thereof) in yard?
dross_ has joined #ruby
qko_ has joined #ruby
nazty has joined #ruby
kenperkins has joined #ruby
dinkytoy has joined #ruby
dross has quit [Read error: Connection reset by peer]
mdszy has quit [Read error: Connection reset by peer]
qko has quit [Read error: Connection reset by peer]
mdszy has joined #ruby
SegFaultAX|work2 has quit [Read error: Connection reset by peer]
SegFaultAX|work2 has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dinkytoy has quit [Client Quit]
dinkytoy has joined #ruby
kenichi has quit [Remote host closed the connection]
mpereira has joined #ruby
trend has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
adeponte has joined #ruby
nateberkopec has quit [Ping timeout: 244 seconds]
perryh_away is now known as perryh
davidpk has joined #ruby
nari has joined #ruby
jeff_sebring has quit [Quit: Leaving]
bbttxu has quit [Quit: bbttxu]
ttilley_off is now known as ttilley
iamjarvo has joined #ruby
<iamjarvo>
is there a way to make get_multiples more object oriented. say if i wanted to check for 2 also
davidcelis has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
freeayu has quit [Ping timeout: 245 seconds]
monkegji_ has quit [Remote host closed the connection]
Targen has joined #ruby
davidcelis has joined #ruby
bradhe has joined #ruby
nazty has quit [Ping timeout: 250 seconds]
Markvilla has quit [Ping timeout: 264 seconds]
jds has quit [Read error: Connection reset by peer]
shadoi has joined #ruby
jds has joined #ruby
cherrypeel has quit [Quit: Leaving]
yonggu_ has joined #ruby
jrhorn424 has joined #ruby
greyEAX has joined #ruby
yonggu has quit [Ping timeout: 264 seconds]
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
heftig has quit [Remote host closed the connection]
heftig has joined #ruby
Hanmac1 has joined #ruby
pu22l3r has joined #ruby
itnomad has quit [Ping timeout: 264 seconds]
Hanmac has quit [Ping timeout: 246 seconds]
JustinCampbell has quit [Remote host closed the connection]
Goles has joined #ruby
Synthead has quit [Ping timeout: 240 seconds]
apok has quit [Ping timeout: 245 seconds]
ukd1 has quit [Quit: Lost terminal]
uris has joined #ruby
perryh is now known as perry
L-----D has joined #ruby
brianpWins has quit [Quit: brianpWins]
davidcelis_ has joined #ruby
itnomad has joined #ruby
monkegjinni has joined #ruby
ben_alman has quit [Excess Flood]
<theRoUS>
rdoc supports *bold*_italic_ and +monospace+ -- how does yard signal those face changes?
davidcelis has quit [Ping timeout: 244 seconds]
Markvilla has joined #ruby
davidcelis_ has quit [Read error: Connection reset by peer]
davidcelis_ has joined #ruby
<offby1>
eww, using "next" inside a "map" makes my brain hurt
Markvilla has quit [Ping timeout: 255 seconds]
k_89 has quit [Ping timeout: 255 seconds]
greyEAX has quit [Read error: Connection reset by peer]
Araxia has quit [Quit: Araxia]
patient has quit [Quit: leaving]
ben_alman has joined #ruby
kvirani has joined #ruby
Synthead has joined #ruby
<offby1>
iamjarvo: you don't want get_multiples to be more object oriented. Rather, you want it to be more functional. Like this: def get_multiples; (1..@upper_bound).find_all{|i| (i % 3 == 0) || (i % 5 == 0) }; end
jarred has quit [Quit: jarred]
* offby1
has spoken
sepp2k1 has quit [Read error: Connection reset by peer]
andrewhl has quit [Remote host closed the connection]
dev_ryan70 has joined #ruby
Synthead has quit [Read error: Operation timed out]
vitor-br has joined #ruby
ackz has joined #ruby
noganex has quit [Ping timeout: 244 seconds]
ZachBeta has quit [Quit: Computer has gone to sleep.]
bglusman has joined #ruby
weasels has joined #ruby
weasels has quit [Remote host closed the connection]
dev_ryan70 has quit [Remote host closed the connection]
<epochwolf>
I'm working on a fork of https://github.com/jlapier/epubbery and I've noticed that the Gemfile lists rubyzip as a dependency but it's not in the gemspec. It is not possible to use this gem without this library installed, should the gemspec contain that file?
dev_ryan70 has joined #ruby
noganex has joined #ruby
<iamjarvo>
offby1: why would i want it more functional though? isn't that limiting? I was thinking i could just pass in the args as an array and iterate over them, so then i can get multiples of any number
<iamjarvo>
offby1: i guess i can leave off the next since i am calling compact
greasegum has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<offby1>
iamjarvo: you want it more function because I'm an anti-OO, pro-functional bigot :)
<offby1>
seriously though, mine's a lot simpler than yours.
ZachBeta has joined #ruby
tama has quit [Ping timeout: 255 seconds]
Peregrinu5 has quit [Ping timeout: 248 seconds]
rippa has joined #ruby
<iamjarvo>
offby1: haha i see
savage- has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
jgrevich has quit [Quit: jgrevich]
ZachBeta has quit [Client Quit]
k_89 has joined #ruby
<greasegum>
offby1:: you nick appeals to me
<greasegum>
*your
roadze has joined #ruby
roadze has quit [Remote host closed the connection]
<offby1>
do you wish to sign up for my newsletter?
<offby1>
It might get delivered to your next-door neighbor by accident.
<shevy>
I wanted to sign up
<shevy>
but I was off by one on the email list and never recieved any notifications :(
Peregrinu5 has joined #ruby
<offby1>
a known risk
<shevy>
the worst thing is to be off by one during sex however
freeayu has joined #ruby
<offby1>
Oh, I'm sorry, honey; I thought that was you!
<greasegum>
only if your newsletter is about reggaeton, otherwise they probably won't be into it.
<shevy>
yeah offby1
<offby1>
it had an article about DubyaStep. The previous president's favorite dance music
apeiros_ has joined #ruby
<shevy>
monkey style?
freeayu__ has quit [Ping timeout: 240 seconds]
<greasegum>
which makes me wonder, what's all this controversy about obamacore? It's got good bass.
nazty has joined #ruby
nai has joined #ruby
graft has quit [Ping timeout: 264 seconds]
greyEAX has quit [Quit: Leaving]
emmanuelux has quit [Ping timeout: 264 seconds]
<greasegum>
do an article.
gtuckerkellogg has joined #ruby
pradeepto has quit [Remote host closed the connection]
<offby1>
:-)
Chryson has joined #ruby
Peregrinu5 has quit [Ping timeout: 256 seconds]
graft has joined #ruby
monkegjinni has quit [Remote host closed the connection]
apeiros_ has quit [Ping timeout: 255 seconds]
jrhorn424 has quit [Quit: jrhorn424]
krz has quit [Quit: krz]
strife25 has quit [Quit: Computer has gone to sleep.]
<greasegum>
ah comedies
adeponte has quit [Remote host closed the connection]
blankverse has joined #ruby
k_89 has quit [Ping timeout: 240 seconds]
<blankverse>
i am using sinatra/r18n plugin , how do i store the t variable in javascript?
<davidcelis>
i'm building a fucking bookshelf chill the fuck out
<StretchedALot>
there are 627 people here
mahmoudimus has joined #ruby
<StretchedALot>
they can't all be inactive
<StretchedALot>
well people will pay
<StretchedALot>
:D
<StretchedALot>
for their insolence
<banisterfiend>
StretchedALot: i like your program it's a good program
<StretchedALot>
so could ruby be used for such an application?
<StretchedALot>
how much would it cost?
<StretchedALot>
I would be willing to suck cock and drink cum to get a discount
mahmoudimus has quit [Client Quit]
d3vic3 has quit [Read error: Operation timed out]
<banisterfiend>
StretchedALot: if you're any good at that, you might make more money sticking to that career
wargasm has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
<StretchedALot>
nah I just do it for pleasure
<StretchedALot>
i like having hot cum splashed into my face
<banisterfiend>
StretchedALot: you dont find it humiliating?
<banisterfiend>
StretchedALot: i would be concerned about your self-esteem if you do that too regularly
<StretchedALot>
oh it turns me on
<StretchedALot>
but that is not all i like to have done
<StretchedALot>
generally I have the guy I am sucking finger my asshole
<StretchedALot>
and press my prostate until I cum
mpereira has quit [Ping timeout: 245 seconds]
<StretchedALot>
:D
<banisterfiend>
StretchedALot: what if he doesnt want to
<StretchedALot>
hot stuff
d3vic3 has joined #ruby
L-----D has joined #ruby
<StretchedALot>
ah I don't just go with guys that only want that
<StretchedALot>
don't worry
<StretchedALot>
the suckoff for the programmer was for a discount
<StretchedALot>
:D
mahmoudimus has joined #ruby
<StretchedALot>
who here hates niggers?
<StretchedALot>
I fucking hate niggers!
<Gavilan>
StretchedALot: What do you have against people who were born in Nigeria?
nmyerson has joined #ruby
mahmoudimus has quit [Client Quit]
<darkf>
Gavilan: I don't think that's what he's talking about
savage- has quit [Remote host closed the connection]
<StretchedALot>
nigerians send me all that spam
<StretchedALot>
it is annoying
<StretchedALot>
gavilan de donde eres guey?
Shrink has joined #ruby
shamik has joined #ruby
RainbowDashh has joined #ruby
rohit has quit [Read error: Connection reset by peer]
beneggett has quit [Ping timeout: 245 seconds]
T_Rex_ has joined #ruby
nmyerson has left #ruby [#ruby]
<shamik>
I'm a ruby newbie. Need some help re: dictionaries. Looking over some code, I see the same dictionary defined in two different ways dict = { :key1 => 25, :key2 => 50 } and elsewhere dict = { key1: 25, key2: 50 }. Whats the difference between these two syntaxes ?
StretchedALot has left #ruby ["Leaving"]
td123 has joined #ruby
_theriffer_ has joined #ruby
anothervenue has quit [Quit: WeeChat 0.3.7]
aroman has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
<banisterfiend>
shamik: they do the same thing, it's just the second one is using 1.9 hash syntax
T_Rex_ has quit [Quit: T_Rex_]
mockra has quit [Remote host closed the connection]
aroman has joined #ruby
<shamik>
tx banisterfiend. Which one is "better" (more current?)
<banisterfiend>
shamik: the first one is probably used more
RainbowDashh is now known as rainbowDashh
mahmoudimus has joined #ruby
<banisterfiend>
shamik: the second one is used sometimes by some people who dont care about 1.8 compatibility
<banisterfiend>
rainbowDashh: are you a brony?
<darkf>
obviously
<darkf>
rainbowDashh: I love your name/mane :3
<rainbowDashh>
I keep wondering why I join random channels. (including this one)
<rainbowDashh>
would be useful if I manage to screw up with some ruby thing
<darkf>
rainbowDashh: why? I'm just complimenting you on your taste in ponies. :(
<rainbowDashh>
yeah, leave it in PM so it wouldn't be too spammy. I don't really know the rules in here.
<banisterfiend>
rainbowDashh: you're not a ruby programmer?
mahmoudimus has quit [Client Quit]
<shamik>
tx
L-----D has quit [Quit: Leaving]
g_rotbart has quit [Write error: Connection reset by peer]
g_rotbart has joined #ruby
anothervenue has joined #ruby
StretchedALot has joined #ruby
<StretchedALot>
lol
anothervenue has quit [Client Quit]
tiripamwe has joined #ruby
ABK has joined #ruby
nai has quit [Remote host closed the connection]
darkf has quit [Ping timeout: 240 seconds]
savage- has joined #ruby
dhruvasagar has joined #ruby
anothervenue has joined #ruby
blazes816 has quit [Quit: Leaving]
Morkel has joined #ruby
jarred_ has joined #ruby
beilabs has quit [Ping timeout: 252 seconds]
Chryson has quit [Quit: Leaving]
yxhuvud has joined #ruby
dv_ has joined #ruby
Eldariof-ru has joined #ruby
a_a_g has joined #ruby
Zolrath has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
fantazo has quit [Remote host closed the connection]
beneggett has quit [Ping timeout: 250 seconds]
vectorshelve has joined #ruby
lolmaus has joined #ruby
<vectorshelve>
hemanth: hai dude
beneggett has joined #ruby
beilabs has joined #ruby
tagrudev has joined #ruby
g_rotbart has quit [Remote host closed the connection]
g_rotbart has joined #ruby
a_a_g1 has joined #ruby
a_a_g has quit [Ping timeout: 246 seconds]
bigkevmcd has joined #ruby
jordan__ has joined #ruby
libertyprime has quit [Quit: Lost terminal]
williamcotton_ has joined #ruby
<jordan__>
How can I download the source of a webpage with ruby?
kevinbond has quit [Quit: kevinbond]
a_a_g1 has quit [Read error: Connection reset by peer]
banghouse has quit [Read error: Operation timed out]
kiela_ is now known as kiela
flak has joined #ruby
flak is now known as Guest347
iamlacroix has joined #ruby
rippa has quit [Ping timeout: 245 seconds]
noyb has quit [Ping timeout: 248 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
tdubellz is now known as thomas
Shrink has quit [Ping timeout: 264 seconds]
zerdliu has joined #ruby
zerdliu has left #ruby [#ruby]
jesly has joined #ruby
brianpWins has joined #ruby
Tearan has quit [Ping timeout: 252 seconds]
BeLucid_ has joined #ruby
BeLucid has quit [Read error: Connection reset by peer]
ij has quit [Read error: Connection reset by peer]
Tearan has joined #ruby
_theriffer_ has quit [Quit: Leaving.]
jesly has quit [Client Quit]
adamkittelson has quit [Remote host closed the connection]
_justin has joined #ruby
Tricks has quit [Remote host closed the connection]
subbyyy has quit [Quit: Leaving.]
_justin has quit [Client Quit]
rainbowDashh has quit [Quit: SLEEP MODE. I NEED A MORE CREATIVE MESSAGE FOR MY DUMB LID CLOSING.]
artm has joined #ruby
yonggu has quit [Quit: yonggu]
pedm has quit [Quit: pedm]
_justin has joined #ruby
_justin has left #ruby [#ruby]
_justin has joined #ruby
Azure has quit [Read error: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac]
_justin has left #ruby [#ruby]
g_rotbart has quit [Remote host closed the connection]
Tearan has quit [Ping timeout: 250 seconds]
Azure has joined #ruby
ttilley is now known as ttilley_off
jesly__ has joined #ruby
Shrink has joined #ruby
jesly__ has quit [Client Quit]
Guest347 is now known as rippa
ryanf has quit [Quit: leaving]
elwristo has joined #ruby
djdb has joined #ruby
<jds>
Hi
<jds>
I'm doing some timezone stuff with ActiveSupport. I'm starting with a string (eg "2012-07-09 17:23:44 +0100"), and would like to know its timezone. Time.parse correctly figures out the timezone, but the return value is converted to UTC, so Time.parse(foo).zone isn't helpful
savage- has quit [Remote host closed the connection]
benlangfeld has joined #ruby
benlangfeld has quit [Changing host]
benlangfeld has joined #ruby
krz has quit [Quit: krz]
<jds>
Oh, huh. DateTime.parse doesn't convert to the local timezone
Azure has quit [Ping timeout: 245 seconds]
benlangfeld1 has joined #ruby
benlangfeld1 has left #ruby [#ruby]
benlangfeld has quit [Ping timeout: 244 seconds]
Shrink has quit [Ping timeout: 264 seconds]
imami|afk is now known as banseljaj
dekroning has joined #ruby
hoelzro|away is now known as hoelzro
afd__ has joined #ruby
qos has joined #ruby
aroman has quit [Read error: Connection reset by peer]
wobr has joined #ruby
aroman has joined #ruby
elhu has joined #ruby
nazty has quit [Ping timeout: 245 seconds]
Hanmac1 is now known as Hanmac
williamcotton_ has quit [Quit: williamcotton_]
ssspiff has joined #ruby
sspiff has quit [Ping timeout: 264 seconds]
cezar has joined #ruby
abstrusenick has joined #ruby
Ontolog has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 264 seconds]
cezar has quit [Client Quit]
mucker has joined #ruby
icyfenix has left #ruby [#ruby]
igotnolegs has quit [Quit: Computer has gone to sleep.]
abra has quit [Ping timeout: 252 seconds]
abra has joined #ruby
jarred_ has quit [Quit: jarred_]
foofoobar has quit [Quit: Changing server]
n1x has joined #ruby
foofoobar has joined #ruby
Shrink has joined #ruby
foofoobar has quit [Client Quit]
n1x has left #ruby [#ruby]
Mon_Ouie has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
elwristo has quit [Quit: elwristo]
TPFC-SYSTEM has joined #ruby
fixl has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
piotr has joined #ruby
bosphorus has joined #ruby
mathie has joined #ruby
jimeh has joined #ruby
rcsheets has quit []
qos has quit [Quit: Leaving...]
graft has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
graft has joined #ruby
qos has joined #ruby
Mon_Ouie has quit [Ping timeout: 245 seconds]
abstrusenick has quit [Read error: Connection reset by peer]
<MikeWorth>
Hi, I'm after a way to have a queue that persists to disk, such that if the machine dies it can be brought back up and re3populate the queue as it was when it died. Appending lines to a file and reading lines seems easy, but deleting the first line each time after it has been processed looks more problematic. Performance is something of an issue, so I guess something like `tail -n +2 file>file` is probably not going to be a very goo
<MikeWorth>
d solution?
ssspiff has quit [Ping timeout: 264 seconds]
Guest44932 is now known as davidw
<hoelzro>
MikeWorth: mmap'd file, maybe?
davidw has quit [Changing host]
davidw has joined #ruby
<hoelzro>
Berkeley DB queue?
Berglund has quit [Client Quit]
lkba has quit [Quit: Bye]
wallerdev has quit [Quit: wallerdev]
baphled has quit [Read error: Connection reset by peer]
Rochefort has quit [Remote host closed the connection]
zz_chrismcg is now known as chrismcg
k_89 has quit [Quit: Leaving]
tiripamwe has quit [Ping timeout: 245 seconds]
neku has joined #ruby
tonini has quit [Remote host closed the connection]
<bnagy>
beanstalkd
<bnagy>
or amqp or redis
<bnagy>
but I like beanstalkd a lot, personally
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
vitor-br has quit [Quit: Saindo]
ssspiff has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
sspiff has quit [Ping timeout: 264 seconds]
tatsuya_o has joined #ruby
pygospa has quit [Read error: Operation timed out]
davidpk has quit [Quit: Computer has gone to sleep.]
<fowl>
lukeholder, in hundreds of years the name lukeholder will be remembered for this gem "256 instance veriables", nobody will know wtf you were talking about though
a_a_g has joined #ruby
jjang has joined #ruby
<lukeholder>
fowl did you try making more than that?
gtuckerkellogg has joined #ruby
<lukeholder>
don't do it.
bier|tp has joined #ruby
<lukeholder>
you have no idea what will happen and it is not good.
bier has joined #ruby
<shevy>
once code becomes too large, I find it hard to keep it simpler
<banisterfiend`>
shevy: then break it up into more classes
<shevy>
yeah hmm
Zolrath has quit [Quit: Computer has gone to sleep.]
<banisterfiend`>
shevy: in other words: learn object oriented programming :P
<shevy>
it often feels as if complexity is just shuffled about or hidden somewhere elese
<lukeholder>
thats why naming is important
<lukeholder>
and hard
bashdy has joined #ruby
<shevy>
I got naming covered
<shevy>
_ = ''
<shevy>
__ = ''
ramblex has joined #ruby
<shevy>
___ = _+__
<lukeholder>
………..ok?
nazty has joined #ruby
wlievens has joined #ruby
Shrink has quit [Ping timeout: 244 seconds]
<shevy>
def __?; puts "hi"; end
<shevy>
well alright I dont do that
<shevy>
I don't like __ in method names much
<lukeholder>
_ or __?
<gogiel>
ada
<gogiel>
ops, sorry
jjang has quit [Ping timeout: 244 seconds]
<gtuckerkellogg>
hi all
<lukeholder>
hi Gadgetoid
<lukeholder>
hi gtuckerkellogg
bigkevmcd has quit [Read error: Operation timed out]
<Gadgetoid>
Ahoy lukeholder
<lukeholder>
sorry Gadgetoid you were a typo
<gtuckerkellogg>
i'm looking for a good yasnippet collection to use for Rakefiles.
<lukeholder>
but hi
<workmad3>
shevy: my naming is better, var2 = var1 + var50
nazty has quit [Ping timeout: 255 seconds]
<Gadgetoid>
lukeholder: I did wonder! But, what the hey… hello *everybody*!
<wlievens>
I reboot my Apache and now a Rails app doesn't work anymore. I get this error: /usr/bin/ruby: No such file or directory -- $(optflags) $(debugflags) $(warnflags) (LoadError)
<fowl>
wlievens, #RAILS, #RUBYONRAILS
<wlievens>
fowl: not sure, it's a ruby environment thing, not rails support
<wlievens>
something fowled up (heh) my ruby installation
A124 has joined #ruby
<wlievens>
strange... /usr/bin/ruby: No such file or directory <---- but it's there!
<wlievens>
shevy: hello again :-) things are spooky again... my ruby install was working fine until I just now restarted apache httpd
tk___ has joined #ruby
<shevy>
how can I remove my own gems from rubygems.org ?
Shrink has joined #ruby
<shevy>
or at least release it into the wild... I want to maintain only active gems
<shevy>
wlievens: this can happen when some other error disguises it
<banisterfiend`>
shevy: gem yank
<shevy>
for instance, I have such errors when I removed some .so file, then I get bogus error reports sometimes
<shevy>
wlievens: but that was just one example, there can be many more
<shevy>
thanks banisterfiend` !
<workmad3>
shevy: I'd probably personally push a version that changes the description to say 'unmaintained, please contact me if you wish to take over maintenance'
<shevy>
but as said, I think there is some other error you have here. it is totally odd that you get random characters auto-appended
<shevy>
no, I dont think make understands "configure" as argument
<wlievens>
ok
<wlievens>
it is indeed, and I accept that it is more likely that the shell is borked
<wlievens>
but I just want to eliminate this
<shevy>
hmm
<shevy>
can you try to do "ruby foo" a few times
<shevy>
perhaps you see a pattern?
akem has quit [Ping timeout: 252 seconds]
<shevy>
also if you are on linux, start "xev"
baphled has quit [Quit: leaving]
<wlievens>
I see no difference in the kind of nonsense chars. Also, putty renders them however putty wants I think
<wlievens>
what is xev?
<shevy>
putty?
<wlievens>
I'm remotely connected to this machine through an ssh terminal
<shevy>
ohhhhhh
<wlievens>
my client is win7
<shevy>
perhaps this is the culprit
<wlievens>
this is the "production" server (internal use)
<wlievens>
well I've never noticed anything like this so I wouldn't know what
<shevy>
I can assure you that on my windows laptop, "ruby foo" via cmd.exe will report the same error as on linux
<shevy>
perhaps some gem did something funky
lockweel has joined #ruby
<wlievens>
ruby worked fine yesterday so it certainly did at some point
<shevy>
I think something like RVM tries to change environment variables
vitoravelino is now known as vitoravelino`afk
charnel has quit [Read error: Connection reset by peer]
<wlievens>
I don't have rvm installed
<wlievens>
heh
<wlievens>
it works fine after the recompile
<wlievens>
the ruby executable...
<wlievens>
and now also redmine
<hoelzro>
speaking of rvm/rbenv, ruby-build failed to build ruby 1.8.7 for me last night =(
<fowl>
that means its time to move on
<fowl>
1.8.7 was cool back in 1993
<shevy>
odd wlievens
<shevy>
but allt he better then
<wlievens>
shevy: yes I'm happy it's fixed but not happy that I have no idea what caused it
<wlievens>
oh I should've kept a copy to make a binary comparison
<hoelzro>
fowl: I want to be able to verify that code I write works on 1.8, though
<wlievens>
of the faulty executable - if that was to blame
<shevy>
pfft wlievens problem is gone! we only remember magic funky super characters
<shevy>
the kobold in your machine
<wlievens>
more likely it was some .so file that was wiped due to whatever - hopefully not something that would happen again
<shevy>
hoelzro: I too! is why I dont want to use -> operator
<wlievens>
thanks for your help in any case people
pk1001100011 has joined #ruby
<shevy>
yeah man
<shevy>
we are here to pat you on the back
<shevy>
WHILE YOU MAKE YOUR WAY THROUGH THE JUNGLE, ENEMY GUNFIRE AT POINT BLANK!
<fowl>
why hoelzro , that's like saying fuck the car i prefer my horse
pdelgallego has quit [Quit: pdelgallego]
<fowl>
kill the horse, it will feed your family for months
<fowl>
good meat
<wlievens>
thanks for your help in any case people
<shevy>
if I wouldn't be a pacifist by nature, I would have had to be the commander in charge in the army. because I can't be arsed to go first into combat zones, I could only send others into it... :P
<wlievens>
oops
<shevy>
teach a man how to fish
<shevy>
and he will take your horse
bigkevmcd has joined #ruby
etehtsea has quit []
<shevy>
horse a fish how to man
<shevy>
and you'll have plenty of fish for the rest of your life
neku is now known as neku|away
saschagehlich has quit [Quit: saschagehlich]
neku|away is now known as neku
<wlievens>
fish a man a horse and he'll tell stories about the feat
<JonnieCache>
dont support 1.8
<JonnieCache>
just like you dont support ie6
<JonnieCache>
for the good of humankind
<JonnieCache>
not that ruby 1.8 is as bad as ie6 but you get the idea
<workmad3>
maybe more like ie7? :)
<banisterfiend`>
ruby 1.8.7 is actually pretty sweet
<banisterfiend`>
procs can even take block arguments :)
etehtsea has joined #ruby
etehtsea has quit [Excess Flood]
<JonnieCache>
i want to be able to use the new hash syntax indiscriminately without having to worry about people not being able to run it though
<shevy>
hmm
<hoelzro>
fowl: I thought there was still a substational amount of code that only runs on 1.8?
<hoelzro>
I may be ill informed
<fowl>
hoelzro, those holdouts will upgrade or die, such is the way of life
<shevy>
the new hash syntax can be nice indeed
<hoelzro>
I know that 1.8 was recently discontinued or something
etehtsea has joined #ruby
etehtsea has quit [Excess Flood]
<workmad3>
1.8 just had its final release
bigkevmcd has quit [Ping timeout: 244 seconds]
<JonnieCache>
rails is removing support for it soon, that will kill it for the most part
<fowl>
at this point, if they havent got compatibility with 1.9 i would consider it dead
justinmcp has joined #ruby
<workmad3>
and yes, rails 4 is 1.9+ only
<JonnieCache>
although people who get excited about new versions of rails are all using 1.9 id imagine
<hoelzro>
so the community concensus is only support 1.9?
<workmad3>
not that they're at any sort of release stage for rails 4 yet :)
<workmad3>
hoelzro: pretty much... and one of these days, I'm sure even codepad will upgrade :)
<JonnieCache>
unless you have a compelling reason to support 1.8, like a client is set on it, then go 1.9 all the way
etehtsea has joined #ruby
etehtsea has quit [Excess Flood]
<hoelzro>
and anyone on an OS that doesn't package 1.9 is screwed, or has to build a custom Ruby if they want to use my stuff?
<hoelzro>
I'm not far along with Ruby yet (just playing), but I'm learning it to add it to my resume, so I'd like to get this stuff down
<JonnieCache>
well obviously its up to you. but i think anything that pressures to community to move on is good. its not like 1.9 is riddled with flaws
<banisterfiend`>
hoelzro: what other langs do u know already?
<workmad3>
hoelzro: pretty much, although I'm not aware of any major (or even minor) packaging systems that don't have some form of 1.9 bundled
<JonnieCache>
but yeah i guess if you want your open source code to be run by as many people as possible then youd want to support 1.8
<hoelzro>
banisterfiend`: I do most of my work in Perl, but I know a handful
bashdy has quit [Quit: bashdy]
<workmad3>
hoelzro: and there are binary builds available for most platforms, along with tools like rvm and ruby-build that make installing your own ruby from source pretty trivial
<workmad3>
hoelzro: so lets say it isn't difficult to get 1.9 installed ;)
etehtsea has joined #ruby
<hoelzro>
workmad3: I have rvm installed, and I think it's a great idea, but what about non-tech folk that want to install my stuff?
<workmad3>
hoelzro: how many non-tech folk do you anticipate installing gems?
pdelgallego has joined #ruby
<hoelzro>
let's say I write a neat application for OS X or something using RubyCocoa; do I have to then distribute 1.9 with my application?
<JonnieCache>
rubycocoa is 1.9 only
<workmad3>
haha
<hoelzro>
oh, really?
<hoelzro>
interesting...
<JonnieCache>
macruby is its own interpreter which is totally separate
<banisterfiend`>
hoelzro: if you write it using macruby, yo uwont even need the ruby runtime
<workmad3>
hoelzro: but basically, yes... if you would need to either release into an env where you know the versions, or package it up with the correct versions
<workmad3>
hoelzro: same as with any other packaged app
etehtsea has quit [Client Quit]
<workmad3>
hoelzro: or you'd need to give instructions as to how to install the requirements
<JonnieCache>
hmm apparently rubycocoa isnt 1.9 only, its macruby, the replacement project for rubycocoa which is 1.9
etehtsea has joined #ruby
<JonnieCache>
but i think macruby produces statically linked binaries with its own interpreter anyway
<hoelzro>
I see
<JonnieCache>
macruby is so cool. i need to write a music player app for it so i can make boatloads of money and never have any free time ever again
<workmad3>
hoelzro: that sort of thing is very application-dependent though, and very target-user dependent too
<JonnieCache>
s/for/in
`brendan has joined #ruby
TheFuzzball has quit [Quit: Leaving...]
shavus has quit [Remote host closed the connection]
wangr has joined #ruby
ssspiff has joined #ruby
sspiff has quit [Ping timeout: 255 seconds]
<gtuckerkellogg>
any good snippet collections for Rakefiles ? (preferably yasnippet)
lxsameer has quit [Quit: Leaving]
Progster has joined #ruby
charnel has joined #ruby
cantonic_ has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
TheFuzzball has joined #ruby
cantonic has quit [Ping timeout: 265 seconds]
cantonic_ is now known as cantonic
wvms has quit [Quit: wvms]
thone has quit [Read error: Connection reset by peer]
TheFuzzball has quit [Remote host closed the connection]
mdszy has joined #ruby
wvms has joined #ruby
wvms has quit [Remote host closed the connection]
A124 has quit [Quit: Leaving.]
minijupe has joined #ruby
krusty_ar has joined #ruby
TheFuzzball has joined #ruby
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
hynkle has joined #ruby
Natch has quit [Remote host closed the connection]
nari has joined #ruby
strife25 has joined #ruby
krusty_ar has quit [Remote host closed the connection]
krusty_ar has joined #ruby
lkba has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
ZachBeta has joined #ruby
ssspiff has quit [Ping timeout: 264 seconds]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
vitoravelino`afk is now known as vitoravelino
Rochefort has quit [Read error: Connection reset by peer]
Rochefort has joined #ruby
justinmcp has quit [Remote host closed the connection]
geekbri has joined #ruby
d3vic3 has quit [Ping timeout: 246 seconds]
pdelgallego has quit [Read error: Connection reset by peer]
_pdelgallego has joined #ruby
d3vic3 has joined #ruby
Axsuul has quit [Ping timeout: 248 seconds]
AndChat| has joined #ruby
lkba has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Quit: Leaving.]
sepp2k has joined #ruby
vectorshelve has quit [Quit: Page closed]
carloslopes has joined #ruby
dv310p3r has joined #ruby
subbyyy has joined #ruby
subbyyy has quit [Client Quit]
charnel has quit [Read error: Connection reset by peer]
sailias has quit [Quit: Leaving.]
lorandi has joined #ruby
<regedarek>
How in ruby compare Time.now == Time.now ??
fantazo has joined #ruby
saschagehlich has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
reuf has quit [Read error: Operation timed out]
GeekOnCoffee has quit [Read error: Connection reset by peer]
GeekOnCoffee has joined #ruby
bigkevmcd has joined #ruby
k_89 has quit [Ping timeout: 240 seconds]
<JonnieCache>
regedarek: what do you mean?
samuel02 has joined #ruby
<shevy>
gtuckerkellogg: dont think so
arkiver has quit [Ping timeout: 244 seconds]
djdb has quit [Ping timeout: 244 seconds]
<Xethron>
Is it better to use a case statement than a if else statement?
<JonnieCache>
depends
<Xethron>
or does it just look nicer?
neku is now known as neku|away
<JonnieCache>
it can be shorter and clearer as well
<JonnieCache>
ruby's case is very powerful so you can do some very clean code with it
wvms has joined #ruby
djdb has joined #ruby
samuel02 has quit [Remote host closed the connection]
<any-key>
or abuse it
<any-key>
...I've seen some shit :(
<JonnieCache>
yeah well thats ruby
spanx has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
robbyoconnor has quit [Ping timeout: 264 seconds]
<Spaceghostc2c>
JonnieCache: It's pretty alright for sure, but if you can, refactor to something a bit better.
ananthakumaran has joined #ruby
<Spaceghostc2c>
Xethron: A case statement evaluates the passed in expression only once. if will evaluate it every logical branch.
d3vic3 has quit [Ping timeout: 248 seconds]
<Xethron>
Spaceghostc2c: So, its more effective...
<Xethron>
meh...
<JonnieCache>
i just like the fact that you can put things like regular expressions into it
* Xethron
redesignes
<Spaceghostc2c>
Depends on your needs.
wargasm has joined #ruby
<JonnieCache>
put it into a loop over the lines of a file and you can write a great parser
<Spaceghostc2c>
JonnieCache: You can do them in if statements too.
<JonnieCache>
or at least a neat one anyway
d3vic3 has joined #ruby
v0n has joined #ruby
iamlacroix has joined #ruby
chson has quit [Remote host closed the connection]
g0bl1n has joined #ruby
nari has quit [Ping timeout: 240 seconds]
<any-key>
I have some downtime at work...what's a neat Ruby trick I should look into?
<any-key>
you'll want the development headers and whatnot
tuxaddicted has joined #ruby
tagrudev has quit [Quit: Me = Awesome]
wobr has quit [Ping timeout: 250 seconds]
<shevy>
Farhan: that is because distributions like to cripple software
<Farhan>
"gem install rails" seems to have hanged
<shevy>
on a default configure/make/make install installation, using the latest ruby 1.9.x, gem will reside in bin/ subdirectory of the --prefix target used
<Farhan>
i installed via the CentOS packages
<hoelzro>
which means Farhan is probably on 1.8
<any-key>
heh yeah
<shevy>
ok, gem is not bundled with 1.8 so that is ok
<lectrick>
JonnieCache: Are you sure? 7zip compresses bit by bit at the bitstream, I don't think it's byte oriented like the others are
<JonnieCache>
7zip is just deflate with a very big window and some other tweaks iirc
<JonnieCache>
thats why its compatible with other zip programs
ABK has quit [Ping timeout: 265 seconds]
<JonnieCache>
oh no im confused - it has its own 7zip format doesnt it
<JonnieCache>
im talking about its ability to output smaller .zip archives than other zip programs
<lectrick>
JonnieCache: 7zip uses LZMA and LZMA2 which are not used in any other format
blischalk has joined #ruby
<JonnieCache>
but i think the .7zip files are just .zip files that have had the algorithm tweaked past the point of backwards compatibility
capsule_toy has quit []
<lectrick>
I don't think it's that simple
cdepue has joined #ruby
<canton7>
the 7zip program is capable of generated archives in various formats, including zip
<lectrick>
yes but that doesn't mean the opposite is true, that just means it supports it
<canton7>
however, the 7zip format is different to zip
<lectrick>
anyway png uses zlib only I believe, so you can't use something like a new algorithm like 7zip inside a png file unfortunately, at least at this time
<Kwpolska>
much, much different. and the extension is .7z.
<JonnieCache>
yeah i was getting confused
<lectrick>
zlib = zip (well essentially)
carloslopes1 has joined #ruby
<JonnieCache>
"When compressing ZIP or gzip files, 7-Zip uses its own DEFLATE encoder, which is often able to achieve higher compression levels, but at lower speed, than the more common DEFLATE implementation of zlib."
<JonnieCache>
thats what i was talking about
thecreators has joined #ruby
carloslopes1 has quit [Client Quit]
<JonnieCache>
optipng etc do the same thing as that for png files
carloslopes1 has joined #ruby
<JonnieCache>
by having bigger dictionary windows or whatever theyre called
<fowl>
lectrick, you could amend chunkypng to save/read from 7z but dont expect to be able to open that png in anything else
<_bart>
how do I get the similarity of 2 strings? With 1 being "completely the same" and 0 being "completely different"
<lectrick>
fowl: yeah i know. you're better off just 7zipping a BMP
<JonnieCache>
_bart: it depends on what you mean by similarity
<any-key>
there's no one size fits all solution to that problem
_pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
<JonnieCache>
Levenshtein distance is usually a pretty damn good answer though
EzeQL has joined #ruby
rekenerd has quit [Read error: Connection reset by peer]
carloslopes has quit [Ping timeout: 248 seconds]
oscardelben has quit [Quit: oscardelben]
<lectrick>
JonnieCache/ _bart : I just found this yesterday btw, it's the damerau levenshtein distance in Ruby https://gist.github.com/182759
rekenerd has joined #ruby
<lectrick>
i.e., the "edit distance between 2 strings"
<lectrick>
so _bart the best you will do is calculate how far apart 2 strings are by how many edits (insertions, deletions, swaps) it would take to change 1 to the other
<JonnieCache>
the damerau version is when you can transpose chars as well right?
<lectrick>
_bart: There's a way to search in O(N) time for strings that are 1 LD away from a given string but it's very sophisticated and involves something called a levenshtein state machine I believe
<lectrick>
JonnieCache: yep
<Synthead>
how can I tell if a hash only includes a certain index?
carloslopes has joined #ruby
<_bart>
but how do I change that from a 0..1 value? what are the maximum amount of edits?
<_bart>
0 is indeed 0
<lectrick>
_bart: LOL there are no "maximum amount of edits". Let's compare the string "a" with the string "b"*10000000 .... lol
mpereira has joined #ruby
rekenerd has quit [Client Quit]
iamjarvo has quit [Quit: Leaving.]
tk___ has quit [Quit: ばいばい]
<lectrick>
_bart: You probably want the inverse of it but then 0 edits will get you an overflow
carloslopes1 has quit [Ping timeout: 245 seconds]
<JonnieCache>
you could work out some celing from the largest word in the dataset or something like that
<lectrick>
but that is nondeterministic
<_bart>
lectrick: okay and what if I just want the similarity "in place", so no insertions/deletions/swaps, just the amount of same characters compared to the whole string?
<JonnieCache>
oh agreed thats a fudge
<canton7>
if the stringly are completely different, surely the max distance is something like max(a.length, b.length) ?
<canton7>
s/stringly/strings
<lectrick>
_bart: that's called... hold on... the SHANNON ENTROPY
Jay_Levitt has joined #ruby
<lectrick>
Either that or the kolmogorov complexity which is not actually computable
<JonnieCache>
i was wondering when the K word was gonna come up
<lectrick>
(can you tell I've been neck deep in this shit for a couple weeks now while trying to create a flexible "strong password evaluator" on the side lol)
T_Rex_ has joined #ruby
virunga has joined #ruby
<_bart>
no let's say I have aabb and bbbb
<_bart>
the similarity is 0.5
<_bart>
aaaa and aaaa is 1.0
<_bart>
bbbb and aaaa is 0.0
wpaulson has quit [Ping timeout: 250 seconds]
<JonnieCache>
thats just... comparing them
oscardelben has joined #ruby
<_bart>
aaab aaaa is 0.75
<lectrick>
_bart: I still think you want the inverse of the edit distance
<canton7>
sounds like the 1 - (levenshtein dist over max(a.length, b.length))
<lectrick>
in your first example that's 2 changes which is 1/2 which is 0.5 which is what you want
<_bart>
no because aaab aaax is also 0.75
mpereira has quit [Ping timeout: 240 seconds]
<_bart>
so how do I do that?
<lectrick>
what canton7 said, probably
<canton7>
I've told you two times now
<canton7>
(well, told you a fudge that will probably work well enough)
<JonnieCache>
he wants only substitutions
dinkytoy has quit []
<lectrick>
you want something that approaches 1.0 as they get more similar
<JonnieCache>
in which case, just compare the letters man!
<JonnieCache>
one by one. doesnt get any easier
<lectrick>
lol i don't think that's that useful but ok :)
<JonnieCache>
me neither
mpereira has joined #ruby
ckrailo has joined #ruby
bglusman has quit [Remote host closed the connection]
<JonnieCache>
_bart: the reason that isnt a good idea is, lets say im comparing aabb with aacc
<JonnieCache>
that is 0.5
wpaulson has joined #ruby
<JonnieCache>
then i add an x to the start of the second string so were comparing aabb with xaacc
<JonnieCache>
now its still 0.5
<JonnieCache>
which is weird
oooPaul has joined #ruby
oscardelben has quit [Client Quit]
<JonnieCache>
ok thats not the best example... but you get the idea.
<_bart>
JonnieCache: okay I get the idea, but is there a ready to use method which gives better results?
<_bart>
JonnieCache: I'm a bit in a rush, I don't have all this day to come up with that method.
wvms has joined #ruby
<_bart>
sure someone must have written this before
<virunga>
where V is the similarity and s is the weight of a allignment
shtirlic has joined #ruby
<virunga>
the score...
sdwrage has joined #ruby
<apeiros_>
_bart: also take a look at the jaro-winkler function
<apeiros_>
useful if you compare small strings like people's names.
<Sou|cutter>
whoa, I actually found a for loop in some legacy code. Wild!
bigkevmcd has quit [Ping timeout: 250 seconds]
Spooner has joined #ruby
Z_Mass has joined #ruby
mpereira has quit [Read error: Connection reset by peer]
<_bart>
okay got it guys!
<_bart>
two more things:
baroquebobcat has joined #ruby
biesiad has joined #ruby
<_bart>
a) how do I know that my Mechanize post got redirected and ended up on a different url? (maybe headers?)
<radu>
you can use a sigmoid function instead of that 1/(1-x) for smoother values. The previous function has goes to 0 for both of the damerau/levenstein beeing much bigger than the other
arkiver has quit [Quit: Leaving]
<radu>
something like 1/(1+exp(-x)) where x = damerau-levenstein
<radu>
I think you also need to explicitly tell Mechanize to follow redirects
<Farhan>
err, when I try to compile ruby, I get the error that I need -fPIC
biesiad-g has joined #ruby
virunga has quit [Quit: Sto andando via]
<JonnieCache>
actually .path only returns the path (surpirsingly) so you will need to get the query aswell and add that back in yourself
yekta has joined #ruby
mpereira has joined #ruby
ramblex has quit [Quit: ramblex]
biesiad has quit [Ping timeout: 250 seconds]
ramblex has joined #ruby
biesiad-g has quit [Remote host closed the connection]
biesiad-g has joined #ruby
blischalk has quit [Quit: blischalk]
freeayu has quit [Quit: 离开]
snapcase has quit [Quit: leaving]
<Farhan>
I am getting this error when compiling ruby: /usr/bin/ld: dln.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC dln.o: could not read symbols: Bad value
<Farhan>
I found some google hits for this error, but I don't understand them
biesiad-g has quit [Ping timeout: 240 seconds]
thecreators has quit [Quit: thecreators]
rainbowDashh has joined #ruby
<lectrick>
Farhan: It sounds like you are far off the beaten paths
<lectrick>
Farhan: Just use rvm to bulid your rubies and let someone else do the work
jsime has quit [Read error: Connection reset by peer]
ben_alman has quit [Excess Flood]
Guest50966 is now known as Yugo
Yugo has quit [Changing host]
Yugo has joined #ruby
thisirs has quit [Remote host closed the connection]
<Aszurom>
let's say I have a class person, with attr_accessor :birthday
<apeiros_>
color = RGB.new(0,255,128); color.red # => 0
Ethan has quit [Read error: Operation timed out]
Drewch has joined #ruby
<Aszurom>
can I have in the class a definition like this...
<apeiros_>
@red is an instance variable
<apeiros_>
attr_reader :red defines a method that will return the value of @red
<apeiros_>
(and the method is named 'red')
apok has quit [Ping timeout: 244 seconds]
apok_ is now known as apok
<Aszurom>
age = currentdate * :birthday
<Aszurom>
and thus person.age will return the calculated value?
<apeiros_>
yes
<Aszurom>
so in that scenario, age would be a reader but not a writer
<apeiros_>
you could provide a custom writer for age. we actually do that for estimated birth dates
bricker88 has joined #ruby
<Aszurom>
I'm trying to pick up Ruby as a cross-platform scripting lang. I spend equal time on OSX and Windows, and while Powershell is nifty, it's platform dependent
<Aszurom>
so? here I am
zommi has quit [Remote host closed the connection]
thecreators has joined #ruby
<fowl>
aszurom, welcome to the wonderful world of rubies, where all your dreams could come true! (no guarantees)
<Aszurom>
* safety not guaranteed
elhu has quit [Quit: Computer has gone to sleep.]
hynkle has joined #ruby
twock has joined #ruby
ZachBeta_ has joined #ruby
_bart has quit [Ping timeout: 245 seconds]
shtirlic has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
ZachBeta has quit [Ping timeout: 250 seconds]
apok has joined #ruby
<Aszurom>
so let's say I have a class Dog, which has :name :age and I defined a method called bark
<Aszurom>
when I want to create dog objects, I'm going to probably have more than one, so that would imply an array or a hash
<Aszurom>
if there was a single dog I could say
<Aszurom>
rover = Dog.new
<Aszurom>
but rover = Array.new
<Aszurom>
well, dogs = Array.new, really
<Aszurom>
so do you address each element of the array individually by saying
<apeiros_>
use [] instead of Array.new
<Aszurom>
dogs[0] = Dog.new
<apeiros_>
better style
KL-7 has joined #ruby
<Aszurom>
like every time I create a dog, do I have to call dog[n] = Dog.new ?
tatsuya_o has quit [Remote host closed the connection]
<Aszurom>
or can I say that all objects in the array dogs are objects of Dog class?
jlwestsr has joined #ruby
flype has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
<apeiros_>
the latter: no
pdelgallego has joined #ruby
<apeiros_>
but you can make it easier than dogs[n], you can use dogs << Dog.new
<apeiros_>
or dogs.push(Dog.new) (same thing)
<Aszurom>
so, dogs[] = Dog.new ain't it
<Aszurom>
ok
<blazes816>
that's a PHPism
<blazes816>
it may be further back, but I know it's common in PHP.
jonathanwallace has quit [Remote host closed the connection]
Morkel has quit [Remote host closed the connection]
Morkel has joined #ruby
_pdelgallego_ has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
noganex has quit [Quit: Eagles may fly, but a weasel will never be sucked into a jet engine.]
_pdelgallego_ has quit [Read error: Connection reset by peer]
<Aszurom>
undefined local variable or method `kennel' for main:Object (NameError)
mucker has joined #ruby
yekta has quit [Quit: yekta]
<Aszurom>
probably something really obvious
<Tasser>
aszurom, why the [] after the variable name?
<Tasser>
and btw, ruby tells if it doesn't know the variable 'kennel'
<Aszurom>
I started without it? put it in there while trying to figure out what the syntax issue was
<apeiros_>
aszurom: it's not kennel[] <<, it's just kennel <<
<apeiros_>
assuming kennel is an array
eywu has joined #ruby
<apeiros_>
aszurom: note that [] is already a method in ruby. as is <<. they just have a fancier syntax than the normal methods
davidpk has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
octarine has joined #ruby
kevinbond has quit [Read error: Connection reset by peer]
kevinbond has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
chrismcg is now known as zz_chrismcg
pdelgallego has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
greasegum has quit [Ping timeout: 244 seconds]
A124 has joined #ruby
_pdelgallego has joined #ruby
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
pdelgallego has joined #ruby
pdelgallego has quit [Client Quit]
fantazo has quit [Remote host closed the connection]
theRoUS_ has quit [Quit: Leaving]
g0bl1n has quit [Ping timeout: 240 seconds]
EzeQL has quit [Ping timeout: 248 seconds]
mathie has quit [Quit: Sleeping...]
_pdelgallego has quit [Read error: Connection reset by peer]
avalarion has left #ruby [#ruby]
burgestrand has joined #ruby
sailias has joined #ruby
<denstark>
Hello! Is using a constant the only way to use it as a default value in a function? eg: HI="hello" def say_hi(msg = HI) puts msg end
<denstark>
I've tried using a normal variable but to no avail
jslvk has joined #ruby
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
<jslvk>
!8ball asdfgasghahsghg?
mathie has joined #ruby
niklasb has joined #ruby
<blazes816>
denstark, you can do def say_hi(msg="hello"); puts msg; end
voodoofish430 has joined #ruby
<denstark>
blazes816: sure, I know that, but I'd like "hello" to be a variable (or loaded in from a config file) but not have to be passed all the time
<blazes816>
denstark, the default value is decided at EXECUTION time, unlike most languages. so you could do: def say_time(time=Time.now); puts time; end
<denstark>
mdszy: I see, making it a class and then making it an instance variable, that'd work
<Aszurom>
is there a decent way to do a comment block?
<mdszy>
denstark: Yup
<denstark>
mdszy: thanks, I think I'll do that
<mdszy>
denstark: It's all because lowercase variables have local scope, and methods have their own scope. A local variable defined outside of a method is outside that method's scope
<denstark>
right, that's what i figured
* mdszy
nods
<mdszy>
Glad to help!
<denstark>
didn't know what "the right way" to get around it, so to say, was
<troessner>
blazes816, the heredoc you are referring to has nothing to do with a comment
<Aszurom>
I'll remember to frown a little every time I use it
<apeiros_>
use your editors block-comment functionality to comment multiple lines with #
<troessner>
apeiros_, yes, but still *everything* is better than to use a heredoc
<troessner>
:-)
<blazes816>
troessner, it doesn't, other than it keeps code from executing
<blazes816>
like a comment
<troessner>
blazes816, yes, but it isn't a comment
<blazes816>
I wasn't aware of =begin/=end
<blazes816>
yes, I know that
<apeiros_>
troessner: sure
schickung has quit [Read error: Connection timed out]
Targen has quit [Ping timeout: 245 seconds]
Targen_ has joined #ruby
r0bby has joined #ruby
ramblex_ has joined #ruby
ramblex_ has quit [Client Quit]
deception has left #ruby [#ruby]
schickung has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
troessner has quit [Quit: Leaving]
anothervenue has quit [Quit: WeeChat 0.3.8]
ramblex has quit [Ping timeout: 265 seconds]
dinkytoy has joined #ruby
anothervenue has joined #ruby
a_a_g has joined #ruby
<fowl>
heredoc to keep code from executing, never heard that one before
DrShoggoth has joined #ruby
<apeiros_>
technically it is executed
<fowl>
yeah we'll just create potentially large strings and never use them
<fowl>
thats what the gc is for anyways
jslvk has quit [Quit: Page closed]
mathie has quit [Quit: Sleeping...]
Farhan1 has joined #ruby
Farhan has quit [Read error: Connection reset by peer]
jarred has joined #ruby
rcsheets has joined #ruby
bigkevmcd has joined #ruby
reuf has joined #ruby
Farhan1 has quit [Ping timeout: 264 seconds]
xaq has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
rcsheets has quit []
Ontolog has quit [Remote host closed the connection]
SQLStud has joined #ruby
Ontolog has joined #ruby
btanaka has joined #ruby
blazes816 has quit [Quit: Leaving]
Ontolog has quit [Read error: Connection reset by peer]
mrsolo has joined #ruby
oooPaul has joined #ruby
Criztian has quit [Remote host closed the connection]
Ontolog has joined #ruby
Eldariof-ru has joined #ruby
twinturbo has joined #ruby
buser3 has joined #ruby
mathie has joined #ruby
kevinbond_ has joined #ruby
kevinbond has quit [Read error: Connection reset by peer]
kevinbond_ is now known as kevinbond
dotdotdotPaul has joined #ruby
kvirani has joined #ruby
kevinbond has quit [Client Quit]
schickung has quit [Read error: Connection timed out]
A124 has quit [Quit: Leaving.]
oooPaul has quit [Ping timeout: 264 seconds]
stephenjudkins has joined #ruby
ryan0x2 has joined #ruby
ZachBeta_ has quit [Quit: Computer has gone to sleep.]
baphled has joined #ruby
mahmoudimus has joined #ruby
schickung has joined #ruby
baphled has quit [Client Quit]
mrsolo has quit [Quit: This computer has gone to sleep]
baphled has joined #ruby
kevinbond has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
mrsolo has joined #ruby
nachtwandler_ has joined #ruby
cheese1756 has quit [Ping timeout: 245 seconds]
baphled has quit [Client Quit]
chrxn__ has joined #ruby
chrxn__ is now known as chrxn
baphled has joined #ruby
nachtwandler has quit [Ping timeout: 248 seconds]
sterNiX has joined #ruby
<Aszurom>
so another thing I encountered is that if I'm assigning values to properties during declaration of an object, the class requires an initializer be defined
buser3 has quit [Remote host closed the connection]
r0bby has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ruby
r0bby has joined #ruby
wallerdev has joined #ruby
grekkos_ has joined #ruby
k_89 has quit [Ping timeout: 265 seconds]
grekkos has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
niklasb has quit [Ping timeout: 264 seconds]
<apeiros_>
aszurom: s/declaration/instantiation/
<apeiros_>
s/properties/instance variables/
DrShoggoth has quit [Quit: Leaving]
theRoUS_ has joined #ruby
Leffs has joined #ruby
cheese1756 has joined #ruby
<Leffs>
Does anyone here has ever handlered with Ruby @ Sketchup?
Leffs has quit [Client Quit]
blacktulip has quit [Remote host closed the connection]
schickung has quit [Quit: schickung]
DrShoggoth has joined #ruby
blazes816 has joined #ruby
twinturbo has quit [Quit: twinturbo]
pradeepto has joined #ruby
nachtwandler_ has quit [Quit: leaving]
robotmay has joined #ruby
fayimora has joined #ruby
r0bby has quit [Ping timeout: 264 seconds]
cheese1756 has quit [Ping timeout: 245 seconds]
Jay_Levitt has joined #ruby
atmosx has joined #ruby
<atmosx>
hello!
sterNiX has quit [Ping timeout: 246 seconds]
nyuszika7h has quit [Ping timeout: 264 seconds]
hynkle has joined #ruby
rekenerd has joined #ruby
abra has quit [Remote host closed the connection]
arkiver has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
nachtwandler has joined #ruby
apok_ has joined #ruby
jgarvey has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
arkiver has quit [Max SendQ exceeded]
emmanuelux has quit [Ping timeout: 246 seconds]
arkiver has joined #ruby
<Aszurom>
is there a way in IRB to interrogate a class to see what all of its methods and properties are?
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
<tds>
yes
dankest has joined #ruby
<tds>
class.methods
<tds>
class.instance_variables
apok has quit [Ping timeout: 246 seconds]
apok_ is now known as apok
maletor has joined #ruby
<tds>
it differs though depending on what you need… #methods will return class methods
<tds>
#instance_methods will return instance methods
<Spooner>
aszurom : using pry, instead of irb, makes interrogation even easier.
kevinbond has quit [Quit: kevinbond]
d3c has joined #ruby
kevinbond has joined #ruby
kevinbond has quit [Client Quit]
<tds>
pry seems cool
cheekymonk3y has joined #ruby
cheese1756 has joined #ruby
cj3kim has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<cheekymonk3y>
is rubygems not compatible with ruby1.9.1? or is the mint linux repo a little out of date?
Deele has joined #ruby
<robacarp>
cheekymonk3y: $5 says the repo is out of date.
<robacarp>
I'd install it from source.
dinkytoy has quit []
<Hanmac>
aszurom ruby does not have someting like properties ... only methods that access instance variables
<Hanmac>
cheekymonk3y: look for a ruby1.9.1-full package
<cheekymonk3y>
okay thanks
Zolrath has joined #ruby
binaryplease has joined #ruby
thecreators has quit [Quit: thecreators]
lichtkind has joined #ruby
<lichtkind>
do you know which version of unicode ruby supports?
<Hanmac>
lichtkind depends on want ruby version you have
<lichtkind>
1.93
jaylevitt has joined #ruby
Jay_Levitt has quit [Read error: Connection reset by peer]
hynkle has quit [Quit: Computer has gone to sleep.]
<cheekymonk3y>
is the command "gem install xxx" meant to hang for a long long time?
<lichtkind>
apeiros_: no its something the implementors of the interpreter/vm have to worry about
<apeiros_>
cheekymonk3y: no. but older version did.
<apeiros_>
lichtkind: why?
cj3kim has quit [Quit: This computer has gone to sleep]
<lichtkind>
because its built in there
k_89 has joined #ruby
<apeiros_>
lichtkind: what about the mechanics of unicode changes?
<cheekymonk3y>
apeiros: it'll eventually complete right?
<apeiros_>
if it's only more symbols added, then it does not matter at all to the vm
<lichtkind>
it defines what unicode symbols are actually known
cheese1756 has quit [Ping timeout: 245 seconds]
<apeiros_>
cheekymonk3y: depends. one reason for it to hang is if it doesn't get a network connection (e.g. if you're behind a proxy). it will not complete then but abort.
ben_alman has quit [Excess Flood]
<lichtkind>
sure if you do an regex the interpreter has to know these or it wil not match
<apeiros_>
lichtkind: again, how should that matter to the language?
<apeiros_>
lichtkind: um, no
<lichtkind>
i case you want to precess japanes character or bali or...
<cheekymonk3y>
apeiros: my internet seems okay, I can install stuff with sudo apt-get install.....does that mean there are no proxy problems?
workmad3 has quit [Ping timeout: 244 seconds]
<apeiros_>
lichtkind: I think you're mistaken
blacktulip has joined #ruby
joshwines has quit [Read error: Connection reset by peer]
<apeiros_>
whether \u0xXXXX was defined when ruby was compiled doesn't matter to ruby
<lichtkind>
maybe i could not express myself clearly
<apeiros_>
it's just a code point to it.
<denstark>
Hrm, anyone know offhand what shell things are executed in with backticks (``)?
<denstark>
or if that is changable?
<apeiros_>
s/\u0xXXXX/\uXXXX/
dinkytoy has joined #ruby
<lichtkind>
apeiros_: so far you would be right but unicode is more than a list of codepoints
<Synthead>
can OptionParser parse whole words? like "this" in ./script this --that ?
<apeiros_>
lichtkind: afaik, the character groups have also been defined for quite a while. anyway, as far as grouping/classification goes - just replace the relevant files before compiling.
hynkle has joined #ruby
<apeiros_>
as long as there's no change in the actual mechanics, the *language* will have absolutely *nothing* to do with the unicode version.
<apeiros_>
all it needs are the most recent definitions.
<lichtkind>
yes so ruby uses definition of the system and not an own?
<apeiros_>
lichtkind: rubys source code is open. just go and look.
r0bby has joined #ruby
<lichtkind>
apeiros_: yes but i thought there is a place for infos like that
<lichtkind>
is ther a rubydelta for 2.9?
balrog-k2n has joined #ruby
<apeiros_>
lichtkind: yes. and you got the information for where to look.
<apeiros_>
2.9 what?
adamkittelson has quit [Remote host closed the connection]
maletor has quit [Ping timeout: 264 seconds]
maletor has joined #ruby
zemanel has joined #ruby
Criztian has joined #ruby
ben_alman has joined #ruby
Z_Mass has quit [Quit: Leaving]
ericcoleman has quit [Quit: Lost terminal]
rainbowDashh has quit [Quit: SLEEP MODE. I NEED A MORE CREATIVE MESSAGE FOR MY DUMB LID CLOSING.]
KL-7 has quit [Quit: This computer has gone to sleep]
arturas has quit [Remote host closed the connection]
_bart has joined #ruby
<_bart>
Hi all!
itnomad has joined #ruby
artOfWar has joined #ruby
cheese1756 has joined #ruby
<lichtkind>
i meant 1.9
kirun has joined #ruby
<_bart>
So I have an abstract challenge
reuf has joined #ruby
<Synthead>
is there a ruby method to raise an exception if I'm overwriting the contents of a hash's index?
<_bart>
I'm trying to write a intelligent scraper. What would be a smart algorithm to search for the menu items of a random page's HTML?
<mdszy>
Synthead: you could test for hash[:key].nil? and if it's not, then you're overwriting
workmad3 has joined #ruby
andrewhl has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
<Synthead>
mdszy: yeah I'm doing a test now. no way to do it in a single method? guess I'll have to roll my own
<mdszy>
Synthead: Not that I know of.
<mdszy>
Synthead: However, if you do `Hash.new "nothing!"`, and you try to access a non-existent key, it'll return "nothing!"
theRoUS_ has quit [Read error: Operation timed out]
<mdszy>
So maybe that could somehow be put to use for your purposes?
KL-7 has joined #ruby
<Synthead>
mdszy: oh that's really interesting
KL-7 has quit [Client Quit]
kenichi has quit [Remote host closed the connection]
rainbowDashh has joined #ruby
hydrozen has joined #ruby
zastaph has joined #ruby
pting has joined #ruby
TheShadowFog has quit [Read error: Connection reset by peer]
<Synthead>
if I do method(variable), how can I make 'method' modify 'variable'? (to my understanding, it doesn't ever modify 'variable' by default
<Hanmac>
lichtkind what do you mean with rubydelta?
berkes has joined #ruby
<workmad3>
Synthead: it depends what you mean by 'modify'
<mdszy>
Synthead: You can't. However, I'll have an example for you in a moment of something you can do that's similar to that
<workmad3>
Synthead: the method gets passed the same reference that the variable currently contains, and you can make changes to that object
cheese1756 has quit [Ping timeout: 245 seconds]
<_bart>
How do I turn a parsed website with Nokogiri into HTML structure only? For example, turn <html><body><div id="content">Boo <a href="#">something</a></div></body></html> to <html><body><div id="content"><a href="#"></a></div></body></html>
<havenn>
_bart: I'd suggest fetching your 'random page with OpenURI, parse HTML and find your 'menu items' with Nokogiri.
<workmad3>
Synthead: however, you can't change the reference stored in the variable
binaryplease has quit [Quit: WeeChat 0.3.8]
<_bart>
havenn: yes, I understand that part, the hard part is finding the menu items with Nokogiri. it should be smart enough to find them!
twinturbo has joined #ruby
ryanf has joined #ruby
bglusman has quit [Remote host closed the connection]
<workmad3>
_bart: nokogiri is smart enough to find them, if you're smart enough to give it the right query :P
<havenn>
_bart: What is a 'menu item'?
adamkittelson has joined #ruby
arkiver has quit [Quit: Leaving]
<mdszy>
erm, nevermind, Synthead. Apparently what I thought would work doesn't.
sdwrage has quit [Quit: geekli.st/programmer]
apok has quit [Remote host closed the connection]
xiphiasx_ has quit [Quit: leaving]
apok has joined #ruby
iamjarvo has quit [Quit: Leaving.]
carlyle has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<_bart>
havenn, workmad3: do you know of examples of such a complex query? I know I can get the value/attributes of anything, but now it should "look" for certain patterns
<workmad3>
_bart: I don't even know what you're actually looking for, and in fairness for complex queries with nokogiri, I'd recommend xpath and I suck at xpath
cheese1756 has joined #ruby
<_bart>
workmad3: Okay let's say I scrape ebay (just an example!), then I want to detect the articles and their specs
akem has quit [Ping timeout: 264 seconds]
`brendan has quit [Read error: Connection reset by peer]
<_bart>
to get that working for just ebay is easy, with either css or xpath, I know. but I want the same code/queries to work for amazon!
<_bart>
(for example)
`brendan has joined #ruby
<workmad3>
_bart: not gonna happen
<_bart>
workmad3: monkeys could do it
<workmad3>
_bart: different sites have different structure, even if they seem to have similar patterns
<workmad3>
_bart: and monkeys/humans are much better at that sort of semantic pattern matching than we can get computers to do :P
Eldariof-ru has quit []
cheese1756 has quit [Ping timeout: 245 seconds]
erichmenge has joined #ruby
yxhuvud has quit [Ping timeout: 244 seconds]
robozahn has joined #ruby
xiphiasx_ has joined #ruby
xiphiasx_ has quit [Changing host]
xiphiasx_ has joined #ruby
dinkytoy has quit []
schwap has joined #ruby
manizzle has quit [Read error: No route to host]
<blazes816>
_bart, short of some intense machine-learning you're not gonna get much. Not that that wouldn't be a fun project.
<workmad3>
_bart: it all depends on how accurate you want the results though... and if they have roughly the same information, but just different locations in the structure you can pull out the abstract pattern into a method or another object and just plug-in the exact queries... but if you want to construct xpath queries that pull out meaning, or if you want to have a set of queries that work across the board without needing to be
<Hanmac>
_bart ... its possible to get an element by id with xpath ... (maybe the different sites has all "menu" as id for an element)
maletor has quit [Ping timeout: 245 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<_bart>
Yes it's hard, but it's also fun like blazes816 stated.
<_bart>
I've already managed to create a ruby script that locates the "search form" on almost any website
maletor has joined #ruby
carlyle has quit [Remote host closed the connection]
wmoxam has joined #ruby
ryan0x2 has quit [Remote host closed the connection]
<bricker88>
what do I google to find the docs for this syntax: %w{} %r{} etc. ?
carlyle has joined #ruby
<_bart>
it loops through all forms, and then checks for logical terms like "search" but also input names like query etc.
A124 has joined #ruby
rainbowDashh has quit [Quit: SLEEP MODE. I NEED A MORE CREATIVE MESSAGE FOR MY DUMB LID CLOSING.]
manizzle has joined #ruby
cheese1756 has joined #ruby
wangr has quit [Ping timeout: 265 seconds]
cheekymonk3y has quit [Ping timeout: 244 seconds]
maletor has quit [Ping timeout: 244 seconds]
mpereira has quit [Ping timeout: 245 seconds]
itnomad has quit [Quit: Leaving]
Z_Mass has joined #ruby
cheese1756 has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
notVert has joined #ruby
axl_ has left #ruby [#ruby]
mpereira has joined #ruby
cdepue_ has joined #ruby
enroxorz has quit [Quit: Leaving]
fayimora has quit [Ping timeout: 265 seconds]
a_a_g has quit [Quit: Leaving.]
cdepue has quit [Ping timeout: 245 seconds]
d3c has quit [Quit: Sleep]
timonv has quit [Remote host closed the connection]
nachtwandler has quit [Quit: leaving]
cheekymonk3y has joined #ruby
fayimora has joined #ruby
cdepue has joined #ruby
r0bby has quit [Ping timeout: 244 seconds]
nyuszika7h has joined #ruby
rainbowDashh has joined #ruby
fayimora has quit [Client Quit]
nyuszika7h has quit [Client Quit]
niklasb has joined #ruby
ryan0x2 has joined #ruby
<shevy>
bricker88: not sure. %w() works too
rainbowDashh has quit [Remote host closed the connection]
<shevy>
it is syntactic sugar I think
mrsolo has joined #ruby
<shevy>
where the opening and closing character has to be the same
<shevy>
%w% cat dog horse %
jsilver has quit [Remote host closed the connection]
notVert has quit [Ping timeout: 252 seconds]
cheese1756 has joined #ruby
nyuszika7h has joined #ruby
cdepue_ has quit [Ping timeout: 264 seconds]
`brendan has quit [Ping timeout: 248 seconds]
zizzyx has joined #ruby
beneggett has joined #ruby
<zizzyx>
i'm having trouble with the rails omniauth plugin, every single time i try to authorize my app with Facebook, it returns the "Session does not match current stored session" error
<zizzyx>
how do i discard this session? if i go to facebook account management, remove the app authorization, and then go through the steps to reauthorize, the callback result is the same
<zizzyx>
so i'm wondering how to clear any session information omniauth is storing and start from scratch
<Hanmac>
zizzyx look at #rubyonrails
cheese1756 has quit [Ping timeout: 245 seconds]
AlbireoX`Away is now known as AlbireoX
khakimov has joined #ruby
AlbireoX` has joined #ruby
beneggett has quit [Ping timeout: 264 seconds]
iamjarvo has joined #ruby
sepp2k1 has joined #ruby
chriskk has quit [Quit: chriskk]
sepp2k has quit [Ping timeout: 264 seconds]
aroman has joined #ruby
sdwrage has joined #ruby
jsime has quit [Read error: Connection reset by peer]
Goles has joined #ruby
Tomasso has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
csmrfx has joined #ruby
<csmrfx>
8)
<havenn>
_bart: I don't think I understand what you're looking for, so this might not help at all <.<, but you can make a generic scraper that looks for 'something' across multiple sites like so: https://gist.github.com/3086118
<_bart>
havenn: thanks, why do you use page.search('link') instead of page.css('a') ?
nilg has quit [Read error: Connection reset by peer]
jlwestsr has quit [Read error: Operation timed out]
<_bart>
havenn: also, I appreciate your help but this is exactly how far I got. Now the code needs to get more intelligent and select all <a> when it's inside div#menu or div#navigation or div.menu or div.navigation or ul.menu or navbar etc!
jsilver has joined #ruby
<havenn>
_bart: ahh
cheekymonk3y has quit [Ping timeout: 255 seconds]
<havenn>
_bart: Would be a much simpler task if people used semantic HTML <nav>
stephenjudkins has joined #ruby
<_bart>
havenn: true! but websites are a mess! but still it's an interesting challenge!
<_bart>
havenn: already wrote a method that checks wether a url is a internal/external one
<Hanmac>
hm <nav> could be okay if there is a standard for that ...
<_bart>
and that sort of stuff
vitoravelino`afk is now known as vitoravelino
cheekymonk3y has joined #ruby
tatsuya_o has joined #ruby
krusty_ar_ has joined #ruby
krusty_ar has quit [Ping timeout: 264 seconds]
jgrevich has quit [Read error: No route to host]
cj3kim has joined #ruby
T_Rex__ has joined #ruby
jgrevich has joined #ruby
jgrevich has quit [Client Quit]
T_Rex_ has quit [Read error: Connection reset by peer]
T_Rex__ is now known as T_Rex_
reuf has quit [Ping timeout: 264 seconds]
zz_chrismcg is now known as chrismcg
joch_n has joined #ruby
samu has joined #ruby
stephenjudkins_ has joined #ruby
cheekymonk3y has left #ruby ["Leaving"]
<samu>
Hi. can I ask phusion-passenger related questions here?
chrismcg is now known as zz_chrismcg
sdwrage has quit [Quit: geekli.st/programmer]
<shevy>
not many will know phusion
<shevy>
you can always give it a try but dont be disappointed if none can help
<samu>
okay, sure. I'll try.
<samu>
so, I'm trying to have two versions of ruby and passenger on my system. for 1.8 and 1.9
LBRapid has quit [Quit: Farewell.]
s0ber_ has joined #ruby
<havenn>
samu: you running standalone daemon or nginx/apache module?
<samu>
I'm installing passenger using gem, but for some unknown reason I haven't got the PassengerWatchdog binary...
<samu>
havenn: nginx.
internet_user has quit [Remote host closed the connection]
<samu>
the only thing is that I haven't got that passenger watchdog.
cheese1756 has joined #ruby
<samu>
I installed entire passenger from freebsd ports system, for 1.8
s0ber has quit [Read error: Operation timed out]
<samu>
it worked, I have it now
stephenjudkins has quit [Ping timeout: 244 seconds]
stephenjudkins_ is now known as stephenjudkins
<samu>
but for some reason it doesn't work for 1.9
beneggett has joined #ruby
s0ber_ is now known as s0ber
<samu>
and I have no idea where to get that watchdog for 1.9 from.
Aszurom has quit [Quit: Leaving]
axl_ has joined #ruby
atmosx_ has joined #ruby
berkes has quit [Quit: Ex-Chat]
<samu>
I'm not sure, but I think that this watchdog is for nginx only.
A124 has left #ruby [#ruby]
<samu>
however, passenger-install-nginx-modules does that for 1.8, not for 1.9 (and I need the 1.9 version)
cbuxton1 has joined #ruby
uris has quit [Read error: Connection reset by peer]
<havenn>
samu: I wonder if PassengerLoggingAgent didn't get installed with the 'gem install passenger'
atmosx has quit [Remote host closed the connection]
<samu>
but I find this good - it is easy for me to have many versions of ruby, or python installed at the same time
aroman has quit [Quit: aroman]
<samu>
globally, not locally, like using rvm.
<atmosx>
samu: gentoo has slots
<shevy>
yeah like debian
<shevy>
I fell for the gobolinux scheme. for versioning I use the directory name, then keep the symlink to point at the version in use
crankycoder has quit [Remote host closed the connection]
<shevy>
I forgot how slots work
<shevy>
they use symlinks too right?
oscardelben has joined #ruby
<shevy>
or was this eselect... rking help me out, you are a gentooler
<havenn>
I do love me some RVM (rvm.io) and rbenv (github.com/sstephenson/rbenv/), but I've been meaning to look at rbfu (https://github.com/hmans/rbfu)
<shevy>
oh? fu?
<shevy>
what a name
<mdszy>
I used to use RVM, now I use rbenv, rbenv is SO much nicer.
<mdszy>
I always had this weird issue with RVM where I had to always run `rvm reload` before any binary gems ran. Not just after installing them, but on every shell startup.
Morkel has quit [Quit: Morkel]
<atmosx>
shevy: I'm not sure if slots are using symlinks
<shevy>
atmosx: yeah that could be... I remember years ago I wondered how they made it work without symlinks... still haven't found out
<atmosx>
I never bothered, just knew that I could have 2 versions of something
<atmosx>
ruby1.9 on gentoo is a mess though
grekkos has joined #ruby
<atmosx>
I installed it manually to avoid the hassles
maletor has quit [Ping timeout: 244 seconds]
grekkos is now known as Guest67397
<Hanmac>
different system ruby versions on ubuntu are no problem
<atmosx>
well, I use rvm now
<atmosx>
like most of ruby-ist I think
tekillaa has quit [Ping timeout: 245 seconds]
<shevy>
Hanmac: but they use symlinks or?
beneggett has quit [Ping timeout: 264 seconds]
wpaulson_ has joined #ruby
aroman has joined #ruby
<Hanmac>
shevy yeah, an symlink chain, but it works
<shevy>
yeah, symlinks are the most common solution. now I need to find out how slots work...
<shevy>
yeah I think those are the /etc/alternatives symlink pointers
<wmoxam>
yeah
<Hanmac>
update-alternatives is cool
<shevy>
"It was rewritten primarily to remove the dependence on perl" hehehe
<shevy>
poor old perl
wpaulson has quit [Ping timeout: 264 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<shevy>
this is kinda interesting
<shevy>
alternatives uses a tag-like scheme or? like ... editor is a symlink to the main editor to use
<shevy>
a bit like a system configuration, is it not?
<shevy>
editor -> vim
<shevy>
what I dont understand though - why dont they just use ENV VARS? like $EDITOR
`brendan has joined #ruby
niklasb has quit [Ping timeout: 264 seconds]
davidw has quit [Ping timeout: 248 seconds]
cheese1756 has joined #ruby
<shadoi>
shevy: they do
<shadoi>
shevy: it's to control the situation where you have multiple editors with the same binary name
<shevy>
aha
<shadoi>
any software
<shadoi>
not just editors
trend has quit [Quit: trend]
atmosx has quit [Quit: leaving]
<shevy>
I see, makes sense
<blazes816>
they aren't really different. using a symlink like /bin/editor is basically just persisting that data to, well, a symlink instead of wherever env vars are stored.
<shadoi>
EDITOR=vim
<shadoi>
you want vim-tiny?
<shadoi>
vim-ruby?
<shadoi>
vim-nox?
<shadoi>
etc.
Spooner has quit [Ping timeout: 248 seconds]
niklasb has joined #ruby
<shadoi>
It's just about convenience
<blazes816>
yeah, that's what I'm saying
<blazes816>
i'm just saying their not fundamentally different. since the original question was why not use env vars.
stephenjudkins has quit [Quit: stephenjudkins]
<matled>
well, the alternatives are also used for things like editor, x-www-browser, x-terminal-emulator, ... to provide a configurable default used if nothing is specified
atmosx has joined #ruby
<shadoi>
Yeah, it's so things can reference an abstract name
<matled>
but it's far from perfect
<matled>
trying to consistently change the pdf viewer, browser and the like for all applications that may spawn it seems almost impossible
atmosx has quit [Client Quit]
baphled has quit [Ping timeout: 246 seconds]
stephenjudkins has joined #ruby
<shadoi>
yeah, since it's debian-specific, it relies on packagers patching apps to use it. Which is very non-ideal.
<shadoi>
linux! yay!
cheese1756 has quit [Read error: Connection reset by peer]
<wmoxam>
shadoi: Year of the Desktop!!!!!!
etrnl has joined #ruby
atmosx has joined #ruby
hydrozen has joined #ruby
<shevy>
lol
tommyvyo has joined #ruby
<Hanmac>
shadoi wesnoth use update-alternatives
<shevy>
someone is making fun of desktop linux!
<etrnl>
just reinstalled my server with ubuntu (natty) and used the ruby1.9.1 package and ruby1.8 packages, doing so get gems to default to 1.8.7 instead of 1.9, how can I change which version rubygems uses?
jaylevitt has quit [Ping timeout: 264 seconds]
<shadoi>
etrnl: uninstall all of the above and use rvm.
<wmoxam>
shevy: <insert> obligatory Frozen Penguin reference as an example of Linux gaming
<etrnl>
oi?
ZachBeta has joined #ruby
<etrnl>
k
<dankest>
etrnl: unfortunately, shadoi is giving the best advice
<Hanmac>
etrnl or use update-alternatives --config ruby
maletor has quit [Ping timeout: 244 seconds]
<etrnl>
Used that, ruby is setup for ruby1.9.1 but "gem env" is still showing that it wants 1.8.7
asobrasil has left #ruby [#ruby]
joshman_ has quit [Ping timeout: 245 seconds]
adamkittelson has quit [Remote host closed the connection]
<Hanmac>
update-alternatives --config gem
<shadoi>
etrnl: trust me, save yourself hours of frustration and remove all that horse-shit.
wvms has joined #ruby
<wmoxam>
er, s/forzen penguin/tuxracer
<_bart>
Hi when I do uri = URI.parse("http://google.co.uk/go/?href=http://test.com") uri.path I get only /go/, but I want /go/?href=…, how do I also get the get variables in the path?
<dankest>
etrnl: shadoi +1
<Hanmac>
shadoi i think the problem could be solved when he used an newer ubuntu
<shadoi>
ubuntu 12.04 is the only one worth even trying to use.
<shadoi>
even it still has a rubygems package for 1.8
<shadoi>
so … yeah, I still recommend blowing it away.
maletor has joined #ruby
jarray52 has joined #ruby
* Hanmac
has 12.10 and it has ruby package linked to ruby1.9.1
<shadoi>
I look forward to wycats new static build showing up in linux soon.
<_bart>
full_path = uri.path + "?" + uri.query
<shadoi>
Hanmac: yeah but for the 1.9.3 package it doesn't depend on the rubygems package.
cjlicata has joined #ruby
<shadoi>
So it doesn't freak out if you use the gem command to install gems.
<Hanmac>
shadoi because the rubygems package is not needed anymore
<blazes816>
just a preference
<shadoi>
Hanmac: exactly, previously you have to hack the gem binary to re-enable "gem install <name>"
bosphorus_ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
<Hanmac>
shadoi that was old 1.8 days ... dont life in history ...
<Hanmac>
if you want something to freak out look at the rubygems-integration package
<shadoi>
Yeah, then people try to install certain ruby libs via APT also.. and it pulls it back in.. and you're down the rabbit-hole again.
Maniacal has joined #ruby
<kapowaz>
does anybody here know anybody who works at github ?
atmosx has quit [Ping timeout: 276 seconds]
<shadoi>
kapowaz: vaguely, why?
carlyle_ has joined #ruby
<kapowaz>
I'd like to have a discreet chat with somebody who works there (ideally developer, rather than, say, office manager)
<bricker88>
How is this possible? https://gist.github.com/3086396 Basically I'm looking for elements where the :meta_value has a youtube URL but the content doesn't reference it. The numbers don't add up and I feel like I'm doing some ruby incorrectly. I've checked all the regular expressions on rubular and they seem to be okay.
<shadoi>
kapowaz: if you're in SF, go to their drinkup
carlyle has quit [Ping timeout: 264 seconds]
samu has left #ruby [#ruby]
<kapowaz>
I'm in London. Missed their last one, alas.
theRoUS has quit [Ping timeout: 260 seconds]
<shadoi>
kapowaz: plenty of their devs are active on twitter, it's probably your best shot.
<kapowaz>
not really so discreet there :)
mahmoudimus has joined #ruby
cjlicata has quit [Ping timeout: 264 seconds]
<kapowaz>
the problem with twitter is it's difficult to have a dialogue with somebody who doesn't follow you without giving away the reason you want to talk to them for all to see…
<shadoi>
bricker88: it's hard to say without knowing what data you're doing that with.
awarner has joined #ruby
beneggett has joined #ruby
<Synthead>
is there a way I can make OptionParser separate the "usage" output with newlines?
cj3kim has quit [Quit: This computer has gone to sleep]
<Synthead>
shadoi: can I make one option dependent of another without using a bunch of tests?
chomp has quit [Quit: Leaving]
<lichtkind>
Hanmac: a doc that tells me differences between versions like perldelta
stewart_ has quit [Quit: Leaving.]
tatsuya_o has quit [Remote host closed the connection]
j3ll3 has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<shadoi>
Synthead: not really.
zizzyx has joined #ruby
mathie is now known as rubaidh-hubot
rubaidh-hubot is now known as mathie
cjs226 has quit []
stewart_ has joined #ruby
khakimov has joined #ruby
alup has quit [Ping timeout: 272 seconds]
mpereira has quit [Ping timeout: 244 seconds]
niklasb has quit [Ping timeout: 264 seconds]
jwg2s has joined #ruby
Gavilan has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
banseljaj is now known as imami|afk
Z_Mass has joined #ruby
tcopp has left #ruby [#ruby]
<jwg2s>
Hi all, I've got a hash that'd like to cycle through and I'm trying to figure out how to best do it efficiently. https://gist.github.com/3086464 I'm trying to cycle through the fixed_width_assignment variable and print out the keys into the target_fields array so my code is more dry
sailias has joined #ruby
j3ll3 has quit [Quit: leaving]
<jwg2s>
This is a concept I've been trying to figure out and would help me dramatically in all aspects of my code :)
<shadoi>
No reason for the target_fields array that I can see.
<jwg2s>
it's used later in other code
<shadoi>
You don't want the actual values?
<jwg2s>
no just the keys
awarner has quit [Remote host closed the connection]
<erichmenge>
Hi everyone. Wondering if there is a concise way to check to see if a hash with keys that are numeric keys are in order. Ex: :'0', :'1', :'2'.
jonathanwallace has quit [Read error: Operation timed out]
<jwg2s>
so :client_id, :file_title, etc
alanp_ has quit [Ping timeout: 252 seconds]
balki has quit [Ping timeout: 252 seconds]
<shadoi>
erichmenge: assuming you don't want to sort?
<erichmenge>
*numeric strings
<erichmenge>
shadoi: Right, don't actually want to change the hash.
<erichmenge>
I should say numeric symbols, sorry.
adamkittelson has joined #ruby
minijupe has quit [Quit: minijupe]
alester has quit [Quit: alester]
<shadoi>
erichmenge: if you know the start and end points it's fairly easy to do by comparing it against a range
<shadoi>
otherwise I'd have to ponder. :)
<erichmenge>
shadoi: Don't know the start and end points :/
<shadoi>
probably easiest to iterate with a counter from 0
<erichmenge>
I was hoping someone could do it with a cute little one liner :)
<shadoi>
and compare the key
Goles has quit [Ping timeout: 246 seconds]
rainbowDashh has joined #ruby
<erichmenge>
shadoi: That's what I was thinking. Was hoping I was missing a better way. Guess I'll stick with the easy way ;)
<erichmenge>
Thanks.
lewis1711 has joined #ruby
<shadoi>
erichmenge: 0.upto(hsh.keys.length) { |n| hsh.keys.all? {|k| n == k}}
<erichmenge>
nice
<erichmenge>
That looks good, thanks.
<lewis1711>
File.open("foo.txt").each do |line| ... end #how do I check to see if line has a trailing whitespace? I have tried line[0] == ' ', line[0] == 32, line[0] == '\s', no dice
adamkittelson has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
<erichmenge>
Yes thanks, I realized that the other example wouldn't work unless it started at 0, but I had a different idea. I like the example apeiros_ gives.
carloslopes has quit [Quit: Leaving.]
<lewis1711>
ok is line not even a string or something?
<lewis1711>
in enumerating over a file
<shadoi>
lewis1711: pry is your friend
<erichmenge>
#each_cons is exactly what I was looking for
<erichmenge>
why I didn't think to google "consecutive" I don't know.
<lewis1711>
i don't want my repl infected with autism
blacktulip has quit [Remote host closed the connection]
<shadoi>
lewis1711: yes you do. :)
KensoDev has joined #ruby
sailias has quit [Ping timeout: 264 seconds]
MatthewGA_ has joined #ruby
carlyle_ has quit [Ping timeout: 245 seconds]
balrog-k2n has left #ruby [#ruby]
niklasb has joined #ruby
MatthewGA has quit [Ping timeout: 240 seconds]
superjoe has left #ruby ["Leaving"]
noganex has joined #ruby
SpitfireWP has quit [Disconnected by services]
<apeiros_>
erichmenge: if your hash is really large, .each_key instead of keys.
crankycoder has joined #ruby
<shevy>
I hate hate hate all the GNU tools to compile things
<erichmenge>
apeiros_: Got it, thanks!
MatthewGA_ has quit [Ping timeout: 248 seconds]
rainbowDashh has quit [Disconnected by services]
<shevy>
'pkg-config --modversion glib-2.0' returned 2.20.4, but GLIB (2.33.3)
RainbowD_ has joined #ruby
T_Rex_ has quit [Read error: Connection reset by peer]
RainbowD_ is now known as rainbowDashh
cakehero has joined #ruby
cbuxton1 has quit [Quit: Leaving.]
cdepue_ has quit [Remote host closed the connection]
kjellski has quit [Quit: This computer has gone to sleep]
SQLStud has quit [Quit: Leaving]
lewis1711 has left #ruby [#ruby]
crankycoder has quit [Ping timeout: 252 seconds]
niklasb has quit [Ping timeout: 264 seconds]
<jarray52>
Is there a tool to find a missing end statement in a Ruby file?
sits has joined #ruby
<eam>
if it's missing there's nothing to be found?