<volty>
hmmmm, abstract talker, patterned by micro notions // somebody here said that perfection is an enemy of done // we can paraphrase and say that talking (too much) is an enemy of coding
Spami has quit [Quit: This computer has gone to sleep]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
asteros has joined #ruby
<a_>
volty: enemy of premature coding :)
AmBienCeD has quit [Read error: Connection reset by peer]
<volty>
last evening here came a guy asking about what we think about the bosses that give too little time for preparing app docs (same type)
doodlehaus has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
SilkFox has quit [Ping timeout: 272 seconds]
Synthbread has quit [Remote host closed the connection]
nonks has quit [Ping timeout: 265 seconds]
melik has quit [Quit: (null)]
Avahey has quit [Quit: Connection closed for inactivity]
phutchins has joined #ruby
<volty>
a_: they say honestly that you have to make clear your ideas, your, and just ideas. I bet you'll get it clearer if you start writing the list of services etc etc
tier has joined #ruby
<volty>
s/they/then/
graydot has quit [Quit: graydot]
mistermocha has quit [Remote host closed the connection]
musicmatze1 has quit [Ping timeout: 260 seconds]
<a_>
havenwood: 0_o trying to work out how that isn't sinatra!
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
braincra- has quit [Quit: bye bye]
carlosipe has left #ruby [#ruby]
krz has joined #ruby
SilkFox has quit [Ping timeout: 265 seconds]
braincrash has joined #ruby
administrator has joined #ruby
axl__ has quit [Quit: axl__]
kenneth has joined #ruby
existensil has quit [Quit: WeeChat 0.4.2]
kedare has quit [Remote host closed the connection]
administrator has left #ruby ["Leaving"]
snath has joined #ruby
diegoviola has quit [Quit: WeeChat 1.0.1]
yetanoth1rdave has joined #ruby
Altonymous has joined #ruby
<Altonymous>
Anyone use the PG directly without ActiveRecord that has used the transaction method? I have some code where most of it runs in <10ms except the transaction method.. It’s taking upwards of 500ms+
sailias has quit [Quit: Leaving.]
yetanotherdave has quit [Ping timeout: 272 seconds]
<sevenseacat>
becuase you're comparing a string and a fixnum?
dermothaughey has quit [Read error: Connection reset by peer]
dermothaughey has joined #ruby
zaid_h has quit [Quit: ZZZzzz…]
Anarch has quit [Ping timeout: 245 seconds]
Anarch has joined #ruby
lw has joined #ruby
cmxu has joined #ruby
northfurr has joined #ruby
<rubie>
thanks
toordog has joined #ruby
<northfurr>
is it necessary to preface rake with bin/?
<northfurr>
it seems like they do the same thing
Photism has quit [Quit: Leaving]
Spami has quit [Quit: This computer has gone to sleep]
LoBoGoL has quit [Ping timeout: 250 seconds]
hobodave has quit [Quit: Computer has gone to sleep.]
timonv_ has joined #ruby
charliesome has quit [Quit: zzz]
benzrf is now known as benzrf|offline
phutchins has quit [Ping timeout: 250 seconds]
chrisja has quit [Quit: leaving]
arescorpio has quit [Excess Flood]
<j_mcnally>
northfurr no
<j_mcnally>
northfurr: rake typically gets installed to the ruby bin path when you install the gem, so as long as your gem/bin folder is in path you dont need to run the local one in the rails project
<j_mcnally>
northfurr you can also run "bundle exec rake" if you use bundler
timonv_ has quit [Ping timeout: 265 seconds]
<northfurr>
ah good to know
<northfurr>
thanks j_mcnally
thomasfedb has quit [Disconnected by services]
thomasfedb has joined #ruby
cmckee has joined #ruby
thomasfedb has quit [Disconnected by services]
jdj_dk has joined #ruby
thomasfedb has joined #ruby
narcan has joined #ruby
jhass is now known as jhass|off
jdj_dk has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
Nilium has quit [Read error: Connection reset by peer]
LoBoGoL has joined #ruby
charliesome has joined #ruby
TroyBolton has joined #ruby
<TroyBolton>
hi folks if I want do find a process number say a rails running process nr what do i append to ps aux?
<DmitryM>
ps auxw|grep rails
arup_r has joined #ruby
<gizmore>
there are not much more params that ps accepts
<DmitryM>
or grep ruby perhaps
cndiv has quit [Ping timeout: 260 seconds]
reinaldob has joined #ruby
<gizmore>
Process.pid
Juanchito has quit [Quit: Connection closed for inactivity]
NoNMaDDeN has quit [Remote host closed the connection]
fabrice31 has joined #ruby
dermothaughey has quit [Remote host closed the connection]
skolman_ has quit [Remote host closed the connection]
Soda has quit [Remote host closed the connection]
maxmachine has quit [Read error: Connection reset by peer]
maxmachine has joined #ruby
maxmachine has quit [Client Quit]
skolman has joined #ruby
SilkFox has quit [Ping timeout: 244 seconds]
maxmachine has joined #ruby
maxmachine has quit [Client Quit]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
maxmachine has joined #ruby
maxmachine has quit [Client Quit]
maxmachine has joined #ruby
maxmachine has quit [Client Quit]
skolman__ has joined #ruby
skolman has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
skolman__ has quit [Remote host closed the connection]
skolman_ has joined #ruby
sinequanon has joined #ruby
NoNMaDDeN has joined #ruby
jdj_dk has joined #ruby
oo_ has joined #ruby
oo_ has quit [Client Quit]
jaequery has joined #ruby
nonks has quit [Ping timeout: 240 seconds]
northfurr has quit [Quit: northfurr]
bricker`work has joined #ruby
srnty has quit [Quit: srnty]
spastorino has quit [Quit: Connection closed for inactivity]
fuhgeddaboudit has quit [Quit: Ex-Chat]
fuhgeddaboudit has joined #ruby
ARCADIVS has joined #ruby
jcdesimp has quit [Remote host closed the connection]
jY has joined #ruby
twoshot_ has quit [Quit: Leaving]
narcan has joined #ruby
<jY>
wondering if this is possible.. is there a 1 liner to return all characters before a number in a string like given host-master01 return host-master
TroyBolton has left #ruby [#ruby]
ndrei has joined #ruby
jcdesimp_ has joined #ruby
LoBoGoL has quit [Ping timeout: 250 seconds]
mercwithamouth has joined #ruby
supersym has quit [Ping timeout: 255 seconds]
arup_r has quit [Quit: Leaving.]
TheRinger_ has joined #ruby
<TheRinger_>
I've been learning ruby on codecademy and it's really been a gem
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
Blizzy has joined #ruby
kyb3r_ has joined #ruby
VBlizzard has quit [Ping timeout: 265 seconds]
mengu has quit [Ping timeout: 250 seconds]
bluehavana has quit [Quit: Connection closed for inactivity]
pyon has joined #ruby
LoBoGoL has joined #ruby
robbyoconnor has joined #ruby
carraroj has joined #ruby
<parabolize>
jY: "the number is 42"[/[^0-9]+/]
<parabolize>
stolen from the koans
<jY>
nice.. better then what i just came up with .match(/^.*[0-9]/)[0].gsub(/(\W-|\d)/, "")
skolman_ has quit [Remote host closed the connection]
<VanillaGoat>
Could someone help me out with sprintf/printf formatting? I want 17.2550 to be displayed as "0017.2" -- four digits of precision on the pre-decimal part, one after it.
carraroj has quit [Quit: Konversation terminated!]
<VanillaGoat>
But "%04.1f" doesn't work.
Xeago has joined #ruby
atmosx_ has joined #ruby
rbrs has quit [Ping timeout: 260 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
<VanillaGoat>
"%04d" works for just 17, "%.01f" works for 17.2, but I can't combine them.
atmosx_ has quit [Client Quit]
oponder has joined #ruby
<sevenseacat>
one says .1, one says .01
<atmosx>
ping shevy
<VanillaGoat>
Just a typo in explaining it, %.1f has the same effect
grzywacz has joined #ruby
chinaski has joined #ruby
shock_one has joined #ruby
sk87 has joined #ruby
SouL has joined #ruby
matchaw has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
SouL__ has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
<tmoore>
VanillaGoat: the width includes the decimal part and decimal point, so add two
<VanillaGoat>
tmoore: ahh, perfect. didn't think of that at all, makes sense. thanks a ton
<tmoore>
also it seems to round up instead of truncate :-)
SilkFox has joined #ruby
jdj_dk_ has joined #ruby
Juanchito has joined #ruby
jheg has joined #ruby
roolo has joined #ruby
SilkFox has quit [Ping timeout: 255 seconds]
shock_one_ has joined #ruby
shock_one has quit [Read error: Connection reset by peer]
kaspergrubbe has joined #ruby
Takle has joined #ruby
ki0 has joined #ruby
SouL has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
dangerousdave has joined #ruby
zhigang1992 has joined #ruby
SouL has joined #ruby
timonv_ has joined #ruby
WormDrink has quit [Ping timeout: 260 seconds]
Xeago has quit [Ping timeout: 256 seconds]
riton has joined #ruby
Jet4Fire has quit []
timonv_ has quit [Ping timeout: 260 seconds]
<riton>
Hi guys, can someone explain me what's really happening in this code (https://gist.github.com/riton/9b52b4283243d93fe145) when I use an implicit *return* statement from a "block" VS. when I use an explicit return ? Thanks
ephemerian has joined #ruby
rbrs has joined #ruby
<sevenseacat>
someone's a python programmer lol
<riton>
sevenseacat: me :-), yes :-)
<hanmac1>
riton: for blocks and procs use break/next instead of return
queequeg2 has quit [Ping timeout: 245 seconds]
crazydiamond has joined #ruby
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<riton>
ok, so "implicit" return and "explicit" return are not *always* the same as I could read on the Internet
<riton>
I read that they were syntaxically equivalent
Dude007 has joined #ruby
<riton>
*syntactically
olivier_bK has joined #ruby
<jokke>
ok i'm still stuck with treetop
<jokke>
i'm starting to fear that reverse polish notation shouldnt be parsed with a PEG
queequeg1 has joined #ruby
yetanotherdave has joined #ruby
elaptics`away is now known as elaptics
reinaldob has joined #ruby
zeusmns has joined #ruby
zarubin has joined #ruby
Darryl has joined #ruby
WormDrink has joined #ruby
<jokke>
this: "+ 5 10 - 2" is totally easy to parse
<jokke>
but this: "5 10 + 2 -" is not
relix has joined #ruby
<shevy>
hey atmosx
Squarepy has joined #ruby
Squarepy has joined #ruby
Squarepy has quit [Changing host]
<shevy>
riton they are somewhat similar - explicit return allows you to return at any one time though, "implicit" return as such does not exist per se because whatever is "returned" last in a method becomes what is returned anyway; in these cases you can omit the explicit return statement there
goshdarnyou has quit [Quit: Connection closed for inactivity]
hellangel7 has quit [Read error: Connection reset by peer]
yetanotherdave has quit [Ping timeout: 260 seconds]
<shevy>
what is that?
<ddv>
shevy: that is a lot of text to explain how returning works
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<ddv>
shevy: did you do that on purpose?
<shevy>
ddv I typed the above on purpose
<shevy>
ddv do you type accidentally?
<ddv>
always
<shevy>
I let my cat do the latter
<riton>
shevy: yes, this was what I understood, but what I don't "really" understand is why using explicit *return* from a block does not propagate the returned value to the "wrapper" function
<hanmac1>
shevy i let my ruby part of rwx scan with codeclimate
<shevy>
riton well a block must return something, but it can be discarded; if you need the value, you can check in that method (we say method and not function btw) through: result = yield if block_given?
mmochan_ has joined #ruby
<shevy>
foo { '42' }
fandi has joined #ruby
lemur has quit [Ping timeout: 244 seconds]
FooMunki has joined #ruby
Scotteh has quit [Quit: Later, folks]
zarubin has quit [Quit: Leaving.]
chipotle has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
einarj has joined #ruby
zarubin has quit [Client Quit]
chipotle has joined #ruby
sk87 has joined #ruby
gauke has quit [Quit: gauke]
HelperW has joined #ruby
bayed has joined #ruby
M3M0CooL has joined #ruby
einarj has quit [Remote host closed the connection]
einarj has joined #ruby
rdark has joined #ruby
PeterBoy has joined #ruby
agjacome has joined #ruby
ELLIOTTCABLE has joined #ruby
<riton>
shevy: thanks for your patience / time. My question could be formulated as "where did my *returned* value went when I use explicit return as it's not returned to the wrapper() method ? I understood that within a block, I should use break/next and implicit return but still, being unable to use *return* from a block is disturbing.
<riton>
Perl has the same thing with implicit return "If a subroutine “falls off the end” without ever encountering an explicit return, the value of the last expression evaluated in a subroutine is returned." but using an explicit return has the same behavior
unshadow has joined #ruby
pedromoreira has joined #ruby
<riton>
this is this difference of behavior in ruby between "explicit return from a block" VS "implicit return from a block" that disturbs me
<riton>
even if I can "admit" this is the way it works :-)
<zhigang1992>
fddd
<atmosx>
shevy: should I let the user define his own stop codons? hm
<jheg>
o/
Lewix has quit [Remote host closed the connection]
<jheg>
is it only classes that create objects in ruby?
yfeldblum has joined #ruby
zhigang1992 has quit [Quit: leaving]
<jheg>
jus trying to understand things a little clearer and wondered about the fact that if everything in ruby is an object and lets say a method returns an integer for example then hasnt the method created an object?
<atmosx>
and a good question is how to do that from the user interface since these are hard-coded in the library shit..
<unshadow>
Can I control the SSL parameter in OpenSSL::SSL::SSLSocket ? for example change ciphers chosen and SSL\TLS protocols used , maybe as a value change in ssl context ? I can seems to find any documentation on the subject
<unshadow>
*can't
yfeldblu_ has quit [Ping timeout: 246 seconds]
timonv_ has joined #ruby
<atmosx>
unshadow: you can yes, but there's not documentation on the subject, true.
pedromoreira has quit [Quit: WeeChat 1.0]
<atmosx>
generally speaking everyone avoids messing with SSL
timonv^ has joined #ruby
timonv_ has quit [Read error: Connection reset by peer]
<unshadow>
atmox: Ok, I need to, sadly, mess with SSL for security reasons (the SSL default options are terrible), do you have some experience with the subject ? or at lest show me the right direction ?
gauke has joined #ruby
FooMunki has quit [Quit: FooMunki]
cmxu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<unshadow>
* atmosx
TPBallbag has joined #ruby
iamdoo2_ has quit []
<atmosx>
unshadow: ah sorry, not really. I messed with SSL some time ago trying to pass some options, remember finding some random examples on some github support posting... Tried to ask/etc no one *knew*
jdj_dk_ has joined #ruby
<unshadow>
Well... ok :(
ELLIOTTCABLE has quit [Quit: Lost terminal]
<atmosx>
wait
marr has joined #ruby
<atmosx>
let me try to take a look at the code, might give you an idea on how to pass arguments
joonty has joined #ruby
shredding has quit [Quit: shredding]
<shevy>
atmosx yes you must, some organelles etc.. use different stop codons
<atmosx>
oh shit, lol. Sorry man, in the end I used Faraday to load ca_cert ... I remember messing with SSL directly at some point but I don't have the code anymore.
<atmosx>
shevy: and how can I do that :-/ since these are kinda hard-coded there.
<atmosx>
10 => %w(taa tag) ... there are the predefined bacterial stop codons
SilkFox has joined #ruby
brushdemon has joined #ruby
sevenseacat has quit [Quit: Leaving.]
poulet_a has joined #ruby
kedare has joined #ruby
<shevy>
good question hehehehe
tvw has quit []
hiyosi has quit [Ping timeout: 260 seconds]
<shevy>
where are they applied?
bitonic has joined #ruby
<shevy>
I mean there must be some area in the code that uses TABLES
<bitonic>
I'm trying to install `atomic' on linux (I need it for travis), I get this bizarre configure error "checking for libkern/OSAtomic.h... *** extconf.rb failed ***"
<bitonic>
apparently the configure file thinks I'm on Mac OS X
brushdemon has quit [Client Quit]
brushdemon has joined #ruby
kedare has quit [Remote host closed the connection]
coderhs has quit [Ping timeout: 272 seconds]
SilkFox has quit [Ping timeout: 255 seconds]
kedare has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bitonic>
I don't know anything about ruby or gems, how do I debug this?
ctp has joined #ruby
matchaw has quit [Ping timeout: 244 seconds]
carraroj has joined #ruby
patric100e99 has joined #ruby
<hanmac1>
bitonic: when you try to install it it should print more output
<ctp>
hi folks. i have a hash like this: {"cat1"=>["foo","bar"],"cat2"=>["bla","fa"],"cat3"=>["baz","foobar"]} and wanna return a random pair of catX and the appropriate element of its value array. {"cat1"=>["foo","bar"],"cat2"=>["bla","fa"],"cat3"=>["baz","foobar"]}.values.flatten.sample retrieves a random key and fetches e.g. "baz" but how to lookup then for the corresponding key? like {"cat3"=>"baz"}
HelperW_ has joined #ruby
HelperW_ has quit [Client Quit]
HelperW_ has joined #ruby
<hanmac1>
bitonic: there is /home/bitonic/src/travis/travis-worker/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/atomic-1.1.16/gem_make.out which might be interesting if it does have more input
<ctp>
s/retrieves a random key/retrieves a random value
zarubin has joined #ruby
<bitonic>
the <mkmf.log> contains, another error, <http://pastebin.com/K5SANkue>. I think that flag is available only in gcc 4.9
<ctp>
the values are unique btw
zarubin has quit [Client Quit]
<bitonic>
hanmac1: right, that file contains what I posted in the first pastebin
HelperW has quit [Ping timeout: 258 seconds]
Takle has quit [Read error: Connection reset by peer]
Takle_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
kaspergrubbe_ has joined #ruby
<hanmac1>
hm i dont know where the flag is coming from, and i currently cant debug it myself
patric100e99 has quit [Ping timeout: 250 seconds]
<bitonic>
hanmac1: well, I also tried to set CC=ghc-4.9 but it doesn't seem to honour it
relix has joined #ruby
davidhq has joined #ruby
carraroj has quit [Ping timeout: 272 seconds]
TPBallbag has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<hanmac1>
hm bitonic how did you build ruby?
FooMunki has joined #ruby
<bitonic>
hanmac1: through apt on debian jessie
User458764 has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
GeorgesLeYeti has joined #ruby
<hanmac1>
hm ah ok i was wondering because its confusing where that flag does come from ... :/
fabrice31 has quit [Read error: No route to host]
unshadow has quit [Quit: leaving]
fabrice31 has joined #ruby
<hanmac1>
bitonic: you did CC=gcc-4.9 too right and not CC=ghc-4.9 ?
<bitonic>
hanmac1: yep
<ctp>
hm, anyone here can explain me why the key by value lookup doesnt work in this snippet?
<ctp>
2.1.3 :012 > h = {"cat1"=>["foo","bar"],"cat2"=>["bla","fa"],"cat3"=>["baz","foobar"]}
<jheg>
take that gist for example. Animal is a subclass of GoodDog I think?
<shevy>
gregf_ I don't feel in any particular way whether you interrupt or not, it's all good for me
supersym has joined #ruby
yetanotherdave has quit [Ping timeout: 272 seconds]
<gregf_>
jheg: nope, animal is the superclass :/
<jheg>
so when I init an instance of GoodDog I thought it will use its own speak method and if it isnt there (like in the Cat class) it then uses the mthod defined in the subclass
<jheg>
ah!
<shevy>
jheg the subclass will look for the parent
<jheg>
Gotcha that explains it then ha thank you
<shevy>
"mother, has this method? if yes, run that method"
<jheg>
So GoodDog < Animal
<shevy>
my english just downgraded towards japanese english
<jheg>
GoodDog subclass - Animal Superclass
<jheg>
?
<gregf_>
the superclass should'nt be instantiated(it can be abstract). thats the whole reason for inheritance :/ OOPS
hobodave has quit [Quit: Computer has gone to sleep.]
<shevy>
jheg yes
<jheg>
ta
<shevy>
you can memorize this super easy - in ruby there is the method called super() which you can use in your subclass, to call the super-class (method)
<shevy>
def foo
masak_grr is now known as masak
AndChat|80625 has joined #ruby
<shevy>
super('hey there these arguments will be passed to the parent method')
<shevy>
I use this sometimes for when my objects have a reset() method
<shevy>
this I use to reset a default / clean state. sometimes subclasses need slightly adapted reset methods yet still have to tap towards the original parent method
ad_boot has quit [Quit: ad_boot]
<shevy>
gregf_ what do you do when you have to rewrite something
<shevy>
but you lost your motivation along the way
<jheg>
thanks shevy
<shevy>
\o/
<gregf_>
shevy: sorry din get you
<gregf_>
rewrite as in refactor?
<shevy>
since some days I have not continued on an important project
<shevy>
so my main way to compile and install programs is broken
<shevy>
I have a second smaller project, with less code and less features that still works
<shevy>
well yeah gregf_ but massive refactoring
<shevy>
basically you'd end up rewriting just about everything (potentially)
robbyoconnor has joined #ruby
jimbach has joined #ruby
mengu has quit [Remote host closed the connection]
<gregf_>
shevy: well if the design is right the rest will follow. its not difficult to write bad code and feel good about it :/.
<shevy>
the original design kinda stinks
<jhass>
gregf_: not quite true. Where you use abstract classes, in ruby you would use modules
nonks has joined #ruby
<shevy>
which is why I had to rewrite :(
<shevy>
for some reason, big projects suck away a lot of time
devdazed has quit [Quit: Computer has gone to sleep.]
jdj_dk_ has joined #ruby
<ddv>
I wanted to read some silly xml for an app, I endedup creating an activerecord like abstraction to read xml
HelperW has joined #ruby
techsethi has quit [Quit: techsethi]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
robbyoconnor has quit [Client Quit]
<jhass>
arel for xpath? :P
volty has joined #ruby
<shevy>
yum
<shevy>
xml
<volty>
hi, trying to go speedy, haml, let's say I have a string containing haml source, how can I invoke haml, from inside a ruby script, to convert to html ?
decoponio has joined #ruby
<ddv>
you need a phd to understand arel but something close to that
rdark has quit [Ping timeout: 272 seconds]
<gregf_>
jhass: true in ruby. but yeah, in java/PHP/Perl(Moo(se)?) you would usually implement an interface/Role or extend from an abstract class
rdark has joined #ruby
bal has quit [Quit: bal]
<volty>
found, ignore
shock_one_ has joined #ruby
<jhass>
I disagree that all classes you want to instantiate are always the leaves of the inheritance tree, it's just the more common case
<shevy>
well
<shevy>
try to model the "tree of life"
nonks has quit [Ping timeout: 265 seconds]
<shevy>
when it was supposed to be "one common ancestor", it is all fine, but the moment it was realized that you can have "multiple inheritance" in reallife when DNA is exchanged freely especially among "lower" organisms, a strict single-parent hierarchy will fail hence why modules really are so much nicer
<gregf_>
yeah, you can have layers of abstraction where every class in the hierarcy can be instantiated
SilkFox has joined #ruby
<shevy>
I sometimes want my modules to be instantiatable too!
<gregf_>
i prefer mixins tbh :/ less code duplication
krz has quit [Quit: WeeChat 1.0.1]
<shevy>
but I can only instantiate classes... and when I am there, I can no longer use a class as mixin
<gregf_>
true
twistedpixels is now known as zz_twistedpixels
<volty>
shevy, you can, though it's tricky and must convention based
artmann has quit [Quit: No Ping reply in 180 seconds.]
<volty>
s/must/has to be/
<shevy>
I can include a class?
artmann has joined #ruby
<volty>
no, the modules, you were talking about instantiating modules
<shevy>
I am talking about both actually - instantiating a module and including a class :)
weemsledeux has joined #ruby
weemsledeux has joined #ruby
bal has joined #ruby
techsethi has joined #ruby
<shevy>
though how do you instantiate a module volty?
<volty>
intercepting new
lw has joined #ruby
alex88 has joined #ruby
alex88 has quit [Client Quit]
rotor has quit [Ping timeout: 272 seconds]
alex88 has joined #ruby
shock_one_ has quit [Ping timeout: 260 seconds]
ixti has joined #ruby
<volty>
and including with another include, e.g. qinclude
SilkFox has quit [Ping timeout: 246 seconds]
<volty>
tricky but suited my need for extension-like initializers
JohnBat26 has joined #ruby
<shevy>
huh
<shevy>
you can intercept new?
Deejay_ has joined #ruby
<shevy>
I need to test this
<volty>
of course, redefine, aliasing
aclearman037 has joined #ruby
<volty>
you know haml?
<shevy>
only from the name
<shevy>
and it looked complicated!
<volty>
i like what I see, just started
sigurding has quit [Quit: sigurding]
<volty>
but do not realize yet where from the data gets pulled
RyanV has quit [Quit: (null)]
likemike has joined #ruby
chipotle has quit [Remote host closed the connection]
<likemike>
in ARGV.each do |a| how do i check if a is empty ?
lw has quit [Quit: s]
tokik has joined #ruby
<volty>
cannot be empty
chipotle has joined #ruby
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<likemike>
volty: i mean when you do pass a commandline argument so you check for it and display an error
IrishGringo has joined #ruby
<volty>
ah, with OPTS
blackmesa has quit [Ping timeout: 240 seconds]
dangerousdave has quit [Client Quit]
<volty>
optparse, .e.g. ?
dangerousdave has joined #ruby
alex88 has quit []
<volty>
but I think that optparse already handles that for you
<volty>
anyway: if you do it manually you cannot check that way
<likemike>
volty: so without optparse i cannot check it ?
<volty>
not that way
<likemike>
how then ? :-)
<volty>
you have to check if there is a right param next to the option
doev has quit [Ping timeout: 272 seconds]
<volty>
rewriting the optparse :)
<likemike>
:D
doev has joined #ruby
alex88 has joined #ruby
NoNMaDDeN has quit [Quit: Leaving...]
<volty>
but writing, yourself, such a thing, you learn a lot
rossgeesman has joined #ruby
shredding has quit [Quit: shredding]
NoNMaDDeN has joined #ruby
gaboesquivel has joined #ruby
<volty>
basically you have to convert an array into hash where the keys are the options
jottr has joined #ruby
jdj_dk_ has quit [Read error: Connection reset by peer]
doev has quit [Read error: Connection reset by peer]
jdj_dk_ has joined #ruby
whowantstolivefo has joined #ruby
zaid_h has quit [Quit: ZZZzzz…]
rotor has joined #ruby
benzrf|offline is now known as benzrf
<shevy>
likemike basic things first
<shevy>
likemike anything you pass from the commandline to a ruby .rb script, is stored in ARGV
<shevy>
that means when you do this:
<shevy>
ruby testing.rb --help
<shevy>
then ARGV will be exactly this:
<shevy>
["--help"]
<shevy>
now there are several ways to check this information
jheg has quit [Quit: jheg]
<shevy>
as it is an Array, you can manually act on the information passed there, using .each for instance
<shevy>
I often do something like this:
<shevy>
foo = MyClass.new
<shevy>
foo.menu(ARGV) unless ARGV.empty?
AlSquire has joined #ruby
spastorino has joined #ruby
<shevy>
where menu is the menu-interface I use to handle stuff. I can optionally connect this with optparse if I need to act on things like "--set-base_directory=/tmp"
<shevy>
for things like -- combined with a value, optparse is indeed simpler than writing the code all by yourself
<jhass>
do you have a .rspec or so that enables them?
northfurr has joined #ruby
FooMunki has joined #ruby
Xeago_ has joined #ruby
thsig has joined #ruby
andikr has quit [Remote host closed the connection]
<jheg>
I have 3 subclasses and a superclass. The subclasses are MyBoat, MyCar & MyTruck and the superclass is Vehicle. Each time I initiate a new class object (boat1 = MyBoat.new) I want the Vehicle class to keep a tally of the total number of vehicles.
<wasamasa>
csmrfx: I don't get why you'd want ruby to compile to elisp
<wasamasa>
csmrfx: the programmer has still to know the emacs internals, elisp and additionally to that ruby and your dsl
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jheg>
it only seems to be counting the MyBoat and MyTruck
<jheg>
is it something to do with the initialize method in MyCar ?
<lessless>
jhass: oh my,... it was a rspec who enabled them! thank you
eikood has quit [Quit: Leaving]
<ddv>
I feel like we are doing your homework, jheg
<csmrfx>
wasamasa: but you understand why I would want to embed vim in emacs? 8D
chipotle has quit [Read error: Connection reset by peer]
GPH|work has joined #ruby
chipotle_ has joined #ruby
Xeago has quit [Ping timeout: 260 seconds]
jerius has joined #ruby
<jhass>
jheg: well you override the method and don't call the one that does the tracking
<wasamasa>
csmrfx: I don't get that either
oleo has joined #ruby
<wasamasa>
csmrfx: because that would be slow, error-prone and not inspectible or extensible
<wasamasa>
csmrfx: you'd rely on an external program for all the work
<wasamasa>
csmrfx: besides, there's already an excellent package that gives you the editing model
<jheg>
jhass: is the overide from me initializing within MyCar?
<csmrfx>
wasamasa: indeed, it is just humor
<jhass>
jheg: you override the initialize method in MyCar, yes
<wasamasa>
csmrfx: I'm just sort of horrified the question keeps popping up regularly
<csmrfx>
16:10 < hanmac1> shevy: emacs now has a html browser ... now it only needs a nice editor to be a great OS ;P
techsethi has quit [Quit: techsethi]
rbrs has joined #ruby
lkba has joined #ruby
agjacome has quit [Ping timeout: 260 seconds]
Squarepy has quit [Quit: Leaving]
<jheg>
Thank you jhass - I added the class variable from the superclass into the initialize method and it seems to work
yfeldblum has joined #ruby
<shevy>
csmrfx but hanmac1 is not joking :)
northfurr has quit [Quit: northfurr]
likemike has quit [Quit: Lost terminal]
<jheg>
ddv sorry but this chan has been really usefull. I am new and OOP is quite overwhelming as a newcomer so if I seem like I am asking you to do my homework I can assure you that it is not the intention
sprihodko has quit [Quit: (null)]
qwyeth has joined #ruby
noop has quit [Ping timeout: 260 seconds]
<shevy>
ddv wash my pants!
<shevy>
ddv take my dogs out for a walk!
<shevy>
ddv cook something now!
<jhass>
jheg: how about calling the original method instead?
<ddv>
ok
lxsameer has quit [Quit: Leaving]
narph has joined #ruby
kp666 has quit [Read error: Connection reset by peer]
<jheg>
sorry I don’t understand jhass
<jhass>
you can call the parent class method with the same name with supoer
<jhass>
*super
<jheg>
do you mean creating a method to store the number of vehicles?
<jheg>
ah ok
yfeldblum has quit [Ping timeout: 246 seconds]
rkalfane has joined #ruby
msmith has joined #ruby
mary5030 has joined #ruby
msmith_ has joined #ruby
hanmac1 has quit [Quit: Leaving.]
slester has joined #ruby
msmith has quit [Read error: Connection reset by peer]
Akagi201 has quit []
<TheBrayn>
which yaml edition does the yaml parser for ruby 1.8.7 support?
<rpag>
sync engine afaik
<rpag>
oops
<rpag>
syck*
<TheBrayn>
so the first edition
<TheBrayn>
thanks
<jhass>
TheBrayn: note that 1.8.7 is EOL
<shevy>
LONG LIVE 1.8.x!!!
<shevy>
TheBrayn for past 1.8.x you can use the syck gem still, if you do not want to switch to psych
Guest41318 has joined #ruby
NoNMaDDeN has quit [Remote host closed the connection]
NoNMaDDeN has joined #ruby
niklasb has joined #ruby
lukeholder has joined #ruby
jdj_dk has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
<ddv>
get rid of 1.8 :P
baordog has quit [Ping timeout: 250 seconds]
beef-wellington has joined #ruby
<shevy>
I can't compile it anymore, anyway
<Nilium>
GET RID OF 1.8 ಠ_ಠ
<shevy>
I think they must have sneakily slipped in some bug
shazaum has quit [Quit: This computer has gone to sleep]
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
dermothaughey has joined #ruby
yetanotherdave has quit [Ping timeout: 246 seconds]
<jheg>
cheers apeiros
<apeiros>
definity_: also `puts "#{myHash}"` is the same as `puts myHash`. but you probably should use `p myHash` instead (or require 'pp' and use pp myHash`
<definity_>
apeiros: Okay thanks :), My second stab at Ruby it is intresting compared to Perl.
<apeiros>
definity_: also [] is for arrays. so your second one (`["key1" => "value1", "key2" => "value2", "key3" => "value3"]`) is defining an array with a hash inside
jfran has joined #ruby
<jhass>
definity_: "my way" is just an expanded version of "your first way"
Takle has joined #ruby
<jhass>
it's equivalent
<apeiros>
definity_: note that `puts obj` calls obj.to_s, while `p obj` calls obj.inspect. and inspect is almost always what you want for debugging.
Aaaal has joined #ruby
troulouliou_dev has joined #ruby
shock_one_ has quit [Ping timeout: 244 seconds]
* apeiros
off, laters
apeiros has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
apeiros has joined #ruby
weemsledeux has joined #ruby
jheg has quit [Quit: jheg]
workmad3 has joined #ruby
marcel has joined #ruby
joonty has quit [Quit: Leaving]
<definity_>
Ahh I see, so puts is only really good for non debugging purposes, but for the writting fo the code you would use p becuase it has diffrent instance methods?
<definity_>
like inspect
ixti has joined #ruby
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
apeiros has quit [Ping timeout: 250 seconds]
mengu has quit []
gregf has quit [Quit: WeeChat 1.0.1]
<jhass>
definity_: it _uses_ a different method to get a string representation of the object
jobewan has joined #ruby
phantummm has joined #ruby
<waxjar>
all objects have an inspect method and a to_s method. inspect is useful for developers, to_s is useful for everyone
<waxjar>
but the most important reason to use p over puts is that it's three characters shorter :P
rylev has joined #ruby
<jhass>
also it returns the first argument, which makes it handy to arbitrarily insert into any expression
sk87 has joined #ruby
SilkFox has joined #ruby
siwica has joined #ruby
sevenseacat has left #ruby [#ruby]
<shevy>
waxjar well you can do this: alias e puts
siwica1 has quit [Ping timeout: 255 seconds]
Timgauthier is now known as timgauthier_away
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jheg has joined #ruby
<Liendre>
are any of you hacking my pc?
siwica1 has joined #ruby
nateberkopec has quit [Read error: Connection reset by peer]
<ddv>
Liendre: shevy probably
paulfm_ has joined #ruby
reinaldob has quit [Remote host closed the connection]
<Liendre>
my codecademy is not working properly
<Liendre>
see
<Liendre>
now is better
<definity_>
Is there a way to specifi a range in ruby like 1..10?
<workmad3>
ddv: well, you did try to do an infinite loop :P
kaspertidemann has quit []
lukeholder has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ddv>
True that
freerobby has joined #ruby
djstorm has joined #ruby
shortCircuit__ has quit [Remote host closed the connection]
ylluminarious has quit [Ping timeout: 246 seconds]
siwica1 has quit [Ping timeout: 244 seconds]
snath has quit [Ping timeout: 240 seconds]
rossgeesman has quit [Remote host closed the connection]
gaganjyot has joined #ruby
gaganjyot has quit [Read error: Connection reset by peer]
gaganjyot has joined #ruby
phutchins has quit [Ping timeout: 244 seconds]
it0a has joined #ruby
mary5030 has joined #ruby
valeriansaliou has joined #ruby
mary5030 has quit [Remote host closed the connection]
linguini has joined #ruby
tagrudev has quit [Remote host closed the connection]
apeiros has joined #ruby
mary5030 has joined #ruby
Techguy305 has joined #ruby
gsd has joined #ruby
Techguy305 has quit [Client Quit]
<shevy>
why is my nick used so often with eval
Snickers has quit [Ping timeout: 260 seconds]
siwica has joined #ruby
<workmad3>
shevy: because you're the person least associated with finding out who unnecessarily hilighted them in IRC and visiting the person's house with a baseball bat late at night?
paulfm_ has quit []
paulfm has joined #ruby
<shevy>
hey
<shevy>
I don't have a baseball bat
<shevy>
but I would come
aclearman037 has quit [Ping timeout: 255 seconds]
jxf has joined #ruby
agjacome has joined #ruby
rossgeesman has joined #ruby
<apeiros>
hm, rubycaribe is quite a bit expensive
paulfm has quit [Client Quit]
* apeiros
pondered going, but at that price… probably not
aclearman037 has joined #ruby
fsapo has quit [Remote host closed the connection]
marr has joined #ruby
siwica has quit [Ping timeout: 255 seconds]
<shevy>
how much does it cost?
<ddv>
1599
codeurge has joined #ruby
allcentury has joined #ruby
nateberkopec has joined #ruby
<apeiros>
$1599 the ticket, $269/night the hotel (you need at least 4 nights) and for me about $800 the flight
agjacome has quit [Ping timeout: 255 seconds]
<apeiros>
so with $200 early booking rebate, it's at least $3300 just to cover the basic costs
renderful has joined #ruby
<linguini>
Is there a way to call the "super" of another method, something like http://ix.io/eSz ?
mistermocha has joined #ruby
<apeiros>
linguini: if you want to do that, you're doing it wrong.
siwica has joined #ruby
blackmesa has joined #ruby
<apeiros>
linguini: but yes, there is a way: A.instance_method(:f).bind(self).call
<linguini>
apeiros: Yes, perhaps. The problem is that B::f is so big that I wanted to break it down into smaller methods. But when I attempted to do that, calls to super broke.
jheg has quit [Read error: Connection reset by peer]
jheg_ has joined #ruby
<apeiros>
linguini: so you indeed did it wrong :-)
<apeiros>
but can't help you with the wrongdoing with the given information
<linguini>
apeiros: Thanks. I'll think about this. I don't really want A.instance_method(:f).bind(self).call ...
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
siwica has quit [Ping timeout: 245 seconds]
<TheBrayn>
I'm not sure if that's even required
<apeiros>
also, readConfig (should name it read_config): def read_config; @hosts = File.readlines(@config); end
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
tkuchiki has quit [Ping timeout: 255 seconds]
<apeiros>
yeah, reading the next line you actually just want params.define_singleton_method. but that method looks horribly wrong.
<apeiros>
$1 is a not-really-global which depends on a previously run regex matching operation
<shevy>
hehehe
sk87 has joined #ruby
mikecmpbll has joined #ruby
PierreRambaud has quit [Ping timeout: 260 seconds]
cmckee has joined #ruby
sk87 has quit [Client Quit]
<apeiros>
TheBrayn: and to actually answer your question: you forgot to call render after params.new(@hosts
reinaldob has joined #ruby
SilkFox has joined #ruby
havenwood has joined #ruby
sk87 has joined #ruby
ylluminarious has joined #ruby
Timgauthier has joined #ruby
<TheBrayn>
but how can I pass arguments to a method which has been defined with define_singleton_method?
sigurding has quit [Quit: sigurding]
dermothaughey has quit []
shock_one_ has joined #ruby
yfeldblum has joined #ruby
volty has joined #ruby
dermothaughey has joined #ruby
sigurding has joined #ruby
SilkFox has quit [Ping timeout: 255 seconds]
dumdedum_ has quit [Quit: foo]
jdj_dk has quit [Ping timeout: 265 seconds]
aclearman037 has quit []
Macaveli has joined #ruby
Macaveli has quit [Max SendQ exceeded]
aclearman037 has joined #ruby
thisguy123 has quit [Ping timeout: 244 seconds]
Macaveli has joined #ruby
fabrice31 has quit [Remote host closed the connection]
shredding has quit [Quit: shredding]
weemsledeux has quit [Read error: Connection reset by peer]
kaspergrubbe_ has joined #ruby
kaspergrubbe has quit [Read error: Connection reset by peer]
weemsledeux has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
weemsledeux has quit [Client Quit]
aclearman037 has joined #ruby
rossgeesman has quit [Remote host closed the connection]
patric100e99 has joined #ruby
Takle has quit [Remote host closed the connection]
rossgeesman has joined #ruby
shredding has joined #ruby
<rpag>
define_singleton_method(:foo) { |arg1| }
einarj has quit [Remote host closed the connection]
weemsledeux has joined #ruby
iamjarvo has joined #ruby
PierreRambaud has joined #ruby
GreatSUN has quit [Ping timeout: 246 seconds]
gauke has quit [Quit: gauke]
bbloom has quit [Ping timeout: 246 seconds]
<banisterfiend>
rpag hey bro what's up
mikecmpbll has quit [Quit: ciao.]
anarang has joined #ruby
timonv_ has joined #ruby
mikecmpbll has joined #ruby
Takle has joined #ruby
patric100e99 has quit [Ping timeout: 246 seconds]
rossgeesman has quit [Remote host closed the connection]
HelperW has quit [Quit: (null)]
testcore has joined #ruby
bbloom has joined #ruby
<Hanmac>
banisterfiend: look https://codeclimate.com/github/Hanmac/rwx i added something to make my samples better in the process ;P (in addition to specs and other tests)
Guest41318 has quit [Remote host closed the connection]
<linguini>
FWIW, an attempt at avoiding A.instance_method(:f).bind(self).call : http://ix.io/eSB -> http://ix.io/eSC . :-/ I'm sure there's a better design pattern here I have yet to identify.
zaid_h has joined #ruby
renderful has quit [Remote host closed the connection]
<apeiros>
linguini: on a glance, that looks *horrible*
juglx has joined #ruby
Timgauthier has quit [Read error: Connection reset by peer]
<apeiros>
but since it's 100% abstract - again: can't help with that little information.
lessless has quit [Remote host closed the connection]
phutchins has joined #ruby
msmith__ has joined #ruby
Timgauthier has joined #ruby
rossgeesman has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonr22 has joined #ruby
sysTemz- has quit [Quit: oooooh]
msmith__ has quit [Client Quit]
valeriansaliou has quit [Ping timeout: 250 seconds]
<shevy>
it is as horrible as A.instance_method(:f).bind(self).call
gsd has joined #ruby
Kricir has quit [Ping timeout: 244 seconds]
<linguini>
I can't disagree. :-/
<linguini>
Unfortunately, the concrete version is rather long, and full of business-specific terminology, and I suspect harder to understand.
cmckee has quit [Quit: cmckee]
Loplin has joined #ruby
matchaw has joined #ruby
snath has joined #ruby
renderful has quit [Remote host closed the connection]
sdwrage has quit [Quit: This computer has gone to sleep]
jheg_ has quit [Quit: jheg_]
itspots has joined #ruby
<linguini>
I basically want to override a single method for one wonky-ish business case. But wonky business case is so wonky, I want to break it down into multiple methods.
<linguini>
Here's another (abstract) attempt that allows me to refactor messy code into another method: http://ix.io/eSE
cmckee has joined #ruby
jdj_dk has joined #ruby
renderful has joined #ruby
beneggett has joined #ruby
aspires has joined #ruby
claw has quit [Ping timeout: 245 seconds]
claw_ has joined #ruby
<gyre007_>
I was here earlier asking about vim-ruby plugin, but the room was fairly empty so im giving this a shot again
<shevy>
DIE VIM!!!
<gyre007_>
anyone here uses vim-ruby plugin ?
<gyre007_>
lol
Xeago_ has quit [Ping timeout: 272 seconds]
<rpag>
i used it a long time ago, it's weird to use
doev has joined #ruby
<shevy>
I am not even sure how many people still use vim here
Loplin has quit [Ping timeout: 272 seconds]
<rpag>
i progressed from vim to emacs
sdwrage has joined #ruby
<shevy>
I dunno
<shevy>
sounds like a downgrade
<shevy>
both ways too, btw :)
<rpag>
lol
<shevy>
from vim to emacs or emacs to vim
thisguy123 has joined #ruby
<shevy>
jhass used to be a vimster
<shevy>
or a hamster
<gyre007_>
ok :-)
<eam>
emacs in viper-mode is a better vi than vim
<shevy>
then he picked sublime
<rpag>
im use to emacs by now
<gyre007_>
got my answer then - as like I wont get it here haha
<shevy>
so you are like matz
<shevy>
gyre007_ nah, you only need to wait until a vimster shows up
<jhass>
shevy: where did I say so?
<gyre007_>
and ask again haha
<rpag>
i answered your question
<shevy>
jhass years ago
<rpag>
is there a more specific one?
cmckee has left #ruby [#ruby]
DrCode has quit [Ping timeout: 246 seconds]
diegoviola has joined #ruby
<jhass>
shevy: it's simply untrue
<shevy>
you never used vim?
<jhass>
not as my main editor
omosoj has joined #ruby
<jhass>
gedit -> scribes -> sublime
jonr22 has quit [Ping timeout: 272 seconds]
<shevy>
see gyre007_ now that is a sane transition
<gyre007_>
haha
sharms has joined #ruby
testcore has quit [Ping timeout: 246 seconds]
doev has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
renderful has quit [Remote host closed the connection]
multi_io has joined #ruby
codeurge has quit [Ping timeout: 246 seconds]
stunder has quit [Ping timeout: 258 seconds]
geoextra has quit [Remote host closed the connection]
renderful has joined #ruby
geoextra has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
niklasb has quit [Quit: WeeChat 1.0.1]
multi_io_ has quit [Ping timeout: 244 seconds]
spyderman4g63 has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
t_mmyv has joined #ruby
volty has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
Loplin has joined #ruby
NoNMaDDeN has joined #ruby
spyderman4g63 has quit [Read error: Connection reset by peer]
Loplin has quit [Max SendQ exceeded]
SCHAAP137 has joined #ruby
mkaesz has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
SCHAAP137 has quit [Excess Flood]
spyderman4g63 has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
spyderman4g63 has joined #ruby
Loplin has joined #ruby
havenwood has joined #ruby
Loplin has quit [Max SendQ exceeded]
cmckee has quit [Quit: cmckee]
Spami has quit [Quit: This computer has gone to sleep]
cmckee has joined #ruby
Dude007 has quit [Remote host closed the connection]
Loplin has joined #ruby
az7ar is now known as az7ar_away
Loplin has quit [Max SendQ exceeded]
Loplin has joined #ruby
sdwrage has joined #ruby
Loplin has quit [Max SendQ exceeded]
chipotle has quit [Read error: Connection reset by peer]
az7ar_away is now known as az7ar
lw has joined #ruby
Loplin has joined #ruby
tier_ has joined #ruby
chipotle has joined #ruby
Loplin has quit [Max SendQ exceeded]
troulouliou_dev has quit [Ping timeout: 258 seconds]
carraroj has quit [Ping timeout: 240 seconds]
Loplin has joined #ruby
jonr22 has joined #ruby
Loplin has quit [Max SendQ exceeded]
timonv_ has quit [Remote host closed the connection]
jdj_dk has quit [Read error: Connection reset by peer]
spyderman4g63 has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
skolman has joined #ruby
tonini has joined #ruby
Loplin has joined #ruby
Loplin has quit [Max SendQ exceeded]
Xeago_ has joined #ruby
Loplin has joined #ruby
rkalfane has joined #ruby
lw has quit [Read error: Connection reset by peer]
Loplin has quit [Max SendQ exceeded]
skolman has quit [Remote host closed the connection]
bricker`work has joined #ruby
Loplin has joined #ruby
lw has joined #ruby
Loplin has quit [Max SendQ exceeded]
jottr has quit [Ping timeout: 245 seconds]
GPH|work has quit [Ping timeout: 272 seconds]
rossgeesman has joined #ruby
tier has quit [Ping timeout: 265 seconds]
benzrf is now known as benzrf|offline
skolman_ has joined #ruby
Akagi201 has joined #ruby
yetanotherdave has quit [Ping timeout: 272 seconds]
Loplin has joined #ruby
Loplin has quit [Max SendQ exceeded]
Loplin has joined #ruby
vauwo has joined #ruby
Loplin has quit [Max SendQ exceeded]
Loplin has joined #ruby
yfeldblum has joined #ruby
<vauwo>
Hello, I have experience with C previously and I would love to learn Ruby. What is the most recommended book/tutorial?
Loplin has quit [Max SendQ exceeded]
<rpag>
The Ruby Programming Language co-authored by the author of ruby is probably a good one
benzrf|offline is now known as benzrf
<vauwo>
Thanks.
<vauwo>
I'll see it
Xeago has quit [Ping timeout: 272 seconds]
<crome>
as far as tutorials go just pick something
<epitron>
vauwo: the ruby quickref by zenspider is a good place to get an overview of everything :)
<havenwood>
rpag: great book!
graydot has joined #ruby
<epitron>
if you already know how to program, that's a nice shortcut
Loplin has joined #ruby
olivier_bK has quit [Ping timeout: 244 seconds]
i_s has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
Loplin has quit [Max SendQ exceeded]
<havenwood>
"The Sparrow"
<epitron>
(and if you're like me, and don't like reading books)
tuti has left #ruby [#ruby]
Loplin has joined #ruby
<vauwo>
epitron: the quickref is a reference, I don't know what most of these methods mean!
<rpag>
is there a book that covers 2.0+ features?
Loplin has quit [Max SendQ exceeded]
<havenwood>
rpag: The Second Edition of Well-Grounded Rubyist
<workmad3>
rpag: the latest edition of the pickax book is 1.9 and 2.0
<epitron>
vauwo: methods aren't really in the quickref -- that's mostly language features. methods are here: http://ruby-doc.org/core-2.1.3/
<rpag>
so at least two, impressive
<Hanmac>
hm what do you guys think, i want to make a ticket request that somehow for gem install or gem update when it does to try to "Building native extensions. This could take a while..." it should try to show a progressbar or something similar ... because sometimes you really dont know how much long it will take ... and while you cant calc the time it might still need, it might show the procentual part of the objects how much are already build
Cheezebox has quit [Remote host closed the connection]
<Liendre>
yay eval is good thanks ^^
<cmckee>
Server is being weird. Did anybody see my issue
lw has quit [Read error: Connection reset by peer]
<rpag>
i saw "I'm using Colloquy"
<rpag>
and nothing else..
lw has joined #ruby
iamjarvo has joined #ruby
<cmckee>
Thought so.
<cmckee>
trying to join the #rubyonrails channel but it keeps telling me I need to register. After a few google searches I havent gotten anywhere. Anybody know what might be going on?
<rpag>
/msg chanserv help register
<cmckee>
From any channel?
techsethi has quit [Quit: techsethi]
<havenwood>
yup
<cmckee>
Because when joining rails it doesnt even get to that point
patrick99e99 has joined #ruby
<cmckee>
Oh. Nice
<havenwood>
cmckee: register your nick
<vauwo>
where do i learn how to use the socket library
<cmckee>
Thanks rpag and haven
beneggett has quit [Ping timeout: 240 seconds]
lw has quit [Read error: Connection reset by peer]
beneggett has joined #ruby
treehug88 has joined #ruby
tvw has quit []
lw has joined #ruby
sinkensabe has quit [Remote host closed the connection]
timonv_ has joined #ruby
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matchaw has quit [Remote host closed the connection]
matchaw has joined #ruby
tvw has joined #ruby
gnephiak has quit [Quit: Konversation terminated!]
TPBallbag has quit [Remote host closed the connection]
geoextra has quit [Remote host closed the connection]
geoextra has joined #ruby
diegoviola has quit [Remote host closed the connection]
beneggett has quit [Read error: Connection reset by peer]
gaboesquivel has quit []
beneggett has joined #ruby
<rpag>
havenwood, o right, gotta use a regexp for that
yetanotherdave has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
luriv has quit [Ping timeout: 244 seconds]
rkalfane has quit [Client Quit]
<epitron>
hmm.. i'm curious.. is there a way to split on the edge between two things?
<epitron>
like, if i wanted to split "hello" into "hel" and "lo"
gauke has quit [Quit: gauke]
geoextra has quit [Remote host closed the connection]
<epitron>
(using a regexp)
NoNMaDDeN has quit [Remote host closed the connection]
<tercenya>
alright I give up, need a sanity check here. when redefining an existing method using define_method, super() only works if the method was actually on the parent class, not in the current class? example: https://gist.github.com/tercenya/e96abfff66a2fa5cdc46 do you have to use alias_method instead?
thisguy123 has quit [Ping timeout: 255 seconds]
geoextra has joined #ruby
phantummm_ has joined #ruby
phantummm_ has quit [Remote host closed the connection]
jfran has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jimbach has quit [Remote host closed the connection]
gauke has joined #ruby
geoextra has quit [Remote host closed the connection]
geoextra has joined #ruby
<vauwo>
What is the difference between private and protected?
Hobogrammer has quit [Ping timeout: 265 seconds]
timonv_ has quit [Read error: Connection reset by peer]
thisguy123 has joined #ruby
qwyeth has quit [Remote host closed the connection]
<epitron>
private means you have to call object.send(:methodname) all the time
luriv has joined #ruby
asmodlol has quit [Read error: Connection reset by peer]
weaksauce has quit [Ping timeout: 244 seconds]
SilkFox has quit [Ping timeout: 244 seconds]
jimbach has joined #ruby
workmad3 has quit [Ping timeout: 272 seconds]
<tercenya>
vauwo: calls to private methods are restricted to that object, protected methods can be called from that class or any subclass thereof. but ruby you can violate these rules with send(:method) if need be.
az7ar is now known as az7ar_away
<vauwo>
oh thanks
Aaaal has quit [Quit: Aaaal]
<epitron>
the best reason to use private/protected, imo, is for autogenerated documentation
thisguy123 has quit [Read error: Connection reset by peer]
<epitron>
i've never really needed to use 'em for anything besides that
<rpag>
there's always # :nodoc:
<epitron>
i guess rails uses them to restrict access in controllers
asmodlol has joined #ruby
<epitron>
rpag: ughh :)
<epitron>
so much work
<epitron>
why don't i just carve out the docs on stone tablets
<rpag>
worked for jesus
<tercenya>
it's also a clear way to identify what parts of class's public interface can freely change. when refactoring, private methods are all fair game. public methods aren't, and protected methods might cause unintended side effects
<epitron>
yeah
<epitron>
it's best as a way of communicating things to other coders
jimbach has quit [Ping timeout: 255 seconds]
jimbach has joined #ruby
weemsledeux has joined #ruby
<rpag>
i've never had a need for the distinction protected provides, so i just use 'private'
<tercenya>
you can promote a private method to protected when you see the need to create class hierarchy
jimbach has quit [Remote host closed the connection]
az7ar_away is now known as az7ar
djbkd has joined #ruby
<tercenya>
overloaded initializers are good candidates to be protected
<gyre007_>
I mean it's looking into some /usr/lib directory for some cache stuff?
<gyre007_>
it shold really be installing all gems into .bundle....
<rpag>
try --path=.bundle
<gyre007_>
why is it looking into dirs which it does not have permissions to read from ?
riton has quit [Ping timeout: 258 seconds]
<rpag>
it's trying to sudo for some reason, haven't seen that before
wallerdev has quit [Quit: wallerdev]
<gyre007_>
yeah
f0ster has joined #ruby
<gyre007_>
totally weird
<gyre007_>
this is jenkins btw
<havenwood>
gyre007_: binstubs != path
<gyre007_>
havenwood: bundle can generate binstubs right ?
shredding has quit [Quit: shredding]
<gyre007_>
and I want them in .bundle/binstubs
<gyre007_>
this works on my box like charm
techsethi has quit [Ping timeout: 250 seconds]
rkalfane has joined #ruby
<havenwood>
gyre007_: set --path like rpag suggested
<gyre007_>
jenkins no like somehow
<tercenya>
gyre: I think you mean bundle --path vendor/bundle, if you want your gems installed locally. you can still put your binstubs where you like
TPBallbag has joined #ruby
techsethi has joined #ruby
riton has joined #ruby
<havenwood>
gyre007_: --path=<path> The location to install the gems in the bundle to. This defaults to Rubygems' gem home, which is also the default location where gem install installs gems. This means that, by default, gems installed without a --path setting will show up in gem list. This setting is a remembered option.
rylev has quit []
wallerdev has joined #ruby
<tercenya>
gyre: after the first time you add --path to the bundle install, you'll see a BUNDLE_PATH entry in your .bundle/config. if you blow away your workspace in jenkins, you'll need to pass --path every time, otherwise not
cndiv is now known as cndiv_afk
rdark has quit [Quit: leaving]
<havenwood>
gyre007_: if you just want to install gems locally change gem home to be user local
SiliconDon has quit []
<cmckee>
Haven or rpag. Still having troubles with registering for Rubyonrails channel. Haha. Im missing something here. \msg rubyonrails REGISTER #rubyonrails
<cmckee>
Or something similar right?
<gyre007_>
Ill try the --path vendor/bundle
<tercenya>
you could --path .bundle/gems or whatever you like. it should put your installed gems in that folder, instead of /usr/...
<havenwood>
cmckee: /msg NickServ REGISTER bar foo@bar.com
m8 has joined #ruby
<havenwood>
cmckee: bar is your password, foo@bar.com is your email, check your email
tier_ has joined #ruby
<cmckee>
Excellent. Thanks
<havenwood>
gyre007_: you can always change your RubyGems to install --user-install, which bundler would follow - your choice
<havenwood>
gyre007_: the gem needs to be somewhere you can read it ;)
<cmckee>
Nickserv thats my name to be registered, correct?
<havenwood>
no
<havenwood>
cmckee: only change foo and bar, otherwise paste as is
weaksauce has joined #ruby
<havenwood>
cmckee: read more at: /msg NickServ HELP REGISTER
niklasb has joined #ruby
tier_ has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
cherwin has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chrisja has joined #ruby
nonks has joined #ruby
testcore has joined #ruby
testcore has quit [Quit: [BX] This BitchX's for you]
<oddover>
yep, both of those work
<oddover>
thanks guys
<max96at>
np
<fartface>
http://pastebin.com/xWxvG5Ku -- I'm trying to solve a pretty simple problem of converting integers into their english equivalents (ie 23 into 'Twenty Three'), and it's all working well for values below 100, but for integers greater than 100 I'm getting an error that my stack level is too deep. As far as I can tell from looking at the places that are calling recursively, they should really only ever be one level deeper, and can't see where I'm going wron
<fartface>
g.
yfeldblum has joined #ruby
Cheezebox has quit [Remote host closed the connection]
<tercenya>
alright lunch calls, then I'll bug you guys about why I think super() does the wrong thing again.
sigurding has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fartface>
Oh... Oh I see. Nevermind lol.
testcore has joined #ruby
kamil has joined #ruby
<waxjar>
fartface: a case statement with ranges might clean up your code nicely
havenwood has joined #ruby
<fartface>
Yeah, that's stage 2. Right now I see my glaring math issue, gonna tackle that fitst
<fartface>
first*
nonks has quit [Ping timeout: 256 seconds]
FooMunki has quit [Quit: FooMunki]
Cheezebox has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
cleopatra has quit [Ping timeout: 244 seconds]
zaid_h has joined #ruby
gaganjyot has quit [Remote host closed the connection]
Timgauthier has quit [Read error: Connection reset by peer]
tyll has quit [Ping timeout: 256 seconds]
benzrf is now known as benzrf|offline
cleopatra has joined #ruby
jheg has joined #ruby
<whatasunnyday>
Would anyone mind explaining to me how I can get a url_helper for a route? get "/archives/public" => 'home#public_archives'
<matt_d>
fartface: Check out the Linguistics gem. It has a method that does just that.
oddover has left #ruby [#ruby]
tyll has joined #ruby
vauwo has quit [Quit: leaving]
ivmx has left #ruby [#ruby]
<whatasunnyday>
It is just archives_public_url?
Timgauthier has joined #ruby
kaspertidemann has joined #ruby
<jhass>
whatasunnyday: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ help
<fartface>
matt_d: I'm doing it to learn Ruby--I know there's probably a gem that already does it, just trying to learn programming, haha
<matt_d>
fartface: Was just going to ask... Unless you're doing it as a leaning project :)
neoxquick has joined #ruby
sdwrage has joined #ruby
<fartface>
ԅ(≖‿≖ԅ)
bluenemo has joined #ruby
Timgauthier has quit [Read error: Connection reset by peer]
IceDragon has quit [Ping timeout: 272 seconds]
omosoj has joined #ruby
Timgauthier has joined #ruby
sirene has quit [Read error: Connection timed out]
cleopatra has quit [Ping timeout: 245 seconds]
ptrrr has joined #ruby
ramfjord has joined #ruby
sinkensabe has joined #ruby
carraroj has joined #ruby
Timgauthier has quit [Read error: Connection reset by peer]
SilkFox has joined #ruby
Timgauthier has joined #ruby
cocotton has joined #ruby
Timgauthier has quit [Client Quit]
einarj has joined #ruby
cleopatra has joined #ruby
<fartface>
Got it! Had to do with PEMDAS in my scientific notation, and doing /= instead of -=. Fixed version is http://pastebin.com/i2ygzMtu if anyone was curious
Xeago has joined #ruby
havenwood has quit [Remote host closed the connection]
<cajone>
Guys, I'm trying to understand a little more about threading, different sources give different takes as usual, is there any difference between "Thread.new do ; command ; end" and "Thread.new{ command}" or is this just a different syntax ie 1 line block against multi line block?
tonini has joined #ruby
melik has joined #ruby
<jhass>
cajone: first of all let's take out the threading out of your question, since it's completely irrelevant
<crome>
cajone: you are right, that's just syntactic difference
<rpag>
in that case there's no difference, but the precendence of "do; end" and "{ }" is different
kireevco has joined #ruby
<rpag>
{} binds to the last method call
SilkFox has quit [Ping timeout: 265 seconds]
noop has joined #ruby
<rpag>
you only really need to be aware of that in cases like: foo [1,2,3].map { |x| x.to_s }
<crome>
cajone: btw, you can enclose a multi line block in curly braces as well
az7ar is now known as az7ar_away
ramfjord has quit [Ping timeout: 272 seconds]
abuzze has quit [Read error: Connection reset by peer]
cleopatra has quit [Ping timeout: 255 seconds]
abuzze has joined #ruby
<cajone>
ok, thanks guys!
beneggett has quit [Max SendQ exceeded]
abuzze_ has joined #ruby
az7ar_away is now known as az7ar
tyll_ has joined #ruby
abuzze has quit [Read error: Connection reset by peer]
freerobby has quit [Ping timeout: 265 seconds]
Xiti has quit [Quit: Leaving]
jheg has quit [Quit: jheg]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
tyll has quit [Ping timeout: 255 seconds]
beneggett has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
yetanotherdave has joined #ruby
JBreit has joined #ruby
beneggett has quit [Client Quit]
JBreit has left #ruby [#ruby]
kenneth__ has joined #ruby
cleopatra has joined #ruby
sirene has joined #ruby
Xiti has joined #ruby
sirene has quit [Client Quit]
beneggett has joined #ruby
cj has joined #ruby
<cj>
hi folks
<cj>
what does the : in front of a symbol indicate?
Cheezebox has quit [Remote host closed the connection]
<wasamasa>
it's a symbol!
<cj>
I've got a line 'erb :some_symbol'
<cj>
I want to have that :some_symbol be replaced with a variable
<rpag>
cj, well its syntax to identify a symbol literal
shevy has quit [Ping timeout: 245 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
<rpag>
you can do that
<wasamasa>
cj: just like capitalizing indicates a class
<cj>
rpag: okay, can that symbol literal be stored to a variable? @foo = :some_symbol ; erb @foo
<jhass>
more just like " indicates a string
<wasamasa>
it's just yet another value
<rpag>
yup, see jhass answer
<cj>
but I guess @ is a maybe a global or lexical?
<rpag>
@ denotes instance variable
<cj>
how is @foo different than foo, and should I prefer one over the other?
<cj>
something like my in perl and var in javascript?
<crome>
wasamasa: capitalization indicates a constant
beneggett has quit [Client Quit]
<wasamasa>
*allcapsization
<jimbach>
$ is global, @ is instance
whatasunnyday has quit [Quit: Leaving]
fartface has quit [Quit: Leaving]
niklasb has joined #ruby
<rpag>
@foo = 'blah' creates an instance variable that belongs to whatever 'self' is at the time of assignment, its not like "my" in perl or "var" in javascript
<crome>
cj: you can only use foo if there is a method or accessor defined with that name. if you want to reference the instance variable directly, you have to use @foo
Kricir has joined #ruby
mikecmpb_ has joined #ruby
<jhass>
crome: he's creating a variable, not accessing it
<dr_toboggan>
any ideas about what's going on here?
jshultz_ is now known as jshultz
az7ar is now known as az7ar_away
RichardLitt has joined #ruby
sdwrage has quit [Read error: Connection reset by peer]
sdwrage has joined #ruby
Kricir has quit [Remote host closed the connection]
SilkFox has joined #ruby
banister has joined #ruby
banister has quit [Max SendQ exceeded]
Kricir has joined #ruby
banister has joined #ruby
skolman has joined #ruby
banister has quit [Max SendQ exceeded]
dermothaughey has quit [Remote host closed the connection]
ghostmoth has quit [Quit: ghostmoth]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<havenwood>
dr_toboggan: compare `Person.instance_variables` and `Person.new.instance_variables` with `Programmer.instance_variables` and `Programmer.new.instance_variables`.
banister has joined #ruby
banister has quit [Max SendQ exceeded]
noop has quit [Quit: Leaving]
<havenwood>
dr_toboggan: the outcome would be different if you declared Person @smart inside #initialize
<dr_toboggan>
hmm
<eam>
the instance of person never sets a value for @smart
gregf has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<dr_toboggan>
right, well, i'm wondering what the purpose of "@variable = value" means outside of a method
<eam>
dr_toboggan: it's an instance variable for the class itself
SilkFox has quit [Ping timeout: 255 seconds]
Kricir has quit [Ping timeout: 245 seconds]
<dr_toboggan>
huh. i see
<apeiros>
it sets the value of the instance variable @variable. everywhere.
<eam>
Person is an instance of Class
<dr_toboggan>
right
<apeiros>
dr_toboggan: all you have to figure out is which instance.
<eam>
Person.instance_eval { @smart }
<dr_toboggan>
how does that relate to @@variable ?
anarang has quit [Quit: Leaving]
<apeiros>
dr_toboggan: the same as @vars relate to $vars
<apeiros>
different type of variable
<dr_toboggan>
oh
jottr_ has joined #ruby
<eam>
@@var is visable to all instances of the class
Kricir has joined #ruby
<apeiros>
all @variables are instance variables
mityaz has quit [Quit: See ya!]
oleo has quit [Read error: Connection reset by peer]
shazaum has joined #ruby
<eam>
Person's @smart isn't visible to Person.new
<apeiros>
all instance variables belong to a single object. the object which can also be identified by `self` in the same context.
skolman has quit [Ping timeout: 265 seconds]
<apeiros>
@@class_variables have a different set of scoping rules
AlexRussia has joined #ruby
<Hanmac>
class_variables does follow rules? i thought that they are some kind of punks that does shit on rules ;P
<dr_toboggan>
@smart means different things inside class ClassName ... end
<dr_toboggan>
than inside a method?
jottr has quit [Disconnected by services]
jottr_ is now known as jottr
<apeiros>
dr_toboggan: no.
mskaesz has joined #ruby
<apeiros>
dr_toboggan: and I told you that just a few lines ago.
<apeiros>
21:21 apeiros: all instance variables belong to a single object. the object which can also be identified by `self` in the same context.
<apeiros>
same rules. everywhere.
Ankhers has quit [Remote host closed the connection]
<apeiros>
outside a method is still inside an object. no special rules needed.
<dr_toboggan>
yeah, i know that, but
<eam>
apeiros: but what he's saying is correct too
<eam>
because self changes
<dr_toboggan>
yeah, there you go
<shevy>
dr_toboggan yes, it is different - the scope is another one
<eam>
so yes, self inside and outside a method is a different object
<apeiros>
eam: yes. but it doesn't mean a different thing.
Liendre has quit [Read error: Connection reset by peer]
<apeiros>
it's associated with a different object
<eam>
apeiros: right, just trying to translate
ghostmoth has joined #ruby
<apeiros>
ok
<eam>
the difference is not in the semantics, it's in the value of self
lw has joined #ruby
<shevy>
dr_toboggan you can still access those variables even outside of a method, let me find an example
Wolland_ has joined #ruby
<dr_toboggan>
well, i'm basically just wanting to set a default value
<dr_toboggan>
and have classes that inherit from a given class change it only if they need to
<apeiros>
there are various gems which try to give you that one way or another
<jheg>
don’t suppose anyone here uses Sublime Text 2 and knows the keyboard shortcut for getting out of distraction free mode do they?
<apeiros>
instance variables themselves won't give you that
<havenwood>
>> class String; def initialize; puts "pumpkin!" end end; String.new
<shevy>
dr_toboggan http://pastie.org/9668620 <- there you can see that it is accessible or at least registered through .instance_methods
<jheg>
^ SHIFT OPTION F11 doesnt seem to work
theotherstupidgu has joined #ruby
mkaesz has quit [Ping timeout: 260 seconds]
theotherstupidgu has quit [Quit: leaving]
einarj has quit [Remote host closed the connection]
<shevy>
dr_toboggan if all you want is a default value, you can use a CONSTANT in the parent class, store it in an @ivar, and overrule it for your subclass
tvw has quit []
lw has quit [Client Quit]
<dr_toboggan>
shevy: not sure i follow, could i see an example?
<dr_toboggan>
i might be able to have the base class do its own version of initialize, but that's not as good as just having an inherent default, because i might want to write another initialize somewhere between the two classes in a hierarchy
Avahey has joined #ruby
theotherstupidgu has joined #ruby
<theotherstupidgu>
hi all
<havenwood>
dr_toboggan: instanciate instance_variablies in initialize. class constants cabalism cabbaged cabinets.
nateberkopec has joined #ruby
Deejay_ has joined #ruby
theotherstupidgu has quit [Client Quit]
akkad_ is now known as AKKAD
<dr_toboggan>
word salad
Kricir has quit [Remote host closed the connection]
mkaesz has joined #ruby
DmitryM has left #ruby [#ruby]
theotherstupidgu has joined #ruby
<theotherstupidgu>
hi
cleopatra has quit [Ping timeout: 260 seconds]
<havenwood>
theotherstupidgu: hi
ramfjord has joined #ruby
RichardLitt has quit [Quit: RichardLitt]
mskaesz has quit [Read error: Connection reset by peer]
amitchellbullard has quit [Read error: Connection reset by peer]
<shevy>
dr_toboggan the example was there above; as you said you don't understand the difference between: class Foo; @foo = 5; end compared to class Foo; def initialize; @foo = 5; end; end
amitchellbullard has joined #ruby
<havenwood>
dr_toboggan: if you create the reference when the instance of the class is initialized, put it in initialize. if you want a constant available to all instances of your class use a constant.
<dr_toboggan>
shevy: oh no, i got that. @foo in the class isn't the same @foo in a method in a class
skolman_ has joined #ruby
<dr_toboggan>
hmm, can classes have constants? like: class Foo ; SMART = true ; end
az7ar_away is now known as az7ar
<theotherstupidgu>
ofcourse
<dr_toboggan>
and can classes that inherit from them override the constants?
<theotherstupidgu>
class name itslef is a constant
<dr_toboggan>
without warnings
<theotherstupidgu>
Foo is constant
<havenwood>
dr_toboggan: why did you make an #initialize method in Programmer but not in Person? maybe try to think of an example where there's a class-wide constant but also unique values that are constant.
<havenwood>
err
<havenwood>
i said that wrong
<dr_toboggan>
havenwood: well with other situations, it might not be a constant. i might just want to have a default value
<dr_toboggan>
for an instance variable
<havenwood>
dr_toboggan: give to Caesar what is Ceasar's
<theotherstupidgu>
the ape?
<dr_toboggan>
or c-czar?
<theotherstupidgu>
dr_toboggan, u got a gist for this?
<apeiros>
dr_toboggan: nil is the default value for ivars which have not been assigned
mskaesz has joined #ruby
<dr_toboggan>
apeiros: right. i'm wanting to have a different default value somehow
<apeiros>
and attr_reader :foo just defines `def foo; return @foo; end`
cndiv_afk is now known as cndiv
<dr_toboggan>
it's looking like i can't do that though
<dr_toboggan>
apeiros: yeah, i figured
<apeiros>
dr_toboggan: either the solution you don't want (initialize) or use one of the gems. I think one is by ara t howard, "fattr" iirc.
<dr_toboggan>
yeah, maybe. i might just go with using initialize (and i'll try not to screw it up)
<dr_toboggan>
thanks
<apeiros>
or as always: roll your own :)
Lewix has joined #ruby
Lewix has joined #ruby
Lewix has quit [Changing host]
kedare has quit [Remote host closed the connection]
<omosoj>
how do i get good at testing?
waltertv has joined #ruby
wallerdev has quit [Quit: wallerdev]
mkaesz has quit [Ping timeout: 255 seconds]
<dr_toboggan>
hmm, inside initialize, can i call the superclass initialize? like: self.superclass.initialize
dermothaughey has joined #ruby
<dr_toboggan>
that would make things easier
<apeiros>
omosoj: practice
<shevy>
omosoj by writing code that sucks so much that you no longer want to continue working without testing
<theotherstupidgu>
i don't think using a gem helps, this should either make sense on its own or not at all
reinaldob has quit [Remote host closed the connection]
<omosoj>
lol shevy
<apeiros>
dr_toboggan: `super`
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dr_toboggan>
ok
<shevy>
alternative - when you are to rewrite or refactor, and you notice that you lost features
sdwrage has quit [Quit: This computer has gone to sleep]
<apeiros>
dr_toboggan: note that `super` calls super with all arguments as passed, `super()` calls super without any arguments. super is special that way.
<omosoj>
apeiros, no magical way to skip that step? :)
<shevy>
which, when you have a test spec, could also be used to assure that the rewrite would functionally be equivalent
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<dr_toboggan>
ok
<theotherstupidgu>
apeiros, good point
<apeiros>
omosoj: get yourself frozen. wake up in ~107 years, get the knowledge & experience transferred directly into your brain.
weemsled_ has joined #ruby
chrishou_ has joined #ruby
<omosoj>
maybe i start with refactoring instead of tdd. tdd is intimidating to start out with
<omosoj>
*goes to cryogenics channel*
<apeiros>
omosoj: refactoring without tests is intimidating
weemsledeux has quit [Disconnected by services]
<apeiros>
omosoj: how do you know you didn't break anything?
<theotherstupidgu>
dr_toboggan, i am sorry i am abit late, but you don't want the initialize?
<havenwood>
omosoj: you could write some code, write some tests, then refactor
<apeiros>
omosoj: also, refactoring is an excellent opportunity to start testing. write tests for the method you want to refactor.
<omosoj>
apeiros, yeah that's what i'm saying. i wrote an app and there are no tests. i'll write tests to capture behavior then refactor
wallerdev has joined #ruby
chrishou_ has quit [Client Quit]
<dr_toboggan>
theotherstupidgu: no, because i use initialize elsewhere, and i'm worrying about intervening initialize calls not getting called
<dr_toboggan>
and not initializing stuff properly
weemsled_ is now known as weemsledeux
weemsledeux has quit [Changing host]
weemsledeux has joined #ruby
<omosoj>
cool, thanks guys
chrishou_ has joined #ruby
<dr_toboggan>
if i could have defaults for instance variables, that'd be ideal (but that doesn't look easy to pull off without a gem)
chrishough has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 240 seconds]
<theotherstupidgu>
dr_toboggan well, what about a factory pattern?
<theotherstupidgu>
that could help you be specific about what class you want to use
NovapaX has joined #ruby
mskaesz has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
Kricir has quit [Remote host closed the connection]
<dr_toboggan>
well, the problem is that when i do .new , there are things in multiple initialize calls that i want to use
<dr_toboggan>
but yeah, nah, i'm just going to move stuff out of my initialize call
<dr_toboggan>
it doesn't need to be there
Kricir has joined #ruby
<dr_toboggan>
i think i got my answers, thanks
blackmesa has joined #ruby
Wolland has joined #ruby
thsig has joined #ruby
tonini has quit [Ping timeout: 250 seconds]
DLSteve has joined #ruby
awarner has quit [Remote host closed the connection]
<theotherstupidgu>
ofcourse you could take the attr_accessor :smart
<theotherstupidgu>
and put it in a parent class for both, etc.
<dr_toboggan>
theotherstupidgu: heh, well, my problem is that i wanted both initialization to happen. both the specific one, Programmer, and the generic one, Person
Wolland_ has quit [Ping timeout: 265 seconds]
Wolland__ has joined #ruby
<dr_toboggan>
i wanted the option to override individual defaults, but still let some go to default
<dr_toboggan>
but, i can split that up into other methods
<theotherstupidgu>
design wise, you are missing somthing
Kricir has quit [Ping timeout: 245 seconds]
<dr_toboggan>
let me come up with another example
nateberkopec has quit [Quit: Leaving...]
awarner_ has joined #ruby
<msmith_>
http://pastie.org/9668701 In general how would I go about writing an rspec test for something like this without duplicating all the logic after the initial 'unless'?
cleopatra has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
<dr_toboggan>
well, i don't know about another example. i think i know what i'm doing, i'm gonna go back to work
skolman has quit [Remote host closed the connection]
thsig has joined #ruby
skolman_ has joined #ruby
tier_ has joined #ruby
zlude has quit [Quit: Leaving]
starkhalo has joined #ruby
lkba has quit [Ping timeout: 272 seconds]
omosoj has quit [Ping timeout: 255 seconds]
Asher has joined #ruby
Wolland_ has joined #ruby
jdj_dk has quit [Ping timeout: 245 seconds]
beneggett has joined #ruby
DLSteve_ has joined #ruby
omosoj has joined #ruby
Xeago has quit [Remote host closed the connection]
tier has quit [Ping timeout: 244 seconds]
Dreamer3 has quit [Quit: Leaving...]
tier_ has quit [Remote host closed the connection]
beneggett has quit [Read error: Connection reset by peer]
digital-ghost has joined #ruby
tier has joined #ruby
beneggett has joined #ruby
<jheg>
thanks apeiros trying to get it working now
Wolland has quit [Ping timeout: 265 seconds]
SilkFox has joined #ruby
ldnunes has quit [Quit: Leaving]
DLSteve has quit [Ping timeout: 272 seconds]
<eam>
It would be nice if constants in ruby were actually constant
Dude007 has quit [Remote host closed the connection]
<twohlix>
eam: why not just make some observer for a constant and whenever anything changes the constant's value, change it back to normal? bit convoluted
SilkFox has quit [Ping timeout: 246 seconds]
<eam>
uhhhh
renderful has quit [Remote host closed the connection]
<apeiros>
but after wasamasa's remark - definity_, you'll not often see it in the wild, but e.g. in `array.each do |x; t1, t2, …|` the part after ; are not params of the block, but block-local local variables.
mijicd has joined #ruby
mijicd has quit [Client Quit]
<apeiros>
ie || can delimit more than just its params
memph1s has joined #ruby
<wasamasa>
^ another contrived example that swaps keys and values of a hash
jerius has quit []
awarner_ has quit [Remote host closed the connection]
niklasb has joined #ruby
skolman_ has quit [Remote host closed the connection]
memph1s has quit [Client Quit]
skolman has joined #ruby
<wasamasa>
apeiros: hmk
<wasamasa>
apeiros: reminds me of `let' in lisp
dermot has quit [Quit: Lost terminal]
<apeiros>
not a lisper :(
<wasamasa>
apeiros: where you can use a form that introduces empty variables in the block you have to set yourself in it
RichardLitt has quit [Quit: RichardLitt]
<wasamasa>
I wish matz stole more from lisp than the implementation of his beloved text editor
mijicd has joined #ruby
<atmosx>
night all
mijicd has quit [Client Quit]
melik has joined #ruby
riceandbeans has joined #ruby
mijicd has joined #ruby
riceandbeans has quit [Changing host]
riceandbeans has joined #ruby
Dude007 has quit [Ping timeout: 265 seconds]
Pupeno has joined #ruby
mijicd has quit [Client Quit]
<wasamasa>
then there would be no scoping gotchas
allcentury has quit [Ping timeout: 244 seconds]
thsig_ has quit [Remote host closed the connection]
<wasamasa>
though, I'm not sure whether to prefer syntax rules and code walkers over instance_eval and ruthless monkeypatching
<apeiros>
theotherstupidgu: nesting methods does probably not work the way you think it does
mijicd has joined #ruby
<apeiros>
a "nested" method will simply become defined at the same level as the outer method when the outer method is called
<jhass>
in other words the def keyword changes self but not the definee
<apeiros>
and with the same visibility
kenneth__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Avahey has quit [Quit: Connection closed for inactivity]
riceandbeans has quit [Client Quit]
riceandbeans has joined #ruby
<theotherstupidgu>
apeiros, jhass, awesome to knw, but how i can manipulate this and get somthing like level_d work as an alias for level_b, etc.
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mijicd has quit [Client Quit]
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
<apeiros>
theotherstupidgu: I don't quite understand what you try to solve, sorry
bluenemo has quit [Quit: Verlassend]
<jhass>
yeah, show real problem
nateberkopec has joined #ruby
RichardLitt has quit [Ping timeout: 265 seconds]
mijicd has joined #ruby
mijicd has quit [Client Quit]
<theotherstupidgu>
user gets a dsl with 3 constructs [level_a,level_b,level_c], if use wants to add his own constructs, i want them to act the same mannger as the original dsl
emmesswhy has joined #ruby
sinkensabe has quit [Remote host closed the connection]
RichardLitt has joined #ruby
testcore has left #ruby ["#archlinux"]
<theotherstupidgu>
clear??
mikeg has joined #ruby
valeriansaliou has joined #ruby
chipotle has joined #ruby
jheg has quit [Quit: jheg]
gyre007_ has joined #ruby
mijicd has joined #ruby
mijicd has quit [Client Quit]
<theotherstupidgu>
in other words, a way to change the constrcuts of a ruby dsl done via yield
chrishough has quit [Ping timeout: 260 seconds]
omosoj has joined #ruby
<apeiros>
still not sure what you want. but there's alias_method
jdj_dk has joined #ruby
<theotherstupidgu>
i tried alias and alias_method, i can't get the constructs as variables inside the nested methods
<apeiros>
again, there's no such thing as nested methods
<theotherstupidgu>
you got a reference for this info?
it0a has quit [Quit: WeeChat 1.0.1]
<theotherstupidgu>
somthing i can read on my own.
i_s has quit [Remote host closed the connection]
valeriansaliou has quit [Ping timeout: 244 seconds]
i_s has joined #ruby
asmodlol has quit [Read error: Connection reset by peer]
leslie has joined #ruby
<theotherstupidgu>
"and with the same visibility" i have to disagree, as if I try to alias level_b I get error
sambao21 has quit [Quit: Computer has gone to sleep.]
chrishough has joined #ruby
awarner has joined #ruby
<apeiros>
theotherstupidgu: did you run the outer method?
<apeiros>
because if you didn't, the method did not get defined. and then there's nothing to alias.
<apeiros>
same thing as if you'd done `if false then def foo; end; end`
beneggett has joined #ruby
<theotherstupidgu>
apeiros, thats interesting and true, difficult to work with if aliasing is the way
<apeiros>
theotherstupidgu: I don't see a reason to nest them
i_s has quit [Ping timeout: 246 seconds]
mrmargolis has quit []
<theotherstupidgu>
apeiros, thats a good point, but a dsl should be a bit strict, don't you think?
<theotherstupidgu>
less error prone
spyderma_ has quit [Remote host closed the connection]
<apeiros>
and why do you believe it is more strict if you nest the methods?
spyderman4g63 has joined #ruby
<theotherstupidgu>
as u can't use level_c unless you got level_b, etc.
<apeiros>
all you do is defer the definition of the method, and redefine the method on *every* call (instead of just defining it once)
doodlehaus has quit [Remote host closed the connection]
<apeiros>
theotherstupidgu: only true on the first try
<theotherstupidgu>
apeiros :)
<theotherstupidgu>
I never thought of that
TripTastic has joined #ruby
<theotherstupidgu>
apeiros thnx
<apeiros>
call level_a once, and you can call level_b without calling level_a.
Soda has joined #ruby
<apeiros>
if you want to ensure that level_b is called only within level_a, you need another device.
msmith_ has quit [Remote host closed the connection]
livingstn has quit []
TripTastic has left #ruby [#ruby]
<theotherstupidgu>
what are my options?
<apeiros>
but IMO if it isn't a natural thing coming with your DSL, then you're trying to hold developers hands. and that's - just my opinion - stupid.
tjbiddle has joined #ruby
<apeiros>
a) instance_eval into an object which defines the method, b) keep track of the call-stack (remember concurrency, though)
Deejay has joined #ruby
Deejay is now known as Guest15201
Guest15201 has quit [Client Quit]
<apeiros>
but - both introduce complexity and make things potentially more brittle. I'd really ask myself if it's necessary.
sailias has quit [Quit: Leaving.]
spyderman4g63 has quit [Ping timeout: 255 seconds]
chrishough has quit [Ping timeout: 240 seconds]
<theotherstupidgu>
call-stack?
<theotherstupidgu>
example?
poguez has quit [Quit: Connection closed for inactivity]
SuperrMann has quit [Quit: Computer has gone to sleep.]
Wolland_ has quit [Ping timeout: 244 seconds]
bluOxigen has quit [Ping timeout: 272 seconds]
mary5030 has quit [Remote host closed the connection]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RichardLitt has quit [Quit: RichardLitt]
soulcake has quit [Quit: Quack.]
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soulcake has joined #ruby
<eam>
theotherstupidgu: no, ripper is an interface into the parser. The call stack is where function call history is tracked (to know where you will return to)
lmickh has quit [Remote host closed the connection]
kenneth has joined #ruby
testcore has joined #ruby
<theotherstupidgu>
eam, thanx, i am experimenting with call stack now thans to apeiros
centrx has joined #ruby
omosoj has quit [Ping timeout: 258 seconds]
grzywacz has joined #ruby
omosoj has joined #ruby
Kricir has quit [Remote host closed the connection]
Kricir has joined #ruby
jhass is now known as jhass|off
Dalajin has joined #ruby
codecop has quit [Remote host closed the connection]
benzrf is now known as benzrf|offline
emanu has joined #ruby
davidhq has joined #ruby
davidhq has quit [Client Quit]
<gyre007_>
will I find any ruby vim users here now ? :-)
renderful has quit [Remote host closed the connection]
<centrx>
they are a mysterious group
tier has joined #ruby
Kricir has quit [Ping timeout: 272 seconds]
xymbol has joined #ruby
<gyre007_>
hahha
renderfu_ has joined #ruby
olivier_bK has quit [Ping timeout: 260 seconds]
hobodave has quit [Quit: Computer has gone to sleep.]
SilkFox has joined #ruby
jhass|off is now known as jhass
hobodave has joined #ruby
Pupeno_ has joined #ruby
pskosinski has joined #ruby
jdj_dk has quit [Ping timeout: 244 seconds]
Pupeno has quit [Ping timeout: 256 seconds]
Dalajin has left #ruby [#ruby]
volty has joined #ruby
qmfnp has joined #ruby
m8 has quit [Quit: Sto andando via]
SilkFox has quit [Ping timeout: 260 seconds]
hobodave has quit [Ping timeout: 245 seconds]
<theotherstupidgu>
i use vim, and the only reason why i want to switch to emacs is because it was Jim(RIP) favourite
testcore has quit [Ping timeout: 246 seconds]
<pipework>
Jesus uses VisualStudio.
<theotherstupidgu>
lol
cmckee has quit [Ping timeout: 260 seconds]
cmckee has joined #ruby
cocotton has quit [Remote host closed the connection]
cocotton has joined #ruby
linduxed has quit [Ping timeout: 272 seconds]
linojon has joined #ruby
<apeiros>
Nietzsche used a fountain-pen
sambao21 has joined #ruby
diegoviola has quit [Ping timeout: 255 seconds]
emmesswhy has quit [Quit: This computer has gone to sleep]
mikeg has quit [Remote host closed the connection]
charliesome has joined #ruby
davidhq has joined #ruby
<apeiros>
theotherstupidgu: socrates
jenrzzz has quit [Client Quit]
phutchins has quit [Ping timeout: 260 seconds]
<apeiros>
he's attributed for "scio nescio"
jenrzzz has joined #ruby
djstorm has quit [Ping timeout: 244 seconds]
reinaldob has joined #ruby
cajone has left #ruby [#ruby]
thsig has joined #ruby
agjacome has joined #ruby
JaMz has quit [Remote host closed the connection]
skinny_much has joined #ruby
snath has quit [Ping timeout: 246 seconds]
qmfnp is now known as qmfndinner
diegoviola has quit [Remote host closed the connection]
cajone has joined #ruby
lampd1 has joined #ruby
davidhq has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
manzo has joined #ruby
diegoviola has joined #ruby
stunder has quit [Quit: Screw you guys I'm going home]
Pupeno_ has quit [Remote host closed the connection]
Photism has joined #ruby
jdj_dk has quit [Read error: No route to host]
cocotton has joined #ruby
Pupeno has joined #ruby
linojon has quit [Quit: linojon]
n_blownapart has joined #ruby
Kricir has joined #ruby
jdj_dk has joined #ruby
kingman has quit [Read error: Connection reset by peer]
aspires has quit []
kingman has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
aspires has joined #ruby
Lewix has joined #ruby
diegoviola has quit [Ping timeout: 256 seconds]
cocotton has quit [Ping timeout: 244 seconds]
graft has joined #ruby
<graft>
hey anyone ever drawn any svgs with ruby?
aspires has quit [Client Quit]
Channel6 has joined #ruby
spyderman4g63 has joined #ruby
charliesome has quit [Quit: zzz]
sepp2k has quit [Read error: Connection reset by peer]
boombadaroomba has joined #ruby
Kricir has quit [Remote host closed the connection]
SilkFox has joined #ruby
aspires has joined #ruby
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
tier has joined #ruby
Kricir has joined #ruby
n_blownapart has quit []
jdj_dk has quit [Ping timeout: 258 seconds]
qmfndinner is now known as qmfnp
aspires has quit [Client Quit]
marr has quit [Ping timeout: 260 seconds]
Kricir has quit [Read error: Connection reset by peer]
Avahey has joined #ruby
Kricir has joined #ruby
SilkFox has quit [Ping timeout: 246 seconds]
diegoviola has joined #ruby
<gkra>
ugh, this sucks... I'm trying to use Open4.popen4 with three threads (one to push stderr to a Queue, one to push stdout to a Queue, and one to pop off the Queue and write to a file)
<gkra>
The writer keeps exiting before it's consumed the whole queue.
drkyro has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
aspires has joined #ruby
manzo has quit [Remote host closed the connection]
Pupeno_ has joined #ruby
nonks has quit [Ping timeout: 265 seconds]
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pupeno has quit [Ping timeout: 256 seconds]
Mia has quit [Ping timeout: 258 seconds]
aspires has quit [Client Quit]
SilkFox has joined #ruby
valeriansaliou has joined #ruby
Tricon has quit [Quit: Lost terminal]
ixti has quit [Ping timeout: 245 seconds]
kristofferR has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wolland_ has joined #ruby
aspires has joined #ruby
<zenspider>
gkra: is there a question in there?
Kricir has quit [Remote host closed the connection]
valeriansaliou has quit [Ping timeout: 265 seconds]
Juanchito has quit [Quit: Connection closed for inactivity]
spyderman4g63 has quit []
Kricir has joined #ruby
Wolland has quit [Ping timeout: 245 seconds]
JaMz has joined #ruby
skolman_ has quit [Remote host closed the connection]
ghostmoth has quit [Quit: ghostmoth]
skolman_ has joined #ruby
arescorpio has joined #ruby
kireevco1 has joined #ruby
kireevco has quit [Read error: Connection reset by peer]
linguini has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Tricon has joined #ruby
Mia has joined #ruby
Kricir has quit [Ping timeout: 245 seconds]
<graft>
gkra: why do you need threads for that?
<graft>
gkra: also, won't it exit right away because when the thread starts the queue is empty?
<gkra>
There was going to be a question there, but I got interrupted...
hobodave has joined #ruby
kristofferR has joined #ruby
<graft>
threading just seems like the wrong way to handle this
kristofferR has quit [Remote host closed the connection]
<graft>
since the writing thread has no idea when the stderr thread is done consuming stderr, etc.
<gkra>
that's what I'm coming to..
<graft>
of course it'll exit early
<gkra>
well, I fixed that by forcing to writing thread to keep running while either the stderr or stdout thread are alive.
arrubin has joined #ruby
<graft>
you still haven't explained why you think threads are important here
skolman_ has quit [Ping timeout: 272 seconds]
zz_jrhorn424 is now known as jrhorn424
<gkra>
but yes, the closer I get to making this work, the more I'm thinking I'm travelling down the wrong road.
<graft>
you want each line of stderr and stdout to go to a separate file or something?
<gkra>
I'm trying to wrap another process in my ruby code, and want to capture this tool's stdout and stderr and write it to a file.
larissa has joined #ruby
<gkra>
and I've ended up at Open4::popen4, which looks really neat, and found an example somewhere where they use threads to do all the reading & subsequent writing.
Takle has quit [Remote host closed the connection]
chrisja has quit [Quit: leaving]
<gkra>
What's the "easy way" for this? just system("#{command} 2>&1 > #{file}") ? :)
<gkra>
I think I have been trying to be too computer-sciency.
jdj_dk has joined #ruby
chipotle has quit [Quit: cya]
<graft>
gkra: is this a continuous process? are you waiting for it to finish running?
<gkra>
it's a potentially long-running processes (5-15 minutes)
jrhorn424 is now known as zz_jrhorn424
i_s has joined #ruby
zz_jrhorn424 is now known as jrhorn424
<graft>
you can just do stderr.read and stdout.read from popen4 and dump them to a file, it'll just take until the process exits
jrhorn424 is now known as zz_jrhorn424
<graft>
if you want to dump it into another thread, just start popen4 in one thread and do all the reading/writing there - ruby won't have to wait, the thread can exit when it likes
sirene has joined #ruby
Aaaal has quit [Quit: Aaaal]
<zenspider>
do you actually need to separate stderr from stdout? you lose context that way
<zenspider>
yeah. system("#{cmd} 2>&1 >> #{logpath}") will do most of what you want
<graft>
even if you want stderr and stdout in their own threads, they can do their own writing, still don't need a third thread
<zenspider>
tack on a & if you want the system call to background
SilkFox has quit [Ping timeout: 256 seconds]
linojon has joined #ruby
<zenspider>
this is also what tee is for
i_s has quit [Ping timeout: 258 seconds]
snath has joined #ruby
nonks has joined #ruby
jimbach has quit [Remote host closed the connection]