Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<yoklov>
regardless of my ineptitudes at programming, it at least seems that classical inheritance is prototypal inheritance with added restrictions and semantics
<yoklov>
hm.
<Asher>
or you could say prototypical inheritance is classical inheritance with added flexibility
statarb3 has joined #ruby
<schlecht>
I don't think one that knows Scheme has a programming ineptitude.
<schlecht>
Unless you're really poor at it
tatsuya_o has joined #ruby
<yoklov>
truly awful :p
<yoklov>
Asher, thats true.
<yoklov>
but that doesn't mean anything about their inherent complexities
bwlang has joined #ruby
<Asher>
that was my point :)
<yoklov>
hrm.
<yoklov>
this may be unresolvable
iocor has joined #ruby
<schlecht>
What you call prototypal inheritance is just polymorphism.
<yoklov>
… :/. that's not really true at all
nobitanobi has quit [#ruby]
BrianE has joined #ruby
azureye has joined #ruby
<schlecht>
yoklov: Why isn't it?
<Asher>
prototypical inheritance is a specific mode of polymorphism
<yoklov>
^
<Asher>
where identity is described by the prototype lookup chain
<Asher>
rather than by a class
<Asher>
so identity consists in interface rather than interface being defined by an identity
ilyam has joined #ruby
<yoklov>
you can have polymorphism that works in a totally different way. haskell, for instance, provides a mechanism ad-hoc polymorphism on arbitrary types (polymorphic even in return values!)
<yoklov>
you couldn't implement that using prototypes
<yoklov>
(so there's some part of polymorphism which exists outside prototypal inheritance)
billy_ran_away has joined #ruby
<schlecht>
Fair enough
ctp_ has joined #ruby
wmoxam has joined #ruby
statarb3 has joined #ruby
i8igmac has joined #ruby
<i8igmac>
i have ran a tool threw console with a large ammmounts of threads and i want to kill all of them
zodiak has joined #ruby
<i8igmac>
30084 pts/4 00:00:00 ruby
<i8igmac>
what is pts/4
<i8igmac>
when i just type `ps`
<i8igmac>
i have a hole bunch of ruby scripts runing and i cant kill them
<i8igmac>
pkill ruby does not work
colossal7 has joined #ruby
n3m has joined #ruby
i8igmac has joined #ruby
stringoO has joined #ruby
randym has joined #ruby
dagnachewa has joined #ruby
pac1 has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
PragCypher has joined #ruby
mattalexx has joined #ruby
mattalexx has joined #ruby
carlyle has joined #ruby
gregorg has joined #ruby
nari has joined #ruby
<mattalexx>
I'm trying to run `site['enabled'] ||= true` top mean "If that variable is not defined, set it to true." But sometimes it's defined and set to false. In that case, I want it to stay false, but it's being set to true instead. What should I do?
pu22l3r has joined #ruby
<banisterfiend>
mattalexx: dont use ||=
<banisterfiend>
mattalexx: use: site['enabled'] = true if site.has_key('enabled')
<banisterfiend>
?
<banisterfiend>
or perhaps
neurodrone has joined #ruby
<banisterfiend>
site['enabled'] = true if site['enabled'].nil?
pu22l3r has joined #ruby
<mattalexx>
banisterfiend, FATAL: NoMethodError: undefined method `has_key' for #<Hash:0xb6c34568>
ckrailo has joined #ruby
<banisterfiend>
mattalexx: has_key?
bobby has joined #ruby
sdwrage has joined #ruby
<mattalexx>
Sorry?
<banisterfiend>
mattalexx: use the has_key?() method
<shadoi>
lol, adium shows that hash object reference as a link to a channel.
nowthatsamatt has joined #ruby
nowthatsamatt has quit [#ruby]
<mattalexx>
banisterfiend, Is this correct?: "site['enabled'] = true if site.has_key?('enabled').nil?"
<banisterfiend>
mattalexx: no
<shadoi>
has_key? returns a boolean
<banisterfiend>
mattalexx: site['enabled'] = true if site.has_key?('enabled')"
<shadoi>
yes it has a the key or no it doesn't.
<banisterfiend>
mattalexx: you really are a noob, right? :P
<banisterfiend>
mattalexx: you're not one of those guys who has been programming rails for 2 years right? :) hehe
<mattalexx>
banisterfiend, I'm new to Ruby, yes.
<banisterfiend>
mattalexx: sorry, should be this: site['enabled'] = true if !site.has_key?('enabled')
<shadoi>
please don't use if !
<mattalexx>
shWhy?
<shadoi>
it's unreadable
<mattalexx>
shadoi, Why?
<shadoi>
and nasty.
<banisterfiend>
or you could use unless
<shadoi>
use unless
<banisterfiend>
shadoi: i disagree :) but it's a matter of opinion
<mattalexx>
So site['enabled'] = true unless site.has_key?('enabled')
<banisterfiend>
mattalexx: yep
hubub has joined #ruby
<shadoi>
banisterfiend: if ! is a ruby anti-idiom IMO
pac1 has joined #ruby
<banisterfiend>
shadoi: i find 'unless' often hard to parse as it's the opposite way im usually thinking about things
<ElderFain>
I'm trying to merge an array of hashes of hashes of hashes.. i tried to do something simple like array[0].merge(array[1]) to see if merge could handle nested hashs https://gist.github.com/a7e8f797867f149b6851
<ElderFain>
but it definitely didn't merge anything
<shadoi>
at least use "if not"
<ElderFain>
actually i shouldn't say merge. i should be trying to add them
nonotza has joined #ruby
<ElderFain>
that makes this much more obvious
<shadoi>
ElderFain: gem install deep_merge :)
<banisterfiend>
shadoi: why do i need to use 'not' when im so used to '!' already? :)
<banisterfiend>
as is every other programmer, i'd expect :)
<shadoi>
banisterfiend: because to someone else reading the code it's super easy to miss that little exclamation
<yoklov>
i like 'not' more
statarb3 has joined #ruby
statarb3 has joined #ruby
Ownatik has joined #ruby
<yoklov>
unless i want it to be really concise.
<shadoi>
ruby was created to be readable
bonhoeffer has joined #ruby
<banisterfiend>
shadoi: i dont think so, i've been programming C for years and never had a problem, as im sure java programmers agree, and most rubyists would too.
<yoklov>
in ruby ! tends to mean mutation takes place anyway
<ElderFain>
shadoi: yeah i think merge was misleading. technically there is no data to merge, it just has to be added
<yoklov>
i've never really had a bug caused by not reading a ! though...
sythe has joined #ruby
sythe has joined #ruby
<shadoi>
ElderFain: yeah if there's no nesting, then just use [] + []
downtown has joined #ruby
<shadoi>
yoklov: I've seen new coders completely invert the logic in some cases because of it, quite often.
<nonotza>
I'm trying to create a multidimensional hash. shouldn't this syntax work?: hash = Hash.new hash["key"][:dimension_1]
<banisterfiend>
shadoi: new coders make lots of mistakes, let's not single out just one :)
<yoklov>
really?
<shadoi>
banisterfiend: you can't really argue that using "if not" is more clear though. :)
<shadoi>
it's english.
<yoklov>
nonotza, is… that in a block?
<nonotza>
yes
<yoklov>
it didn't really come through hwen you pasted it.
<shadoi>
nonotza: "multi-dimensional" hash? A hash is a multi-dimensional array.
bwlang has joined #ruby
<ElderFain>
shadoi: its hashes. going to have to be some kinda weird inject thing to iterate through the single array and merge
<shadoi>
ElderFain: thus deep_merge
<banisterfiend>
shadoi: i dont like it,i actually am more likely to miss a 'not' than a '!', because '!' is weird syntax that fires an alert in my brain whereas 'not' is just a word that can pass through without making me immediaetly think 'ah, something is about to happen'. Also perhaps im just not used to 'not', but i dont see why i need to get used to it when '!' is fine as it is, and much more ubiquitous
pingfloyd has joined #ruby
pingfloyd has joined #ruby
<shadoi>
ElderFain: it has test cases for all the strange edge cases you may encounter.
colossal7 has joined #ruby
<yoklov>
nonotza: i see. you're not initializing results[a.content]
<nonotza>
I'm getting an error with the code I pasted. You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[]=
<yoklov>
right.
<nonotza>
ok
<shadoi>
banisterfiend: I think you're just carrying around baggage from C. ;)
<yoklov>
you need to say results[a.content] = {} first
<nonotza>
ok cool thanks
<yoklov>
Hash.new can also take a block to use for 'default value'
<yoklov>
and you can do some magic with that
<nonotza>
sweet
<nonotza>
thanks
<yoklov>
np
<banisterfiend>
shadoi: well it's not just C, it's all C-like languages, which are the most dominant sort.
<shadoi>
banisterfiend: and ruby was created to be *different* than them. More expressive, more readable.
<yoklov>
the scorge of text files everywhere
<yoklov>
though, i really do like having the option for "if !". sometimes that's what's gotta be there.
conntrack has joined #ruby
ByteCrunch has joined #ruby
<banisterfiend>
shadoi: i agree, but i also dont agree that the '!' vs 'not' is part of that, '!' is perfectly readable to me and i've never really (as far as i can remember) had a bug as a result of misreading it. Also i dont think that 'not' has taken off to the extent yo say in the ruby community to be promoted as 'idiomatic'. Most Ruby code i read uses '!'
<blueadept>
what's a good way to loop through an array at a specific interval, like say 50 array items every 5 seconds?
<Axsuul>
Can someone please recommend me a good gem for doing CLI?
<shadoi>
banisterfiend: hmm, most ruby code I've seen tends to use unless. Also you are the type of person who wouldn't benefit from more readable code, you're a long-time coder, user of many languages. I've been encountering a lot of people who are totally new to programming, and it's the little things like this that trips them up more than anything else.
<banisterfiend>
Axsuul: slop
<Axsuul>
banisterfiend: thanks
<shadoi>
Axsuul: mixlib provides a good framework also.
<banisterfiend>
shadoi: well, in multi-part if statements where there's more than one condition
<banisterfiend>
shadoi: i.e: if x && !y
<shadoi>
yeah
asuka_ has joined #ruby
_|christian|_ has joined #ruby
<shadoi>
show a neophyte a C for loop and their eyes glaze over instantly.
bjensen has joined #ruby
conntrack has joined #ruby
<yoklov>
while (*p++ = *q++);
<shadoi>
isn't that an Emojii? ;)
<yoklov>
you know, i can sorta see that.
Seisatsu has joined #ruby
randym_ has joined #ruby
conntrack has joined #ruby
<schlecht>
19:59 < yoklov> while (*p++ = *q++);
<schlecht>
I don't think you meant for assignation there.
tilde` has joined #ruby
S2kx has joined #ruby
tomzx has joined #ruby
kmurph79 has joined #ruby
<schlecht>
Night.
<banisterfiend>
schlecht: yeah he did
<yoklov>
yeah
<banisterfiend>
schlecht: it's a strcpy
<schlecht>
Ah.
<schlecht>
Night then.
<banisterfiend>
cya
stephenjudkins has joined #ruby
<gift>
what would be the best way to write socket traffic to a properly formatted pcap?
<yoklov>
night
chimkan_ has joined #ruby
jergason has joined #ruby
conntrack has joined #ruby
randym has joined #ruby
cooper has joined #ruby
cooper has joined #ruby
namidark has joined #ruby
dubellz has joined #ruby
Corey_ has joined #ruby
bryanray has joined #ruby
<namidark>
Moving from ree to 1.9.3 -- does Klass.send(:include, OtherKlass) not work any longer?
conntrack has joined #ruby
<banisterfiend>
namidark: of course it still works
<banisterfiend>
namidark: but u cant include classes, only modules ;)
<namidark>
banisterfiend: err yeah my bad otherklass should be othermodule ;0
zodiak has joined #ruby
Aquilas has joined #ruby
albemuth has joined #ruby
conntrack has joined #ruby
kpshek has joined #ruby
<namidark>
banisterfiend: hm :\ Not sure then, its being required but it still says uninitalized constant
<banisterfiend>
namidark: is this in rails
<namidark>
banisterfiend: yup
<banisterfiend>
namidark: well rails has some weird lazy constant loading thing going on
<banisterfiend>
hmm
<banisterfiend>
but i guess it should still work in your case
<yoklov>
is there any way i can get a class called ``SomeClass'' if i have the symbol ``:SomeClass''?
aetaric has joined #ruby
bobby has joined #ruby
<yoklov>
aside from eval(:SomeClass.to_s)
<savage->
yoklov: Object.const_get(:SomeClass)
<yoklov>
awesome
<yoklov>
thanks
<savage->
np
Aquilas has joined #ruby
conntrack has joined #ruby
twock has joined #ruby
azureye has joined #ruby
conntrack has joined #ruby
<namidark>
banisterfiend: well if you're still interested... it had to do with rails' stupid config.autoload_paths -- a require dir glob wasn't working
matthias_ has joined #ruby
waxjar has joined #ruby
gen0cide_ has joined #ruby
<dark3rdre4ms>
do you guys recommend using gems from my distros package management system or installing them with `gem`
<ryannielson>
dark3rdre4ms: Use gem, the versions in distro package managers are often more out of date.
<dark3rdre4ms>
ryannielson: yeah
<dark3rdre4ms>
I'm considering joining my distros Ruby team
macmartine has joined #ruby
CannedCorn has joined #ruby
badabim has joined #ruby
chrxn has joined #ruby
conntrack has joined #ruby
fallen has joined #ruby
colint_ has joined #ruby
c0rn has joined #ruby
<td123>
dark3rdre4ms: which distro?
igotnolegs has joined #ruby
joslin01 has joined #ruby
denom has joined #ruby
jordanstephens has joined #ruby
twock has joined #ruby
samsonjs has joined #ruby
conntrack has joined #ruby
Retistic has joined #ruby
conntrack has joined #ruby
waazzuup has joined #ruby
`brendan has joined #ruby
i8igmac has joined #ruby
trend has joined #ruby
conntrack has joined #ruby
sterNiX has joined #ruby
shadoi has joined #ruby
twock has joined #ruby
conntrack has joined #ruby
xissburg_ has joined #ruby
dagnachewa has joined #ruby
mikeycgto has joined #ruby
colint has joined #ruby
t0mmyvyo has joined #ruby
tilde`_ has joined #ruby
wmoxam_ has joined #ruby
conntrack has joined #ruby
ByteCrunch has joined #ruby
i8igmac_ has joined #ruby
Ownatik has joined #ruby
conntrack has joined #ruby
skrewler has joined #ruby
jitesh_shetty has joined #ruby
kmurph79 has joined #ruby
josefig has joined #ruby
nfluxx has joined #ruby
wmoxam has joined #ruby
pdtpatr1ck has joined #ruby
dark3rdre4ms has joined #ruby
Yusuke has joined #ruby
conntrack has joined #ruby
p0y has joined #ruby
jxpx777 has joined #ruby
conntrack has joined #ruby
Jay_Levitt has joined #ruby
regedarek has joined #ruby
_axx has joined #ruby
denysonique__ has joined #ruby
<dagnachewa>
anyone here using pgune
<dagnachewa>
pgtune
milkpost_ has joined #ruby
sayakb has joined #ruby
<Yusuke>
how do i declare a function with like 3-5 lines in interactive ruby
<yoklov>
same way as in a text editor.
<yoklov>
just don't screw up.
<yoklov>
alternatively, use semicolons.
bbttxu_ has joined #ruby
CannedCorn has joined #ruby
conntrack has joined #ruby
gentz has joined #ruby
conntrack has joined #ruby
wmoxam has joined #ruby
tilde` has joined #ruby
cantbecool has joined #ruby
sterNiX has joined #ruby
TomJ has joined #ruby
maletor has joined #ruby
radic_ has joined #ruby
conntrack has joined #ruby
sawjig has joined #ruby
wmoxam_ has joined #ruby
taipres has joined #ruby
yekta has quit [#ruby]
conntrack has joined #ruby
t0mmyvyo has joined #ruby
sdwrage has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
Tearan has joined #ruby
conntrack has joined #ruby
zodiak has joined #ruby
bwlang has joined #ruby
wmoxam has joined #ruby
conntrack has joined #ruby
zakwilson has joined #ruby
IAD has joined #ruby
PragCypher has joined #ruby
conntrack has joined #ruby
nerdy has joined #ruby
nerdy has joined #ruby
conntrack has joined #ruby
wmoxam has joined #ruby
denom has joined #ruby
denom has joined #ruby
michaelh has joined #ruby
conntrack has joined #ruby
headius has joined #ruby
wallerdev has joined #ruby
pu22l3r has joined #ruby
Emmanuel_Chanel has joined #ruby
pu22l3r_ has joined #ruby
conntrack has joined #ruby
dv310p3r has joined #ruby
looopy has joined #ruby
akem has joined #ruby
akem has joined #ruby
<crazed>
is there a way to take a block and modify it before using it?
<banisterfiend>
crazed: modify it in what way
<crazed>
for example a method that takes a block as an argument, i want to set a var in that block before using it
majoh has joined #ruby
<banisterfiend>
crazed: what kind of var
<wallerdev>
maybe he just wants to pass a parameter to his block
<wallerdev>
that's pretty normal to do
<crazed>
banisterfiend: an instance
<banisterfiend>
crazed: if you defined your block like this: { |x| x + y }
<banisterfiend>
crazed: then you cuold pass in that variable, rather than having to 'set it in the block'
<crazed>
hmm
<banisterfiend>
def hello(&block); block.call(5); end
<banisterfiend>
hello { |x| x + 10 } #=> 15
wyhaines has joined #ruby
Ownatik has joined #ruby
_srp has joined #ruby
t0mmyvyo has joined #ruby
tdubz has joined #ruby
Aquilas has joined #ruby
Corey_ has joined #ruby
ByteCrunch has joined #ruby
leoncame` has joined #ruby
dootdoot_ has joined #ruby
araujo has joined #ruby
alphabitcity has joined #ruby
<alphabitcity>
is the object.save convention an activerecord thing?
<alphabitcity>
i know, let me rephrase my question: is it an activerecord convention? if i were to write a ruby library that used .save, would this be considered "activerecord like"
adeponte has joined #ruby
_srp has joined #ruby
vivep has joined #ruby
macmartine has joined #ruby
<userbard>
Not sure, sounds right.
rippa has joined #ruby
<banisterfiend>
alphabitcity: 'save' is quite a ubiquitous term, it's used in image manipulation libraries for example: Image#save, and in fact probably in any library where it makes sense to export an object's contents to disk. I dnot think it's activerecord-like, as it's such a common term.
<alphabitcity>
banisterfiend: gotcha, thanks
redgetan has joined #ruby
chimkan_ has joined #ruby
nerdy has joined #ruby
krz has joined #ruby
savage- has joined #ruby
aetaric has joined #ruby
c0rn has joined #ruby
gokul has joined #ruby
nfluxx has joined #ruby
<redgetan>
I'm experiencing problems trapping SIGINT for ruby 1.8.7p357 when i use the system() command before calling gets
<Asher>
why don't you start each section off with a scenario description
<Asher>
where you would want those features
<Asher>
otherwise it looks awesome
<banisterfiend>
thx
<banisterfiend>
Asher: does the theme make it hard to read? should i change themes?
<Asher>
no theme is good
<Dreamer3>
is there a way to call a block but pass it a diff binding?
<Asher>
other_object.instance_eval( & block )
<Asher>
so yes but you worded it backwards
<Asher>
you pass a different binding your block
<i8igmac_>
any ideas on how i can start a thread with a max thread lim?
<i8igmac_>
Thread.start{`ruby wc3.rb`} Max=10
otakutomo has joined #ruby
<banisterfiend>
Dreamer3: no it's not
<Dreamer3>
Asher: that's exactly what i needed, thanks
<banisterfiend>
Dreamer3: that's not changing the Binding though ;) that's just changing the object context
<Asher>
it's changing which binding it takes place in context of
<Dreamer3>
Asher: yep, which is what i wanted
<Asher>
dreamer3- awesome :) banisterfiend is just trolling ;)
alphabitcity has quit [#ruby]
<Dreamer3>
kind of an ugly syntax though
<Dreamer3>
lambdas
<banisterfiend>
Asher: no im not trolling actually :) by Binding i mean which context the local variables are attached to and how they are looked up, you can't change that for a block
pu22l3r has joined #ruby
<banisterfiend>
you can nly change ivars and method lookup for a block by changing the object context, that's totally unrelated to Binding
<Asher>
there are two bindings for a block
<Asher>
the local binding and the block binding
<Asher>
no?
<Asher>
isn't there a local binding context for the block itself plus one for the local context it's in?
Axsuul has joined #ruby
<banisterfiend>
Asher: all u do is change the 'self' for a block when you do instance_eval, that's not called binding
<Asher>
i'm aware i wasn't questioning that…
chrxn has joined #ruby
ohcibi has joined #ruby
ilyam has joined #ruby
tommyblue has joined #ruby
Bish has joined #ruby
aef has joined #ruby
drizz has joined #ruby
sinuc has joined #ruby
sinuc has joined #ruby
vereteran has joined #ruby
Joelio has joined #ruby
jordanstephens has joined #ruby
caveat- has joined #ruby
mbreit has joined #ruby
linopolus has joined #ruby
k_m has joined #ruby
wereHamster has joined #ruby
tessi has joined #ruby
eeadc has joined #ruby
g0r_ has joined #ruby
_axx has joined #ruby
snapcase has joined #ruby
aces1up has joined #ruby
ryanf has joined #ruby
telling has joined #ruby
Illiux has joined #ruby
sayakb has joined #ruby
iaj has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
ccooke has joined #ruby
regedarek has joined #ruby
senthil has joined #ruby
Muz has joined #ruby
pkondzior has joined #ruby
patricksroberts has joined #ruby
c0rn has joined #ruby
eeadc has joined #ruby
chimkan has joined #ruby
relix has joined #ruby
pvh has joined #ruby
nfluxx has joined #ruby
notbrent has joined #ruby
tonini has joined #ruby
eeadc has joined #ruby
macmartine has joined #ruby
davidboy has joined #ruby
sunaku has joined #ruby
<sunaku>
puts :hello
sdwrage has joined #ruby
tessi has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
JohnBat26 has joined #ruby
moeSeth has joined #ruby
denysonique__ has joined #ruby
iaj has joined #ruby
Erik_H has joined #ruby
ninor has joined #ruby
MoMo has joined #ruby
snearch has joined #ruby
jordanstephens has joined #ruby
kaktus has joined #ruby
hosiawak has joined #ruby
welterde has joined #ruby
rickmast has joined #ruby
SeanTAllen has joined #ruby
maletor has joined #ruby
MetaCosm has joined #ruby
MetaCosm has joined #ruby
MetaCosm has joined #ruby
JohnBat26 has joined #ruby
Illiux has joined #ruby
nemesit has joined #ruby
sixdahs has joined #ruby
sunaku has quit [#ruby]
otakutomo has joined #ruby
azureye has joined #ruby
sayakb has joined #ruby
yxhuvud has joined #ruby
cableray has joined #ruby
thone_ has joined #ruby
zomgbie has joined #ruby
mxweas_ has joined #ruby
sdwrage has joined #ruby
n3m has joined #ruby
Morkel has joined #ruby
zomgbie has joined #ruby
eko has joined #ruby
mxweas_ has joined #ruby
Illiux has joined #ruby
savage- has joined #ruby
samuel02 has joined #ruby
examancer has joined #ruby
johnny86 has joined #ruby
eldariof has joined #ruby
chrxn has joined #ruby
johnny86 has quit [#ruby]
djdb has joined #ruby
kapowaz has joined #ruby
punkrawkR has joined #ruby
sterNiX has joined #ruby
Asher1 has joined #ruby
Asher has joined #ruby
Kyle__ has joined #ruby
td123 has joined #ruby
banseljaj has joined #ruby
senny has joined #ruby
csherin has joined #ruby
stoffus has joined #ruby
samsonjs has joined #ruby
maletor has joined #ruby
Asher1 has joined #ruby
michaelh_ has joined #ruby
davidpk has joined #ruby
ph^ has joined #ruby
Nirvanko has joined #ruby
<Nirvanko>
How to configure Apache for Ruby? Can't find any info.
<fragmachine>
is there a way to output a jpeg file from ruby?
chaitanya has joined #ruby
InBar has joined #ruby
daglees has joined #ruby
daglees has joined #ruby
ph^ has joined #ruby
schlecht has joined #ruby
mxweas_ has joined #ruby
akem has joined #ruby
<RubyPanther>
yes
nicksmith has joined #ruby
<fragmachine>
RubyPanther: does it use rmagick, becuase I'm having trouble with that at the moment
Dreamer3 has joined #ruby
mxweas_ has joined #ruby
<RubyPanther>
fragmachine: you could use gimp or something
<RubyPanther>
or, fix your trouble
<fragmachine>
yea I might just have to try and fix rmagick
a_a_g has joined #ruby
aces23up has joined #ruby
jonnie|home has joined #ruby
<a_a_g>
is include a special 'syntax' or is it a method of some object?
twqla has joined #ruby
bjensen has joined #ruby
<a_a_g>
in rib, include.class gives "Class < Module". what does that mean?
nicksmith has joined #ruby
LMolr has joined #ruby
<a_a_g>
s/rib/irb
Spockz has joined #ruby
nd___ has joined #ruby
iocor has joined #ruby
burgestrand has joined #ruby
mxweas_ has joined #ruby
ikaros has joined #ruby
ephemerian has joined #ruby
grouzen has joined #ruby
robotmay has joined #ruby
arturaz has joined #ruby
Doppp has joined #ruby
Doppp has joined #ruby
Mekkis has joined #ruby
samsonjs has joined #ruby
ChampS666 has joined #ruby
dazoakley has joined #ruby
bier has joined #ruby
banisterfiend has joined #ruby
trivol_ has joined #ruby
marvin_ has joined #ruby
ephemerian has joined #ruby
eldariof has joined #ruby
BiHi has joined #ruby
Shrink has joined #ruby
niko has joined #ruby
EddieS has joined #ruby
a_a_g has quit [#ruby]
Natch| has joined #ruby
banseljaj has joined #ruby
heftig has joined #ruby
sterNiX has joined #ruby
jbw_ has joined #ruby
speress has joined #ruby
shevy2 has joined #ruby
iocor has joined #ruby
<speress>
I need to change some regex in the login method from the Telnet class. How to integrate it properly in my project ? I can copy the net/telnet.rb in my project and make some changes but I don't find it really good. Can I overwride the methode ?
<arturaz>
yes, but thats also not very good
<arturaz>
is regexp hardcoded in the method?
<speress>
Yes arturaz
<arturaz>
copy it out, its the cleanest and most reliable solution
<speress>
arturaz: So I include the telnet.rb core class in my project ?
<arturaz>
What would that give you?
<rippa>
you just open Telnet class
<rippa>
and write a new method there
<rippa>
and use it instead
<arturaz>
oh, you need to change it
<arturaz>
how about subclassing?
<arturaz>
monkey-patching is kind of evil
phantomfakeBNC has joined #ruby
<speress>
I just change it : login_prompt = /[Ll]ogin[: ]*\z/
<rippa>
makes sense
mengu has joined #ruby
KristianDK has joined #ruby
tvo has joined #ruby
bjensen has joined #ruby
shadoi has joined #ruby
trivol has joined #ruby
darthdeus has joined #ruby
tk_ has joined #ruby
<Amorsen>
Err login_prompt can be changed simply by passing the appropriate argument to login
<Amorsen>
Of course that isn't documented, but nevertheless
Kambus has joined #ruby
tatsuya_o has joined #ruby
iocor has joined #ruby
rickmasta has joined #ruby
Talvino has joined #ruby
moshef has joined #ruby
dyer has joined #ruby
justinmcp has joined #ruby
p0y_ has joined #ruby
ephemerian has joined #ruby
Mekkis has joined #ruby
canton7 has joined #ruby
eka has joined #ruby
emmanuelux has joined #ruby
iain12323 has joined #ruby
trivol has joined #ruby
ph^ has joined #ruby
yopp has joined #ruby
<yopp>
hey guys
<yopp>
Is there any way to fix backtrace, when using blocks?
lurch_1 has joined #ruby
Mekkis has joined #ruby
<yopp>
For example I've capured block on line 555, and then calling it somewhere else, and I really need to know where it comes from (line 555)
<banisterfiend>
yopp: if you believe in yourself you can do anything
<shevy>
the second way would be to convert it within your ruby code
<shevy>
though
<shevy>
I think it is best to have the yaml file as close to what you need, in the first place
<shevy>
that makes it easier in the long run
<softarn_>
yea that is the part I've been trying to do, but maybe the first option is better
<softarn_>
thanks alot shevy, I need to rethink my yaml parsing part
<shevy>
sure, good luck with your code
ph^ has joined #ruby
gianlucadv has joined #ruby
virunga has joined #ruby
jensc_a has joined #ruby
QaDeS has joined #ruby
banseljaj has joined #ruby
kurko_ has joined #ruby
dnjaramba has joined #ruby
tvw has joined #ruby
berserkr has joined #ruby
JohnBat26 has joined #ruby
imami has joined #ruby
imami has joined #ruby
jlebrech has joined #ruby
nari has joined #ruby
imami has joined #ruby
badelat has joined #ruby
ReTFEF has joined #ruby
elliottc1ble has joined #ruby
kurko_ has joined #ruby
jensc_a has joined #ruby
virunga has joined #ruby
gianlucadv has joined #ruby
ph^ has joined #ruby
jsaak has joined #ruby
andynu has joined #ruby
softarn_ has joined #ruby
phux has joined #ruby
justfielding has joined #ruby
samsonjs has joined #ruby
randym has joined #ruby
Mekkis has joined #ruby
trivol has joined #ruby
iain12323 has joined #ruby
emmanuelux has joined #ruby
canton7 has joined #ruby
ephemerian has joined #ruby
justinmcp has joined #ruby
Talvino has joined #ruby
rickmasta has joined #ruby
iocor has joined #ruby
Kambus has joined #ruby
darthdeus has joined #ruby
tvo has joined #ruby
KristianDK has joined #ruby
shevy has joined #ruby
heftig has joined #ruby
Natch| has joined #ruby
Guest91213 has joined #ruby
marvin_ has joined #ruby
bier has joined #ruby
dazoakley has joined #ruby
ChampS666 has joined #ruby
burgestrand has joined #ruby
nd___ has joined #ruby
LMolr has joined #ruby
nicksmith has joined #ruby
aces23up has joined #ruby
Dreamer3 has joined #ruby
akem has joined #ruby
daglees has joined #ruby
InBar has joined #ruby
examancer has joined #ruby
cyri_ has joined #ruby
bluOxigen has joined #ruby
msch has joined #ruby
mafolz has joined #ruby
opin_ has joined #ruby
Asher has joined #ruby
csherin has joined #ruby
senny has joined #ruby
Kyle__ has joined #ruby
kapowaz has joined #ruby
djdb has joined #ruby
savage- has joined #ruby
eko has joined #ruby
n3m has joined #ruby
thone_ has joined #ruby
yxhuvud has joined #ruby
sayakb has joined #ruby
MetaCosm has joined #ruby
SeanTAllen has joined #ruby
hosiawak has joined #ruby
kaktus has joined #ruby
ninor has joined #ruby
iaj has joined #ruby
denysonique__ has joined #ruby
moeSeth has joined #ruby
eeadc has joined #ruby
pvh has joined #ruby
relix has joined #ruby
c0rn has joined #ruby
patricksroberts has joined #ruby
pkondzior has joined #ruby
regedarek has joined #ruby
Dr4g has joined #ruby
snapcase has joined #ruby
_axx has joined #ruby
g0r_ has joined #ruby
wereHamster has joined #ruby
mbreit has joined #ruby
caveat- has joined #ruby
vereteran has joined #ruby
sinuc has joined #ruby
drizz has joined #ruby
aef has joined #ruby
tommyblue has joined #ruby
ohcibi has joined #ruby
award85 has joined #ruby
jhunter has joined #ruby
kp666 has joined #ruby
Aaaarg has joined #ruby
tdubz has joined #ruby
wyhaines has joined #ruby
majoh has joined #ruby
Emmanuel_Chanel has joined #ruby
IAD has joined #ruby
radic has joined #ruby
milkpost_ has joined #ruby
dark3rdre4ms has joined #ruby
davidcelis has joined #ruby
bryanray has joined #ruby
namidark has joined #ruby
cooper has joined #ruby
S2kx has joined #ruby
Seisatsu has joined #ruby
asuka_ has joined #ruby
statarb3 has joined #ruby
hubub has joined #ruby
gregorg has joined #ruby
Indian has joined #ruby
TheTFEF has joined #ruby
Sivart has joined #ruby
alex__c2022 has joined #ruby
zykes-_ has joined #ruby
ada2358 has joined #ruby
milkpost has joined #ruby
Mohan has joined #ruby
manizzle has joined #ruby
y3llow has joined #ruby
s0ber has joined #ruby
kuzushi has joined #ruby
rfloriano has joined #ruby
dross has joined #ruby
CoverSlide has joined #ruby
Russell^^ has joined #ruby
mgm7734 has joined #ruby
gilesw has joined #ruby
saurb has joined #ruby
oddmunds has joined #ruby
ihme-TTilus has joined #ruby
FlyingFoX13 has joined #ruby
deryl has joined #ruby
alek_b has joined #ruby
dnyy has joined #ruby
straind has joined #ruby
timonv has joined #ruby
matti has joined #ruby
jds has joined #ruby
sonkei has joined #ruby
moshee has joined #ruby
MChizhov has joined #ruby
mefis has joined #ruby
josephwilk has joined #ruby
sliv has joined #ruby
mitchty has joined #ruby
KillerFox has joined #ruby
felipe has joined #ruby
koivula has joined #ruby
tightwork has joined #ruby
pygmalion has joined #ruby
nwonknu has joined #ruby
y_matsu_ has joined #ruby
Kiall has joined #ruby
RegEchse has joined #ruby
matled has joined #ruby
Otend has joined #ruby
thebastl has joined #ruby
brian- has joined #ruby
parus has joined #ruby
bikcmp has joined #ruby
psino has joined #ruby
babinho has joined #ruby
pigoz has joined #ruby
trengof has joined #ruby
xpot-mobile has joined #ruby
libertyprime has joined #ruby
marcin_m has joined #ruby
destructure has joined #ruby
wookiehangover has joined #ruby
beilabs_ has joined #ruby
Y_Ichiro has joined #ruby
Gm4n has joined #ruby
nuba has joined #ruby
jeedey_ has joined #ruby
jbc22 has joined #ruby
Kovensky has joined #ruby
Caius has joined #ruby
tomsthumb_ has joined #ruby
hSATAC has joined #ruby
ChloeD has joined #ruby
DeeJayTwo has joined #ruby
Derander_ has joined #ruby
stepnem has joined #ruby
xxtjaxx has joined #ruby
ping_pong has joined #ruby
giminy has joined #ruby
pseud0cod3r has joined #ruby
mxweas has joined #ruby
Jb_ has joined #ruby
nricciar has joined #ruby
WanderingGlitch has joined #ruby
kivi has joined #ruby
dv_ has joined #ruby
hackeron has joined #ruby
hechien_ has joined #ruby
shikamaru has joined #ruby
Amorsen has joined #ruby
jmcphers has joined #ruby
d-snp has joined #ruby
andman_ has joined #ruby
fortysixandtwo has joined #ruby
salvador has joined #ruby
nick_h has joined #ruby
oddraisin has joined #ruby
epochwolf|vps has joined #ruby
r126l has joined #ruby
dkr_ has joined #ruby
tomku has joined #ruby
JStoker has joined #ruby
ReinH has joined #ruby
Elfix has joined #ruby
erenrich has joined #ruby
sv has joined #ruby
eregon has joined #ruby
G has joined #ruby
crazed has joined #ruby
affix has joined #ruby
Tick-Tock has joined #ruby
end3r- has joined #ruby
cespare has joined #ruby
klaas has joined #ruby
UdontKnow has joined #ruby
DefV has joined #ruby
jmeeuwen has joined #ruby
sixteneighty has joined #ruby
mikalv has joined #ruby
trebaum has joined #ruby
Sigma00 has joined #ruby
leex has joined #ruby
Apocalypse has joined #ruby
drPoggs has joined #ruby
speerfissure has joined #ruby
seitensei has joined #ruby
dwon has joined #ruby
mephux has joined #ruby
slash_nick has joined #ruby
bbttxu has joined #ruby
mrmist has joined #ruby
Mchl has joined #ruby
robacarp has joined #ruby
any-key has joined #ruby
elliot98 has joined #ruby
__null has joined #ruby
sizz_ has joined #ruby
duey has joined #ruby
stdcall has joined #ruby
plato has joined #ruby
Liothen_ has joined #ruby
krisfremen has joined #ruby
nyuszika7h has joined #ruby
at5l has joined #ruby
laen_ has joined #ruby
res_ has joined #ruby
mk___ has joined #ruby
orospakr has joined #ruby
audy has joined #ruby
er1c_ has joined #ruby
doomviki1g has joined #ruby
JonnieCache has joined #ruby
dhodgkin has joined #ruby
nricciar__ has joined #ruby
supplysidejesus has joined #ruby
s14 has joined #ruby
Zolrath has joined #ruby
tomb has joined #ruby
dnordstrom has joined #ruby
frontendloader has joined #ruby
LowKey has joined #ruby
ElderFain has joined #ruby
SirFunk has joined #ruby
mythmon has joined #ruby
Nisstyre has joined #ruby
flagg0204 has joined #ruby
Guest49438 has joined #ruby
neko_gata_s_away has joined #ruby
jakky has joined #ruby
JonSchuff has joined #ruby
norm has joined #ruby
Sp4rKy has joined #ruby
dominikh has joined #ruby
lavaman has joined #ruby
tshirtman has joined #ruby
uxp_ has joined #ruby
indeterminate has joined #ruby
vdvluc has joined #ruby
akl has joined #ruby
patronus_ has joined #ruby
deryldoucette has joined #ruby
Flushot has joined #ruby
alup_ has joined #ruby
milky has joined #ruby
rtl has joined #ruby
ichilton has joined #ruby
yugui_zzz has joined #ruby
shaman42 has joined #ruby
Drakx has joined #ruby
Boohbah has joined #ruby
__main__ has joined #ruby
soulcutter has joined #ruby
jrist-afk has joined #ruby
mpereira has joined #ruby
crodas has joined #ruby
andyl has joined #ruby
cynosure has joined #ruby
Drakevr has joined #ruby
savant_ has joined #ruby
elektronaut has joined #ruby
spectre^ has joined #ruby
KitsuneDrag0n has joined #ruby
Freijo has joined #ruby
sejo has joined #ruby
`mx has joined #ruby
preller_ has joined #ruby
txa-ea has joined #ruby
ewag has joined #ruby
ged has joined #ruby
warebec|1at has joined #ruby
undert has joined #ruby
tdmackey has joined #ruby
peterhil has joined #ruby
Afal has joined #ruby
mtkd has joined #ruby
Jelco has joined #ruby
kloeri has joined #ruby
dhruvasagar has joined #ruby
ereslibre_laptop has joined #ruby
Tasser has joined #ruby
bob_f has joined #ruby
vitoravelino has joined #ruby
nimred_ has joined #ruby
esmaxwill has joined #ruby
wayne[mo1ile] has joined #ruby
xea_ has joined #ruby
theoros has joined #ruby
ozzloy has joined #ruby
ixx has joined #ruby
stat1x has joined #ruby
mackid has joined #ruby
balgarath_ has joined #ruby
SpitfireWP has joined #ruby
cjk101010 has joined #ruby
pcboy_ has joined #ruby
benwoody has joined #ruby
majnun has joined #ruby
zaargy has joined #ruby
sgronblo has joined #ruby
lupine_85 has joined #ruby
fred has joined #ruby
stic02 has joined #ruby
cola_zero has joined #ruby
somnium_ has joined #ruby
PhilK has joined #ruby
nlko_ has joined #ruby
omry_ has joined #ruby
glacius has joined #ruby
sernin has joined #ruby
froy has joined #ruby
fahadsadah has joined #ruby
Utkarsh has joined #ruby
wang has joined #ruby
jeekl has joined #ruby
vandemar has joined #ruby
xoebus has joined #ruby
TheMoonMaster has joined #ruby
__class__ has joined #ruby
_root_ has joined #ruby
Mx|away has joined #ruby
Schmidt has joined #ruby
linduxed has joined #ruby
hyperboreean has joined #ruby
tomaw has joined #ruby
joschi has joined #ruby
marienz has joined #ruby
nate_h has joined #ruby
danheberden has joined #ruby
milkshakes has joined #ruby
chrismcg has joined #ruby
rcs has joined #ruby
epitron has joined #ruby
Nowaker has joined #ruby
mattp_ has joined #ruby
lobak has joined #ruby
Guest55437 has joined #ruby
joey__ has joined #ruby
jshsu has joined #ruby
johnduhart has joined #ruby
ampex has joined #ruby
jmaister has joined #ruby
Radar has joined #ruby
David_Miller has joined #ruby
pavelz has joined #ruby
ReTFEF has joined #ruby
dibri has joined #ruby
aef has joined #ruby
mitchty has joined #ruby
y3llow has joined #ruby
Nathandim has joined #ruby
Spockz has joined #ruby
MetaCosm has joined #ruby
davidboy has joined #ruby
kapowaz has joined #ruby
niko has joined #ruby
MoMo has joined #ruby
sebicas has joined #ruby
gvt has joined #ruby
sebicas has quit [#ruby]
MissionCritical has joined #ruby
jobicoppola has joined #ruby
moeSeth has joined #ruby
Sliker has joined #ruby
araujo has joined #ruby
niklasb has joined #ruby
leoncamel has joined #ruby
yopp has joined #ruby
phite has joined #ruby
sinuc has joined #ruby
sinuc has joined #ruby
_axx has joined #ruby
Bish has joined #ruby
ohcibi has joined #ruby
g0r_ has joined #ruby
aef has joined #ruby
hosiawak has joined #ruby
Muz has joined #ruby
banseljaj has joined #ruby
telling has joined #ruby
telling has joined #ruby
imami has joined #ruby
linopolus has joined #ruby
opin has joined #ruby
tommyblue has joined #ruby
notbrent has joined #ruby
bwlang has joined #ruby
relix has joined #ruby
regedarek has joined #ruby
eeadc has joined #ruby
frishi has joined #ruby
Bish_ has joined #ruby
iaj has joined #ruby
snapcase has joined #ruby
drizz has joined #ruby
MoMo has joined #ruby
fridim_ has joined #ruby
gvt has joined #ruby
trivol has joined #ruby
mbreit has joined #ruby
sayakb has joined #ruby
Joelio has joined #ruby
vereteran has joined #ruby
Mekkis has joined #ruby
kapowaz has joined #ruby
ccooke has joined #ruby
kaktus has joined #ruby
davidboy has joined #ruby
welterde has joined #ruby
caveat- has joined #ruby
iocor has joined #ruby
moeSeth has joined #ruby
banseljaj has joined #ruby
darthdeus has joined #ruby
patricksroberts has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
pvh has joined #ruby
sogeking99 has joined #ruby
wereHamster has joined #ruby
<sogeking99>
hey guys, i want to learn programming, i choose ruby for my language. i know basic programming concepts like data types, variables and OOP. what should I read to learn?
tehhobbit has joined #ruby
IAD1 has joined #ruby
<burgestrand>
sogeking99: start a project
<oddmunds>
sogeking99: if you want to learn the syntax of Ruby go for the koans or rubymonks. if you want to learn how to program in ruby, start a project.
<burgestrand>
learning rubys’ syntax and data types is the easy part; how to write ruby applications, however, you only learn by doing
sdwrage has joined #ruby
<tehhobbit>
ArgumentError: odd number of arguments for Hash <- getting that trying to use rubygem-snmp, so a quick question could it be caused by a to old version of ruby (google seems to indicate that it comes from converting a array to hash)
<sogeking99>
ok so i will try to learn the syntax then jump straight in?
MetaCosm has joined #ruby
randym has joined #ruby
<burgestrand>
tehhobbit: it happens when using Hash[] to create a hash out of an array; there could be numerous causes however, one of them is you using the library with the wrong kind/number of parameters
<burgestrand>
tehhobbit: as for old version of ruby; possibly
<tehhobbit>
burgestrand: tested with the example given by the guy that made it
<tehhobbit>
still get the same error
<burgestrand>
tehhobbit: which version of ruby are you using?
<burgestrand>
As far as 1.9.3 goes it won’t allow that either; not sure about 1.8.7 though
fr0gprince_mac has joined #ruby
ChampS666 has joined #ruby
Companion has joined #ruby
denysonique__ has joined #ruby
<burgestrand>
tehhobbit: it says on the README that it supports both 1.8 and 1.9; I’d try it with a more recent version and see if you still get the same error
<tehhobbit>
yeah trying to find a src rpm now
cyri_ has joined #ruby
emocakes has joined #ruby
<banseljaj>
Hi. Is there an IDE for ruby GUI apps?
<burgestrand>
I’d recommend RVM or rb-env over your OS’ package manager
kkszysiu_work has joined #ruby
kkszysiu_work has quit [#ruby]
<burgestrand>
Everytime somebody has a trouble with their ruby installation in here, it’s their OS’ package manager that blew it all up, especially if they try to install two versions of ruby at once (or even just upgrading) :(
Jay_Levitt has joined #ruby
<burgestrand>
banisterfiend: you can use XCode with MacRuby
<oddmunds>
banseljaj: ^
<banisterfiend>
burgestrand: that's cool, man!
<tehhobbit>
burgestrand: bitter and concervative sysadmin :) so rather use os pkgs
<banseljaj>
burgestrand: But i'm on linux.
<burgestrand>
tehhobbit: I understand, some people are just sadists
<burgestrand>
banisterfiend: I know, it’s awesome :d
<burgestrand>
banseljaj: sorry, no idea then
<burgestrand>
No, wait, masochists, I always get those mixed up
<banisterfiend>
burgestrand: btw is macruby decent? say i was to write a gui for pr... would it be a good choice to do it in macruby or rather i should do it in obj?
<banseljaj>
burgestrand: k :(
<burgestrand>
banisterfiend: I’m not sure, I haven’t used it that much
<tehhobbit>
burgestrand: well I can atleast confirm that its the ruby version that was the cause of the problem
<burgestrand>
tehhobbit: \o/
Kambus has joined #ruby
p0y has joined #ruby
<burgestrand>
banisterfiend: either way, you’re probably better off if you *know* objC as well
probst has joined #ruby
<burgestrand>
banisterfiend: hey, you changed your blog layout?
p0y has joined #ruby
<banisterfiend>
burgestrand: Yeah, i thought it needed freshening up
<burgestrand>
banisterfiend: it’s way better now, more room to read :)
auska has joined #ruby
bwlang has joined #ruby
<banisterfiend>
burgestrand: cool, is the theme readable btw? or are the link colors / heading colors not differentiated well enough?
sja_ has joined #ruby
<burgestrand>
banisterfiend: they’re a bit on the down-low, but personally I like it as it does not attract attention away from the post
<auska>
Hi! I need to develop a crawler that detects the Ajax requests, does anyone have any idea about how to do it?
<banisterfiend>
burgestrand: how was the post btw? tell u anything u didnt know etc?
<burgestrand>
banisterfiend: reading it atm ;)
LMolr has joined #ruby
waxjar has joined #ruby
MrGando has joined #ruby
<burgestrand>
banisterfiend: as for things I didn’t know you show me a lot of stuff before they’re done so not sure about that, but it’s an informative post, should show it to my workmates :)
bigkm has joined #ruby
andrewhl has joined #ruby
SPYGAME has joined #ruby
jensc_a has quit [#ruby]
saurb has joined #ruby
phantomfake has joined #ruby
iMe has joined #ruby
BiHi has joined #ruby
lewix has joined #ruby
kaiwren has joined #ruby
tomzx has joined #ruby
looopy has joined #ruby
iocor has joined #ruby
kurtisnelson has joined #ruby
<kurtisnelson>
Ok, I've been beating my head against the wall for an hour now trying to figure out why FileUtils.compare_stream is returning false when diff/cmp every other tool says otherwise.
<kurtisnelson>
I finally ask about it and then realize my co-coder snuck a timestamp into the file...
ph^ has joined #ruby
alanp has joined #ruby
xissburg has joined #ruby
jtrudeau has joined #ruby
jtrudeau has joined #ruby
albemuth has joined #ruby
savage- has joined #ruby
<darthdeus>
hey guys, anyone here got experience with mysql2 gem causing "[FATAL] failed to allocate memory"? when I try to run a 2.3 app using "mysql" driver it works fine, but when I try "mysql2" on rails 3.1 or 3.2, it crashes with the memory error ... I tried reinstalling mysql-connector-c library via homebrew, even the whole mysql, recompile the gem with both llvm-gcc and gcc-4.2 and neither seems to help
grouzen has joined #ruby
<waxjar>
just don't use mysql :p
achievbot has joined #ruby
gvt has joined #ruby
nanderoo has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
yalue has joined #ruby
achievbot has joined #ruby
Ownatik has joined #ruby
Deele has joined #ruby
phantomfakeBNC has joined #ruby
<Deele>
hey
<Deele>
working with sockets
<Deele>
how to "wait until connected"
ryannielson has joined #ruby
<Deele>
like, wait until get first response from server
moshef has joined #ruby
heftig has joined #ruby
kurtisnelson has quit [#ruby]
`brendan has joined #ruby
schlecht has joined #ruby
<schlecht>
[A-lang
mdel has joined #ruby
<linduxed>
if i'm to start a new project, should i go with 1.9.2-p290, or is a newer version recommended?
<yalue>
td123: You can just watch this page: ftp://ftp.ruby-lang.org/pub/ruby/1.9/ , and download the most recent version.
yfeldblum has joined #ruby
<shevy>
td123 no idea. I found it from distrowatch.org
<shevy>
I watch a few nice sites every day and update some URLs to point to the latest source package respectively
chimkan has joined #ruby
yekta has joined #ruby
wyhaines has joined #ruby
wroathe has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
wmoxam has joined #ruby
nowthatsamatt has joined #ruby
sja_ has quit [#ruby]
dv310p3r has joined #ruby
gvt has joined #ruby
saurb has joined #ruby
denom has joined #ruby
_obiJuan has joined #ruby
thisirs has joined #ruby
gvt has joined #ruby
saurb1 has joined #ruby
geekbri has joined #ruby
hackeron has joined #ruby
statix has joined #ruby
viuo has joined #ruby
dazoakley has quit [#ruby]
gianlucadv has joined #ruby
gvt has joined #ruby
hackeron has joined #ruby
nowthatsamatt has quit [#ruby]
cantbecool has joined #ruby
cantbecool has quit [#ruby]
speggey has joined #ruby
berkes has joined #ruby
ohcibi has joined #ruby
yekta has quit [#ruby]
yekta has joined #ruby
moshef has joined #ruby
hosiawak has joined #ruby
linopolus has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
Dr4g has joined #ruby
nlko_ has quit [#ruby]
internet_user has joined #ruby
aef has joined #ruby
bwlang has joined #ruby
tommyblue has joined #ruby
sayakb has joined #ruby
tessi has joined #ruby
regedarek has joined #ruby
pvh has joined #ruby
sinuc has joined #ruby
jgarvey has joined #ruby
caveat- has joined #ruby
kaktus has joined #ruby
CannedCorn has joined #ruby
iaj has joined #ruby
telling has joined #ruby
telling has joined #ruby
drizz has joined #ruby
snapcase has joined #ruby
mbreit has joined #ruby
gvt has joined #ruby
eeadc has joined #ruby
MetaCosm has joined #ruby
denysonique__ has joined #ruby
davidboy has joined #ruby
Muz has joined #ruby
_axx has joined #ruby
Joelio has joined #ruby
carlyle has joined #ruby
patricksroberts has joined #ruby
execute has joined #ruby
gvt has joined #ruby
jcromartie has joined #ruby
theRoUS has joined #ruby
execute has joined #ruby
yoklov has joined #ruby
welterde has joined #ruby
Erik_H has joined #ruby
relix has joined #ruby
notbrent has joined #ruby
gvt has joined #ruby
welterde has joined #ruby
phantomfake has joined #ruby
davidpk has joined #ruby
kapowaz has joined #ruby
andrewhl has joined #ruby
MoMo has joined #ruby
jcromartie_ has joined #ruby
int has joined #ruby
punkrawkR has joined #ruby
bjensen has joined #ruby
notjohn has joined #ruby
bwlang_ has joined #ruby
moeSeth has joined #ruby
Bish has joined #ruby
vereteran has joined #ruby
wyhaines has joined #ruby
rippa has joined #ruby
blueadept has joined #ruby
pdtpatr1ck has joined #ruby
ccooke has joined #ruby
<linduxed>
style question here
<linduxed>
in this file https://gist.github.com/1827384, i've got two things that i suspect are worth refactoring, but i'd like to hear your opinion on it
<linduxed>
first of all, i use Mineral.all in two places, so suspect i should store that in a variable instead
hydrozen has joined #ruby
gvt has joined #ruby
Spockz has joined #ruby
<shevy>
or use a method and use that
wereHamster has joined #ruby
<linduxed>
secondly, i'm storing params["minerals"] in a "amounts"-variable and only using it once, which feels like a waste of a line
g0r_ has joined #ruby
<CannedCorn>
hey guys, where would you file a ruby bug
<shevy>
alternative you could have MineralCalculator.new default to Mineral.all
<linduxed>
shevy: that's a good idea
canton7 has joined #ruby
<shevy>
linduxed well it is ok to assign a variable
<shevy>
remember the intent should be to make the code clear
<linduxed>
oh, as in indicating that it's an amount-variable with the n_
<shevy>
argh
<shevy>
Tasser, I so hate the 'r:FOO' thing :(
<shevy>
ruby used to be cooler without it
<yopp>
def self.calculate_prices_fro(amounts); MineralCalculator.new(all).calculate_prices(amounts); end
<Tasser>
shevy, gotta do it, the people don't give me unicode
enherit has joined #ruby
<shevy>
hehe
<yopp>
don't put crap into controllers
<shevy>
yeah linduxed
<shevy>
n_something
<Tasser>
shevy, well, r:encoding is like growing up - you see the problems now, they're not hidden from you anymore
<shevy>
Tasser, that is only valid when they *were* real problems :)
<yopp>
There no place for bl implementation in controllers. It's models work.
<linduxed>
yopp: sorry, i'm pretty green when it comes to rails and ruby
<shevy>
for my personal ruby stuff so far I have not needed unicode. now I have no choice anymore though
<Tasser>
shevy, like wrong encoding?
<linduxed>
yopp: could you be more specific as to what is wrong with my code, you think?
jordanstephens has joined #ruby
fayimora has joined #ruby
<yopp>
linduxed: you felt right thing: there no place for this crap here. so it's queue good :)
<yopp>
•quite
<shevy>
Tasser wrong how?
<shevy>
all my old ruby code worked beautifully
<linduxed>
yopp: yeah, but then again, i have no clue as to how to improve it.
<linduxed>
yopp: where to move stuff and so on
<jcromartie>
does anybody know how to use Sequel to execute an insert query using "?" placeholders?
<shevy>
linduxed always the hardest choice... where to put things
<linduxed>
yopp: and more importantly, _why_
<shevy>
linduxed always try to remain flexible in your code though
<linduxed>
shevy: dude, flexibility is a feature i cannot grasp yet
<shevy>
right now I am turning all longer methods in a big ruby class into new classes
<yopp>
linduxed: Controllers shouldn't know about business logic implementation, whey just control execution flow
<yopp>
All business logic should be implemented in models.
<shevy>
linduxed yeah I dont know either. I am trying to build like a pyramid ... the simple things on the bottom (many), the complicated things on top of it (few)
<linduxed>
yopp: ok, so what part of that code i posted would you consider business logic?
<linduxed>
yopp: just so we are on the same page..
<shevy>
and when things break down, I remove blocks from the pyramid and reassemble it until things work again
<Tasser>
shevy, string.size with binary will fail if your data is utf8
<yopp>
linduxed: how stuff is calculated
<deryl>
yopp: I don't agree with that but thats a topic thats been hotly debated in #rubyonrails, this channel, and a good many ruby related articles and talk shows :)
<deryl>
the 'all business logic' comment.
<linduxed>
yopp: but more specific, down to line content
<shevy>
all logic is business?
<deryl>
transforms of the data just prior to being stored, or just after being pulled, and checks for data integrety i agree go in the model. but not *all* business logi needs to be in the model
<geekbri>
i smell a flamewar ;)
<deryl>
geekbri: :)
<deryl>
naaa. just one of thos debatable items. yopp doesn't strike me as a basher type. shevy now..
* deryl
runs
<yopp>
:D
Jay_Levitt has joined #ruby
<shevy>
hey
<geekbri>
I personally find MVC can be a bit gray or blurry as to where some of the business logic can live. Sometimes things don't seem appropriate living in models. However I don't necessarily take issue with people say, no put it in the model not the controller.
<deryl>
hehehe
<shevy>
I have no opinion about rails really
<shevy>
except
<deryl>
shevy: naa, i meant the MVC BL only in models
<shevy>
ruby was cooler before rails
<shevy>
:>
<deryl>
not a 'rails' specific thing. even cakephp would be afflicted with this discussion
<yopp>
booooring
<deryl>
i haven't done any rails work in.. damn, 4 or 5 months now?
<shevy>
when I read "models" I am thinking of beautiful women. It's hard to associate model with a programming pattern
<JonnieCache>
surely there isnt any debate over fat model+thin controller?
<shevy>
FAT MODELS SUCK!
<deryl>
shevy: ahh see? you got your mind wired right
<deryl>
JonnieCache: yes there is. quite a bit
<JonnieCache>
it depends on the domain i guess
<deryl>
JonnieCache: except the debate is more on where that line should be which effects fat/thin :)
<yopp>
linduxed: in your case, I suppose that how you want to calculate stuff is BL.
<deryl>
how fat is too fat, how thin is too thin, and I'm telling mommy, model is getting more than me! screams the controller
<JonnieCache>
i generally do everything in the models, if it doesnt make sense there i write a helper class
<yopp>
^^ ++
<linduxed>
yopp: but there's none of that in the controller? am i missing something/
<linduxed>
?
<yopp>
really?
<JonnieCache>
ive actually started uysing inherited_resources now so my controller are mostly 2 lines haha
<linduxed>
yopp: it creates a claculator and tells the calculator to calcualte the prices
<linduxed>
yopp: ok so how could i retain the functionality of those lines, but move them to the model?
thecreators has joined #ruby
<yopp>
Yes. In case when you will want to change logic of caclulation.
<yopp>
For example use VeryFastCalculator if there 100 items, and DistributedCalculator if there 10kk
<yopp>
controller not supposed to know this
<linduxed>
oh now i understand
<linduxed>
hmmm
<JonnieCache>
you could have a method like Mineral.total_value(MineralCalculator)
<JonnieCache>
which calls `all` somewhere in it
<deryl>
JonnieCache: i'm not understanding how thats any different than resources :things in route.rb
asobrasil has joined #ruby
<linduxed>
so you're saying that already the fact that i commit to using the MineralCalculator class is a decision that the model should take?
<deryl>
(was looking inherited_resources up)
<shevy>
hmm guys...
<JonnieCache>
deryl: you write your controllers to inherit from their class rather than actioncontroller so it has all the sensible defaults for REST and json etc
<yopp>
linduxed: kinda
<shevy>
I am current using OptionParser.new
chrxn has joined #ruby
<JonnieCache>
rather than having loads of dupe code
<shevy>
but I can't say I like it too much. Any better alternative?
<deryl>
JonnieCache: ahh, was looking to me like i had to manually add the respond_to etc
<deryl>
shevy: nothing i can offer you. I'm removing clint from rvm-test in excahnge for OptionParser so as to cut down on the deps for the app. Haven't had a chance to redo it yet
<yopp>
linduxed: other thing is a testing
<deryl>
but if OptionParser isn't cutting it for you then see clint
<yopp>
if you hide this logic into model, it will be a tiny unit test for this
<JonnieCache>
deryl: so my controllers are like `PagesController < InheritedResources::BaseController; end` or something like that
<deryl>
there is also one called commander, but i've NO experience with that one
<JonnieCache>
and i can override it if i want
jlebrech has joined #ruby
<shevy>
ok Derander_
<shevy>
I mean deryl
<linduxed>
yopp: ok, now i understand the "why" i think, could you give me an example of what you'd replace those two lines with?
<deryl>
JonnieCache: and InheritedResources handles AR integration how? what about if they are using mongodb (shudder) or couchdb (bigger shudder) for backing their model(s)?
<yopp>
linduxed: um? I've already posted it. But okay. I'll fork your gist
Synthead has joined #ruby
Indian has joined #ruby
phantomfakeBNC has joined #ruby
`brendan has joined #ruby
<JonnieCache>
deryl: it infers the model name from the controller name and just calls Model.all or Model.find(params[:id]) or whatever is needed
<JonnieCache>
if youre using a mongo adapter that also follows ActiveModel then its all the same
<deryl>
JonnieCache: also, dvise is notorious for friggin burying anything and everything 10 miles deep under crap in order to customize even basic portions of itself. How does InheritedResoruces handle *that*?
<deryl>
JonnieCache: yeah but you still need to tell rails or ruby that the model is to be backed by a db
<JonnieCache>
well devise has its own controllers that are separate you just dont worry about it
<deryl>
how is IR handling that? I dont' see any way within IR to define that
<JonnieCache>
IR doesnt do anything until you make some classes to inherit from it
<deryl>
yes i know that
<JonnieCache>
you can mix it with normal controller, so it doesnt affect devise
<deryl>
*nothing* does anything unless you make some classes that inherit from *
<deryl>
no no I was using devise as an example
<deryl>
don't get fixated on 'devise'
<JonnieCache>
heh
<JonnieCache>
well it has a simple enough API for overriding the behaviour if htats what you mean
<deryl>
just devise is a classic case of where the gem goes out of its way to hide modifiabe areas :)
<JonnieCache>
but if i needed lots of custom behaviour i wouldnt use IR, its designed for the case where you have alsmot no custom behaviour and you want to DRY up your code
<JonnieCache>
jesus my typing is bad today
<deryl>
well AR backing of models is quite common, and support for different db engines is transparent. you only have to class MyClass < ActiveRecord::Base I don't see AR or any db in the IR
<deryl>
hehe mine usually gets like that too
lorandi has joined #ruby
<deryl>
I went to bed at 0400 and only got up about an hour ago. working on cup o' joe #1. so forgive *my* typing. I'll forgi ve your's in exchange :)
gerardc has joined #ruby
<shevy>
oh man... I am rewriting 4400 lines of ruby code (including comments and empty lines though). This is so boring and tedious, I have to think how to reword the logic, split it up ... :(
<deryl>
JonnieCache: nevermind. feel free toslap me
<gerardc>
Can someone explain why this this use of super doesnt work like I expect it to, but it does if the original definition of #m is in a module which is included in C? http://pastie.org/3381414
<deryl>
class == AR, you keep referencing controller and for some reason totally and utterly glossing over we are in different sections
<deryl>
so, feel free to beat me senseless, or senseful in this case.
<shevy>
gerardc what does not work?
<shevy>
ah you mean
<shevy>
you want to output "new"
* deryl
starts chugging the coffee
<shevy>
hmm odd
<shevy>
I have not seen super used in a module before, I think
<gerardc>
it only seems to work if both method definitions are in a module, but i dont understand why the orginal one cant be directly in the class.
<yopp>
gerardc: What do you expect to be "super" for module method?
<shevy>
well I have no idea what that does really, it's the first time I see it too, and I am very suspicious when I see things I have not seen before
speggey has joined #ruby
ccooke has joined #ruby
<JonnieCache>
its the pattern yehuda katz used to replace the alias_method_chain madness in ruby
<JonnieCache>
rails rather
<shevy>
oh no surprise I never saw it before then
<shevy>
I try to stay away as much as possible from that
<JonnieCache>
super in a module calls the implementation from the module included before this one, or something like that
<JonnieCache>
its a good pattern. better than a_m_c anyway
<shevy>
it makes the brain explode!
<gerardc>
JonnieCache: So necessarily both the original and the decorating method must be defined in modules? So whats best practice if the method I want to decorate is not defined in a module (and I cant change that)?
<gerardc>
ping
<shevy>
PONG!!!
<gerardc>
just checking ...
<shevy>
he is either on the toilet or thinking of a 50 sentences reply
<shevy>
or trying to ignore you :>
JonSchuff has joined #ruby
JonSchuff has quit [#ruby]
denom has joined #ruby
JonSchuff has joined #ruby
<shevy>
ohh
<shevy>
you have a dynamic IP gerardc ?
<shevy>
I regularly get disconnected by my stupid ISP provider every now and then... so I often tend to miss things said to me before I get disconnected
<gerardc>
huh? I guess so. Why? are you stalking me?
<shevy>
lol
<shevy>
nah
<gerardc>
oh i see
<shevy>
but in case you have a dynamic IP, I can relate to you!
_marvin has joined #ruby
<gerardc>
yes that happens a lot when you use webclients like I am atm.
<shevy>
I used to have a static one, and was online 24/7 without real problems... but it was more expensive, so I switched. so now... I got the cheaper connection... but it's worse. it's still an ok-tradeoff, costs only 60% of what I had to pay before
axl_ has joined #ruby
<yopp>
gerardc: C.ansectors will answer you question
fr0gprince_mac has joined #ruby
<JonnieCache>
shevy: run your irc session inside screen on a server
<yopp>
you aren't re-defined C's methods, you just added M to inheritance chain. Just after C.
tatsuya__ has joined #ruby
fr0gprince_mac has joined #ruby
tilde`_ has joined #ruby
jxpx777 has joined #ruby
stoffus has joined #ruby
sinuc has joined #ruby
sinuc has joined #ruby
ex0a has joined #ruby
Mekkis has joined #ruby
moeSeth has joined #ruby
nebiros has joined #ruby
<gerardc>
yopp: Ah
nathaniel1 has joined #ruby
thomasfedb has joined #ruby
ex0a has joined #ruby
ex0a has quit [#ruby]
y3llow_ has joined #ruby
Jackneill has joined #ruby
Jackneill has joined #ruby
<yopp>
if you want to redefine method, then use included hook and then actually change C's methods.
<shevy>
JonnieCache awww :( would have to learn screen first... but it's on my todo list!
bwlang has joined #ruby
banisterfiend has joined #ruby
<Tasser>
shevy, screen? ^A^D is everything you need ;-)
rtdv has joined #ruby
carlyle has joined #ruby
<shevy>
what does that do?
thecreators_ has joined #ruby
philips has joined #ruby
<shevy>
I tried out tmux
<Tasser>
then you can add ^a^c, ^a^n, ^a^p
<shevy>
I managed to make some ... vertical line
mlue has joined #ruby
<shevy>
that was fun
mlue has joined #ruby
jhulten has joined #ruby
<yopp>
gerardc: it's time to read about eigenclasses :)
<Tasser>
splitting I suppose
blueadept` has joined #ruby
Quadlex has joined #ruby
mbreit has joined #ruby
<CannedCorn>
is there a good guide somewhere on writing ruby extensions in c
deadbea7 has joined #ruby
sebastian_pl has joined #ruby
<shevy>
hehe
auska has joined #ruby
opin_ has joined #ruby
<burgestrand>
CannedCorn: there are a few spread out but none that covers all
xsdg has joined #ruby
Ownatik has joined #ruby
jbpros has joined #ruby
<yopp>
but I think it will be kinda tricky to add method to eigen class of all instances of C, to make "super" work
<Tasser>
yet another try to emulate window managers? ^^
Shamgar has joined #ruby
<shevy>
JonnieCache sadly I am on linux here :(
<JonnieCache>
it automatically maps tmux splits/sessions etc to its own tabs and splits
<shevy>
someone on #rubinius showed me something cool with osx, some terminal thingy with icons
<JonnieCache>
but it can do it remotely as well its clever
DarthGandalf has joined #ruby
<CannedCorn>
burgestrand: im trying to figure this out, my tests pass in 1.9.2 but in 1.9.2 when I call rb_obj_classname() with a DateTime it doesn't say it's a DateTime
<CannedCorn>
thanks burgestrand
<Tasser>
5 aur/ruby-tmuxinator 0.5.0-1 (4)
<CannedCorn>
those sites look like good material :-)
<Tasser>
Manage complex tmux sessions easily
<Tasser>
hm
<burgestrand>
CannedCorn: what does it say it is?
Ttech has joined #ruby
dju has joined #ruby
Targen has joined #ruby
<JonnieCache>
i really want a good excuse to use this
<CannedCorn>
i'm reading someone else's code so trying to understand
<CannedCorn>
ok sweet
<_john>
does 'var blah = lambda ….' basically turn 'blah' into an anonymous function
<burgestrand>
CannedCorn: I read the ruby source a lot when making C extensions, it’s the only way to stay sane
<JonnieCache>
shevy: he actually mentions tron as an inspiration
<Tasser>
_john, var? O.o
<_john>
err
<JonnieCache>
as well as alien, and wargames
<_john>
wrong language
<_john>
lol
<_john>
forget the var
samxor has joined #ruby
<Tasser>
ask again
<burgestrand>
_john: blah = lambda do … end — yes, kind of; you can call it with blah.call(arguments)
<_john>
^ cool
<burgestrand>
_john: it’s also a closure, so you can access any local variables reachable from that scope within the block
<burgestrand>
(the block is the body of code you pass to the "lambda" method)
<_john>
awesome
hippyphysicist has joined #ruby
bwlang_ has joined #ruby
<gerardc>
JonnieCache: Have ASCII star wars running on that app now. Its awesome!
ben_alman has joined #ruby
enroxorz-vroom has joined #ruby
<JonnieCache>
brb im gonna try irssi in it
enroxorz-vroom has quit [#ruby]
iocor has joined #ruby
etehtsea has joined #ruby
Synthead has joined #ruby
<CannedCorn>
burgestrand the when i print out rb_obj_classname it actually outputs Object
Skaag has joined #ruby
JonnieCache has joined #ruby
ByteCrunch has joined #ruby
<JonnieCache>
ok this is officially awesome
ckrailo has joined #ruby
macmartine has joined #ruby
<shevy>
god
<shevy>
I hate java
<shevy>
configure: error: not found set with_jdk_home
<gerardc>
Yup. You made my [offices] day with that find JonnieCache
ckrailo has joined #ruby
gvt has joined #ruby
<JonnieCache>
j ttn_spree
<shevy>
downloading java from oracle feels as if I jumped into a pool of mud
<jcromartie>
shevy: what are you building it on?
<jcromartie>
shevy: what distro
headius has joined #ruby
<Deele>
what is used to allow usage of multibyte characters?
aeu has joined #ruby
<yopp>
gerardc: not exactly
<shevy>
jcromartie I am actually trying to compile libreoffice from source. Downloaded the 80 mb core source... ran configure. it told me that I miss java. Ok, I go to Oracle... I download the 76MB jdk ... I put it into /usr prefix... libreoffce then says "not found set with_jdk_home"
<shevy>
so i decide to hate on Java
<jcromartie>
shevy: got it :)
<shevy>
ohhhh
interopc1p has joined #ruby
<shevy>
I will try --without-java now that I think about it...
<jcromartie>
shevy: but generally, there are easier ways to get Java running on Linux
<jcromartie>
shevy: just depends on how hardcore you are
<yopp>
gerardc: in short, you want to add M before C in chain.
JonnieCache has joined #ruby
<shevy>
jcromartie a bit hardcore!
<aeu>
is there a way to find what classes and methods of those classes used in a module or class ?
<interopc1p>
is there a magic Ruby Array funciton for this? ['A','B','C','D','E','F'].magic(2) == [['A','B'],['C','D'],['E','F']] ?
<shevy>
I try to use the source whenever possible
<yopp>
gerardc: there no simple way to do this, if M is not child of C. But
baroquebobcat has joined #ruby
<jcromartie>
for instance if you're on Ubuntu just install openjdk-6-jre or openjdk-6-jdk
<yopp>
hm. how it will play with my patented method def yes; rand 555; end;? :D
<audy>
yopp: it's useful for doing things in IRB
18WABMLD8 has joined #ruby
mefis has joined #ruby
DFectuoso has joined #ruby
crankycoder has joined #ruby
kenperkins has joined #ruby
thecreators has joined #ruby
snip_it has joined #ruby
jwmann has joined #ruby
fallen has joined #ruby
df11 has joined #ruby
ph^ has joined #ruby
hooper_ has joined #ruby
<df11>
anyone familiar with Resolv::DNS.new and what the search and ndots objects actually are? assuming search is the subdomain i want to search but what about ndots?
<yopp>
Placebo gig vs RailsConf 2012. Rough decision.
<JonnieCache>
df11: at a guess, ndots is the number of dots in the TLD
<JonnieCache>
so .co.uk has two where .com has one
<yopp>
it must be 3
<yopp>
since actually it's .co.uk.
<JonnieCache>
you need to specify that sometimes when doing dns stuff, in some cases its impossible to guess
samsonjs has joined #ruby
<df11>
Interesting, thanks
<JonnieCache>
because you can have unlimited subdomains, it cant know where the domain ends and the tld begins
<shevy>
I have UNLIMITED sex
kenyabob has joined #ruby
<emocakes>
same shevy
<emocakes>
it's called living with your girlfriend....
crescendo has joined #ruby
<virunga>
in the shevy's case is called right hand
niklasb has joined #ruby
blueadept` has joined #ruby
danishkhan has joined #ruby
<virunga>
kidding
<yopp>
virunga: left hand is better!
<shevy>
:(
<virunga>
lol
<emocakes>
its true
<emocakes>
left hand feels like someone else
apok has joined #ruby
bwlang_ has joined #ruby
<yopp>
yup. but it's better to have threesome with both of them
<virunga>
yopp, nice but it'd nicer with more colors
dasfugufish has joined #ruby
dasfugufish has quit [#ruby]
<virunga>
i think
pu22l3r has joined #ruby
<yopp>
don't trust codes, when they speak about "nicer" :D
<yopp>
•coders
mefis has joined #ruby
ciopte7 has joined #ruby
<virunga>
yopp, is it made with rdoc?
<yopp>
yup
<yopp>
actually rails uses it for api.rubyonrails.org
jamiejackson has joined #ruby
df11 has joined #ruby
badabim has joined #ruby
maletor has joined #ruby
SegFaultAX|work has joined #ruby
bjensen has joined #ruby
Synthead has joined #ruby
<shevy>
hmm
<shevy>
ruby docu used to suck
<shevy>
it is quite ok these days
<virunga>
shevy, used to suck 'cause poor contents?
apucacao has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
gabeh has joined #ruby
havenn has joined #ruby
<tayy>
hi everyone. how do i offset Time.now by a certain number of seconds?
<shevy>
virunga hmm not sure. the layout sucked, the colours sucked, the usability was low. I dont remember what the content was... but it probably sucked too, while being semi-useful
<Deele>
hey, when I use "case stuff \n when regex \n true stuff" construct, how to insert variables inside regex statement
<tayy>
a server's off by a few seconds (the offset is not constant!)
<gabeh>
What is the cleanest way to always call a method before any class method is invoked on a class?
saurb has joined #ruby
fr0gprince_mac_ has joined #ruby
<shevy>
Deele just as you always do with a regex. x = "foobar"; when /#{x}"
<df11>
having issues with resolv, the doc on it is a bit lacking. res = Resolv::DNS.new({:nameserver => ["1.1.1.1"], :search => ["my.subdomain.com"], :ndots => 2})
<df11>
res.getaddress("host.my.subdomain.com")
<df11>
Resolv::ResolvError: DNS result has no information for host.my.subdomain.com
<df11>
dig works fine with: dig@1.1.1.1 host.my.subdomain.com
<df11>
where 1.1.1.1 is my NS
<shevy>
oh
<shevy>
the last " has to be a /
<shevy>
when /#{variable_name}"
<shevy>
ARGH
<Deele>
oh, same as inside strings?
<shevy>
when /#{variable_name}/
<shevy>
finally
<shevy>
my keyboard does not obey today
<tayy>
shevy: does the number have to be a certain type?
<shevy>
I think it defaults to n seconds
adeponte has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
<shevy>
Time probably implements a method called -
* waxjar
is listening to Pickled! by Flying Lotus (0:37/2:13)
<Companion>
I got 1.9.3
bwlang_ has joined #ruby
<gift>
i wonder if it matters all that much
<waxjar>
oops wrong channel
zomgbie has joined #ruby
samsonjs has joined #ruby
<Companion>
trying to mess between RVM and ruby from pacman tho : /
Jay_Levitt has joined #ruby
<Companion>
on RVM it works
<Companion>
only it does not run :')
<Companion>
rvm can compile it but dunno how to install it system wide ; /
xec has joined #ruby
fridim_ has joined #ruby
mkscrg has joined #ruby
alex__c2022 has joined #ruby
<shevy>
hehehehe
<shevy>
dont you love it when switching between different installations of ruby ;)
badabim has joined #ruby
sinuc has joined #ruby
<Companion>
shevy, rvm use 1.9.2
<Companion>
that aint the problem :P
stringoO has joined #ruby
e-dawg has joined #ruby
<shevy>
hmm
<shevy>
why is "gem install iconv" compiling anything for you?
<shevy>
oh
<shevy>
for me I dont see any output
<shevy>
"Fetching: iconv-0.1.gem (100%)"
<shevy>
Building native extensions. This could take a while...
<shevy>
installed without problems
marioisdead has joined #ruby
sizz has joined #ruby
Jake232 has joined #ruby
<marioisdead>
hey guys i want to learn ruby, i am new to programming, how should i learn?
hadees has joined #ruby
zakwilson_ has joined #ruby
bwlang_ has joined #ruby
banseljaj has joined #ruby
phux has joined #ruby
gvt has joined #ruby
CoverSlide has joined #ruby
<linduxed>
so i've got a model that is called Mineral which is supposed to describe the price and name of certain minerals. for the calculation of a pile of minerals' worth i'm using a calculator class called MineralCalculator which resides in the lib/ directory (not a model). what i wonder is whether it's right to include "calculation code" into the Mineral model?
df11 has joined #ruby
<linduxed>
I'm asking this because I imagined that Mineral as a class strictly describes a mineral
jwang has joined #ruby
groe has joined #ruby
Ferdev has joined #ruby
josx has joined #ruby
<linduxed>
while i thought that calculation of the worth of multiple minerals is something that happens "outside" of that model
luckman212 has joined #ruby
<linduxed>
that's what my intuition says, but correct me if I'm wrong
<groe>
is there a library (or rubygem) providing a convinient user interface to distributed ruby objects (i.e. a DRb service)?
<shevy>
third step: start to write a ruby script that you can extend in the next days and weeks slowly
mikepack has joined #ruby
kmurph79 has joined #ruby
ilyam has joined #ruby
banseljaj has joined #ruby
tatsuya_o has joined #ruby
<marioisdead>
thanks shevy
<ElderFain>
I still can't seem to mentally get my mind around merging this data. deep_merge gem didn't help at all. I've been playing with inject trying to add the values together but I run into problems because of the nested nature of the data. https://gist.github.com/a7e8f797867f149b6851 so now im thinking.. recursion ?
<ElderFain>
there is a single array with 3 hashes, each hash has the example same keys, the only difference is the values at the bottom level, which i just need to add.
<ElderFain>
example== exact
<shevy>
marioisdead the reason behind it is: the earlier you start to write code on your own, the more you learn. you learn by doing mistakes too. so the earlier you start to write code, the better
<shevy>
and you can always ask others for feedback
<marioisdead>
thanks. does ruby also have the thing python has where you need to use 4 spaces for code blocks?
josx has joined #ruby
Nathandim has joined #ruby
<ElderFain>
marioisdead: no
<marioisdead>
oh good so i can space my lines however i want really?
<banseljaj>
marioisdead: Indeed.
tomzx has joined #ruby
<ElderFain>
any suggested avenues on tackling that data set? i feel like im missing something obvious
<ElderFain>
I was hoping a good nights sleep would give me the answer, but nadda
<marioisdead>
i have two computers which i will be using. one windows and one linux. whats the best way for me to have easy access to my files on both computers?
<ElderFain>
marioisdead: dropbox?
macmartine has joined #ruby
<marioisdead>
ok i'll take a look
opin has joined #ruby
havenn has joined #ruby
wroathe has joined #ruby
<audy>
The last Ruby Trickshot: `/(<foo>?\w)/ =~ 'bar'` creates the local variable foo = bar. but the regexp must be a literal at the beginning of the line. Is it possible to make the regexp a variable and still be able to do this?
cyri_ has joined #ruby
<ElderFain>
why would you write something so difficult to understand at a glance?
fridim_ has joined #ruby
<yopp>
linduxed: Yes, it worth.
levity_island has joined #ruby
<levity_island>
is anyone else getting sporadic 404's from rubygems.org's cloudfront host?
niklasb has joined #ruby
flagg0204 has joined #ruby
zomgbie has joined #ruby
<banseljaj>
marioisdead: github, if you are working on projects. Or bitbucket,which offers private repos.
<ElderFain>
argh kill me now. y.inject { |sum,val| sum.collect { |k,v| v.collect { |a,b| b } } + val.collect { |i,o| o.collect { |p,l| l } } }
fayimora_ has joined #ruby
jgrevich has joined #ruby
dcvii has joined #ruby
<dcvii>
hello
stephans has joined #ruby
Azure has joined #ruby
wedgeV has joined #ruby
snip_it has joined #ruby
fr0gprince_mac has joined #ruby
snearch has joined #ruby
dnjaramba has joined #ruby
<dcvii>
question
<dcvii>
how can i get rdoc to publish to a particular directory under Sites?
<linduxed>
yopp: worth?
<linduxed>
yopp: what do you mean? that I should put calculation methods in my Mineral class?
<yopp>
it's simple
<linduxed>
well... i wouldn't be surprised if it's simple
dch4pm4n has joined #ruby
<linduxed>
i was just asking if it's right
<yopp>
If it's complex enough to be separate class — make separate class. Or if you want to isolate calculation implementation, from model.
<CannedCorn>
ok so when you call TYPE in 1.9.3 on DateTime or Complex it says T_DATA... before 1.9.3 it says Object
<linduxed>
considering, as i said, that i imagined that the class Mineral is something that describes minerals, not what you do with them
<CannedCorn>
why would that have changed
<linduxed>
at least that was my train of thought
startling has joined #ruby
bwlang_ has joined #ruby
<yopp>
Do not over complicate things. Think about how easy it will be to find what and why happens in your model
<startling>
as someone who knows haskell and python mostly, how should I learn ruby?
<linduxed>
yopp: well i'll also (later on) have conversions like "200 of ore A and 300 of ore B => convert both piles to minerals => convert all the resulting minerals to cash"
<burgestrand>
CannedCorn: T_DATA is the datatype you use to attach custom data to an object in C extensions
<burgestrand>
CannedCorn: essentially it’s an implementation detail
<yopp>
linduxed: then what bother you?
<linduxed>
yopp: that first conversion would then have nothing to do with the mineral class... but i guess i could do the conversion of ores in the Ore model
<burgestrand>
startling: came from the same background as you; what I did is that I used it
<linduxed>
yopp: well
MrGando has joined #ruby
<burgestrand>
startling: okay, not the same, but similar :)
carlyle has joined #ruby
banseljaj has joined #ruby
<linduxed>
yopp: it's just that since it's my not-really-first-time-but-might-as-well-be that i work with MVC, i still think in just classes
<linduxed>
yopp: and with just classes, it was easy for me to figure out what goes where
<linduxed>
yopp: like in this case
<startling>
burgestrand: heh, I've been trying to but a bunch of things keep distracting me. I guess I can just keep a tab open on the docs...
<yopp>
then you already made right thing
<burgestrand>
startling: it’s helpful to have a project, that way you can ask specific questions to plow forward when you get stuck
rfloriano has joined #ruby
<linduxed>
yopp: i'd just make an app.rb or main.rb file, in it i'd start off by creating a new MineralCalculator object which would then recieve data in the shape of amounts of Minerals and Ores
<linduxed>
for instance
nemesit has joined #ruby
<linduxed>
here, it's different, because i don't know if i should make a MineralCalculator model, because i don't need database entries for that
<linduxed>
i've already got the calculator in lib
<yopp>
uh
<linduxed>
on the other hand
<linduxed>
yopp: actually
fayimora has joined #ruby
<startling>
burgestrand: yeah, that's true.
<linduxed>
yopp: it's hard to explain, i'll just give you a link
<yopp>
so, it just summarize a price of something by given amount?
johnny86 has quit [#ruby]
<yopp>
best want, in your case is actually make this in two steps
<yopp>
oh
numo16 has joined #ruby
banisterfiend has joined #ruby
bwlang_ has joined #ruby
sdwrage has joined #ruby
<Deele>
hey, can someone hint me about sockets, I need to "catch" the moment when my client has successfully connected to server
jxpx777 has joined #ruby
jxpx777- has joined #ruby
<linduxed>
yopp: so now that you see that code, and you think back to that code we discussed earlier, would you still put calculator object creation inside the Mineral model?
<ged>
Deele: What do you mean by "catch"? And what kind of socket does your client use?
johnny86 has joined #ruby
<Deele>
ged, connection to irc server with TCPSocket.open(server, port)
<yopp>
linduxed: I'm actually leaving office now, it will be nice to talk tommorow
<yopp>
but main thing: it's too complex :D
<linduxed>
yopp: oh, i see
<yopp>
there should be one class (model)
<ged>
Deele: When that call returns, the socket is open.
ryannielson has joined #ruby
<ged>
I.e., has successfully connected.
jxpx777_ has joined #ruby
senny has joined #ruby
<Deele>
ged, I do that with @con = TCPSocket.open(#server, @port). What should be syntax? I'm newbie to ruby, be gentle :)
nanderoo1 has quit [#ruby]
nw` has joined #ruby
<ged>
Deele: Yes, conn = TCPSocket.open( host, port )
Azure|netbook has joined #ruby
Azure has joined #ruby
<Deele>
ged, I need to make some sort of timed loop, that is checking?
<ged>
Deele: No, when .new returns, the socket will be open.
<Deele>
ged, still, did not get it. I want somehow to catch that delay between initiating connection and receiving first successfull answer from server. And if that delay is too long (timeout), initiate connection again.
dgbaley27 has quit ["ISON nickserv"]
<skitrees>
ged, awesome thanks, I'll try that - makes sense
capotej has joined #ruby
mengu has joined #ruby
twoism has joined #ruby
coucher has joined #ruby
<ged>
Deele: Ah, then you'll probably want to use one of the lower-level socket classes like Socket, which has #connect_nonblock, and lets you set socket options before connecting.
travisjeffery has joined #ruby
Tearan has joined #ruby
<Deele>
ged, I use "require 'socket'"
<Deele>
ged, I just see, that it does not block already, I see that all join messages etc are sent to server, only after couple seconds, it just connects :)
<ged>
Deele: Sure, but you're using the TCPSocket class, which is a higher-level abstraction. To get more fine-grained control, you need to use one of TCPSocket's superclasses.
<Deele>
oh
18WABMRD2 has joined #ruby
<ged>
At least if I'm understanding what you're trying to do.
<Deele>
I have an idea, I can add "connection successfull" method inside my response filter, if it receives 001 irc rawcode message, it is connected
<Deele>
ged, what that select() do?
<ged>
Deele: Waits until the socket is writable.
<CannedCorn>
where in the ruby source does it definte the macros for types
hosiawak has joined #ruby
jmeeuwen has joined #ruby
<Deele>
ged, hey, that is what I already have in my basic-irc client code, I got
<ged>
CannedCorn: Like RSTRING_PTR and the like?
<CannedCorn>
like T_STRING
<CannedCorn>
or T_OBJECT
<Deele>
ged, look at this loop, it is called right after connection is initiated http://pastie.org/3383266
<CannedCorn>
or T_HASH or T_ARRAY
<Deele>
ged, server output filters are inside handle_server_inputs, but I not really understand this loop
<ged>
CannedCorn: ruby.h?
<ged>
Or ruby/ruby.h I guess in 1.9.
<CannedCorn>
right
<CannedCorn>
didn't see it in there, hrm
<CannedCorn>
maybe i am retard
<ged>
Look for 'ruby_value_type'
shell0x has joined #ruby
<shell0x>
hi
<ged>
They're in an enum.
<Deele>
ged, after which line In my given pastie, ruby "knows" - connection is writable?
<ged>
Deele: It doesn't because you're never asking it to tell you.
Retistic has joined #ruby
<ged>
Deele: That's the second argument to select().
bwlang_ has joined #ruby
<ryan0x2>
anyone know how in lion i can revert back to a reinstall of ruby... i've mistakenly upgraded it a while back and now it's starting to mess things up like vim, homebrew, etc. would like to revert and then switch to a rbenv/rvm type of deal.
<ryan0x2>
revert to a default install~
bitrot has joined #ruby
<ged>
ryan0x2: Restore from backup? ;)
<shell0x>
I try to do a add a gist on github via https with net/http and uri. But i get always the following error: "start': HTTP session already opened (IOError)" https://gist.github.com/12d6ae791174966cd589
<ryan0x2>
ged, no backups going back that far, this was ages ago, never started being annoying until recently
<shell0x>
anyone have an idea what could be the problem?
<ged>
ryan0x2: There should be a package in the Lion install mpkg that installs Ruby.
<ryan0x2>
ged, i seem to still have the old versions in /System/Library/Frameworks/Ruby.framework/Versions/1.8/, seems i can just replace the links that i overrwrote
<ged>
I've never done it, but the Makefile looks pretty straightforward.
flagg0204 has joined #ruby
<ryan0x2>
will try this, w/ a backup first ;) cheers
<ged>
ryan0x2: Yeah, if you didn't clobber those, yeah.
tatsuya_o has joined #ruby
<ged>
shell0x: Do you mean to be calling 'start' twice?
<ged>
shell0x: I.e., "Net::HTTP.start(...).start"
<shell0x>
ged: oh, thanks! i haven't seen this, my fault :(
<shell0x>
just saw the first start :P
<ged>
shell0x: Second pair of eyes is sometimes useful. :)
<shell0x>
ged: yes, i also should search in the file the next time :P
<ged>
Hehe.
ryannielson has quit [#ruby]
savage- has joined #ruby
havenn has joined #ruby
dibri has joined #ruby
nim_ has joined #ruby
dibri has joined #ruby
<nim_>
how can i get the width ad the heigth of a two dimentional array?
chimkan_ has joined #ruby
<Deele>
ged, a little offtopic from previous, is it "ok" to use regex in ruby. working with php, regex was last suggested string tool
<dootdoot>
width = array[0].length, height = array.length, assuming each row is the same length
<CannedCorn>
what TYPPE does BigDecimal fall under
<nim_>
thx dootdoot
nemesit has joined #ruby
jeedey has joined #ruby
lewix has joined #ruby
oo27 has joined #ruby
gvt has joined #ruby
shadoi has joined #ruby
CoverSlide has joined #ruby
datapolitical has joined #ruby
<robert_>
is there a pattern or whatever for developing plug-ins in ruby?
oo27 has quit [#ruby]
bwlang has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
timonv has joined #ruby
ilyam has joined #ruby
gvt has joined #ruby
pingfloyd has joined #ruby
davidpk has joined #ruby
msch has joined #ruby
<Axsuul>
I have a UTF-8 encoded string, but I want to output it to an HTML document. Do I need to encode it to something in order to display it properly?
<ryan0x2>
could just use utf8 as the html document's charset?
<ryan0x2>
pretty standard to do so i think
bwlang has joined #ruby
<burgestrand>
Axsuul: what ryan0x2 said
<burgestrand>
Axsuul: so no, just set the charset for the document to UTF8 and it should display correctly
oooPaul has joined #ruby
justinmcp has joined #ruby
tarpsocks has joined #ruby
eighty4 has joined #ruby
<Axsuul>
that's right, thanks guys =)
kmurph79 has joined #ruby
chimkan_ has joined #ruby
badabim_ has joined #ruby
phantomfakeBNC has joined #ruby
bigkm has joined #ruby
charlenopires has joined #ruby
dcarper has joined #ruby
phantomfakeBNC has joined #ruby
Janmdkan has joined #ruby
zomgbie has joined #ruby
tilde` has joined #ruby
bwlang_ has joined #ruby
sdwrage has joined #ruby
Guest94492 has joined #ruby
DFectuos_ has joined #ruby
Ttech has joined #ruby
joshrendek has joined #ruby
joast has joined #ruby
mikepack has joined #ruby
namidark has joined #ruby
twoism has joined #ruby
joshrendek has joined #ruby
namidark has joined #ruby
namidark has joined #ruby
viper1092 has joined #ruby
namidark has joined #ruby
namidark has joined #ruby
stephenjudkins has joined #ruby
sythe has joined #ruby
jamesaxl has joined #ruby
denom has joined #ruby
schlecht has joined #ruby
linoj_ has joined #ruby
<ged>
Deele: Yes, regexes are okay to use, but IMO they're overused a bit.
schlecht has joined #ruby
<Deele>
ged, as I'm php dev, zillions of different structures @ruby, that can be used, is frustrating
bluenemo has joined #ruby
Nisstyre has joined #ruby
matthias5 has joined #ruby
<ged>
Deele: You can cover a lot of ground just using regexes and #include?/#index.
<Deele>
ged, in fact, I really like regex :)
<ged>
Deele: Me too.
<Deele>
ged, can you suggest some good reference or "cheat sheet", that covers all core syntax and function/method parameters for ruby?
<shell0x>
kjellski: just wondered, it works on one box and on one not :P
<ElderFain>
that will show you the two styles better than IRC can
<shevy>
a block inside a block inside a block inside a block inside a block inside a block inside a block inside a block inside a block
<ElderFain>
Deele: and it will also explain the differences between the two
<kjellski>
shell0x, compare the gem list
<shell0x>
but %w(net/http uri nokogiri).each{|x| require x} always works :P
<Deele>
ElderFain, yeah, do end will be good for me
<soulcutter>
or you could write 3 lines
<slash_nick>
beautiful shevy
<shevy>
well I like blocks a lot
bbttxu_ has joined #ruby
<shevy>
they make ruby very flexible
<slash_nick>
i used to play with blocks =)
<Deele>
each_index do |index| \n stuff1 \n stuff2 \n end
<shevy>
there you go Deele !
<Deele>
:)
<ElderFain>
I'm looking for additional insight on solving the problem of merging these 3 hashes in this array, https://gist.github.com/a7e8f797867f149b6851 I've been poking at inject with a custom merge block (unsuccessfully) and played with just calling collect.collect and merging them as flat arrays, then rebuilding the hash around the resulting arrays, its just all a mess
Liothen has joined #ruby
chrxn_ has joined #ruby
<ElderFain>
basically the only values that have to be merged are the #s after P1 P2 P3 etc. all the rest of the data structure is the exact same
<shevy>
.inject confuses me a lot
<ElderFain>
shevy: well it seemed ideal except for the nested natured was screwing me over
<robacarp>
ElderFain: you want to add up those numbers or something?
<ElderFain>
robacarp: yep
<robacarp>
yea, inject
<ElderFain>
robacarp: there are 3 hashes in the array, each hash has hte exact same data structure, just different values on the very inside
<ElderFain>
so its not really a 'merge' because there is nothing to merge. structures are the same
<ElderFain>
its just an addition
sizz has joined #ruby
<robacarp>
ElderFain: well, this is off the top of my head, but given that ary = your array...
kurko_ has joined #ruby
<kjellski>
whats the most idiomatic way to check for some condition to be met on all things in a list? is there something like an all method?
<shevy>
lol
<ElderFain>
kjellski: .all?
<shevy>
that's a huge ass gist man
<shevy>
1272 lines!
<ElderFain>
shevy: its just a lot of data repeating itself in a single array. hah
<robacarp>
I have a meeting to go to but I can write the full inject for you later if you want
<robacarp>
send me a pm
<ElderFain>
wouuld leave you with {"9/8/2011" => { "P1"=>19, "P2" =>152… }
<ElderFain>
kjellski: you supply something is how i use it.. like .all?(5) (are all the values 5)
<ElderFain>
kjellski: but just using .all? works too
<ElderFain>
%w{5 5 5 5}.all?
<ElderFain>
true
<slash_nick>
ElderFain, But all your keys are different... "9/8/2011", "9/9/2011"... did you intend to repeat "9/8/2011" in that example?
<kjellski>
%w(5 nil).all?
<slash_nick>
ElderFain: again, sorry... Had to go down a few hundred lines on the Gist lol
<ElderFain>
slash_nick: so in the data series it works like this. Array is the top level. inside the array are 3 giant hashes. those hashes all have the *Exact* same dates
<kjellski>
:/ should get my own bot ^^
<kjellski>
%w{5 nil}.all?
<ElderFain>
slash_nick: so in the array, there are 3 hashes, which means three instances of 9/8/2011
<ElderFain>
and inside 9/8/2011 there will be p1 p2 p3 p4 p5 p6 and the values of all 9/8/2011 need to be added together to form 1 single value
yfeldblum has joined #ruby
<ElderFain>
basically its a giant hash add
<ElderFain>
not a merge, since we don't have unique keys
<slash_nick>
ElderFain: I find myself wanting to do that with to_a and some matrix math...
<ElderFain>
kjellski: "all? will ret urn true only if none of the collection members are false or nil"
<Deele>
when I do like string.each do ...each1... end.lenght.each do ...each2... end I understand, each1 will iterate over every string char, but what will lenght do? will it "receive" string in input? what will each2 receive in input?
<slash_nick>
ElderFain: all will return nil if you send it an empty though...
<ElderFain>
kjellski: in your example, %w{5 nil} is making a string with the value "nil"
<ElderFain>
which is why it still returns true
<slash_nick>
ElderFain: all? will return nil if you send it an empty
pabloh has joined #ruby
<kjellski>
ElderFain, I've used this for my hash like this h.all? {|k,v| v == "" }
<ElderFain>
im just quoting the docs
<ElderFain>
robacarp: gonna give it a whirl
<ElderFain>
robacarp: oh, haha you cheated, you've already got access to the inner hash
<ElderFain>
doesn't return the value properly however
startling has joined #ruby
<startling>
is there a way to use irb to load a file and then put you into the repl?
alex__c2022 has joined #ruby
<oooPaul>
startling, like in your .irbrc?
nowthatsamatt has joined #ruby
<startling>
I was thinking a command-line flag
tvo has joined #ruby
tvo has joined #ruby
<ElderFain>
robacarp: y being that entire array in the gist
<oooPaul>
-r will require a library before dumping you in.
Maarius has joined #ruby
<startling>
oooPaul: how about a script in the current working directory?
<Maarius>
Hey, can anyone tell me how I can get Ruby to send a specified string as a Cookie _without_ altering (e.g. escaping) it?
Maarius has joined #ruby
ddbot has joined #ruby
<oooPaul>
startling, probably. Try it. "irb foo.rb" See what happens.
<oooPaul>
Maarius, Ruby, or Rails? Ruby doesn't do anything with cookies, AFAIK.
wedgeV has joined #ruby
Seisatsu has joined #ruby
cooldude86 has joined #ruby
<startling>
oooPaul: it just runs the whole script and exits.
Vaerros has joined #ruby
<Maarius>
oooPaul: Well I thought it is ruby but it also might be rails
Vaerros has quit [#ruby]
<oooPaul>
startling, probably not, then.
havenn has joined #ruby
<oooPaul>
Maarius, What's the context?
<startling>
oooPaul: weird, I've never met a repl that doesn't do that.
<oooPaul>
Try just requiring the file.
<oooPaul>
irb -rfoo
<oooPaul>
Requiring a file is basically the same as loading it and running it.
<Maarius>
oooPaul: Well, I use net/http to make a post request to an API. The API then returns an AUTH cookie. I am able to read and store the value and send it with every request that I make. The issue is however, that ruby/rails always alters the value of the AUTH cookie, therefore rendering it useless. I can't really find a way to submit the exact AUTH string as there seems to be a build in escape function.
<oooPaul>
And I'd hope you wouldn't be doing doing this that often anyway. :)
<oooPaul>
Maarius, so the problem is the cookie you get back, when you send it back up, is not correct?
<Maarius>
oooPaul: exactly
<oooPaul>
What's your Cookie: header line look like?
<Maarius>
You mean when I send it with the request?
<Maarius>
This is when I stored the cookie value in the session. However the same issue occurs when I just use plaintext instead of 'session[:AUTH]'
<oooPaul>
Check the format of the HTTP Cookie header, and what you're getting back from session[:AUTH]
<oooPaul>
The value of the Set-cookie header is NOT the same format as what's used in the Cookie: header.
<Maarius>
I can show you the difference, just a second
<oooPaul>
My guess is you're trying to just regurgitate the raw Set-cookie header and the app is choking because the Cookie: header isn't in a format it expects.
<oooPaul>
What is the value of session[:AUTH]? Is it JUST the value of the cookie named "AUTH"? If so, your Cookie header should be "AUTH=#{session[:AUTH]}"
<Maarius>
I get what you mean, but this is not the issue. See, correct value of the AUTH cookie is ZoXTxppW08eZW9WUl1iikmpcpJJqWNfCZ4erkZVcpZE%3D, this value is also stored in session[:AUTH]. However, when the cookie is send, this value is modified to ZoXTxppW08eZW9WUl1iikmpcpJJqWNfCZ4erkZVcpZE%253D. The problem is the % and the 25 afterwords.
<Maarius>
*the
virtuoussin13 has joined #ruby
sinuc has joined #ruby
sinuc has joined #ruby
<oooPaul>
That's fine. When you send the cookie, though, are you putting AUTH= in front of the value?
<oooPaul>
The other option, if you think that's really the only problem, is to unescape the cookie in the first place
<Maarius>
Nope
<virtuoussin13>
Can someone tell me why this code isn't doing what I want? http://pastebin.com/t6htdNqt If the answer is "that's a bug" then I suppose there's nothing I can do, but I'd like to know why it's not working
<oooPaul>
That's probably half the problem.
<Maarius>
How can I unescape it? Because as long as it is stored in session[:AUTH] is has the correct value
<oooPaul>
Maarius, the other thing is to unescape the cookie value when you process the header in the first place. %3D is already escaped, so unescape it, and then when you send the cookie and it gets escaped, it'll end up the same.
<oooPaul>
No, %3D is an escaped character.
pu22l3r has joined #ruby
josx has joined #ruby
Skaag has joined #ruby
dmn001 has joined #ruby
<virtuoussin13>
every single one of those calls to call fails with a LocalJumpError
<Maarius>
oooPaul: Just to clarify, you mean I should store the unescaped version in the session?
<oooPaul>
virtuoussin13, don't use lambda.
tomaw has joined #ruby
<virtuoussin13>
Proc.new doesn't work either...
<oooPaul>
Just pass a block to .send()... A.send(:define_method, :foo) do | a, b, c |; yield(a, b, c); end
pu22l3r has joined #ruby
<oooPaul>
define_method takes a block for the definition.
<oooPaul>
Plus it'll be a lot clearer.
wyhaines has joined #ruby
shevy has joined #ruby
<oooPaul>
Maarius, I'm saying that you're getting back a cookie with a %3D on the end, because it was escaped for HTTP transport. You can unescape the cookie, turning %3D back into a character (\n, I think), and then when you pass the cookie out again, the Net::HTTP stuff will escape it back to %3D and everyone should be happy.