zzak [zzak!~zzak@ec2-107-20-68-16.compute-1.amazonaws.com] has joined #ruby-lang
thenagain [thenagain!~thenagain@67-135-38-137.dia.static.qwest.net] has joined #ruby-lang
<duckinator>
Is there something like `load` that returns the last thing in the loaded file, instead of 'true'? as in, assuming this: https://gist.github.com/1691948 ... i want to have './loader.rb input.rb' print "hi\nlololol\n"
CodeBlock [CodeBlock!~CodeBlock@fedora/CodeBlock] has joined #ruby-lang
<drbrain>
duckinator: nope
<duckinator>
damn :( thanks anyway
<drbrain>
duckinator: sounds like you want to write tests
<drbrain>
oh wait, that was theconartist
RomyRomy [RomyRomy!~stickycak@NYUFGA-WLESSAUTHCLIENTS-01.NATPOOL.NYU.EDU] has joined #ruby-lang
<drbrain>
duckinator: so, what do you want to do with this loader idea?
<drbrain>
duckinator: with careful abuse of eval you can do what you want
<drbrain>
but I don't recommend it
<duckinator>
drbrain: me and CodeBlock are each working on safe eval systems. he's got one using `sandbox` (part of selinux), mine's a bit nastier (passwordless sudo to plop itself into a chroot...ow) since i didn't know of selinux at the time. the idea was to avoid my method of basically using a template to generate the file that's ran in the sandbox/chroot
voker57 [voker57!~voker57@128-70-8-28.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
<erikh>
robgleeson also created one that uses the os x sandboxing facilities
<drbrain>
you might want to check out the try ruby sandbox as well
<duckinator>
drbrain: but since this is mainly for an IRC bot, it's far friendlier if you can do `>> 1` and get 1 back and things like that
<drbrain>
duckinator: yeah, I think tryruby has what you want
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby-lang
uberjar [uberjar!~hideyoshi@li179-144.members.linode.com] has joined #ruby-lang
<uberjar>
anyone familiar with the mail gem ? I have a properly formatted MIME email in a string and I'd like to parse it with the mail gem. There is a method Mail.read which does what I need except it reads from a file.
<uberjar>
did the author of the gem forget to include a way to load from memory without first writing to disk ?
<uberjar>
I can't seem to find a way. It would be a shame to have to do extra disk seeks just because I can't find the right method in this mail library. I really don't see it though.
<uberjar>
I'm about ready to monkeypatch it I just wanted to make sure I'm not missing something obvious first.
nofxx [nofxx!~nofxx@177.106.32.38] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
CodeBlock [CodeBlock!~CodeBlock@fedora/CodeBlock] has quit [#ruby-lang]
<uberjar>
monkeypatched. *sigh*
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
<shevy>
hey uberjar are you like uberfrau
nofxx [nofxx!~nofxx@177.106.32.38] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
mikeric [mikeric!~mike@S0106c03f0e8b23f3.vc.shawcable.net] has joined #ruby-lang
<uberjar>
naw. uberjar is something clojure related.
<uberjar>
thnx peeps.
uberjar [uberjar!~hideyoshi@li179-144.members.linode.com] has quit [#ruby-lang]
ksinkar [ksinkar!~ksinkar@115.240.117.100] has joined #ruby-lang
Jarred [Jarred!~Administr@c-71-198-139-210.hsd1.ca.comcast.net] has joined #ruby-lang
RomyRomy_ [RomyRomy_!~stickycak@static-129-44-58-217.ny325.east.verizon.net] has joined #ruby-lang
<Jarred>
Is anyone here driving from SF to Palo Alto this weekend?
<andrewvos>
heh
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
g0kul [g0kul!~gokulnath@117.204.114.227] has joined #ruby-lang
nwonknu [nwonknu!~nwonknu@unaffiliated/nwonknu] has joined #ruby-lang
gregf [gregf!~gregf@207.5.168.94] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@115.240.117.100] has joined #ruby-lang
<postmodern>
how does one get the encoding of a String in 1.8?
<shevy>
postmodern hmm... iconv I think
<shevy>
or that only converts hmmm
pigdude [pigdude!~tallen@li61-243.members.linode.com] has joined #ruby-lang
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
jbsan [jbsan!~jbsan@c80-216-213-130.bredband.comhem.se] has joined #ruby-lang
nwonknu_ [nwonknu_!~nwonknu@unaffiliated/nwonknu] has joined #ruby-lang
cosmic_charlie [cosmic_charlie!~chase@pool-108-35-111-124.nwrknj.fios.verizon.net] has joined #ruby-lang
<theconartist>
is there a way to forward all method calls on one object to an other
lianj [lianj!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
lianj [lianj!~lianj@subtle/user/lianj] has joined #ruby-lang
<slyphon>
holy crap
<slyphon>
%w[a b c].each.with_object({}) { |i,h| h[i] = i }
<slyphon>
i've been looking for that for so damn long
<slyphon>
%w[a b c].inject({}) {|h,i| h[i] = i ; h }
<slyphon>
now i can finally get rid of that stupid semicolon
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
g0kul [g0kul!~gokulnath@117.204.114.227] has quit ["Leaving"]
takaokouji [takaokouji!~takaokouj@p6236-ipbffx02osakakita.osaka.ocn.ne.jp] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@101.169.143.59] has joined #ruby-lang
nwonknu [nwonknu!~nwonknu@unaffiliated/nwonknu] has joined #ruby-lang
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
fullsailor [fullsailor!~fullsailo@ip24-250-174-76.ga.at.cox.net] has joined #ruby-lang
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby-lang
take_cheeze [take_cheeze!~Adium@pc06224.anc-tv.ne.jp] has joined #ruby-lang
r0bby [r0bby!~wakawaka@64.134.71.218] has joined #ruby-lang
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
r0bby [r0bby!~wakawaka@guifications/user/r0bby] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
lianj [lianj!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
lianj [lianj!~lianj@subtle/user/lianj] has joined #ruby-lang
antinitro_ [antinitro_!~adam@cpc1-stap4-0-0-cust418.12-2.cable.virginmedia.com] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
rpowell [rpowell!~rpowell@CPE-124-183-113-126.lns14.ken.bigpond.net.au] has joined #ruby-lang
<raggi>
slyphon: a = %w[a b c]; Hash[a.zip(a)]
brianpWins [brianpWins!~brianpWin@S01060014bf8930ea.vc.shawcable.net] has joined #ruby-lang
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
<whatasunnyday>
i am whatasunnyday
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has quit [#ruby-lang]
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
nwonknu [nwonknu!nwonknu@gateway/shell/anapnea.net/x-ughqakrqcadfrvvi] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
spuk [spuk!~spuk@189.6.30.65] has joined #ruby-lang
<shevy>
hmm
<shevy>
are you guys using mostly json, mostly yaml, or both? like when you have a config file for a ruby project ... in what format do you tend to keep that config file?
<shevy>
Background for this question - I am still using yaml mostly, and wondering about switching to json (or at least make it optional for all my projects)
<raggi>
shevy: yaml is slightly easier for human authoring, but moving to json if you're using chef or the like to manage configurations can make life easier and more consistent
<raggi>
shevy: i prefer using plain ruby scripts to actually configure simple code stuffs, though
<raggi>
(and i DO NOT mean spending hours writing some pathetic excuse for a "DSL" or using instance_eval - i mean, just plain old attr_accessors and other method calls)
<duckinator>
woo! :D
<duckinator>
i now have implemented safe (as far as i know) ruby eval in an irc bot, it does not require passwordless sudo (like it used to..yay UNIX-style permissions?), and no longer has any race conditions :D
rpowell [rpowell!~rpowell@CPE-124-183-113-126.lns14.ken.bigpond.net.au] has joined #ruby-lang
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
csherin [csherin!~csherin@202.164.151.110] has joined #ruby-lang
treeleaf_ [treeleaf_!~matt@c-107-3-150-89.hsd1.ca.comcast.net] has joined #ruby-lang
<duckinator>
raggi: your skepticism was well-deserved... `def Exception.to_s;loop{};end` will let it run endlessly...and after 2 hours me + 3 other people have not found a single way to stop it, nor a way that even works as well -- let alone better -- than the current Timeout.timeout(5){ ... } i use
<raggi>
you can't stop it
<raggi>
$SAFE is flawed
<raggi>
at best you can keep it down to DoS vectors
<raggi>
but there's holes too
<duckinator>
i'm not relying solely on $SAFE, but it still seems you're still right about only keeping it down to DoS vectors, unfortunately
<bnagy>
ok this is bugging me
<bnagy>
need to scan a string for all repeated letters
<bnagy>
but scan keeps eating my doubles if I do scan(/([a-z]\1+/) etc
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby-lang
<bnagy>
I can do it recursively with #partition, but ew
<brianpWins>
Can you include a module into an instance as opposed to a class?
<uniqanomaly>
duckinator: can't you just kill the process?
<uniqanomaly>
whatev, dunno how Timeout tries to do it
<duckinator>
uniqanomaly: easier said than done :\ it gets messy real fast. atm i found ForkExec which seems to mostly work but has a bug. seeing if i can get it to play nice (it's not been touched since 2010 :P)
<uniqanomaly>
put timeout in self.run and just kill process created at 25 line
<uniqanomaly>
I played with bot like that long time ago, iirc in the end I just added array of keywords I don't want eval
CodeBlock [CodeBlock!~CodeBlock@fedora/CodeBlock] has joined #ruby-lang
<duckinator>
uniqanomaly: blacklists don't work well, in my experience :P
<rippa>
eval "#{packed keywords here}"
<rippa>
you can just blacklist eval
<rippa>
but I'm sure it is avoidable too
<duckinator>
uniqanomaly: this will get past your idea: def Exception.to_s;loop{};end;loop{}
<duckinator>
rippa: eval is already blocked by $SAFE=3
<rippa>
oh, right
<duckinator>
the only way i've managed to break it is with the snippet i just mentioned to uniqanomaly :\
<duckinator>
but when i fix that, it tends to make it *easier* to break
<duckinator>
ForkExec got close, but is buggy...so trying to fight it into submission atm
<uniqanomaly>
I wanna nodebox and kivy written in ruby :<<<
<rippa>
I want ruby written in ruby
<rippa>
working in 1.9 mode
<rippa>
and on windows
<zenspider>
that's a tall order
Defusal [Defusal!Defusal@196-209-88-154.dynamic.isadsl.co.za] has joined #ruby-lang
Defusal [Defusal!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
<zenspider>
@bws.shuffle.first n
<uniqanomaly>
yea
<rippa>
.shuffle.first ?
<rippa>
why not .sample ?
<duckinator>
hmm
<zenspider>
because I write code that is still compatible with 1.8
<uniqanomaly>
ust put 2012 buzzwords in there and do some startups
<uniqanomaly>
haha
<duckinator>
rippa, uniqanomaly: prefixing "timeout -sILL 5 " to that `` call made it work, but it's unfortunately no longer all-ruby like i'd hoped for :(
<CodeBlock>
zenspider: +1 :)
hagabaka [hagabaka!~hagabaka@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
<zenspider>
anyone here have experience with factor?
srbartlett [srbartlett!~srbartlet@101.169.143.59] has joined #ruby-lang
<queequeg1>
So does anyone have any suggestions for best command line progressbar gem?
<zenspider>
the best is none at all
<queequeg1>
I don't really need a progress bar, I just want to learn how they do it.
<queequeg1>
without using ncurses.
<queequeg1>
So I thought I would ask for recommendations because I really don't know how to judge how well they are coded on my own. I'm new.
<zenspider>
queequeg1: find one that works. obsessing on "best" is a waste of time
fragmachine [fragmachine!~fragmachi@101.169.172.64] has joined #ruby-lang
bousquet [bousquet!~bousquet@74.197.255.182] has joined #ruby-lang
<queequeg1>
I'm not obsessing, just looking for suggestions form experience programmers.
<queequeg1>
heh, experienced I mean.
<queequeg1>
I guess it is too late, I can't type straight.
shevy [shevy!~shevy@194-166-100-6.adsl.highway.telekom.at] has joined #ruby-lang
<Mon_Ouie>
ri Regexp is also nice
<erikh>
oh is it better now?
<apeiros_>
yes
<erikh>
oh wow
<erikh>
yes
<Mon_Ouie>
Yeah, it actually includes the file it was supposed to include
<apeiros_>
they fixed the broken doc link
<erikh>
still pretty :( on 1.8 though
<erikh>
I wasn't sure before, but a 1.8.8 would be a nice thing I think, given the number of people still using it.
<shevy>
good old 1.8
tbuehlmann [tbuehlmann!~sjdfndsf@unaffiliated/tovias] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
<zenspider>
still the majority
<zenspider>
time to sleep... ta
<erikh>
oh well.. yeah, I was just about to say the same, night
<yxhuvud>
erikh: on the other hand, not doing 1.8.8 would make people change faster
hebz0rl [hebz0rl!~hebz0rl@95.130.165.85] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
jamw [jamw!~j@cpc11-orpi3-2-0-cust53.2-3.cable.virginmedia.com] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@101.169.143.59] has joined #ruby-lang
Cope [Cope!~stephen@91.194.75.218] has joined #ruby-lang
<Cope>
hello - is there a more programatic way to do this: http://d.pr/R8oj
<brianpWins>
why would something return #<Class:#<TestClass:0x007fd4eb804630>> instead of just #<TestClass:0x007fd4eb804630>
<Cope>
with 4, it's kinda ok... but breaks the rule of 3... :) if I had 20, I'd like to be able to do something lie %w{a b c d e f}.each { |thing| assign_if_key_exits(thing) }
<apeiros_>
brianpWins: because it's the singleton_class of an instance of TestClass
<apeiros_>
brianpWins: ruby-1.9.2:052:0>> class TestClass;end;TestClass.new.singleton_class # => #<Class:#<TestClass:0x007f9281ab2870>>
<brianpWins>
ahhhh…. so what am I doing wrong if I was expecting it to return the instance of TestClass ?
<hagabaka>
Cope, why not just access them through the hash directly?
<Cope>
hagabaka: later on I do stuff with them, but the hash may not always have all those values
<Cope>
hagabaka: so I want it to not break because params[:ca] doesn't exist
<hagabaka>
why would hash break, but local variable not break?
<brianpWins>
ohhh i think it's because I was doing an instance eval
<Cope>
hagabaka: well, because i am checking for its existence; or are you just questioning the intermediate assignement to a var?
<Cope>
hagabaka: that's just for readability in the subsequent method
<Cope>
apeiros_: will look at that - thanks
<hagabaka>
as long as you know whether a value exists, and access only those that do, it doesn't matter whether you access them though local variable or hash
rpowell [rpowell!~rpowell@CPE-124-183-113-126.lns14.ken.bigpond.net.au] has joined #ruby-lang
<brianpWins>
if I'm trying to spec a module but the module includes another module how do I test them both in isolation? How can i test the first module without it including the 2nd?
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby-lang
Mchl [Mchl!~Mchl@h1881165560.rev.rootvps.pl] has joined #ruby-lang
<apeiros_>
hagabaka: readability of an lvar is quite a bit better than going through a hash all the time.
<apeiros_>
hagabaka: also if you're in a tight loop and access the value often, it can start to matter.
<hagabaka>
that's assuming you'll access the value in a loop, or even more than just once, and/or write the accessing code more than once
<apeiros_>
hagabaka: no, that's not assuming. I said "if".
<apeiros_>
that's specifying a situation. no assumptions.
benanne [benanne!~rijdier@ip-213-49-105-20.dsl.scarlet.be] has joined #ruby-lang
bousquet [bousquet!~bousquet@74.197.255.182] has joined #ruby-lang
bousquet [bousquet!~bousquet@74.197.255.182] has joined #ruby-lang
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
<shevy>
if all swiss were to like chocolate, they would be very THICK PEOPLE
csherin [csherin!~csherin@202.164.151.110] has joined #ruby-lang
molgrew [molgrew!~m@f054179073.adsl.alicedsl.de] has joined #ruby-lang
toretore [toretore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby-lang
<rpowell>
hey what library would you guys reccomend for making a game?
<rpowell>
thinking of branching out from web dev
<injekt>
what kind of game?
<rpowell>
2D
<rpowell>
side scrolling puzzle type deal
pbjorklund [pbjorklund!~pbjorklun@c-b9dbe655.026-155-626f721.cust.bredbandsbolaget.se] has joined #ruby-lang
<injekt>
gosu is pretty good
<rpowell>
yeah I hear good things about it
<rpowell>
there's RubyGame too but I don't think that's being worked on by anyone
<shevy>
rpowell yeah, jacius abandoned it, but he left it in a good condition for someone else to pick up one day
<rpowell>
hmm
<rpowell>
maybe if I get good at this stuff
<shevy>
I think he should have tried to expand it into a general widget set
<shevy>
and focus on what makes ruby strong - to type less, yet achieve more, than you do in other languages, like C
<rpowell>
yeah
<rpowell>
totally
<pbjorklund>
Did I get it right that hash = Hash.new([]) ; hash[:one] << "string" tries to find the [:one] key, fails and then appends the value "string" to the default obj [] passed in when instantiating the hash?
<shevy>
no idea but the above code returns ["string"]
<bnagy>
yes, cause the default object is shared there
<shevy>
oh interesting
<bnagy>
mostly people want Hash.new {|h,k| h[k]=[]}
<bnagy>
I just did horrible, horrible thing to AWS Ruby SDK
<shevy>
good!
<shevy>
you are a man of action
<pbjorklund>
bnagy: I can feel my mind expanding :) Thanks
<bnagy>
I couldn't work out their byzantine config stuff, so I just monkeypatched a method in one of their Request classes to add a header I need added :|
<bnagy>
that'll teach them not to impement stuff they have been supporting for months at the backend :|
<injekt>
pbjorklund: the object sent to Hash.new is the default object returned. Hash.new("foo")[:hello] #=> "foo"
<bnagy>
raaar
<injekt>
oh bnagy said that
<injekt>
it's too early
rpowell [rpowell!~rpowell@CPE-124-183-113-126.lns14.ken.bigpond.net.au] has joined #ruby-lang
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
Bwild [Bwild!~irc@netblock-75-79-22-130.dslextreme.com] has joined #ruby-lang
gix [gix!~gix@e180021111.adsl.alicedsl.de] has joined #ruby-lang
KDiddy [KDiddy!~kdiddy@p4FEE8F52.dip0.t-ipconnect.de] has joined #ruby-lang
yadav [yadav!~quassel@dsl-173-248-230-235.acanac.net] has joined #ruby-lang
jamescotterill [jamescotterill!~james@host-89-243-244-110.as13285.net] has joined #ruby-lang
Stalkr_ [Stalkr_!~Stalkr@x1-6-e0-46-9a-1f-97-a2.k617.webspeed.dk] has joined #ruby-lang
<shevy>
hehe
antinitro [antinitro!~adam@cpc1-stap4-0-0-cust418.12-2.cable.virginmedia.com] has joined #ruby-lang
Pip [Pip!~Pip@188.134.46.174] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
<brianpWins>
this si going to be awkward to explain. I have module A which includes module B. When I include module A into a class. I also want module B to include module C into whatever class module A was included into...
<shevy>
hehe
<manveru>
yo dawg...
<erikh>
look at the included() hook on Module
<erikh>
I think that's it at least
<rue>
Nuh
<shevy>
Huh
<brianpWins>
erikh: I've been trying to use it but it's kind of awkward still. Like module B needs to assign modules A's included hook to include module C
<muzone>
sup
<erikh>
brianpWins: eh
<shevy>
when things get complicated, my brain leaves body
<erikh>
awkward is the smelliest code smell of them all
<erikh>
I have nothing constructive to add
<rue>
brianpWins: So all included modules of a module already get in the lookup chain
<rue>
brianpWins: Are you trying to include modules *in addition* to that?
<erikh>
yes, he wants to hook A which include B to include C
<rue>
You could just have a module ALLTHETHINGS; include A, B, C, D, …; end; class Wee; include ALLTHETHINGS; end
<brianpWins>
rue but module C can't be included until it's attached to whatever A is being included into. Because on inclusion module C takes params from the class it's included into and builds out dynamic methods
<erikh>
basically he wants the grandparent to include the child
<rue>
Oh, fuck all that
<erikh>
^
<rue>
brianpWins: That'll probably be pretty nasty to maintain
<rue>
If you want to generate methods (and you can't just rely on a contract like Enumerable, for example), I think you should try to include those modules explicitly
<rue>
You *can* do it with .included/.append_features, but I'd heavily favour explicitness here.
<shevy>
this boggles the mind
<apeiros_>
sounds contorted and smelly
<brianpWins>
the reason it's broken up is A is written by other devs. and then included into other classes written by other devs.
<brianpWins>
then B has the main functionality they want
<shevy>
I hate other devs
<brianpWins>
and C has extra functionality which is speerated just for modularity really
<apeiros_>
shevy: given that your mind and body are separated, which one of the two is you, and does it hate the other part?
<shevy>
apeiros_ dunno really. my body is a bit like a zombie
<shevy>
my brain is out somewhere on the streets doing something more useful
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
<apeiros_>
so zombies aren't evil. they're just people whose brain has separated itself from them, and now they're searching for them…
<rue>
brianpWins: That doesn't sound particularly modular, honestly :P
jamescotterill [jamescotterill!~james@host-89-243-244-110.as13285.net] has joined #ruby-lang
<brianpWins>
it's a modular namespace kind of thing, there B and theres B::Relationships (previously referred to as C)
<brianpWins>
so B::Relationships handles all the logic for B's relationships
<brianpWins>
that's modular I think
<brianpWins>
actually no
<brianpWins>
you make a REALLY great point
<brianpWins>
it's easy to skip because it's not needed until you want it
<brianpWins>
and if they want it they can include it in A just like the included B
molgrew_ [molgrew_!~m@g224068020.adsl.alicedsl.de] has joined #ruby-lang
<brianpWins>
that works for me
<rue>
Yep
<shevy>
apeiros_ I try to have my code understandable to zombies :)
<shevy>
*be understandable
<apeiros_>
*nomnom*
<rue>
That's not what zombie-proofing means, shevy
<shevy>
zombies invented
<shevy>
wat
<brianpWins>
the downside to it is it's a nice function to have without thinking about it. Like I wouldn't want to have to require ActiveRecord::Relationships every time I anted those proxy methods
csherin [csherin!~csherin@202.164.151.110] has joined #ruby-lang
<shevy>
can we turn this into a problem of cats dogs and mice?
Z2FyZA [Z2FyZA!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby-lang
<rue>
brianpWins: You'd probably document that somewhere. Explicitly, you don't need to.
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
Jade [Jade!~jade@unaffiliated/jade] has joined #ruby-lang
publicvoid__ [publicvoid__!~publicvoi@p4FCAEA2D.dip.t-dialin.net] has joined #ruby-lang
Pip_ [Pip_!~Pip@188.134.46.174] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
<brianpWins>
I'm glad spec 2.8 has a random order setting. I've got a race condition somewhere so if I run this 1 test by itself it fails but in the group it works =S
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@bl7-44-30.dsl.telepac.pt] has joined #ruby-lang
<andrewvos>
minitest
<andrewvos>
minitest does that by default
<ReinH>
brianpWins: you should fix that
<brianpWins>
ReinH: got it worked out =)
<brianpWins>
i need to goto sleep
<brianpWins>
it's 525 in the morning
<brianpWins>
ugggg
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
<erikh>
rue: hey, got a few minutes to poke at some code and tell me what sucks?
mark_locklear [mark_locklear!~jlocklear@58.25.216.216.transedge.com] has joined #ruby-lang
<rue>
Sure, watching a CX race so may be a bit async
<erikh>
no rush or anything. what's your github name? not ready to share this with everyone yet
<rue>
erikh: rue
<erikh>
danke
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby-lang
<erikh>
the important bits are in lib -- ignore proto and test for now
<erikh>
anyhow, just ping me when you're looking at it if anything's confusing
<erikh>
mostly worried about having a correct system, and need concurrency-experienced eyes since I'm pretty new to it
<rue>
Roger Wilco
<yorickpeterse>
Is there any easier way to increment an instance of Time by a year without having to use seconds? I can use Date and increment per day but Date is slower sadly
<yorickpeterse>
But that's ok, I need to set it to the first day anyway
<yorickpeterse>
Cheers
vdrab [vdrab!~vdrab@p922ecb.kyotnt01.ap.so-net.ne.jp] has joined #ruby-lang
enebo [enebo!~enebo@75-168-50-253.mpls.qwest.net] has joined #ruby-lang
Guest87376 [Guest87376!~mephux@li246-165.members.linode.com] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
mephux_ [mephux_!~mephux@li246-165.members.linode.com] has joined #ruby-lang
mephux_ [mephux_!~mephux@unaffiliated/mephux] has joined #ruby-lang
<darix>
yorickpeterse: you could look at activesupport's 1.year.from_now
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
molgrew_ [molgrew_!~m@g224068020.adsl.alicedsl.de] has quit [#ruby-lang]
benanne [benanne!~rijdier@ip-213-49-105-20.dsl.scarlet.be] has joined #ruby-lang
gregf [gregf!~gregf@207.5.168.94] has joined #ruby-lang
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
<yorickpeterse>
I'm not even going to touch AS with a 10m stick
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
wimplash [wimplash!~Adium@wireless.sit-co.net] has joined #ruby-lang
<shevy>
haha
<shevy>
I'd wish I'd have a lot of money, then I would hire yorickpeterse and have him work with AS daily!
Sailias [Sailias!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<yorickpeterse>
I'd probably jump out of the window on the first day
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
* shevy
silently adds an entry on a todo list: "fix windows"
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.247.109] has joined #ruby-lang
Z2FyZA_ [Z2FyZA_!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.47.180] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
vesan [vesan!vesan@maailmanlopun.modeemi.net] has joined #ruby-lang
<injekt>
erikh: back!
<injekt>
erikh: ooo zmq
kitallis [kitallis!~kitallis@122.172.247.109] has joined #ruby-lang
imperator2 [imperator2!~djberg96@184-96-115-43.hlrn.qwest.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
sora_h [sora_h!~sora_h@sorah.jp] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
uniqanomaly_ [uniqanomaly_!~ua@dynamic-87-105-215-28.ssp.dialog.net.pl] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-72-66-12-100.washdc.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
kitallis [kitallis!~kitallis@122.172.247.109] has joined #ruby-lang
<nofxx>
Which solution to choose to make my apps compliant with my new syslog centralized arch? stdlib's syslog, log4r, buffered_syslogger, gelf, syslog-logger...
<nofxx>
and remote_syslog too... they use in papertrail, can send UDP directly to my main syslogd
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<bougyman>
so can log4r
<bougyman>
for that matter, so can any of them.
<bougyman>
generally you'd let the local syslog on the box talk to the central syslog server
<bougyman>
the apps shouldn't have to know anything about that.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
<nofxx>
bougyman, thanks man, makes sense.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B31127C.dip0.t-ipconnect.de] has joined #ruby-lang
<nofxx>
bougyman, the remote feat might be nice when deploying to rootless servers
<nofxx>
heroku playground
<bougyman>
sure sure, cloud blah-blah
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby-lang
<nfxgosu>
#i have a few sets; if *#{Set}*.proper_subset? entire_set; puts "#{Set}"; else; puts "Set not found"; end; #what should be in between the asterisks
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0C204.dip0.t-ipconnect.de] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
slimfit [slimfit!~slimfit@c-98-245-122-231.hsd1.co.comcast.net] has joined #ruby-lang
SkramX [SkramX!~SkramX@pool-173-73-134-143.washdc.east.verizon.net] has joined #ruby-lang
Jade [Jade!~jade@unaffiliated/jade] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
flebel [flebel!~flebel@unaffiliated/flebel] has joined #ruby-lang
jaisoares [jaisoares!~jsoares@bl7-44-30.dsl.telepac.pt] has quit [#ruby-lang]
<Spooner>
I'm writing some deploy scripts for ruby applications (part of Releasy). Is there anywhere people would want to deploy win/osx/source applicaitons other than Github and Dropbox?
<apeiros_>
putting something to github is considered a deployment? o0
<apeiros_>
well, I release/deploy ruby related things either to github, rubygems, or my server
<Spooner>
Well, rubygems isn't relevant to me, since gems are not executables (not intended for non-Ruby users).
<apeiros_>
k, I've never released an executable. only executables as part of a gem.
<Spooner>
But how do you push files to your server? Never needed to do that automagically (Only ever used ftp clients).
<nofxx>
Spooner, scp !
<apeiros_>
Spooner: at the moment capistrano.
<apeiros_>
will replace it with my own script sometime soon. that'll use a combination of net/ssh and git
<Spooner>
apeiros_: Yeah, most ruby "executables" are aimed at ruby devs, not end-users. I'm making games, but it also applies to GUI apps and similar.
<apeiros_>
those are webapps, though, so probably not your target audience.
<apeiros_>
anyway, pushing .dmgs/.exes/.zips to your own server via scp might be an idea for your Releasy
<Spooner>
Nope, but I think people have tried to make Rails desktop apps.
<Spooner>
nofxx: OK. scp sounds sensible.
mweichert [mweichert!~mweichert@184.151.63.209] has joined #ruby-lang
jMCg [jMCg!~hiro@apache/committer/igalic] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@184-96-128-49.hlrn.qwest.net] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
<apeiros_>
erikh: you there?
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
RomyRomy [RomyRomy!~stickycak@cpe-69-203-115-155.nyc.res.rr.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
benanne [benanne!~rijdier@34.85-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
jamescotterill [jamescotterill!~james@94-192-130-249.zone6.bethere.co.uk] has joined #ruby-lang
virunga [virunga!~virunga@151.64.35.56] has joined #ruby-lang
hackeron [hackeron!~hackeron@gentoo/user/hackeron] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
uniqanomaly__ [uniqanomaly__!~ua@dynamic-87-105-215-28.ssp.dialog.net.pl] has joined #ruby-lang
voker57 [voker57!~voker57@128-70-11-80.broadband.corbina.ru] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
majnun [majnun!~boner@unaffiliated/otherj] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
GiambalaGiambala [GiambalaGiambala!~virunga@151.64.61.8] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
tbuehlmann [tbuehlmann!~sjdfndsf@unaffiliated/tovias] has joined #ruby-lang
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
dous_ [dous_!~dous@cm171.sigma67.maxonline.com.sg] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-136-201.aei.ca] has joined #ruby-lang
Transformer [Transformer!~Transform@ool-4a59e397.dyn.optonline.net] has joined #ruby-lang
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
Pip [Pip!~Pip@188.134.46.174] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Ashkin [Ashkin!601aee4d@gateway/web/freenode/ip.96.26.238.77] has joined #ruby-lang
nwonknu [nwonknu!nwonknu@gateway/shell/anapnea.net/x-brhoxlanvqagcpjt] has joined #ruby-lang
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.45] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<Ashkin>
i love coming onto irc to ask a question pertaining to a problem that has been pissing me off for hours, then thinking of a new approach while trying to word it, and getting everything to work.
<erikh>
apeiros_: am now
<Ashkin>
bloody frustrating. but it works.
jamescotterill [jamescotterill!~james@94-192-130-249.zone6.bethere.co.uk] has joined #ruby-lang
Pip_ [Pip_!~Pip@2001:0:4137:9e76:0:f6b2:4379:d151] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
<Ashkin>
well, almost >:/ but i need to leave for work, so i don't have time to debug
Pip__ [Pip__!~Pip@188.134.46.174] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
<apeiros_>
erikh: silly question and only if you just happen to know the answer - does Kernel#select return the IOs in order?
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
Pip_ [Pip_!~Pip@188.134.46.174] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
rhalff [rhalff!~rhalff@d88077.upc-d.chello.nl] has joined #ruby-lang
* rhalff
*>:D<*
lordofthedance [lordofthedance!~daddycool@wnpgmb0911w-ad03-144-208.dynamic.mtsallstream.net] has joined #ruby-lang
<erikh>
apeiros_: afaik, yes
<apeiros_>
erikh: thanks, thats great
<rue>
I'm not 100% that select() guarantees order in the returned sets
tdubz [tdubz!~tdubellz@freenode/staff/tdubellz] has joined #ruby-lang
<rue>
Although the max fd paradigm might indicate it does.
<rue>
apeiros_: Is it necessary to rely on it?
<apeiros_>
rue: I have server and client IOs, and I wanted to pass in [server, *clients]
<apeiros_>
if it retains order, I can simply check the first whether it is the server, shift it off if it is, and do a normal loop with the rest
<apeiros_>
else I have to either do a more expensive check, or I have to do a non-blocking select on the server before the select on the clients.
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
CCD [CCD!~ccd@pool-74-103-35-18.bltmmd.fios.verizon.net] has joined #ruby-lang
CCD [CCD!~ccd@pool-74-103-35-18.bltmmd.fios.verizon.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
<erikh>
apeiros_: you could always reject! the server by fd
<erikh>
but yes, that could also be slow depending on how many clients you ahve
<erikh>
but I'm *pretty* sure select returns in-sit
<erikh>
situ
Sailias_ [Sailias_!~jonathan@CPE0018f85e576d-CM001bd7aaaf96.cpe.net.cable.rogers.com] has joined #ruby-lang
<erikh>
should be reasonably easy to test though
publicvoid [publicvoid!~publicvoi@p4FCAEA2D.dip.t-dialin.net] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@174.128.210.18] has joined #ruby-lang
dubellz [dubellz!~tdubellz@freenode/staff/tdubellz] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
Paoc_ [Paoc_!~paoc@pc-162-161-164-190.cm.vtr.net] has joined #ruby-lang
Phrogz_ [Phrogz_!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-87-105-215-28.ssp.dialog.net.pl] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Phrogz [Phrogz!~Phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
slimfit [slimfit!~slimfit@c-98-245-122-231.hsd1.co.comcast.net] has joined #ruby-lang
whatasunnyday [whatasunnyday!~sunny@c-24-130-81-47.hsd1.ca.comcast.net] has joined #ruby-lang
Heimidal [Heimidal!~heimidal@c-67-165-197-126.hsd1.co.comcast.net] has joined #ruby-lang
<whatasunnyday>
Hi, I'm a bit confused while using the net/http library. I would like to set the waiting for time out parameter to be shorter and I found open_timeout as attr_accessor attribute but I'm not sure if that's what I'm looking or where I would pass it. Would anyone mind enlightening me? Here is the relevant documentation. http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html
flak [flak!~rippa@93-181-235-196.adsl.yaroslavl.ru] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby-lang
<necromancer>
are there any bundles for Jekyll which syntax-highlight YAML front matter?
<necromancer>
for textmate, that is
<necromancer>
or sublime i guess
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
lupine_85 [lupine_85!~lupine_85@unaffiliated/lupine-85/x-7392152] has joined #ruby-lang
<rue>
whatasunnyday: It's an instance method, so you create an HTTP object, and call it on that
<whatasunnyday>
rue: i am very new to programming, so do I use HTTPObject.open_timeout(30)?
brianpWins [brianpWins!~brianpWin@S01060024a5c9e438.vc.shawcable.net] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
wimplash [wimplash!~Adium@wireless.sit-co.net] has quit [#ruby-lang]
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
chalky [chalky!~4eek@41-133-175-232.dsl.mweb.co.za] has joined #ruby-lang
Paoc_ [Paoc_!~paoc@pc-162-161-164-190.cm.vtr.net] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
Pip_ [Pip_!~Pip@188.134.46.174] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
<rue>
whatasunnyday: Net::HTTP::Get.new and so on, I think
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
at5l [at5l!~at5l@unaffiliated/at5l] has joined #ruby-lang
bjensen [bjensen!~brianj@3007ds3-ar.0.fullrate.dk] has joined #ruby-lang
<fragmachine>
is there a way to use Time to calculate how many years and months x seconds equals?
<fragmachine>
so 86400 seconds = 1 day
<fragmachine>
or 31556926 seconds = 1 year etc
Pip_ [Pip_!~Pip@188.134.46.174] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
<whatasunnyday>
rue can i pm you for just a second?
<rue>
Please ask on channel
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
<whatasunnyday>
http = Net::HTTP.new(uri.host, uri.port).open_timeout(30) is this what I should be doing?
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
<apeiros_>
fragmachine: there's a way to use basic maths to calculate that…
<whatasunnyday>
actually
<apeiros_>
fragmachine: though months and years can't be correctly expressed in seconds.
<whatasunnyday>
i think i found an example that would be fitting
<fragmachine>
apeiros_: yea but my maths is horrible. I'm getting stuck on the months bit
<apeiros_>
only if you know which year/month
nfxgosu [nfxgosu!~nekid@117.202.80.125] has joined #ruby-lang
xsdg [xsdg!~xsdg@SIPB-VM-99.MIT.EDU] has joined #ruby-lang
<fragmachine>
I'm close but months is throwing me off. I think 31643326 is supposed to me 1 month 1 year, but I get 1 year 0.008 months! -- http://pastie.org/3272306
<fragmachine>
Someone suggested using modulo but I couldn't figure that out
<apeiros_>
fragmachine: how did you get at 31643326?
<fragmachine>
seconds in year + seconds on month on google
<fragmachine>
*in
<queequeg1>
erikh: thanks :-)
<apeiros_>
fragmachine: so you want to use an approximation? if so, then: 1 day = 86400s, 1 year = 365.2425 days, 1 year = 365.2425*86400
<apeiros_>
1 month = that / 12
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
<apeiros_>
so I get 2629746s per month on average
<apeiros_>
and yes, you'd use divmod, start with the biggest unit and work your way down with the remainder
ilyam [ilyam!~ilyam@c-67-188-113-128.hsd1.ca.comcast.net] has joined #ruby-lang
<apeiros_>
see, if you have 72s, you do 72.divmod(60), you get [1,12] - so 1 is the integral quotient, and 12 the remainder - meaning you have 1min, 12s
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
<fragmachine>
ok so I need to work my way up to months from seconds, then use divmod x_months.divmod(12)?
<apeiros_>
fragmachine: no, as said, you work your way *down*.
<fragmachine>
but I only have seconds to go on
<apeiros_>
so?
<apeiros_>
you have 3672s - 3672.divmod(3600) # => [1,72] - 1 hour, 72s
<zenspider>
semicolon... I didn't even have to read the code! :P
<apeiros_>
NARKOZ: unless cond --> if (!cond)
<zenspider>
negate one of them so the conditional matches, then combine
<zenspider>
I'd negate the if instead since it is cleaner
<zenspider>
unless string.length >= 2
<apeiros_>
I'd agree. but I've noticed lots of people struggle with unless when it has and/ors in it
<zenspider>
sad, isn't it?
<apeiros_>
yes
tbuehlmann [tbuehlmann!~sjdfndsf@unaffiliated/tovias] has joined #ruby-lang
<apeiros_>
worst is when I try to write simple and understandable code, and I still get a "what the heck does that do". you know, even with all intermediary results labeled by properly named lvars…
<apeiros_>
maddens me at times :(
<zenspider>
reading is HARD!
<zenspider>
I swear the generation behind me is so ADD that they've got about a 1.5 second reading buffer
<zenspider>
watching tenderlove go over something that is more than 2 paragraphs is maddening... unless it has kittens
<apeiros_>
:-/
<apeiros_>
kittens are a good reason to keep on reading, tho