<zzak>
drbrain: '@agent.agent.http.reuse_ssl_sessions = false' did it, thanks!
<injekt>
oh.. must be a rake thing
<zenspider>
try `ruby -Ilib test/test_blah.rb --seed 42` first
<zzak>
drbrain: will you ping #13 when youve resolved the issue?
<injekt>
zenspider: yup that works fine, must be a rake issue. Thanks
<zenspider>
I haven't looked at rake's test task in a really long time
<injekt>
zenspider: I read that rake steals TESTOPTS and throws it at minitest, that was all
<drbrain>
zzak: I'll push a commit with the issue number, but I don't know if that causes a notification
<zenspider>
sure looks like it: ruby "#{ruby_opts_string} #{run_code} #{file_list_string} #{option_list}"
<zenspider>
option_list => ENV["TESTOPTS"] ...
<injekt>
zenspider: odd
<zzak>
drbrain: thanks
<injekt>
zenspider: yup, doesn't work here, strange
<zenspider>
injekt: is it doing -e requires or -Ilib + rake_loader ?
<zenspider>
try setting loader to :direct if it isn't -e requires
<injekt>
zenspider: -I lib and manual requires, Dir['test/*_test.rb'] and require
<zenspider>
well shit
<injekt>
ahh
<injekt>
well duh
* injekt
slaps himself
<zenspider>
?
<injekt>
that code you have is for the rake test task?
<zenspider>
I'm looking at testtask.rb yeah
<injekt>
which I dont use, I assume rake doesn't even look at TESTOPTS with the method I'm using
<injekt>
yeah
<injekt>
my fault
mkovacs [mkovacs!~mkovacs@216.38.150.34] has joined #ruby-lang
<zenspider>
hee
<zenspider>
so if you rolled your own, just throw in ENV['TESTOPTS'] into your sh string
<injekt>
word
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
havenn [havenn!~skipper@rrcs-76-79-113-21.west.biz.rr.com] has joined #ruby-lang
<Guest42318>
i'm trying to write text for a text file format converter ... i could just test the input file vs. a expected output file, correct?
mksm [mksm!~ramorim@pdpc/supporter/professional/mksm] has joined #ruby-lang
<mksm>
*write tests
<drbrain>
mksm: yup
<zenspider>
abstract out the conversion from the file writing and test the conversion directly
<mksm>
drbrain: a colleague says I should test the method that converts each line, not just input/output. I feel like testing every detail of the internal code is turning a small simples project into something way larger
<drbrain>
mksm: if it's a complex format, line by line is better
<mksm>
it seems that i need both then ... test the conversion and the other methods for header/footer and then the input vs. output file.
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
<drbrain>
most likely
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
<mksm>
testing is too much work <.<
<injekt>
rarely
<drbrain>
mksm: testing has saved me uncountable hours of time
<injekt>
time you dont appreciate unless you forgot to test something
<injekt>
but.. it's there
<drbrain>
it's best when you add some new feature and you find out that it broke something that you never would have remembered
<zenspider>
mksm: I'm working on something very similar right now... and testing saves my ass EVERY. Single. Day.
<injekt>
regression testing <3
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
<zenspider>
I was just able to isolate a bug, corner it into a test, and then work out the solution. boom done.
<mksm>
tests are essential but they are a lot of work
<mksm>
or i'm not doing it right
<shevy>
yeah you need discipline
<shevy>
hippie coders don't test
<zenspider>
they're not much more work than you're already doing, and they permanently prevent regressions... so they make up for the time spent
<zenspider>
shevy: haha
<zenspider>
I like that term
<mksm>
shevy: duuuuude, make code not test
<mksm>
but yeah, they save our asses/weekends
<injekt>
hippie coders
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
<mksm>
what's that thing that shows test coverage?
<drbrain>
simplecov
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
<mksm>
thanks
wyhaines [wyhaines!~wyhaines@64.134.162.13] has joined #ruby-lang
<zzak>
drbrain: nvm that didn't fix it, still getting 'certificate verify failed'
<zzak>
Net::HTTP::Persistent::Error: too many connection resets (due to SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed - OpenSSL::SSL::SSLError) after 0 requests on 23186980, last used 1327019940.1339812 seconds ago
<drbrain>
zzak: hrm
<zzak>
could it be the server i'm requesting?
<drbrain>
it could be
<zzak>
i have no idea what their using
<drbrain>
without vcr, can you connect?
<drbrain>
maybe you don't have the right certificate?
lightcap [lightcap!~lightcap@97-115-90-91.ptld.qwest.net] has joined #ruby-lang
<zzak>
same issue
<zzak>
even without vcr
<zzak>
i've installed ca-certificates for ubuntu
<wwalker>
zzak: i hate to be ovious, but your earlier gist had http not https....
<zzak>
right, this _is_ http
<wwalker>
oh, quite strange that
<zzak>
hm so it appears to be an issue on the server i'm requesting
<zzak>
i'm getting a 302 to an https login page now
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
slyphon [slyphon!~weechat@unaffiliated/slyphon] has joined #ruby-lang
<zzak>
son of a..
<zenspider>
abe?
<erikh>
abe froman, the sausage king of chicago
_inc [_inc!~inc@unaffiliated/-inc/x-0498339] has joined #ruby-lang
<zzak>
two things i hate in life: encodings and crypto
<zzak>
oh, and regex
<zzak>
three things
<drbrain>
and counting?
<zzak>
four things
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
<zenspider>
five anybody? do I hear five?
<zzak>
and spiders
replore [replore!~replore@203.152.213.161.static.zoot.jp] has joined #ruby-lang
<andrewvos>
YES spiders
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby-lang
<cconstantine>
I have a class instance, and the name of a method as a string/symbol. How would I wrap calls to methods of that name on instances of the class?
<cconstantine>
class.alias_method and class.define_mathod ?
oddmunds [oddmunds!~oddmunds@s21-04214.dsl.no.powertech.net] has joined #ruby-lang
<injekt>
cconstantine: 'wrap calls to methods of that name on instances of that class' confuses the hell out of me
RomyRomy_ [RomyRomy_!~stickycak@cpe-74-64-122-182.nyc.res.rr.com] has joined #ruby-lang
drdr [drdr!d059b08f@gateway/web/freenode/ip.208.89.176.143] has joined #ruby-lang
<injekt>
you want to execute existing methods with this name, or build new ones?
<cconstantine>
I want to replace an instance method on the class with another method that can call the old version
<injekt>
oh, yeah define_method and alias_method
<zenspider>
yes, alias it to the side and replace the method with a new one
<injekt>
^
<zenspider>
I wonder if muff daddy is still around... did I gem that?
<injekt>
muff..daddy..?
<zenspider>
the ultimate wrapper!
jaisoares [jaisoares!~jsoares@bl13-197-21.dsl.telepac.pt] has quit [#ruby-lang]
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
<cconstantine>
injekt: I don't want to have to call foo.class.send… for every new object
<injekt>
cconstantine: then build a helper method, you're calling private methods on a class
<injekt>
drbrain: oh snap
mantono [mantono!~mantono@c83-251-126-234.bredband.comhem.se] has joined #ruby-lang
<cconstantine>
injekt: it'll be provided by a extend class
<injekt>
then what's the problem?
<cconstantine>
it's not working
<injekt>
cconstantine: you might want to show some code then
<cconstantine>
it's for protecting methods, so I want to be able to say "permission :method name, :some_permission" in a class
<cconstantine>
and before :method is called on an instance some code verifies that you have :some_permission
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
<injekt>
ahhhh
<injekt>
you know you could use a delegator and permissions hash of some sort
<cconstantine>
so it looks like, because I'm defining the permission at the top of the class no other methods are defined so the alias_method is failing
<injekt>
not sure I'd redefine a new method for every single method just to test that
<savage->
here's an example of redefining methods to do an ActiveRecord before_filter type thingy: https://gist.github.com/1283413
<injekt>
right
<savage->
right
<injekt>
tehe method_added
<savage->
I agree, redefining all the methods might be a little overkill.
<savage->
ignore method_added though
<injekt>
not often you see that
<savage->
that's being too clever
<cconstantine>
sure
<savage->
but the basic idea of redefining methods is shown there.
<drbrain>
injekt: oh, I guess this is not the right video
<injekt>
drbrain: I wasn't allowed to watch it anyway
<injekt>
plus I'm on a dial up connection right now
<drbrain>
heh
<cconstantine>
python and stewart… might be wrong but it's still right
<cconstantine>
ew
<cconstantine>
savage-: that's almost exactly what I wanted. thanks :)
<savage->
cconstantine: np
<injekt>
:)
<injekt>
savage-: how's the job/
<injekt>
?*
<savage->
injekt: love it!! :)
<savage->
injekt: let me know if you want to move to SF :)
<injekt>
I have some stuff on the table right now, but depending on how that goes, I may be eventually looking. Already have my eye on a couple of SF based companies
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
<savage->
injekt: cool!
<savage->
let me know if you'd like to chat, we're doing some really stuff here with ruby/rails/eventmachine/async-sinatra/etc.
<savage->
^cool stuff
<injekt>
well, new product is going out in 3 weeks, so I'll know within a few more how successful things are looking :)
<zenspider>
heh
<savage->
cool !
<savage->
we are having a tough time finding qualified people.
<injekt>
'qualified' what does that mean? ;P
<savage->
almost everyone that I've interviewed iterates in ruby with: for x in y
<savage->
:-(
<injekt>
hah
<injekt>
I almost joined an SF company just before christmas but changed my mind at the last minute, heh. Still thinking about it, though
<injekt>
I kinda liked van, though
<savage->
well, the weather is a lot better over here than in Canada :)
codewrangler [codewrangler!~codewrang@pool-108-28-240-83.washdc.fios.verizon.net] has joined #ruby-lang
<injekt>
yeah, even better than the uk (where I am now)
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
<savage->
injekt: I thought you were in Canada?
<injekt>
savage-: I came back early dec for xmas
<injekt>
(I like here)
<injekt>
live*
<savage->
ohhh
<savage->
I thought you were living in Canada permanently.
<erikh>
working here, rvm gcc-4.2 build of 1.9.2-p290
<erikh>
xcode 4.1 if that helps any
<erikh>
built it earlier today
<deryl>
yeah 4.1 works fine. its 4.2 thats flakey
<savage->
interesting
<savage->
well at least it crashes for some other folks.
<erikh>
blame the compiler
<drbrain>
llvm-gcc is flaky
<deryl>
the osx-gcc-installer works too, but if you are going to need Node.js then you need the regular full xcode due to the headers.
<robgleeson>
i didnt build with llvm-gcc
<deryl>
forget if its Carbon or Cocoa headers that are needed
<erikh>
X11 headers.
<erikh>
probably carbon
<savage->
how do I find out which version of xcode I have?
<robgleeson>
just run 'xcode'
<savage->
I'm running version 4.1 build 4B110
yxhuvud [yxhuvud!mongo@h-85-82.a212.priv.bahnhof.se] has joined #ruby-lang
<erikh>
how'd you build ruby?
<savage->
just grabbed it using rvm.
<erikh>
before or after late december?
<deryl>
yeah we include the URL for the 4.1 dmg in the requirements
<erikh>
because.. I had this exact argument with mr. papis, who argued back, until phusion said something about it.
<deryl>
hrmm well we did
<erikh>
about gcc-4.2
<deryl>
i see michal changed hat out
<deryl>
s/hat/that/
<savage->
erikh: definitely before december.
<erikh>
:)
<erikh>
totally have nothing else to add right now
* erikh
does a dance
<deryl>
erikh: if you had 4.1 already installed and upgraded to 4.2 it works fine because rvm checks for gcc-4.2 binary. 4.2 leaves it in place on an upgrade, but an initial install of 4.2 will not put it in place
<erikh>
no, that is not what was happening
<erikh>
it's why REE was failing to build, period
<deryl>
something different then?
<erikh>
he was using /usr/bin/gcc
<deryl>
ahhh
<erikh>
which is not gcc on anything xcode 4.x
<muzone>
lol
<deryl>
yeah thats the llvm version
<muzone>
nice dance erikh
<theconartist>
it runs fine for me in a script, not in irb
<deryl>
erikh: actually it is.
<deryl>
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
<deryl>
the version string for gcc-4.2 is i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
<erikh>
I'm already a white guy, I don't need an instruction manual
<muzone>
:P
<deryl>
the point was that gcc-4.2 binary is what is being looked for with rvm, and if thats not found then iirc, michal has it defaulting to --with-gcc=clang iirc
<deryl>
been awhile
<deryl>
hahah
<deryl>
erikh: i thought that was just you playing with the bleach ;)
<erikh>
ok!
<erikh>
I am going to ... go stack b.b.'s underwater or something
<erikh>
bbl
<deryl>
time for me to hit the rack. 0136
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host250-13-dynamic.54-79-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
fullsailor [fullsailor!~fullsailo@ip24-250-174-76.ga.at.cox.net] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
<heftig>
lianj: parallel assignment seems to be fast on rbx
<heftig>
it seems to skip the array creation
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
flowerpot [flowerpot!~flower@ec2-50-112-22-115.us-west-2.compute.amazonaws.com] has joined #ruby-lang
<lianj>
heftig: oh, nice!
<heftig>
just experimenting, rbx compile -Be 'c, d = :c, :d'
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
Locke23rus [Locke23rus!~quassel@188.162.162.191] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
thone [thone!~thone@g226033030.adsl.alicedsl.de] has joined #ruby-lang
JohnBat26 [JohnBat26!~Eugene@89.175.77.79] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
fritzek [fritzek!~fritzek@p5DDB5AF5.dip.t-dialin.net] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
fritzek [fritzek!~fritzek@p5DDB5AF5.dip.t-dialin.net] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
<havenn>
join #pry
<havenn>
sry
jredville [jredville!~james.dev@c-66-235-23-17.sea.wa.customer.broadstripe.net] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-121-218-185-93.lnse4.cht.bigpond.net.au] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@2001:268:306:3:226:8ff:fedd:31a3] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-10-236.dyn.iinet.net.au] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby-lang
gaveen_ [gaveen_!~gaveen@unaffiliated/gaveen] has joined #ruby-lang
cyri_ [cyri_!~cyri_@149.93.119.80.rev.sfr.net] has joined #ruby-lang
tokumine [tokumine!~kunio@82-69-174-54.dsl.in-addr.zen.co.uk] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@124-170-10-236.dyn.iinet.net.au] has joined #ruby-lang
<rob___>
so by extending itself it adds it's own methods to the module object?
setmeaway2 [setmeaway2!~setmeaway@118.45.149.247] has joined #ruby-lang
<lianj>
it adds his instance methods to its class obj
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dave_miles_cf [dave_miles_cf!~davemiles@gatej.mh.bbc.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
dave_miles_cf [dave_miles_cf!~davemiles@gatej.mh.bbc.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<rue>
rob___: If you want to call a method like Foo.test, it's the same as anyobject.test. The object, in this case Foo, must respond to the method
<rue>
Any of the above ways work
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
publicvoid_ [publicvoid_!~publicvoi@p5DC15226.dip.t-dialin.net] has joined #ruby-lang
soze [soze!29df91eb@gateway/web/freenode/ip.41.223.145.235] has joined #ruby-lang
<soze>
hi
<soze>
pls i need some help with Ruby.. a newbie here
<tobiasvl>
soze: ok?
<tobiasvl>
just ask your questiom
<tobiasvl>
n
<tobiasvl>
i'm sure someone can help :)
niklasb [niklasb!~codeslay0@p5B31098C.dip0.t-ipconnect.de] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@194.209.75.58] has joined #ruby-lang
<soze>
thank you @tobiasvl
<soze>
ActiveRecord::JDBCError: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.: SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [tbl_traces].trace_id) AS _row_num, [tbl_traces].* FROM [tbl_traces] WHERE [tbl_traces].[] = N'22') AS t WHERE t._row_num BE
<soze>
I have that error when I try to run this
<soze>
@tbl_trace = TblTrace.find(params[:id])
<soze>
notice the ......... WHERE [tbl_traces].[] = N'22')
<soze>
no column was supplied in d query
empity [empity!~user@149.255.121.162] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
mark_locklear [mark_locklear!~jlocklear@ab-tech-lan-to-ab-tech-gw.ncren.net] has joined #ruby-lang
<judofyr>
soze: that's very weird
<judofyr>
what is params[:id] ?
<judofyr>
(what value does it has)
<apeiros_>
icanhazvalue!
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
* apeiros_
feel elpful
<judofyr>
apieros: always
<soze>
my primary key is tracer_id not id
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<kke>
how come String#concat isn't concat!
<soze>
@judofyr
<soze>
my primary key is tracer_id and not id
<tobiasvl>
kke: it's not?
<soze>
I tried to change that to tracer_id but it says "Couldn't find TblTrace without an ID"
<kke>
i would think it would be s.concat!("poo") if it overwrites
<apeiros_>
judofry, who's it going?
<tobiasvl>
kke: isn't that concatenation?
<judofyr>
ah, but ! doesn't mean "overwrite"
<judofyr>
! means "more dangerous than without !"
<apeiros_>
actually it just means "dangerous"
<kke>
just like str.upcase! modifies the original and str.upcase returns the modified version
<judofyr>
I disagree
<apeiros_>
kke: there ain't push & push!, unshift & unshift! etc. either
<judofyr>
you pretty much never see a bang-method without a equivalent non-bang-method
<kke>
correct
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-ffhmlzduwxqdftog] has joined #ruby-lang
<Spooner>
I'd expect: s="foo"; s.concat!("poo"); s => "foopoo"; s.concat("poo") => "foopoopoo"; s => "foopoo"
<Spooner>
But since we have + and += anyway, seems moot.
<soze>
judofyr: pls help
<apeiros_>
judofyr: while that's true, we have what matz said, and afair that was simply and only "dangerous", not "more dangerous than"
<soze>
is there something I need to do to tell ruby that my primary key is tracer_id and not id?
<rue>
soze: Drop and roll!
<soze>
sry, I dont understand what that means (newbie)
<rue>
soze: In AR, you can .set_primary_key or somesuch
<kke>
soze: that's something you should ask in #rubyonrails
soze_ [soze_!29df91eb@gateway/web/freenode/ip.41.223.145.235] has joined #ruby-lang
<kke>
but if you google "rails legacy database", you'll find how it's done
<soze_>
sry I lost conection
<soze_>
I didnt see ur previous posts
<kke>
soze: that's something you should ask in #rubyonrails, but if you google "rails legacy database", you'll find how it's done (set_primary_key :poop maybe)
<tobiasvl>
*snicker*
<kke>
snickerpoop
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
<soze_>
kke: thanks
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
ricardovaleriano [ricardovaleriano!~ricardova@186.220.217.229] has joined #ruby-lang
<andrewvos>
I want to run a bit of code for 30 mins, then another bit of code for 4 hours. Any thoughts how I can make this happen in a stable manner
<andrewvos>
?
<andrewvos>
Same script though
joast [joast!~rick@76.178.187.164] has joined #ruby-lang
rippa [rippa!~rippa@87-253-30-9.pppoe.yaroslavl.ru] has joined #ruby-lang
<rue>
Depends largely on the characteristics of the code
<andrewvos>
rue: Which characteristics?
<rue>
You can time it out in many ways
<rue>
Primarily whether the code has a natural run-pause rhythm. If it's a busy loop, then you'll need to just kill it off
<andrewvos>
rue: I want it to run for ten hours in total. For the first thirty minutes it will request and record the response from a set of urls. Then I fake a downed API. Then I run it for a few hours again and record all responses. (This is to tested caching obviously)
<andrewvos>
s/tested/test
<rue>
At its simplest, you could use Timeout
<andrewvos>
rue: the method?
<rue>
Is it the same code and you're just changing what happens when it runs?
<andrewvos>
Oh ok I see
<andrewvos>
Yeah
<andrewvos>
So timeout would work in this situation
tekin [tekin!~tekin@88-96-65-166.dsl.zen.co.uk] has joined #ruby-lang
mztriz [mztriz!~mztriz@nkugateway.nku.edu] has joined #ruby-lang
<mztriz>
Is there a directory listing script for a website in Ruby...similar to this? http://greg-j.com/phpdl/
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
<Tasser>
mztriz, you should have one in 10 minutes ;-)
<Tasser>
mztriz, cross-posting is evil btw
<mztriz>
Tasser, lol sorry
Defusal [Defusal!~DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
outoftime [outoftime!~mat@ool-ad03cbeb.dyn.optonline.net] has joined #ruby-lang
indstry [indstry!~apple@c-71-238-98-243.hsd1.mi.comcast.net] has joined #ruby-lang
Defusal [Defusal!DeFi@dsl-240-243-100.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-145.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
<rob___>
hi, if i create an include like this: http://pastie.org/3219193 for sinatra and then try and run Rob::SubRob.test i get 'NameError: uninitialized constant Rob', can anyone tell me what I'm doing wrong?
<rob___>
or if i've made some fundamental error
Asher [Asher!~asher@c-24-126-149-16.hsd1.ga.comcast.net] has joined #ruby-lang
<judofyr>
rob___: Rob isn't in the global namespace
<rob___>
judofyr: is it because i'm using two layers of modules?
<judofyr>
rob___: yes
<judofyr>
and because Sinatra::HTMLEscapeHelper.h and h are two completely different things
<rob___>
still confused :)
<judofyr>
rob___: the important thing you must know: self
<judofyr>
self decides what methods and instance variables you can access
<judofyr>
someobject.somemethod runs the `somemethod` with someobject as self
<judofyr>
so `Sinatra::HTMLEscapeHelper.h` means that the h-method is called with Sinatra::HTMLEscapeHelper as self
<judofyr>
same with Sinatra::Rob::SubRob.test
<judofyr>
so that means that inside the test-method, it doesn't know that it has been called from a Sinatra request
<judofyr>
because self == Sinatra::Rob::SubRob
<rob___>
ah i see
<judofyr>
running "halt" inside there will lookup halt within Sinatra::Rob::SubRob
<judofyr>
and there is no Sinatra::Rob::SubRob.halt
<judofyr>
also note that `halt` is the same as `self.halt`
<rob___>
and this is because using 'helpers Rob' to register my module doesn't understand sub modules?
<judofyr>
if you had this: module Sinatra::Rob; def test; … end; end
<judofyr>
then you could call `test` from within your app
<rob___>
the reason i wanted that extra layer of modules is because if i load two of my modules then the method names will clash..
<rob___>
i want to be able to seperate the namespaces
<judofyr>
rob___: why do you want them as helpers?
<rob___>
so i can use them from my routes
<judofyr>
helpers are there explicitly for creating methods you can use directly in your routes
<judofyr>
isn't it really needed?
<rob___>
maybe my application design is wrong then
<judofyr>
if so: rename the helpers do they don't clash
<rob___>
ok, is that the solution? i thought having submodules and accessing them through their sub-module names would be neater..
<judofyr>
first of all: it's not equivalent
<rob___>
because of self?
<judofyr>
doing "Mod.meth" is completely different from "meth"
<judofyr>
yes
<rob___>
ok, then i suppose i dont really understand modules properly
<rob___>
this is the first time i've tried to use them
<judofyr>
the only reason you can actually call "Mod.meth" is because you used the "extend self" trick
<apeiros_>
extend self--
<apeiros_>
use module_function
<apeiros_>
(which is what things like the Math module use too, just as an example)
<rob___>
oh
uniqanomaly [uniqanomaly!~ua@dynamic-87-105-215-27.ssp.dialog.net.pl] has joined #ruby-lang
<rob___>
i'll look up method_function
<rob___>
but is what i'm trying to do fundamentally A Bad Thing?
<judofyr>
rob___: your app shouldn't have helpers which clashes
tekin [tekin!~tekin@88-96-65-166.dsl.zen.co.uk] has joined #ruby-lang
<apeiros_>
rob___: module_function, not method_function
<judofyr>
rob___: if you want to use other classes/modules in your routes, you don't need to register them as helpers
<judofyr>
just use them
<rob___>
even if they include 'halt'?
<judofyr>
nope. you can only use halt in a helper or your routes
<rob___>
ok so that's why i was trying to make an extension
<judofyr>
just try to write classes which don't need halt inside them :)
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
elux [elux!~peter@96.45.198.150] has joined #ruby-lang
<rob___>
judofyr: :)
<judofyr>
rob___: it's kinda hard to know without seeing the real code, but it seems to me that you're making the helpers do too much
<rob___>
judofyr: im not sure where else to put my code?
<rob___>
i thought the helpers where simply where you defined all your methods to do all the work
Sailias [Sailias!~jonathan@206-248-172-164.dsl.teksavvy.com] has joined #ruby-lang
<judofyr>
no, no, no. helpers are there for simple stuff that's used in several routes
<judofyr>
so you don't need to copy-paste code around
<judofyr>
rob___: to give an example: when you click the "Follow" button on Twitter, they don't have a follow_user_helper. instead they have a User class (representing a user) that has a follow-method
<judofyr>
rob___: so their route look something like: current_user.follow(User.find(params))
<judofyr>
sorry
<rob___>
i didnt see any point in putting these methods in a class since they have no state
<judofyr>
well, they must be working on *something*. what do they take as argument?
<rob___>
basically this app is an interface between an api on another web server and a php page
ap3mantus [ap3mantus!~ap3mantus@c-98-217-179-108.hsd1.ma.comcast.net] has joined #ruby-lang
<judofyr>
so, what kind of helpers do you have?
<judofyr>
e.g. what do they do; what's the name; what are the parameters?
<rob___>
so an example:
ricardovaleriano [ricardovaleriano!~ricardova@201-27-125-84.dsl.telesp.net.br] has joined #ruby-lang
<rob___>
one helper takes in params['name'], adds something to it and then calls this other webserver with the new parameter
zmack_ [zmack_!~zmack@78.97.143.6] has joined #ruby-lang
MistyM [MistyM!~mistym@50.museumforhumanrights.com] has joined #ruby-lang
<judofyr>
I would have a class called WebService (or, the name of the web-service/server). with something like this: def initialize(options = {}) @url = options[:url] end
<judofyr>
and then maybe a low-level: def call(url) end
jxie [jxie!~jxie@115.197.87.147] has joined #ruby-lang
<rob___>
what's the point in creating a class for it when it has no state?
<judofyr>
and one for your specific example: def do_something(name) call(name + "foobar") end
<judofyr>
rob___: what's the other solution?
<rob___>
because it is better to keep code in classes than modules or helpers?
<judofyr>
this class can be used outside of Sinatra too
<rob___>
i dont know :)
<judofyr>
the other solution is usually to do things like this: class WebService; def self.do_something() … end end
<judofyr>
so you do WebService.do_something instead of creating a new WebService and calling methods on that object
<judofyr>
brb
<rob___>
ah yes
<rob___>
that is sort of what im looking for
<rob___>
but then why not just do module WebController; module_function; def do_something; "blah"; end; end ?
<rob___>
i can't get over this idea that modules should be used if your group of methods are related but have no state
<judofyr>
rob___: well, this is less flexible. because now you can only have one web service.
<judofyr>
what if you want to use the same code across several sites?
<rob___>
hmm, ok
<rob___>
ok, thanks for explaining this to me
<rob___>
in my app i'd set API_KEY as a global constant
<rob___>
if i change my module to a class then i can store that key when i initialize it
ricardovaleriano [ricardovaleriano!~ricardova@201-27-125-84.dsl.telesp.net.br] has joined #ruby-lang
<judofyr>
it's called a "singleton" when you can only use a single object
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
<rob___>
then i can get over this OCD DONT USE A CLASS IF IT HAS NO STATE problem that for some reason i'm having :)
<judofyr>
rob___: it does have state in some sense; just not changing state
<rob___>
aye
<judofyr>
rob___: you can also do: class WebService; end; WS = WebService.new("api_key")
<judofyr>
and then you get the same functionality as if you've used a singleton
<judofyr>
it's harder to do it the other way
<judofyr>
rob___: ever played with ActiveRecord? (or heard of it)?
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
<rob___>
heard of it but not used it
<rob___>
doesnt rails use it?
<judofyr>
yeah
<rob___>
i've never used rails
<judofyr>
there you do: ActiveRecord::Base.establish_connection(…)
<judofyr>
to connect to a DB
Markuss [Markuss!Markuss@79.115.148.217] has joined #ruby-lang
<judofyr>
and then magically everything uses that connection
Markuss [Markuss!Markuss@79.115.148.217] has quit [#ruby-lang]
<judofyr>
which means that if I want to talk to two databases; well, I have no idea how to do that reliable without looking up the docs.
<rob___>
ok
<rob___>
hmm
<judofyr>
what I'm trying to say: singletons may look simpler, but when you first use them, you're kinda stuck
<rob___>
i should look up self/singletons and how calling module methods and things work
<rob___>
tell you what though, it's hard finding places where this sort of stuff is explained and makes sense
<rob___>
so thanks for your help :)
<judofyr>
rob___: try to think that "one class should solve one problem"
<judofyr>
e.g. one class to talk to a web service
<judofyr>
one class to represent a user
<rob___>
hey brb 1 sec
bludimnd [bludimnd!~amichai@178-83-34-252.dynamic.hispeed.ch] has joined #ruby-lang
<judofyr>
rob___: e.g. it explains it very briefly
<judofyr>
rob___: that just explains objects though
<judofyr>
rob___: I've got to go now
<judofyr>
catch me later (or mail me at judofyr@gmail.com)
<judofyr>
if the tutorial makes sense, I might finish it; if it's not for you, well, we'll figure something out
jMCg [jMCg!~hiro@apache/committer/igalic] has joined #ruby-lang
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
imperator [imperator!~djberg96@184-96-109-96.hlrn.qwest.net] has joined #ruby-lang
<imperator>
good morning
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
ap3mantus [ap3mantus!~ap3mantus@c-98-217-187-172.hsd1.ma.comcast.net] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
Austin__ [Austin__!~austin@96.45.197.22] has joined #ruby-lang
micha-- [micha--!~mbelow@i59F6D44D.versanet.de] has joined #ruby-lang
<rob___>
what a spiffing chap
dustin_ [dustin_!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
perryh_ [perryh_!~root@unaffiliated/perry753] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@bl13-197-21.dsl.telepac.pt] has quit [#ruby-lang]
kleech [kleech!~kleech@cpc18-mapp10-2-0-cust39.12-4.cable.virginmedia.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
n0rest [n0rest!58a62175@gateway/web/freenode/ip.88.166.33.117] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
paul0 [paul0!~user@189.114.198.57.dynamic.adsl.gvt.net.br] has joined #ruby-lang
<rue>
MORNNG
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<paul0>
moarning
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nofxx [nofxx!~nofxx@187.23.26.139] has joined #ruby-lang
<zzak>
moooooo
<n0rest>
has anything to do with pastie bot here ?? o.O
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<erikh>
HELLO
<rue>
n0rest: No, you have to WORK for your paste
<n0rest>
no, I mean, on the site, it explain that to get a pastie URL, you have to register to nickserve, then send a msg to "pastie"
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
<n0rest>
The pastie bot can be found on freenode in #rubyonrails or #ruby-lang. Obtaining a paste URL is easy. send a public message to pastie (e.g. "pastie: hi!")
mahlon [mahlon!mahlon@martini.nu] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0C406.dip0.t-ipconnect.de] has joined #ruby-lang
darkf_ [darkf_!~darkf_dix@adsl-68-88-97-41.dsl.wacotx.swbell.net] has joined #ruby-lang
darkf_ [darkf_!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
robotmay [robotmay!~robotmay@94.30.13.228] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ricardov_ [ricardov_!~ricardova@177.33.16.222] has joined #ruby-lang
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue>
Wait, where am I again?
Yu\2 [Yu\2!~Yu@ubi-1-50-54.zif.uni-bielefeld.de] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
perryh_ [perryh_!~root@mobile-111-90.near.uiuc.edu] has joined #ruby-lang
perryh_ [perryh_!~root@unaffiliated/perry753] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-uyufnalikskhqbnm] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-dldajprualtlzisp] has joined #ruby-lang
malev_ [malev_!~malev@190.210.138.237] has joined #ruby-lang
jMCg [jMCg!~hiro@apache/committer/igalic] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-awhbctxesupkxaur] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-kxnuctjhjftmgkal] has joined #ruby-lang
dkannan [dkannan!u480@gateway/web/irccloud.com/x-ciyhxqwqhnkvlylo] has joined #ruby-lang
<zzak>
guatemala
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-qcurwzmcqioyupsj] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
agib [agib!u781@gateway/web/irccloud.com/x-xfqireptxnznumbd] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-zamfmrjebbmcynag] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.122.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
hzlocky [hzlocky!~me@dynamic-vpdn-93-125-116-216.telecom.by] has joined #ruby-lang
dreinull [dreinull!~dreieins@217.18.70.225] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-iparzxantbnkpglz] has joined #ruby-lang
pvh [pvh!u717@gateway/web/irccloud.com/x-gqficydzaajrdlmi] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-burjhglsnklxaome] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-gkkvkcykmfpjlqpc] has joined #ruby-lang
savage- [savage-!~savage-@209.118.197.220] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
m1d4s [m1d4s!~m1d4s@77-255-12-89.adsl.inetia.pl] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-sskjdonfbauccqfe] has joined #ruby-lang
longtheta [longtheta!u4275@gateway/web/irccloud.com/x-qonstcvhocudrnhp] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
principino97 [principino97!~principin@host246-136-dynamic.36-79-r.retail.telecomitalia.it] has joined #ruby-lang
benanne [benanne!~rijdier@137.7-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
principino97 [principino97!~principin@host246-136-dynamic.36-79-r.retail.telecomitalia.it] has quit [#ruby-lang]
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-faqzlquurydggwhp] has joined #ruby-lang
Sailias [Sailias!~jonathan@206-248-172-164.dsl.teksavvy.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-fngiwjataryiknmv] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
dreinull [dreinull!dreieins@217.18.70.225] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
cldwalker [cldwalker!~cldwalker@64.134.66.135] has joined #ruby-lang
cldwalker_ [cldwalker_!u2984@gateway/web/irccloud.com/x-wyvxduasqcdglwzs] has joined #ruby-lang
taf2 [taf2!~enduser@66.153.72.177] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-47-145.washdc.btas.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
madona [madona!jkilaa@41.141.182.242] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<MistyM>
Loving the ri docs on #instance_variable_set.
<MistyM>
"Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class’s author to attempt to provide proper encapsulation."
madona [madona!jkilaa@41.141.182.242] has joined #ruby-lang
dustin_ [dustin_!~ddeyoung@99-7-24-156.lightspeed.iplsin.sbcglobal.net] has joined #ruby-lang
<rue>
Heh, I think that's from the last doc drive drbrain was running
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ilyam [ilyam!~ilyam@2620:65:0:281:f5ac:b0f0:39c1:e843] has joined #ruby-lang
InfiniteJest [InfiniteJest!~InfiniteJ@dynamic-adsl-78-12-91-46.clienti.tiscali.it] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
vamshionrails [vamshionrails!~Adium@216.172.20.16] has joined #ruby-lang
<vamshionrails>
hi
<vamshionrails>
anybody there
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<ged>
vamshionrails: Yes.
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<vamshionrails>
hi ged
<vamshionrails>
nice meeting you
RomyRomy [RomyRomy!~stickycak@cpe-74-64-122-182.nyc.res.rr.com] has joined #ruby-lang
<ged>
Likewise.
<rue>
You say that to everybody!
<vamshionrails>
I have a question are they gonna add sinatra to default framework?
<vamshionrails>
for ruby
cconstantine [cconstantine!~cconstant@173.247.200.5] has joined #ruby-lang
pigdude [pigdude!~tallen@li61-243.members.linode.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<pigdude>
is there anything like virtualenv's --no-site-packages option for rvm? i don't want my local to use system gems, etc
<rue>
vamshionrails: Default how, in the stdlib?
<rue>
pigdude: Gemsets?
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-djmbaglayhrphqia] has joined #ruby-lang
<vamshionrails>
not as gem
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<vamshionrails>
as sinatra is only 1500 lines of code
setmeaway [setmeaway!~setmeaway@118.45.149.247] has joined #ruby-lang
tenderlove [tenderlove!~tenderlov@pdpc/supporter/active/tenderlove] has joined #ruby-lang
<erikh>
unfortunately, rubygems is a lot more than package management
<erikh>
you're pretty much stuck using them
<pigdude>
rue, not quite
<vamshionrails>
sinatra uses most of the ruby code
<vamshionrails>
while programming compared to rails
<pigdude>
rue, i've been using gemsets ... but it's really weird because after i install rails 2.3.8, i see gem yaml (spec) errors coming out of AR 3.2, etc in the gemset directory
<pigdude>
stuff like:
<pigdude>
Invalid gemspec in [/Users/tomallen/.rvm/gems/ree-1.8.7-2011.12@gawa3/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x1033cb280> 3.2.0"]
agib [agib!u781@gateway/web/irccloud.com/x-hrzfdxvcjjqzzwne] has joined #ruby-lang
timbleck [timbleck!u3835@gateway/web/irccloud.com/x-fejkdgmnqdorbbwb] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-yhqmonvmgmopvlfc] has joined #ruby-lang
<rue>
vamshionrails: It's unlikely it'll be added, but not impossible. Right now, the idea is more to *reduce* the number of standard libraries
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby-lang
<pigdude>
hm, i think i barked up the wrong tree. i'll come back when i have more info. i think something else is going on here, but i should be able to fix it myself
pvh [pvh!u717@gateway/web/irccloud.com/x-ionyblnjzdauofzt] has joined #ruby-lang
<pigdude>
thanks for looking rue :^)
<rue>
Sure
mccraig [mccraig!u574@gateway/web/irccloud.com/x-edikhhirpocmescw] has joined #ruby-lang
<vamshionrails>
rue : thank you
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-znxkptkcccmdnfgy] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-katyuctzbnbibior] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ap3mantus [ap3mantus!~ap3mantus@c-98-217-187-172.hsd1.ma.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
janissary [janissary!~user@adsl-98-85-0-232.mco.bellsouth.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
vamshionrails [vamshionrails!~Adium@216.172.20.16] has quit [#ruby-lang]
imperator2 [imperator2!~djberg96@184-96-109-96.hlrn.qwest.net] has joined #ruby-lang
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has quit [#ruby-lang]
crudson [crudson!~doug@static-72-94-51-106.phlapa.fios.verizon.net] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby-lang
probst [probst!~probst@global-1-92.nat.csx.cam.ac.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<crankharder>
is there a way to simplify this: a ? Foo.new(a) : Foo.new
<crankharder>
can't pass nil to new
<fullsailor>
Is Foo your class?
<crankharder>
yes
<crankharder>
er, no
<crankharder>
IPAddr
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<fullsailor>
Foo.new(a||'::')
<crankharder>
yea, could do that, but the default could change behind my back
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<fullsailor>
That's why we write tests! :-P
InfiniteJest [InfiniteJest!~InfiniteJ@dynamic-adsl-78-13-118-218.clienti.tiscali.it] has joined #ruby-lang
<fullsailor>
And it wouldn't change without you upgrading Ruby
<crankharder>
mostly just thinking academically now
<crankharder>
say it's some gem with more churn
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
headius [headius!~headius@71-210-154-45.mpls.qwest.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.40.68] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-rkctocoshijjytuy] has joined #ruby-lang
<fullsailor>
I think you're overthinking it.
<fullsailor>
The API could change anyways. Maybe it starts requiring that argument.
<fullsailor>
So the second part of your ternary would fail.
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@46.50.40.68] has quit [#ruby-lang]
<fullsailor>
Or they could remove the arguments from #new and then the first part would fail.
<fullsailor>
Thats why your tests are so important
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
ambethia [ambethia!~Adium@cpe-24-160-98-85.tampabay.res.rr.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
csherin [csherin!~csherin@61.11.47.238] has joined #ruby-lang
Locke23rus [Locke23rus!~quassel@128-70-95-104.broadband.corbina.ru] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@92.250.30.106] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
<chris2>
i get a series of events, and want to run a function after 200ms of no event. how to do that best?
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
logbot99693 [logbot99693!~cinch@boxand.lnk.telstra.net] has joined #ruby-lang
<rue>
Ooh, a twist on the timeout question from earlier
<rue>
How about a 200 ms ticker reset by other events?
<chris2>
dont really have one
<rue>
Might be a little tight on the timing
<chris2>
its not that hard
kyrylo [kyrylo!~kyrylo@46.118.237.209] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@subtle/user/kyrylo] has joined #ruby-lang
<chris2>
essentially, i get tk window resize events and only want to redraw when the resize is done
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue>
Hm, is that tight enough to not seem sluggish? I guess
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<workmad3>
chris2: hmm... redraws... I'd be tempted personally to add a ticker that limits redraws to every 200ms or something, rather than wait till the end of the resize and then redraw
<workmad3>
chris2: that way, your screen content will look like it's resizing with the rest of the window ;)
<rue>
That's reasonable
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<chris2>
workmad3: know how to do that in tk?
<workmad3>
chris2: pass? :)
<chris2>
hehe
<rue>
Rescheduling a timer callback
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<rue>
chris2: after event?
<imperator2>
did someone say they're using tk?
<chris2>
i am
<rue>
Tk.after delay, proc
<chris2>
rue: hah!
<chris2>
thanks
<shevy>
rue is the master of documentation
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<shevy>
20 years of finnish bootcamp really pays off eventually
<rue>
If you wanted to get fancy, you could then have the timer invalidated by the resizes
<rue>
I didn't see a way to cancel a timer at a glance
<livinded>
people still use tk?
<rue>
livinded: Bundled, native
<livinded>
yuck
nfxgosu [nfxgosu!~nekid@117.202.87.140] has joined #ruby-lang
<imperator2>
hm, how do you get the char number again in 1.9? .chr just returns the letter
<chris2>
.ord
<imperator2>
thanks
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
<chris2>
livinded: and freaking fast to develop in
<chris2>
i have no idea how to do this stuff in a different toolkit
<chris2>
(heavily using TkText)
<livinded>
Qt and Cocoa are pretty fast
<shevy>
hmmm ruby-qt?
* imperator2
used to do tk a long, long time ago
<chris2>
and fuck qt
<chris2>
:P
<livinded>
shevy: ya, I haven't used it in probably 3-4 years but it was pretty quick and easy
<imperator2>
tk was pretty easy, i'll give it that
<shevy>
when you were still young and EVIL imperator2 but those days are gone, you weak old man!
<livinded>
macruby with cocoa is pretty slick though
<imperator2>
but platform specific :)
<shevy>
damn mac fanboys!
lightcap [lightcap!~lightcap@bc100132.bendcable.com] has joined #ruby-lang
<shevy>
admit it
<wmoxam>
fanboys?
<livinded>
can't remember the last time I built a cross platform gui app
<shevy>
you are just too lazy to hack your own WM
<livinded>
I prefer native UIs
<imperator2>
i played with fox and wx a bit
<shevy>
wmoxam I can't mention the 3% fangirls :>
dfr|mac [dfr|mac!dfr|work@nat/google/x-mbodayngndlfaqvk] has joined #ruby-lang
Xzyx987X [Xzyx987X!~Xzyx987X@c-75-72-121-187.hsd1.mn.comcast.net] has joined #ruby-lang
<rue>
Cool. I thought there must be a way to cancel timers, but didn't glance far enough, obviously
<chris2>
note that you always need to cancel because they seem to repeat
<shevy>
hmm what is BIND {} ?
QaDeS [QaDeS!~mklaus@frbg-5f73156f.pool.mediaWays.net] has joined #ruby-lang
epitron_ [epitron_!~epi@unaffiliated/epitron] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
fritzek [fritzek!~fritzek@tmo-096-104.customers.d1-online.com] has joined #ruby-lang
fritzek [fritzek!~fritzek@tmo-096-104.customers.d1-online.com] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-72-66-12-100.washdc.fios.verizon.net] has joined #ruby-lang
Regenechse [Regenechse!~regechse@h1985974.stratoserver.net] has joined #ruby-lang
cirwin [cirwin!~conrad@wiktionary/ConradIrwin] has joined #ruby-lang
<MistyM>
Hm. This feels tricky.
<MistyM>
I have a set of plain-English descriptions of filename ranges I'd like to expand into an array of all the files.
<MistyM>
Having a little trouble figuring out how, though. Ruby Range is lovely for simple patterns but this is a little beyond it.
<manveru>
MistyM: like?
<drbrain>
what's an example description?
<MistyM>
Few examples: "C0001_d4.mov to C0011_d4.mov"; "C0001.mov to C0085.mov"; "000_0014_01.mov to 000_0035_01.mov"
<MistyM>
So, the filename patterns themselves are not consistent from one to the next, and the variable portion of the filename can happen anywhere (numerical) in the name.
Weems [Weems!~the@nat.resnet.mc.edu] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
<manveru>
ok... that sounds doable
<manveru>
you scan for digits, look for ones that are different, calculate the range, create a glob, match the files
<erikh>
you'd think after 30 years of large scale software development people would learn that estimations are pointless.
<lake>
is agile > scrum? is agile worth it?
<slyphon>
i used to look at my manager and tell him "I'm going to sit here, and type thing at this keyboard, until it works. When it works, it will work, and I will stop typing things"
<uniqanomaly>
guys, relaing to levels of abstraction, what do you thing about treating programming languages as simply syntax + libraries being translated to machine language?
<slyphon>
uniqanomaly: WHAT!?
<uniqanomaly>
syntax as means of expression more than utilistation of existing ecosystem
<slyphon>
it sounds like you need to stop doing bong hits
<uniqanomaly>
that would ultimately destroy low lvl languages for most purposes i believe
<lake>
LOL
<chris2>
the slyphon
<uniqanomaly>
1) divide language syntax from its implementation
<Spooner>
Speaking of new projects, people might be interested in https://github.com/Spooner/relapse (used for releasing ruby applications, including reasonable cross-platform support). I'd appreciate any feedback from you fellows (based on reading the readme, that is; it works reasonably well, but needs to be made less crappy :D). Still wondering if I shouldn't use a prettier DSL than to copy the gemspec style.
<context>
spooner: id personally make it less "optiony"
<drbrain>
slyphon: use a manifest
<Spooner>
drbrain: And why not? (Based on the fact that I'm expecting the user to decide what does and doesn't go in there).
<injekt>
also, str[0] wont ever be '.' on 1.8.7
<slyphon>
drbrain: i use that kind of thing from bundler
<Spooner>
context: Less optiony? Don't know what you mean?
<slyphon>
yeah
<slyphon>
str[0] == ?.
<injekt>
str[0, 1] == '.'
<injekt>
or that
<context>
spooner: output_for :windows assume .exe, output_for :os_x assume .dmg (realize probably cant do that on linux)
<shevy>
well str[0,1] would work on both I guess
<injekt>
yeah as would ?.
<injekt>
or start_with?
<drbrain>
slyphon: Spooner: thanks to manifest I've never released a gem that's contained previous versions of my gem
<slyphon>
uhh
<drbrain>
I'm with injekt on start_with?
<slyphon>
drbrain: that happens?
<context>
though i guess the archive format is the only really optional thing in there :/
<Spooner>
drbrain: I don't understand the issue. Explain?
<drbrain>
slyphon: yes
<slyphon>
you mean someone doesn't clear .gem out of their wd
<slyphon>
?
<drbrain>
slyphon: the manifest ensures you know what you're shipping with your gem
<drbrain>
slyphon: jeweler doesn't
<drbrain>
and doesn't use a manifest
<slyphon>
yeah, but it's a pain in the balls to maintain
<slyphon>
i liked my gem-creator
<drbrain>
slyphon: nope! `rake check_manifest` then review then `rake check_manifest | patch`
<slyphon>
'mohel'
<slyphon>
pfft
<slyphon>
i did a clean-room build
<slyphon>
based on a tag
<slyphon>
checked out the current repository into a temp dir, changed to a tag, created the .gemspec version based on the tag, built the gem, copied it back to the original dir, blew awya the temp one
<slyphon>
i think that was pretty ideal (for git)
SuperTa__ [SuperTa__!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang