Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<petercooper> It sounds interesting but your explanation alone isn't giving me the Aha! moment yet.
_whitelogger joined #ruby-lang
Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<whitequark> anyway.
<whitequark> class A; TEST = 1; end
<whitequark> def m(&block) Class.new(A) { class_exec &block } end
<whitequark> m { def q; p TEST; end }.new.q
<whitequark> works on 1.9.2 (prints "1")
<whitequark> and raises on 1.9.3 (uninitialized constant TEST (NameError))
<whitequark> i.e. the thing which has changed is the cref scope of methods defined in lambdas evaluated with class_exec in a context of an anonymous class created with a block.
<whitequark> quite subtle, isn't it? :D
<whitequark> petercooper: I've reduced it to this: class A; TEST = 1; end; Class.new(A) { def self.q; p TEST; end }.q
<petercooper> nice work
<whitequark> thanks
<petercooper> It gives me the result I'd expect in 1.9.3 at least
<petercooper> though totally illogical
<petercooper> Aha, I see the 1.9.2 vs 1.9.3 diff here.
replore_ joined #ruby-lang
<petercooper> 1.9.2's behavior is more logical to me but.. 1.9.3's fits better with the lexical scoping of constants nonsense from 1.8.
<whitequark> in that sense, yes, but I thought that metamagical things should bypass that rule
<petercooper> I always have to retest my assumptions on this stuff given how illogical they are to remember (IMHO)
<whitequark> petercooper: what's also weird, is that I don't see where rb_class_new or anything it calls does anything with a passed block
<whitequark> (that's HEAD)
<petercooper> yeah, this seems to be acting more like instance_eval
<petercooper> Ohhhhh, this is your site :)
<whitequark> yes :)
<petercooper> It was in Ruby Weekly last week, in case you didn't know.
WillMarshall joined #ruby-lang
<whitequark> well, I definitely know, as I have written you about it :D
<petercooper> Interesting finding, this, but I'm not artful enough on implementation to really give anything but wild speculation.
<petercooper> You did? Oh there goes my memory
<whitequark> ... from a email like whitequark@whitequark.org ...
<petercooper> Sorry, I get a metric buttload of e-mail about stuff to put in ;-)
<whitequark> sure :)
tesseract joined #ruby-lang
<whitequark> ah, the rb_class_new is internal, the rubyish thing is here: http://rxr.whitequark.org/mri/source/object.c#1626
<whitequark> nor the instance_exec itself or yield_under() which it uses have changed.
<whitequark> petercooper: I think I've hunted it down
<petercooper> nice find
looopy joined #ruby-lang
<petercooper> there has to be a redmine ticket for this already, surely
spuk joined #ruby-lang
<petercooper> wow, this was a really late addition to 1.9.3
<petercooper> it came in on a commit on Oct 26
<petercooper> 5 days before release :)
<whitequark> petercooper: got a ticket # in changelog?
<whitequark> ah
<petercooper> I git blamed it but.. I think so
<whitequark> yes, you were right
<petercooper> http://redmine.ruby-lang.org/issues/3908 is also mentioned
<whitequark> that's 1.9 stuff
<whitequark> *1.8 stuff going back
<whitequark> hm
<whitequark> how private constants are involved into this?
<petercooper> dunno, it's just mentioned in the commit msg
<petercooper> Ah, I'm looking at the commit specifically for freeing the const table which is all memory management stuff.
<petercooper> The other commit makes more sense ;-)
<whitequark> memory management, hm
<petercooper> though it still mentions it as a preparation for private constants
<whitequark> I guess this may be one of reasons my rails app has stopped leaking upon upgrading to 1.9.3
<whitequark> uh. I never knew that iv table has also contained constants. that's quite weird actually
<petercooper> the oddities of MRI know no bounds
<whitequark> yeah. just thinking about _what_ mri does with stack pointer frightens me
<andrewvos> rue: <3 <3
<rue> :D
<whitequark> I may be somewhat incorrect, but from what I understand, on a GC call MRI traverses its entire stack up to the ruby_init() call point
<whitequark> and checks each 4-(or 8-)byte value if it is a pointer to a ruby object or no, to mark it if it is
<whitequark> ... and if it actually does, then it traverses the entire heap for each 4-byte value on the stack.
<rue> whitequark: petercooper: Hm, are they flopping back and forth on the const lookup rules again? I hadn't noticed
<whitequark> and by "stack" I mean the OS stack of course, not YARV stack.
<whitequark> rue: indeed
<rue> 'Cause it changed in 1.9.1, then got changed back in 1.9.2
<whitequark> had it changed in each minor version earlier, too?
<rue> Fortunately no
<rue> t
<whitequark> poor rbx
<petercooper> basically it seems this was something they missed on 1.9.2
<rue> Ah, rolling back another change from .1? I'm not quite awake anymore
<rue> That looks like the same lexical scoping thing as previously
tomzx joined #ruby-lang
nofxx joined #ruby-lang
macmartine joined #ruby-lang
Defusal joined #ruby-lang
dreinull- joined #ruby-lang
denysonique joined #ruby-lang
ecin joined #ruby-lang
wyhaines joined #ruby-lang
srbaker joined #ruby-lang
Defusal joined #ruby-lang
denysonique joined #ruby-lang
macmartine joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
takaokouji joined #ruby-lang
_inc joined #ruby-lang
srbaker joined #ruby-lang
DRCALKIN joined #ruby-lang
<freedrull> i upgraded to 1.9.3 from 1.8.7, and i'm having trouble reading out some objects that have typed_serialized columns. I get a yaml parse error from psych. http://pastebin.com/89VZ5MKE
<freedrull> now, I'm not exactly sure why yaml is involved at all. the typed_serialized column in question is stored as a Hash.
<freedrull> active_record must be converting to yaml somewhere along the way?
nofxx joined #ruby-lang
<mksm> probably a question for #ror or #rails (idk)
<mksm> but I wonder by a Hash is in a serialized data column
<mksm> s/by/why/
<freedrull> mksm: well that wasn't my decision, but yeah
marcostoledo joined #ruby-lang
<mksm> hmm just noticed 1.9.3 is released
looopy joined #ruby-lang
<mksm> :D
bnagy joined #ruby-lang
boxmo joined #ruby-lang
nofxx joined #ruby-lang
rhinux joined #ruby-lang
queequeg1 joined #ruby-lang
ksinkar joined #ruby-lang
ecin joined #ruby-lang
m0wfo joined #ruby-lang
livinded joined #ruby-lang
<manveru> freedrull: can you read them using Syck?
<manveru> YAML::ENGINE.yamler = 'syck'
SuperTa__ joined #ruby-lang
<manveru> by switching these two you might be able to automate upgrading to psych, which is the default in 1.9.3 if libyaml is installed
<freedrull> manveru: not really, other things break and i get encoding errors when i switch to syck. i'll probably just try 1.8 to read the data and convert it manually
<jammi> I've been using 1.9.3-head since a week ago or so. Psyck was one of the things I noticed immediately, because it threw syntax errors on a couple of yaml files
<jammi> easy fixes anyway, and the startup speed is much better now
<manveru> ok :)
<jammi> seems like all requires are an order of magnitude faster
curtism joined #ruby-lang
<Spooner> I had startup got from 4s to 1.6s upgrading to 1.9.3 (Gosu game). Was over the moon :D God, 1.9.2 was broken slow on Windows.
<manveru> i don't see a difference... but i don't require large stuff
<jammi> the more requires you have, the bigger the difference
<manveru> and yeah, 1.9.2 was painful on win
<manveru> jammi: i hear the rails folks are the happiest :)
<jammi> I run quite big projects and a restart is down from over 10 seconds to about one second in my case
terraUNDverra joined #ruby-lang
<jammi> manveru: yeah, they have a lot of bloat
<manveru> wow
<manveru> i don't think i've ever had more than 200ms or so...
<manveru> and i don't use yaml when i don't have to
<jammi> manveru: probably like 20-30k lines in this project alone, plus all the dependencies
<jammi> it's the disk access or something, because the difference is clearly audible on hdd access sounds alone
<jammi> smarter (or any) caching or something like that
<manveru> you don't use SSD?
<jammi> no, ssd's wouldn't be audible
<jammi> just a raid on my workstation
<petercooper> audible SSDs would be like those electric cars they have to add engine noises to for safety purposes ;-)
twittard joined #ruby-lang
<jammi> someone will probably make an audible activity indicator when hdd's become nostalgic
srbaker joined #ruby-lang
<petercooper> given the nostalgia for those noisy IBM keyboards, I can't imagine it'll be long
tomzx joined #ruby-lang
<steveklabnik> petercooper: SHUT UP I HAVE 3 MODEL Ms
<petercooper> and 3 pairs of ear defenders
<steveklabnik> it's not the noise, it's the tactile fedback
<jammi> well, at least they are technologically superior
looopy joined #ruby-lang
<petercooper> My feedback is letters appearing on the screen
<petercooper> Anyway, I only said they're /noisy/, not that they suck ;-)
<jammi> I'd love a "alps white":ish keyboard with the "apple laptop" layout, I'm a current user of their wired aluminium keyboard with the same layout
d3vic3 joined #ruby-lang
<jammi> I have to consider something else, when I wear it out
towski joined #ruby-lang
<jammi> wireless keyboards are a pita imho, because of unreliability; they run out of batteries or act up otherwise usually at the worst possible moment
<petercooper> that's what I've noticed whenever anyone drags an imac round here, they set up and spend 10 minutes cursing at their peripherals
<petercooper> I'm fully wired on mine but only because I got too lazy to recharge batteries
<jammi> they drop random packets when a cell phone is too close too
<jammi> or in any other similar rf situations
<mksm> stay away from BT headphones
towski joined #ruby-lang
plusk left #ruby-lang
woollyams joined #ruby-lang
towski joined #ruby-lang
towski joined #ruby-lang
yank joined #ruby-lang
towski joined #ruby-lang
towski joined #ruby-lang
perryh joined #ruby-lang
perryh joined #ruby-lang
dr0id joined #ruby-lang
dr0id joined #ruby-lang
looopy joined #ruby-lang
wyhaines joined #ruby-lang
ryanf joined #ruby-lang
srbaker joined #ruby-lang
<shevy> hmm
x0F__ joined #ruby-lang
<shevy> anyone knows if it is possible to interface with google gmail? I would like to write a small ruby script which queries whether a new email is available or not
<lianj> sure
<mksm> ruby-gmail
<shevy> wheeeeeeeeeeee
towski joined #ruby-lang
towski joined #ruby-lang
knu joined #ruby-lang
resetexistence joined #ruby-lang
<shevy> require 'gmail'; LoadError: no such file to load -- mime/message
<shevy> hmm doesn't like me
<shevy> so let's try that other script
ivorybishop joined #ruby-lang
mksm joined #ruby-lang
macmartine joined #ruby-lang
tomzx joined #ruby-lang
<shevy> I still <3 the new doc layout
ryanf joined #ruby-lang
looopy joined #ruby-lang
corsican_ joined #ruby-lang
corsican_ left #ruby-lang
<shevy> haha
<shevy> is there a word for looking at code from someone else, but thinking that it sucks, taking only the good pieces, and starting from zero with something else
<shevy> (with "something else" I mean a project that is almost the same)
rhinux joined #ruby-lang
gianlucadv joined #ruby-lang
ksinkar joined #ruby-lang
nofxx joined #ruby-lang
ABK joined #ruby-lang
kitallis joined #ruby-lang
artOfWar joined #ruby-lang
nofxx joined #ruby-lang
nofxx joined #ruby-lang
terraUNDverra joined #ruby-lang
michael_mbp joined #ruby-lang
meth joined #ruby-lang
<meth> is there a way to know when an object gc's ?
ivanoats joined #ruby-lang
terraUND_ joined #ruby-lang
looopy joined #ruby-lang
srbaker joined #ruby-lang
<meth> cool thanks
<meth> hm finalizer is called "after" with an "id" ??
mikeric joined #ruby-lang
<meth> i need that data still alive so i can clean up some ffi pointers
looopy joined #ruby-lang
<bnagy> I thought FFI mostly cleaned up after itself
<meth> actually I'm already cleaning it up anyway
<erikh> free() maybe
<bnagy> I'm confused by the objectspace thing anyway, since it says id2ref can't be called on the objid inside your finalizer proc
<bnagy> ... so what's the point?
<meth> right..
<bnagy> maybe that
Indian joined #ruby-lang
savage- joined #ruby-lang
<Mon_Ouie> You should give the proc access to the resources that needs to be freed, not the object that wraps them directly
resetexistence joined #ruby-lang
<bnagy> can the finalizer proc still see that stuff from the binding?
<bnagy> ... wait isn't that exactly what that buggy code is doing wrong? Trying to access the resources directly instead of through the obj?
<meth> yea i mean it's proper to clean up after your self as I'm doing but that's basically the issues with manual memory management in c.. it's much nicer to just set a finalizer and never worry about it.. worst case is that you crash
<meth> at some point in the future when your c module tries to access the freed pointer.. or in my case the pointer the object references is created in c so nothing ever tells the module to clean it up
terraUNDverra joined #ruby-lang
<bnagy> I tend to just put #close or #destroy methods in classes that contain stuff which is liable to be leaky
zwang joined #ruby-lang
yumike joined #ruby-lang
jensn joined #ruby-lang
ryanf joined #ruby-lang
deadbea7 joined #ruby-lang
yxhuvud joined #ruby-lang
towski joined #ruby-lang
looopy joined #ruby-lang
burgestrand joined #ruby-lang
tallship joined #ruby-lang
bnagy joined #ruby-lang
tallship joined #ruby-lang
terraUNDverra joined #ruby-lang
solars joined #ruby-lang
jxie joined #ruby-lang
kitallis joined #ruby-lang
lightcap joined #ruby-lang
Mchl joined #ruby-lang
jkyle joined #ruby-lang
shapeshed joined #ruby-lang
robotmay joined #ruby-lang
DEac- joined #ruby-lang
gnufied joined #ruby-lang
ryanf_ joined #ruby-lang
ben_ joined #ruby-lang
diegoviola joined #ruby-lang
burgestrand joined #ruby-lang
heftig joined #ruby-lang
DEac- joined #ruby-lang
resetexistence joined #ruby-lang
StevenRingo joined #ruby-lang
yorickpeterse joined #ruby-lang
tallship joined #ruby-lang
tallship joined #ruby-lang
dc5ala joined #ruby-lang
amerine joined #ruby-lang
molgrew joined #ruby-lang
WillMarshall joined #ruby-lang
sirfilip joined #ruby-lang
ammar01 joined #ruby-lang
<sirfilip> morning
SuperTaz joined #ruby-lang
zmack joined #ruby-lang
timbleck joined #ruby-lang
adambeynon joined #ruby-lang
ruskie joined #ruby-lang
tla_ joined #ruby-lang
dr0id joined #ruby-lang
srbartlett joined #ruby-lang
meth left #ruby-lang
robotmay joined #ruby-lang
mksm joined #ruby-lang
saLOUt joined #ruby-lang
benanne joined #ruby-lang
thrcka joined #ruby-lang
dave_miles joined #ruby-lang
Indian joined #ruby-lang
terraUNDverra joined #ruby-lang
TvL2386 joined #ruby-lang
jb-san joined #ruby-lang
Guedes joined #ruby-lang
Guedes joined #ruby-lang
Manhose joined #ruby-lang
neoesque joined #ruby-lang
zmack joined #ruby-lang
s0undt3ch joined #ruby-lang
Manhose_ joined #ruby-lang
postmodern joined #ruby-lang
<terraUNDverra> cout: ping
Guest89147 joined #ruby-lang
<terraUNDverra> _ko1: what exactly is dfp and lfp ?
srbartlett joined #ruby-lang
<terraUNDverra> whitequark: http://yarvinstructions.heroku.com/
sepp2k joined #ruby-lang
fai|safe joined #ruby-lang
Pip joined #ruby-lang
<terraUNDverra> whitequark: you here?
s0undt3ch joined #ruby-lang
Aaaarg joined #ruby-lang
felipegb joined #ruby-lang
fayimora joined #ruby-lang
workmad3 joined #ruby-lang
saLOUt joined #ruby-lang
toretore joined #ruby-lang
marcostoledo joined #ruby-lang
woollyams joined #ruby-lang
ksinkar joined #ruby-lang
jesterac_ joined #ruby-lang
stamina joined #ruby-lang
tomb joined #ruby-lang
syuzi330 joined #ruby-lang
syuzi330 left #ruby-lang
tomb joined #ruby-lang
jensn joined #ruby-lang
flexd joined #ruby-lang
flexd joined #ruby-lang
Natch| joined #ruby-lang
savage- joined #ruby-lang
kitallis joined #ruby-lang
marcostoledo joined #ruby-lang
S2kx joined #ruby-lang
<kitallis> quickest way to delete the first line of a file?
felipegb joined #ruby-lang
EvilJStoker joined #ruby-lang
<sirfilip> lines = File.readlines('some_file'); File.write('somefile', lines[1..lines.length].join(''))
<sirfilip> :D
<sirfilip> but it will be a problem if you have a large file
<sirfilip> since it is loading its content into memory
felipegb joined #ruby-lang
<rane_> what's the workaround in ruby for that?
<sirfilip> lines = File.readlines('some_file')[1..-1];File.write('some_file', lines.join('')) would do kitallis
<sirfilip> well you can read the file one line at the time
<sirfilip> and write the content into filename.new and when you are done just remove the original one and remove the .new at the end
<sirfilip> but this is the most basic solution i could think of at the moment
<sirfilip> :D
<sirfilip> looks like tail +2 the_file > the_new_file is the winner
ABK left #ruby-lang
<sirfilip> and there is a whole discussion about it http://www.ruby-forum.com/topic/163631
shevy joined #ruby-lang
heftig joined #ruby-lang
JohnBat26 joined #ruby-lang
lenilson_dias joined #ruby-lang
malev joined #ruby-lang
<manveru> heh
<cout> je suis ici
<terraUNDverra> cout: oh hey, can you tell me everything you know about lfp/dfp/cfp ?
<cout> I don't remember much about lfp/dfp
<cout> oh wait
<terraUNDverra> cout: im getting a weird crash due to 'invalid dfp' in my c lib, and debugging it would be easier if i had a better understanding of what it does exactly
<cout> lfp stores locals and dfp stores dynamics
<terraUNDverra> cout: what's a dynamic exactly
<cout> dfp needs to be different from lfp b/c you can have multiple dynamic scopes inside a function
<cout> e.g. foo.each { |x| ... }
<cout> but I can't remember why lfp is different from cfp
<terraUNDverra> cout: oh ok, i see the type of dfp is a VALUE, but it's really just a pointer, what is the tpe of the object it's pointing to? another rb_control_frame_t or ?
<cout> look at the code for getdynamic
<cout> it's an array of VALUEs
<cout> I don't know where the index comes from though
<terraUNDverra> cout: im very impressed you gleaned all this stuff on your own from just source diving :P
<cout> it was over the course of 10 years
<cout> plus I started with ruby 1.6, which was much simpler
<cout> thank you though
<terraUNDverra> cout: im currently getting this when i use binding_of_caller, it's very very rare though: https://gist.github.com/1390993
<terraUNDverra> "invalid dfp"
<cout> that comes from vm_make_env_each()
<terraUNDverra> yeah
<cout> it means the pointer is null
<cout> hmm.
<terraUNDverra> i checked there, and now you've explained relationship between lfp/dfp i think i have a better idea of where to go from here
<terraUNDverra> but
<terraUNDverra> hm
<cout> that function isn't very well documented
<terraUNDverra> yeah, hardly anything is
<terraUNDverra> so it's pretty hard to figure out what's going on sometimes
<terraUNDverra> often just tracign things through in gdb seems the best bet
<cout> it has to do with procs
<cout> that's so weird
<cout> vm_make_env_each(rb_thread_t * const th, rb_control_frame_t * const cfp, VALUE *envptr, VALUE * const endptr)
<cout> envval = vm_make_env_each(th, cfp, cfp->dfp, cfp->lfp);
<cout> dfp is envptr and lfp is endptr?
<cout> that makes no sense to me
Spooner joined #ruby-lang
<terraUNDverra> yeah if only they gave things proper names we'd be 50% of teh way there
<cout> I think the names are right
<cout> I suspect it's an optimization of some kind
Manhose joined #ruby-lang
<terraUNDverra> cout: line 26 here https://gist.github.com/1391382
<terraUNDverra> that's where my program is dying
saLOUt joined #ruby-lang
saLOUt joined #ruby-lang
<cout> it's only going to hit that rb_bug call if the environment (which is where lfp/dfp point) is allocated on the stack
<cout> that's ruby code (which I have in front of me); where's your code?
<terraUNDverra> it's the 'callers' method which is dying
<terraUNDverra> callers works right to the top of the stack and creates a binding for each stack frame
<terraUNDverra> walks*
zmack joined #ruby-lang
<cout> oh, did you copy that function?
<terraUNDverra> no i wrote it
<terraUNDverra> hehe
jensn_ joined #ruby-lang
<terraUNDverra> cout: my find_valid_frame() and valid_frame_p() functions were written as a result of a process of trial and error hehe
<terraUNDverra> and playing around in gdb, seeing what caused segfaults and what didnt :)
<terraUNDverra> cout: let me knwo if you see anything obviously wrong/retarded in my code
<rue> terraUNDverra: There's some macros you probably should be using to verify the fp validity
<rue> In general, I mean
<cout> I think you need to copy the environment from the stack to the heap before you call rb_vm_make_env_object
<cout> ... or is that what that function is doing?
<rue> rb_binding_new encapsulates this stuff to a degree
<rue> terraUNDverra: Damn it, I was supposed to do stuff today.
<terraUNDverra> cout: i think it must be done there, since it's all that's used to create a normal ruby binding, all im doing is pretty much using that exact code but on cfps further up the stack
<terraUNDverra> hehe
Austin__ joined #ruby-lang
robbrit joined #ruby-lang
<deryl> ok rather confused here. Trying to remove the dependency of a class variable for a github object creation into the TestReport class. Running into an interesting issue (or so it appears) which acts like a chicken and the egg scenario. I have to instantiate the TestReport object to get access to github() method from the class but I need the class to create the github connection at the time its instantiated. The code is at: http://z.pist0s.ca/zX0
<deryl> would someone take a look please and tell me what I'm doing wrong?
<deryl> because I really don't understand where I've screwed up.
<cout> terraUNDverra: I feel like I've dealt with this before, but I can't remember whre
<rue> terraUNDverra: Why aren't you using rb_binding_new? Also, did you look at the binding of caller impl in evil.rb?
<deryl> the TestReport class file is here: http://goo.gl/O5rwH (The first URL i gave is the commit)
<cout> terraUNDverra: but for now I must endure the pain of eating cinnamon rolls that my mother made :)
<terraUNDverra> rue: the binding of caller impl in evil.rb is a joke, it's very limited and uses an ugly approach with continuations and so on.
<terraUNDverra> rue_: and i think it only works for the immediate caller too
<rue> Oh, right, I remember how he did it now
Manhose joined #ruby-lang
<deryl> and I said that wrong. I had a @@github object in rvm_test.rb. Trying to remove the class level variable, and move the github creation and ownership into the TestReport class directly.
<terraUNDverra> rue: i think i startd with the code in rb_binding_new (which i think was really just a warpper for rb_f_binding or osmething) and i messed with it for a few days until it worked on frames further up the stack
<rue> deryl: Shouldn't that just be a class method, then?
<deryl> rvm_test.rb is the init script for this project which loads the classes (TestReport and Command. Command is linked to TestReport by belongs_to)
<deryl> rue: it is a class method. see def github(login_string) in TestReport
<rue> No, that's an instance method
<rue> If you just have a single connection, you can do something like TestReport.setup_github_connection!; rep = TestReport.new
<deryl> oh duh. yeah MY terminology is off. Masically I want each instance to have its own github connector
<deryl> s/Masically/Basically/
<rue> deryl: self.initialize -> initialize
<deryl> i tried that first. still gave me: undefined method `github' for nil:NilClass (NoMethodError)
<deryl> thats what I get for the errors
<deryl> I know its my logic, i just don't see where I'm goofing it (Where the idea is that *each* TestReport object has its own github connection, rather than a shared one)
<rue> Try it again, there shouldn't be anything special about it
<deryl> change it back from self.initialize to initialize you mean?
<rue> Yes
<deryl> ok sec
<rue> self.initialize is kinda meaningless
<rue> Also, you must have obtained the login string from somewhere
<deryl> now it changes to: test_report.rb:39:in `github': undefined method `[]' for nil:NilClass (NoMethodError)
<deryl> yes, line 18 in TestReport loads that
<rue> I'm not sure what it loads, but it's not setting an ivar of an object that's not yet been created :)
<deryl> i have it in a file that the git repo ignores so that I don't have to worry about accidently including secure info into the repo
<rue> If there's only ever a single login, I'm not sure there's any point to having multiple connections
<deryl> so should I be adding a attr_accessor :login_string and move the load line for the file into initialize?
<terraUNDverra> cout: do u have a twitter account?
<deryl> rue: a single login is all that is going to do. its just moving that login into the actual object that will be using and creating it
<rue> deryl: What you probably ought have is a txt/json/yaml file with just the login info, and then @login_string = read that string from the file in the #initialize
<deryl> swap those verbs
<rue> Rather than a .rb file that you load
<cout> terraUNDverra: yes but I don't use it
<cout> terraUNDverra: paul_brannan
<deryl> rue: if I'm 'load'ing the file and I have the @login_string = blah in that file what difference does it make since it loads that var each time
<rue> deryl: Loading doesn't happen in the context of where you load something
<deryl> and it isolates the security information out of the class file into a file that the repo ignores so that security info isn't accidently exposed.
<deryl> rue: hrmm, ok. i though 'load' did exactly that. it loaded the contents of the file right there. like a C #include does
<rue> If you have class A; load "b"; end # a.rb and @foo = 1 # b.rb that doesn't mean that A will have a class ivar @foo
<rue> Loading (and requiring) executes the script just as if you'd done $ ruby a.rb
<rue> No, it's not like #include
<deryl> ok, then if 'load' isn't doing what i think it does, then what should I do to load the content of that file as if it was part of the file? 'include' ?
<terraUNDverra> cout: thanks, following. Now i can harrass you 24/7 with questions on ruby internals
<rue> >> deryl: What you probably ought have is a txt/json/yaml file with just the login info, and then @login_string = read that string from the file in the #initialize
<cout> haha
<rue> Or if it's structured data (e.g. {name, token}), you could pass the path to #connect_to_github and handle loading the data in there
<terraUNDverra> cout: btw, my binding of caller code is quite simple and perhaps naive, if you see anything dumb in there let me know, i'd really love to have a robust bindnig of caller, and this thing is almost there (at least it's worked great for 2 months until this particular piece of code made it die :/)
<deryl> thats what i AM doing. the file I'm loading containts: @login_string = { :login => "MYUSER", :user => "MYUSER", :password => "MYPASS", :repo => "rvm-test" }
<cout> terraUNDverra: what piece of code?
<deryl> when I have it in rvm_test.rb and load it into a @@var it works perfectly
<deryl> but when i try to remove the @@var it fails.
<terraUNDverra> cout: i haven't been able to chisel it down to a minimal case yet, but i'll show u it anyway, probably not much use in its current form tho
<terraUNDverra> cout: the binding.callers call on line 100
<terraUNDverra> is where it crashes
<cout> terraUNDverra: interesting, a toplevel proc
apeiros_ joined #ruby-lang
<terraUNDverra> cout: this code is juts a plugin to let you move up/down the stack in a pry session (pry is kind of an irb-clone that can be invoked in the middle of a running program)
lenilso__ joined #ruby-lang
<deryl> rue: ah thats why I put it the way i did as well. If I do a file.gets to read in the entry, even if I create @login_string as a hash and then file.gets or file.readline willr ead it as a string, and doesn't know to populate it as a hash.
<deryl> such that @login_string goes from Hash to String type. This is the only way I can think of whithout needlessly complicating the code by making it convert the portions of the string to k,v pairs. since it's already laid out as k.v pairs in the config/github.rb
<terraUNDverra> cout: oh i'll show u the commit wehre the segfault started arising
tomzx joined #ruby-lang
<terraUNDverra> cout: i located the exact commit where it went from working fine to segfaulting
<terraUNDverra> cout: it's now segfaultint in line 39 of hooks.rb
steph021 joined #ruby-lang
<terraUNDverra> cout: crazy
<terraUNDverra> cout: if i get rid of this block Pry::Helpers::BaseHelpers.silence_warnings do ... end wrapping the exec_hook invocation, i no longer get the segfault
<terraUNDverra> cout: well i fixed the segfault in the ruby code, i needed to jump out of an extra frame since i added the silence_warnings wrapper block. But i'd still like to grok why it was segfaulting
rippa joined #ruby-lang
looopy joined #ruby-lang
yumike joined #ruby-lang
MistyM joined #ruby-lang
<sirfilip> :D
wyhaines joined #ruby-lang
ksinkar joined #ruby-lang
<rue> deryl: If you have structured data, store it as JSON or YAML, then use those libraries to read it into a Hash.
<rue> You could also do something like module Github; DETAILS = {blah}; end but there's really no need.
RomD joined #ruby-lang
<terraUNDverra> cout: how do i go backwards in gdb again?
<terraUNDverra> i remember they added that feature a while ago but i never used it
m0wfo joined #ruby-lang
<rue> What's backwards?
<kalleth> step previous
<rue> You can move up and down the framse
<kalleth> didn't think you could
<cout> backward?
<terraUNDverra> rue: i mean like 'next' backwards
<terraUNDverra> run the program in reverse ;)
fai|safe joined #ruby-lang
sepp2k1 joined #ruby-lang
<rue> terraUNDverra: rs (reverse-step) apparently
<terraUNDverra> rue: phat, is there a reverse-next too?
<rue> Dunno, I just duckducked
<terraUNDverra> reverse-next
<terraUNDverra> crazy
<terraUNDverra> gdb 7.0 is the bomb
<terraUNDverra> stupid macosx lion only comds with gdb 6.3
<terraUNDverra> comes*
<rue> homebrew, homes
<terraUNDverra> im on it, puffin
m0wfo joined #ruby-lang
fayimora joined #ruby-lang
<rue> Actually I'm not sure if there's a homebrew formula for it
<MistyM> rue: In homebrew-alt, but not in mainline Homebrew: https://github.com/adamv/homebrew-alt/blob/master/duplicates/gdb.rb
<rue> Ah, neat
looopy joined #ruby-lang
setmeaway joined #ruby-lang
m0wfo joined #ruby-lang
tbuehlmann joined #ruby-lang
gregmoreno joined #ruby-lang
nofxx joined #ruby-lang
darkf joined #ruby-lang
sirfilip left #ruby-lang
jkyle joined #ruby-lang
fayimora joined #ruby-lang
Jake232 joined #ruby-lang
theconartist joined #ruby-lang
looopy joined #ruby-lang
heftig joined #ruby-lang
shaman42 joined #ruby-lang
voker57 joined #ruby-lang
voker57 joined #ruby-lang
michael_mbp joined #ruby-lang
Mister joined #ruby-lang
<Mister> gg
Mister left #ruby-lang
looopy joined #ruby-lang
deryl joined #ruby-lang
hagabaka joined #ruby-lang
cyndis joined #ruby-lang
fayimora joined #ruby-lang
jkyle joined #ruby-lang
macmartine joined #ruby-lang
yorickpeterse joined #ruby-lang
malev joined #ruby-lang
mksm joined #ruby-lang
DEac- joined #ruby-lang
<mksm> I need someone to code some ruby bindings for a couple of libs. Any suggestions on where I could look for a ruby/c/cpp dev to hire?
<steveklabnik> you're not a programmer yourself? or you are?
r0bby joined #ruby-lang
<mksm> i am, but not experienced in c/cpp
<steveklabnik> ah.
<steveklabnik> FFI is pretty simple.
<steveklabnik> was why I was mentioning it.
<mksm> Yeah, FFI. I could give it a shot but was hoping to find someone interested first
* steveklabnik nods
<steveklabnik> the pool of rubyists who know and like c/cpp is pretty small.
<steveklabnik> good luck. :/
savage- joined #ruby-lang
<mksm> thanks
<mksm> who uses C anyway? :D
yorickpeterse joined #ruby-lang
yorickpeterse joined #ruby-lang
looopy joined #ruby-lang
<steveklabnik> I do... with Ruby. ;)
<steveklabnik> Shoes is mostly C.
<mksm> Yep, why_ whould easily nail this :<
<epitron> mksm: what do you want bindings for?
<epitron> like, which library?
<mksm> imagemagick and tesseract
<epitron> RMagick isn't good enough for you?
<epitron> Clippy: It looks like you're trying to create OCR software. Do you want me to open a template?
<steveklabnik> ... you wouldn't want _why to write your C bindings.
<steveklabnik> trust me.
<mksm> epitron, I just need one feature included in rmagick (morphology)
<epitron> i'm sure _why can write serious code :)
<steveklabnik> yeah, well, he never demonstrated that.
<epitron> but he wouldn't
<steveklabnik> :)
<steveklabnik> totally.
<steveklabnik> he wasn't dumb.
<epitron> remember, _why was his alter ego
<epitron> he had a regular ego as well
<epitron> probably with a dayjob
<epitron> he didn't learn those mad skillz by being wacky all the time
<injekt> hm
<epitron> or maybe he burned out on serious coding and became a wacky coder
<epitron> (just speculating)
<steveklabnik> well, his personna actually rejected 'good code'
<epitron> mksm: you want to apply a kernel to images?
<epitron> you should probably use python if you want to do that stuff
<steveklabnik> I do not write tests for my code. I do not write very many comments. I change styles very frequently. And, most of all, I shun the predominant styles of coding because that would go against the very essence of experimentation. In short: all I do is muck around.
<steveklabnik> so....
<epitron> python's imaging library (PIL) gives you very fine-grained efficient control of images
<epitron> rmagick (last time i used it) was pretty bloated, leaky, and flaky
<savage-> I used Enumerable#each_cons the first time yesterday.
<epitron> and google has done lots of work on tesseract-ocr
<savage-> I'm a big fan.
<epitron> they probably have python code for it
<epitron> savage-: \o/
<savage-> o_O
ecin joined #ruby-lang
<epitron> savage-: btw, you might find this neat -- http://ai4r.rubyforge.org/
<epitron> i was asking about clustering the other day, and someone hit me with that
<epitron> it has a whole bunch of handy little routines
ecin_ joined #ruby-lang
<savage-> epitron: neat! thanks man
yorickpeterse joined #ruby-lang
<epitron> Ai4r::Clusterers::SingleLinkage is the most basic one
<mksm> epitron, porting this module to python would be even more work/trouble than getting the bindings working.
<savage-> epitron: are you using this in a personal app or?
<epitron> savage-: yeah, it's just for playing around
<savage-> cool
<epitron> the code is actually pretty shitty, i've noticed
<savage-> hehe
<epitron> to wrap each element in an array, instead of: elements.map{|e| [e]}
<epitron> they did:
<epitron> result = []
srbaker joined #ruby-lang
<epitron> elements.length.times { |i| result << elements[i] }
<epitron> result
<epitron> i was like ... O_O
<savage-> hehehe
<mksm> savage-, not personal, it's for my business
<epitron> obviously a java developer
<erikh> happy t-day everyone
<erikh> well, the americans at least I suppose.
Pip joined #ruby-lang
<epitron> or as turkeys call it, the holocaust
<erikh> heh
<deryl> hey erikh
<erikh> hi!
<deryl> how goes it?
<erikh> ah yes, you want me to review your code aye?
<robbrit> some of us use the excuse that the americans are cooking turkey to cook turkey too
<deryl> true, but i wasn't saying hi for that :) just saying hi cause well.. HI!
robotmay joined #ruby-lang
<deryl> erikh: but I am majorly stuck and getting nothing back definitive from the bombing message.
<erikh> robbrit: heh
<erikh> deryl: what bombing message?
<erikh> actually I asked my wife to make ham today
<erikh> I can cook kraft dinner, that's about it
terraUNDverra joined #ruby-lang
<robbrit> ham/dinner and kraft dinner would be pretty good
<robbrit> *ham/turkey
<erikh> sec
<erikh> lecture time
<deryl> rvm_test.rb pulls in the test report model and executes it
<erikh> self.test_failed+=1
<deryl> what i did was remove the class level variable (@@github) out of rvm_test.rb
<erikh> is your spacebar broken?
<deryl> who me?
<erikh> heh yes
<erikh> the above code
<erikh> anyhow, let me look at your current issue
<deryl> no i must have accidently deleted the space and didin't realize it
<deryl> sec. is that in Command.rb? or TestReport.rb?
<erikh> command.rb
<erikh> just be mindful of how others will read your code when you write it
<erikh> clever code goes the same way
<deryl> I see it fixxing
<erikh> don't sweat it too hard.
<deryl> pushed :)
<deryl> naa, minor fix
<deryl> wish you had skype or google+ so we could talk voice.
<deryl> make it easier to explain and not such a lapse between typing
hhatch joined #ruby-lang
<rue> Ah good, we're back here.
mdel joined #ruby-lang
<deryl> rue and aperios_ were trying to explain it to me. I converted the file I had to yaml format, its importing just fine, and @test_report.login_string and @test_report.my_github populate just fine now. but I'm getting that undefined method delete error, and if I go back to .save! I get has_key? error on nilClass
<deryl> rue: hehe yeah my bad. i shouldn't be bouncing over all the channels.
<deryl> not right
<rue> So, add a super call in your #initialize if it's inheriting
<deryl> ahh yeah I just saw taht from #ror. NEVER dawned on me i was masking the AR initialize
<erikh> honestly this feels like a rails bug to me
<erikh> unless there's sql output going on with it
<rue> The error you're seeing implies the attributes aren't getting set up correctly, which leads me to suspect the base isn't getting set up properly
<erikh> yeah, I'm not much of a rails guy
<deryl> erikh: this is straight ruby
<deryl> not in testsuite
<erikh> that stack above is from activerecord
<erikh> which for me is "rails"
<deryl> testsuite is the rails frontend. rvm-test is the console only
<deryl> oh naa, i'm just backing my models with AR
<deryl> need db storage
<deryl> what I get when i add super is self.gist_url = "#{@test_report.my_github.gists.create_gist(:description => cmd, :public => true, :files => { "console.sh" => { :content => gist_content }}).html_url}"
<deryl> err
michael_mbp_ joined #ruby-lang
<erikh> i just use mysql2/pg/sqlite-ruby directly
<deryl> ehh i like AR. handles most of the stuff for me, gives me great finders and the like. I like it
<erikh> cool
<erikh> Arel is some sick code
<deryl> Now I get undefined method my_github from that line: self.gist_url = "#{@test_report.my_github.gists.create_gist(:description => cmd, :public => true, :files => { "console.sh" => { :content => gist_content }}).html_url}"
<rue> Have you defined that method?
<deryl> yes. its in TestReport
<deryl> @my_github = self.github(@login_string)
<rue> That's not a method though :)
<deryl> from TestReport.rb line 21
<deryl> def github(login_string)
<deryl> return Github.new(:login => "#{login_string[:login]}", :user => "#{login_string[:user]}", :password => "#{login_string[:password]}", :repo => "#{login_string[:repo]}")
<deryl> end
<deryl> lines 31-33 from TestReport.rb
<deryl> wonder if its because I used self. there
<deryl> but i shoudl bea ble to. the Object is a TestReport object and that method is defined in TestReport only
<rue> No, you need to do that if it's a setter method
<rue> def my_github; @my_github; end or use an accessor
<rue> That's a method
<deryl> i have attr_accessor :my_github, :login_string
<deryl> and @login_string gets set right, and its passed in
setmeaway joined #ruby-lang
<deryl> or do I need to do @my_github = Github.new(...) in the github(login_string) method?
<deryl> and just *call* github(@login_string) (like that) in initialize?
jbwiv_ joined #ruby-lang
<rue> I suppose that'd work too
<deryl> i tried that. its bombing on command.rb:156 which is self.gist_url = "#{@test_report.my_github.gists.create_gist(:description => cmd, :public => true, :files => { "console.sh" => { :content => gist_content }}).html_url}"
<deryl> its telling me: app/models/command.rb:156:in `run': undefined method `my_github' for nil:NilClass (NoMethodError)
<rue> Ah, so @test_report is nil at that point
<deryl> oh wait a second
LanceHaig left #ruby-lang
<deryl> nope. thought it was cause I changed my pass. the pass was wrong in the file but i just changed it and am STILL getting that error
<deryl> if I open pry, and I manually run the lines that populate @login_string and @my_github it works fine
<deryl> i think its cause i'm not passing in github as a var to the run command.
<deryl> hrmm. how to do that correctly
Manhose joined #ruby-lang
<deryl> no tahts not it. damn it
<deryl> now this is really pissing me off
livinded joined #ruby-lang
<andrewvos> rue: How would you test support for exit 1 in docu?
<deryl> https://gist.github.com/1391978 - (I did not include @test_report.login_string and @test_report.my_github because they contain my pass and stuff)
<deryl> but they *are* populated
ryanf joined #ruby-lang
<deryl> reload that gist, I redacted the password, but it now shows they are populated
jaffachief joined #ruby-lang
lsegal joined #ruby-lang
<deryl> so if it works in pry with loading both models and setting APP_ROOT and calling the AR connection to the db, and then creating a new @test_report which causes both @test_report.login_string and @test_report.my_github to be populated as epected, I don't see what I'm doing wrong
<deryl> the ponly thing *I* can think of is that I need to pass either @test_report or @test_report.my_github in along the path but Command.rb neither TestReport.run_command nor TestReport.Command[#].run call the gisting capabilities. those are built up later from the db entries
<deryl> + so they have no need TO know about github directly
malev joined #ruby-lang
apeiros_ joined #ruby-lang
<deryl> i just pushed an update which is just the addition of 'super' to initialize
towski joined #ruby-lang
<deryl> so i know if i should just roll on or not, are you guys looking at it or just doing other things?
jensn joined #ruby-lang
<rue> Most are probably eating turkey
<deryl> ahh yeah i keep forgetting today is thanksgiving. i haven;t celebrated it in several years, myself.
resetexistence joined #ruby-lang
<rue> You need to clarify to yourself what the sequence and flow of the program is. If the gist_url method needs to access a test report, then you need to pass one in or you can set an instance variable to it
<rue> That implies you'll need to have created the test report object before you call that method
Indian joined #ruby-lang
<deryl> I am. in rvm_test.rb I am calling @test_report.display_combined_gist_report which should populate self.gist_url. Since i'm calling it WITH @test_report.blah it should know about gist_url. both commands and test_report have gist_url variables. and in commands I'm calling self.gist_url = "#{@test_report.my_github.gists.create_gist(:description => cmd, :public => true, :files => { "console.sh" => { :content => gist_content }}).html_url}"
<deryl> which as you can see i'm literally handing it the full ruby path @test_report.my_github
<deryl> (in command.run)
<deryl> trying explicitly
<rue> No… calling @obj.some_method doesn't imply that there'll be a variable @obj inside #some_method
michael_mbp_ joined #ruby-lang
<deryl> i think you're misunderstanding where the variable is. @obj = @test_report. and my_github is a method on @test_report. and @test_report.my_github is populated
<rue> OK, but your problem is that @test_report = nil
<rue> Guessing from the error, anyway
<deryl> which is what I'm not understanding. if I open pry and manually run it its populated.
<rue> In order to have def self.gist_url; "#{@test_report.blah.moo}"; end; you must have defined the instance variable for whatever self is
<deryl> and I just now added test_report to the command's run() method and I pass in @test_report to that
<rue> Or you could do def self.gist_url(test_report); and use the lvar
igotnolegs joined #ruby-lang
<deryl> yes self.gist_url IS there. i have defined it. BOTH models define a gist_url variable
dejongge joined #ruby-lang
<deryl> both the migrations for each model AND the db have gist_url
<deryl> thats a variable not a method
<rue> That's not what I'm saying at all
<rue> Or, specifically, that the problem is still @test_report being nil at the point where you're trying to use it
<deryl> then you're confusing the hell out of me because you sound like you think I don't have gist_url define OR that its a method call and its not
<deryl> gist_url on both models is a string variable.
michael_mbp_ joined #ruby-lang
<rue> OK, let's forget about gist_url
<rue> The problem is, if the error message is still correct, that @test_report is nil
<deryl> which brings us right back to my original confusion. WHY is it not populated? If I do it manually its populating just fine (if I do it in pry) so I'm not understanding why if i run it fromt he script its not
<deryl> actually its seems to be saying that it can't find my_github which would mean ither my_github is failing to be populated or @test_report is failing to be passed in.
<rue> OK, let's do this: paste all the relevant code files and the current error
Jake232 joined #ruby-lang
<deryl> OK, the code is at http://goo.gl/GT6jT - The error is at https://gist.github.com/1392015
<deryl> it looks like as you say that for some reason @test_report is not being passed in. but I can't see why.
<deryl> rvm_test.rb is the main execution file. app/models/test_report.rb and app/models/command.rb are the two files that define my models
nofxx joined #ruby-lang
<deryl> (for the code url so you see which files to look at)
<deryl> feature/api_key_addition:1c11b20
<deryl> thats the branch and the commit sha
<deryl> the yaml file that loads is correct (its not in the repo because it has the sensitive info, but the format is correct because if i manually load that file with YAML.load_file it works right)
<deryl> that yml file populates @test_report.login_string correctly, and it gets passed to @test_report.github(@login_string) which should populate @test_report.my_github with a GitHub connection object
<deryl> which when done manually (importing the file and then making the assignments in pry) it does
<deryl> i was NOT passing in the @test_report object to the TestReport.run_command but I am now. same with Command.run
<rue> That error just says you're passing one too few arguments to #run_command
<rue> def run_command( cmd, test_report, bash )
<deryl> right. which seems to indicate that @test_report is not being populated. but if i do it manually (calling the lines using C&P as I have in https://gist.github.com/1391978) it populates
<deryl> right and I AM passing it in when i call it in rvm_test.rb with @test_report.run_command( cmd, @test_report, @bash)
<deryl> @test_report has *already* been instantiated at this point
<deryl> thats done 78 lines earlier
<deryl> Line 44 of rvm_test.rb and Line 45 saves it
fayimora joined #ruby-lang
<deryl> on Line 120 I do @test_report.run_command( cmd, @test_report, @bash)
<deryl> which calls line 47 of TestReport.rb which is def run_command( cmd, test_report, bash ) Line 49 of TestReport.rb is command.run( cmd, test_report, bash ) which calls line 88 of Command.rb which is def run( cmd, test_report, bash )
<deryl> the rest of command.run executes until it gets to line 156 which is self.gist_url = "#{test_report.my_github.gists.create_gist(:description => cmd, :public => true, :files => { "console.sh" => { :content => gist_content }}).html_url}"
<rue> No, no
<deryl> how i COULD call ig as self.gist_url = "#{test_report.my_github... or as self.gist_url = "#{@test_report.my_github... since @test_report id definitely instantiated at this point and its the ONLY @test_report object existing.
<rue> run_command needs 3 arguments
<rue> You're giving it 2
<deryl> how?? I'm giving it cmd, @test_report, and @mbash
<rue> @test_report.run_command(ARGV[0].strip, @bash)
<deryl> er @bash
<deryl> OHHHH! I modified the --script section!
<deryl> wait wait wait :)
<deryl> ah hah! NOW i get a DIFFERENT error. method_missing': undefined local variable or method `gist_content' for #<Command:0x007ff87b36bde0> (NameError)
<deryl> so lets see what I'm missing from gist_content
dinesh_ joined #ruby-lang
<rue> You've defined it as a class method, and are invoking it on an object
<rue> I'd wager.
kmeehl joined #ruby-lang
savage- joined #ruby-lang
<deryl> WOOHOO! that was exctly it. I was defining self.gist_content not gist_content
<deryl> well I got the single command working, now to find out where the error is int he --script section
<deryl> rue: thanks for dealing with my brain deadness
<erikh> not knowing something doesn't make you an idiot
<erikh> get that thought out of your head; you'll grow faster.
<deryl> hehe, i'm hard on myself. sort of ingrained
<erikh> shit happens
<rue> deryl: Sure! The main thing I can suggest is to try to forget about what you *think* is happening in the code, and e.g. in the case of errors, track it exactly
ryanf joined #ruby-lang
<deryl> i got ya. Now I'm down to a different error. its in my @test_report.dump_obj_store - https://gist.github.com/1392075 - The error is at https://gist.github.com/1392075
<deryl> the line is Marshal.dump(self, report_obj) wonder if that means I have to pass @test_report rather than self
zmack joined #ruby-lang
fayimora joined #ruby-lang
jaffachief joined #ruby-lang
<rue> You can't marshal a proc
<apeiros_> procs don't matter. marshal does…
<erikh> yay, just leveled up in make
<erikh> I learned how to use patsubst
<deryl> its breaking on line 77 cmd.dump_obj_store
<deryl> test_report.rb:77:in `dump_obj_store': undefined method `commands' for nil:NilClass (NoMethodError)
<deryl> ok, why can't I call self in the Marshal call now? shouldn't self refer to the current TestReport object?
<deryl> I'm calling it as @test_report.dump_obj_store
<deryl> so self should == @test_report
<deryl> and if its gotten that far, @test_report.commands should be populated since this is executed after all other commands have finished, which means @test_report.commands should alreadybe populated (it processed all the commands already. I even see the gist outputs)
<deryl> and thats the last command to be executed in that section
saLOUt joined #ruby-lang
<deryl> here are all the relevent sections and the error https://gist.github.com/1392154
<deryl> wish i could turn off the alphabeetic ordering of the files added. its supposed to be rvm_test.rb then test_report.rb then command.rb and then ERROR.sh
<deryl> reload that gist. https://gist.github.com/1392154 - Had to add #1 - filename #2 - filename etc to get the ordering right
workmad3 joined #ruby-lang
<erikh> GNU documentation is so awesome
s0ber_ joined #ruby-lang
<Austin__> erikh: written by robots for robots?
<erikh> heh
<erikh> well, it is rather pedantic and detailed
<erikh> nice features when you're learning new things.
<deryl> Y 4 2 U NO LIKE ROBOTS?
* deryl grins
michael_mbp_ joined #ruby-lang
thone joined #ruby-lang
<injekt> D:
<injekt> er wrong window
<injekt> although probably applicable in here at times also
<dreinull-> instead of creating new editors for os x why does nobody adds some nice syntax files for xcode?
<dreinull-> add
<Mon_Ouie> I think syntax coloration isn't the most important point
<dreinull-> I'd be happy with that for now.
<dreinull-> it has autocomplete and a file viewer.
<andrewvos> dreinull-: Is it hard to write syntax files for it? (I ask this with the intention of never having to use it)
<andrewvos> s/having//
<andrewvos> Wait that doesn't work.
<dreinull-> don't know.
<andrewvos> Anyone have any experience writing a task class for rake?
<injekt> dreinull: for xcode? I only find people use xcode for obj-c anyway
<injekt> I know I do
<dreinull> injekt: well, just asking.
cyri_ joined #ruby-lang
<dreinull> frustraded with all existing editors
<injekt> dreinull: sure :) I think vim is more popular for general purpose dev, and well, there's thousands of syntax files for that
<dreinull> injekt: I tried vim for a thousand times. I can navigate and develop with it fairly well but it drives me crazy that I'm forced to use the keyboard for everything.
stetho joined #ruby-lang
<injekt> you're not forced to use your keyboard for everything
<dreinull> going from browser to editor is going from trackpad to keyboard
<dreinull> I like my point and click features as much as I love my keyboard.
<robbrit> i typically mix vim with other stuff
<robbrit> do the actual coding in vim, do stuff like refactoring and all that in an IDE
<dreinull> redcar is nice if it wouldnt stop working every once ina while.
<dreinull> autocomplete that is.
sepp2k joined #ruby-lang
<dreinull> I know that vim would be the perfect editor I just dont have enough time to get fluent in it
<dreinull> ok, going to fix my noisy mbp fan now.
<dreinull> wish me luck
<robbrit> good luck
publicvoid joined #ruby-lang
m0wfo joined #ruby-lang
zmack joined #ruby-lang
michael_mbp_ joined #ruby-lang
perryh joined #ruby-lang
perryh joined #ruby-lang
<andrewvos> dreinull: Just start using it
jaffachief joined #ruby-lang
michael_mbp_ joined #ruby-lang
workmad3 joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
robbrit left #ruby-lang
cored joined #ruby-lang
cored joined #ruby-lang
Pip joined #ruby-lang
dejongge joined #ruby-lang
mikeric joined #ruby-lang
m0wfo joined #ruby-lang
stamina joined #ruby-lang
saLOUt joined #ruby-lang
Pip joined #ruby-lang
wmoxam joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
Pip joined #ruby-lang
dr_bob joined #ruby-lang
srbartlett joined #ruby-lang
burgestrand joined #ruby-lang
dejongge joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
michael_mbp_ joined #ruby-lang
benanne joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
<dreinull> andrewvos: I usually demand about 17,000 a day.
<andrewvos> dreinull: Can't tell if serious
<dreinull> seriously.
corundum joined #ruby-lang
<andrewvos> You do consulting?
<dreinull> nobody asks but anyway. Just in case.
<dreinull> but hey, I can fix mbp fans.
gix joined #ruby-lang
hexo joined #ruby-lang
spectra joined #ruby-lang
<MistyM> dreinull: Hooray, it worked?
<andrewvos> :|
<dreinull> yes, I spiked it up to 6k rpm with scmfancontrol but the fixed fan is a bit slower.
<dreinull> don't know if that matters but it's quiet again.
<MistyM> Quiet is good, so long as the temperature is good too ;)
<MistyM> re: vim, as you were asking before... you ever try MacVim?
<dreinull> yes, I used it quite a lot last year
<andrewvos> dreinull: Don't listen to MistyM. Use vim in a terminal. Use it for everything. You'll soon learn.
<MistyM> andrewvos: ;o
<andrewvos> :)
vesan_ joined #ruby-lang
<dreinull> then something broke. I always got some balloon tool tips for my code and couldnt get rid of it.
<shevy> hehe
<dreinull> always some ri on my ruby code.
<andrewvos> hahahh
<dreinull> nobody could help me and when I removed all config files it was ok but then all my settings were gone too.
<dreinull> also I think vim works better with an English keyboard
<andrewvos> Yeah, probably.
<dreinull> I have so many unused keys it makes things complicated
<dreinull> all the gains from easy key cobos are gone if I have to press five keys at the same time and then press this extra key
Pip joined #ruby-lang
Pip joined #ruby-lang
<andrewvos> Anyone know a cheap good screen recorder for os x?
Pip joined #ruby-lang
michael_mbp_ joined #ruby-lang
<rane_> andrewvos: quicktime
<andrewvos> rane_: what?
<dreinull> yup, qt does the job
<andrewvos> whoa
<andrewvos> Last time I used it I must have done something wrong.
<andrewvos> rane_: Thanks
<andrewvos> zenspider: It would be nice to have red/green output for minitest.
<andrewvos> zenspider: I mean, pride is cool and all. But I miss the harsh redness.
workmad3 joined #ruby-lang
<injekt> andrewvos: turn?
<injekt> that's what rails uses
<injekt> andrewvos: my tests usually have a require 'turn' with a rescue
saLOUt joined #ruby-lang
ruby_newbie joined #ruby-lang
<ruby_newbie> hello
<injekt> good afternoon
<ruby_newbie> i know C a little but i whant to start learning ruby
<ruby_newbie> can you recommend any good books?
<andrewvos> injekt: Does it work with pride?
<ruby_newbie> now i read SICP
<injekt> corundum: books?
<corundum> see "poignant guide" or "pickaxe" or http://www.ruby-doc.org/bookstore/
<injekt> andrewvos: I've no idea
<ruby_newbie> but dunno what read to learn ruby
<injekt> andrewvos: pride was nothing more than a gimic to me, I dont use it
<andrewvos> injekt: We are talking minitest right?
<injekt> andrewvos: yes
<injekt> ruby_newbie: there are a lot of ruby books
<andrewvos> injekt: I enjoy pride. It changes things a bit. Have been seeing boring tests for too long :)
<ruby_newbie> injekt: thats it, im confused
<injekt> ruby_newbie: if you know c already, you should be able to pick up ruby fine
<andrewvos> ruby_newbie: Ruby koans, or Project Euler.
<andrewvos> ruby_newbie: Unless you enjoy reading programming books. I don't.
<injekt> :)
<livinded> speaking of books, still no word about pragprog turkey day sale
<ruby_newbie> i enjoy read no matter what it is but also iwhat to understand what i read :)
<MistyM> livinded: Are you on their mailing list? I got an e-mail about their black Friday sale at the beginning of the week.
<livinded> MistyM: no, are they doing the normal 40% off?
<MistyM> livinded: Yeah. Don't remember if there was a code or what - they'll probably have a public announcement during the sale. It's one day only, tomorrow.
<livinded> ah, I thought it was normally on thanksgiving and not black friday
<MistyM> Dunno what it normally is, but it's black Friday this year. ;)
<livinded> the code is usually like turkey and the year or something
<MistyM> InformIT's got a 50% off ebook sale right now too. Eloquent Ruby has me tempted. I heard good things about it.
<livinded> I've got like a $350 wish list on pragprog that I'm considering picking up all of
<ruby_newbie> but can you recommend some books to start learn ruby?
<livinded> ruby_newbie: none of the books I read I liked
<livinded> just fuck around and read code until you get it
<livinded> I still think pickaxe is highly overrated and really not that useful
<MistyM> I disagree, Pickaxe was really helpful to me.
<ruby_newbie> ok, i see, thx
<MistyM> ruby_newbie: Just out of curiosity, how comfortable do you feel with programming? Like, do you feel like you have a good grounding on the concepts?
<livinded> a huge bulk of it is just ri basically and the actual chapters that teach ruby I thought were kinda poor in regard to other books I've read
<ruby_newbie> MistyM: i have something(basics of C and 3 years of linux experience)
<ruby_newbie> MistyM: i reading SICP right now
<ruby_newbie> MistyM: do you what to recommend something?
<MistyM> ruby_newbie: OK, the Poignant Guide is probably a little too "beginner" for you then. It's written with the assumption that you've done no programming, or very simple scripting.
<livinded> but who doesn't want to look at cartoon foxes!
<livinded> and chunky bacon!
<MistyM> Yes, it's the only guide with cartoon foxes!
<MistyM> And synergy.
<injekt> l
<ruby_newbie> then enything else?
hagabaka joined #ruby-lang
<steveklabnik> metaprogramming ruby is good
<steveklabnik> teaches the ruby object model
<steveklabnik> it might be good after the poignant guide.
<livinded> I need to read that still. It's been sitting on my shelf
<MistyM> steveklabnik: Surely a little advanced for someone who hasn't touched Ruby before?
<steveklabnik> MistyM: hence 'after the poignant guide'
<MistyM> I hit enter before I saw that ;)
<steveklabnik> livinded: do it. it's really good
<steveklabnik> hahah okay :)
<livinded> Also have "Design Patterns in Ruby" that I haven't read yet
<MistyM> ruby_newbie: I found the Pickaxe book (Programming Ruby by the Pragmatic Programmers) very helpful. Its introduction to Ruby is well-paced and it does a good job of teaching you the most important parts of the language. Apparently livinded didn't, so it's not universally-approved ;)
benanne joined #ruby-lang
Rich_Morin left #ruby-lang
<ruby_newbie> what do you think about "The Ruby Programming Langueage" by Flanagan and Matz?
<steveklabnik> i dont like the pickaxe either.
<steveklabnik> ruby_newbie: it's pretty solid
<ruby_newbie> solid == good?
<livinded> I've heard good things about "Learning Ruby" from O'Reilly but I haven't read it
<ruby_newbie> it's shit, to fast forward
<ruby_newbie> s/to/too/
<steveklabnik> ruby_newbie: yes
<ruby_newbie> thank you guys
looopy joined #ruby-lang
<ruby_newbie> hm, do you know any source of exercises for ruby learning
<ruby_newbie> i learn ruby for the dream and i haven't got thing to write right now
<dreinull> duh, now my fan clicks when I scroll. Don't know if I like that better.
<ruby_newbie> im such a dick
<shevy> ruby_newbie the only real way to learn ruby is to write ruby scripts!
<ruby_newbie> usualy book have some exercises for training
<ruby_newbie> but does it have poignant guide?
<dreinull> ruby_newbie: set yourself a goal. usually that involves all kinds of steps to learn ruby.
Carnage\ joined #ruby-lang
<dreinull> ruby_newbie: if you dont have anything write a simple web app. copy something like a paste bin or url shortener
felixrabe joined #ruby-lang
Tick-Tock joined #ruby-lang
felixrabe joined #ruby-lang
hagabaka joined #ruby-lang
ruby_newbie joined #ruby-lang
michael_mbp joined #ruby-lang
Pip joined #ruby-lang
vesan_ joined #ruby-lang
gix joined #ruby-lang
srbartlett joined #ruby-lang
m0wfo joined #ruby-lang
mikeric joined #ruby-lang
perryh joined #ruby-lang
zmack joined #ruby-lang
publicvoid joined #ruby-lang
s0ber joined #ruby-lang
jensn joined #ruby-lang
lsegal joined #ruby-lang
livinded joined #ruby-lang
jbwiv_ joined #ruby-lang
mdel joined #ruby-lang
ecin joined #ruby-lang
DEac- joined #ruby-lang
shaman42 joined #ruby-lang
shevy joined #ruby-lang
EvilJStoker joined #ruby-lang
S2kx joined #ruby-lang
marcostoledo joined #ruby-lang
flexd joined #ruby-lang
dave_miles joined #ruby-lang
SuperTaz joined #ruby-lang
tallship joined #ruby-lang
rhinux joined #ruby-lang
ivorybishop joined #ruby-lang
x0F__ joined #ruby-lang
twittard joined #ruby-lang
singpoly1a joined #ruby-lang
Axsuul joined #ruby-lang
babinho joined #ruby-lang
dnjaramba joined #ruby-lang
cjs226 joined #ruby-lang
ddima joined #ruby-lang
jsaak joined #ruby-lang
Mon_Ouie joined #ruby-lang
brianpWins joined #ruby-lang
musl joined #ruby-lang
Kovax joined #ruby-lang
benjaminoakes joined #ruby-lang
slaytanic joined #ruby-lang
locks joined #ruby-lang
vikoren joined #ruby-lang
chendo_ joined #ruby-lang
kith joined #ruby-lang
blowmage joined #ruby-lang
jaimef joined #ruby-lang
gentz joined #ruby-lang
Xzyx987X_ joined #ruby-lang
turboladen joined #ruby-lang
infid joined #ruby-lang
dustacio joined #ruby-lang
akr_ joined #ruby-lang
yellow5 joined #ruby-lang
zigidias joined #ruby-lang
korch joined #ruby-lang
rue joined #ruby-lang
t0h joined #ruby-lang
rhizmoe joined #ruby-lang
dhoss joined #ruby-lang
pabs_ joined #ruby-lang
bmaland_ joined #ruby-lang
ironcamel joined #ruby-lang
freedrull joined #ruby-lang
basicxman joined #ruby-lang
Bwild joined #ruby-lang
Minalien joined #ruby-lang
deryldoucette joined #ruby-lang
coderrr joined #ruby-lang
muzone joined #ruby-lang
oddmunds joined #ruby-lang
alindeman joined #ruby-lang
uzimonkey joined #ruby-lang
bryno joined #ruby-lang
iwamatsu joined #ruby-lang
RORgasm joined #ruby-lang
Arsen7 joined #ruby-lang
joast joined #ruby-lang
ixx joined #ruby-lang
andman joined #ruby-lang
znz_jp joined #ruby-lang
akahn joined #ruby-lang
abuiles joined #ruby-lang
cldwalker joined #ruby-lang
whoops joined #ruby-lang
tobiasvl joined #ruby-lang
fvollero joined #ruby-lang
jjore_ joined #ruby-lang
troubleman joined #ruby-lang
threedaymonk joined #ruby-lang
jtoy joined #ruby-lang
foca joined #ruby-lang
khaase joined #ruby-lang
jason^ joined #ruby-lang
Frodotus joined #ruby-lang
spap joined #ruby-lang
andrewvos joined #ruby-lang
youngin joined #ruby-lang
mihar joined #ruby-lang
schroedinbug joined #ruby-lang
nick_h joined #ruby-lang
tpope joined #ruby-lang
jorgenpt joined #ruby-lang
yugui_zzz joined #ruby-lang
sordina2 joined #ruby-lang
dvorak joined #ruby-lang
eban joined #ruby-lang
Kivi joined #ruby-lang
ange joined #ruby-lang
rapha joined #ruby-lang
levifig joined #ruby-lang
zerokarmaleft joined #ruby-lang
manveru joined #ruby-lang
rane_ joined #ruby-lang
devn joined #ruby-lang
adgar joined #ruby-lang
jarib joined #ruby-lang
thebastl joined #ruby-lang
shajith joined #ruby-lang
ltd- joined #ruby-lang
VGoff_afk joined #ruby-lang
sinuc joined #ruby-lang
snuxoll joined #ruby-lang
DefV joined #ruby-lang
lake joined #ruby-lang
mtkd joined #ruby-lang
Foxmaster joined #ruby-lang
ahf joined #ruby-lang
_ko1 joined #ruby-lang
companybot joined #ruby-lang
Kuukunen joined #ruby-lang
samuelk|away joined #ruby-lang
stderr- joined #ruby-lang
zenspider joined #ruby-lang
mahlon joined #ruby-lang
znz_v joined #ruby-lang
bleything|away joined #ruby-lang
jmcphers joined #ruby-lang
robgough joined #ruby-lang
ddollar joined #ruby-lang
bca joined #ruby-lang
aef_ joined #ruby-lang
<andrewvos> Can anyone see what might be breaking in 1.8.7 and not 1.9.2? https://gist.github.com/1392491
benanne joined #ruby-lang
saLOUt joined #ruby-lang
Defusal joined #ruby-lang
thone joined #ruby-lang
Natch| joined #ruby-lang
ruskie joined #ruby-lang
ammar01 joined #ruby-lang
Mchl joined #ruby-lang
dbussink joined #ruby-lang
kalleth joined #ruby-lang
epitron joined #ruby-lang
theoros joined #ruby-lang
lele joined #ruby-lang
hackeron joined #ruby-lang
xsdg joined #ruby-lang
joschi joined #ruby-lang
segy joined #ruby-lang
corecode joined #ruby-lang
mrchrisadams_ joined #ruby-lang
mccraig joined #ruby-lang
Cope joined #ruby-lang
snafoo joined #ruby-lang
wasnotrice joined #ruby-lang
ozzloy joined #ruby-lang
neilc joined #ruby-lang
flori joined #ruby-lang
csmrfx joined #ruby-lang
Caius joined #ruby-lang
jalljo joined #ruby-lang
JoL1hAHN joined #ruby-lang
cynosure joined #ruby-lang
TTilus joined #ruby-lang
s0undt3ch joined #ruby-lang
timbleck joined #ruby-lang
jxie joined #ruby-lang
solars joined #ruby-lang
yango joined #ruby-lang
imajes joined #ruby-lang
Asher joined #ruby-lang
dabradley joined #ruby-lang
alip joined #ruby-lang
stepnem joined #ruby-lang
comboy joined #ruby-lang
lucas joined #ruby-lang
any-key joined #ruby-lang
perplex joined #ruby-lang
felipe joined #ruby-lang
bryanl joined #ruby-lang
hachiya_ joined #ruby-lang
mephux joined #ruby-lang
jasiek joined #ruby-lang
KillerFox joined #ruby-lang
looopy joined #ruby-lang
looopy joined #ruby-lang
terraUNDverra joined #ruby-lang
hrnt joined #ruby-lang
stepnem joined #ruby-lang
michael_mbp_ joined #ruby-lang
<andrewvos> Doesn't seem to be the Hash sorting.
<andrewvos> Hmmm. Wait actually maybe it is.
<lianj> whats the error?
<andrewvos> lianj: Well it's hard to tell. I'm getting different values...
<andrewvos> -{"good"=>4, "sirs"=>4, "hello"=>1, "there"=>3}
<andrewvos> +{"good"=>4, "sirs"=>4, "hello"=>5, "there"=>5}
<andrewvos> lianj: That's the difference when I run a test.
<andrewvos> lianj: Sadly, I don't know enough about the algorithm to know what's going on :(
michael_mbp_ joined #ruby-lang
<lianj> haha
<andrewvos> Wonder if it's the hash
michael_mbp joined #ruby-lang
sepp2k joined #ruby-lang
michael_mbp_ joined #ruby-lang
Bwild joined #ruby-lang
<andrewvos> Damn. Wish it was broken up into classes right now :(
<andrewvos> Is there any way to emulate 1.9.2 hash behaviour?
ryanf joined #ruby-lang
michael_mbp_ joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
dejongge joined #ruby-lang
<felixrabe> shevy: found http://web.njit.edu/all_topics/Prog_Lang_Docs/html/ruby/syntax.html#if - but nothing canonical yet - i'm googling for "ruby regex literal condition" now as i get the "warning: regex literal in condition"
WillMarshall joined #ruby-lang
michael_mbp_ joined #ruby-lang
<injekt> andrewvos: they're just sorted, no?
wyhaines joined #ruby-lang
<andrewvos> injekt: I think so
<rue> Well, warnings are warnings
michael_mbp_ joined #ruby-lang
<andrewvos> rue: Huh?
<rue> felixrabe: You might have better luck searching for something like default regexp match global or somesuch
<rue> andrewvos: If you need to support both 1.8 and 1.9, use keys.sort or something
<rue> Or just an assoc Array or something more suitable
<andrewvos> rue: That won't keep them in the same order as 1.9.2?
<rue> It will, they sort the same either way.
<andrewvos> rue: So you're saying that in 1.9.2 the keys get sorted?
<injekt> no they're sorted by entry
<injekt> but
<rue> No, I'm saying that if you need to have the keys in the same order in both, sort them
<injekt> he's saying if you do .sort
<injekt> it'll work in both
<andrewvos> injekt: Ok
hahuang65 joined #ruby-lang
<andrewvos> rue: But the algorithm will likely fail if it is a sorting issue.
michael_mbp joined #ruby-lang
<shevy> with something like Time.now.strftime "%d-%m-%Y" one can get today's date
<felixrabe> rue: my question is not about global matching
<rue> I dunno what the particulars are. Generally I'd say that if the order matters, Hash isn't the right data structure (since by definition it's unordered), but I seem to be in the minority
<shevy> is there a way to work on %m though without splitting the string? I'd like to insert some element from an array into the %m part
<felixrabe> maybe it's an instance of "the implementation is the spec"
<rue> felixrabe: If your question is about puts "hi" if /foo/ then yes, there's a global involved
<felixrabe> ah yes, the $_, but google returns results concerning global matching
<felixrabe> for your search term suggestion
<andrewvos> rue, injekt: Is there any order to the ruby 1.8.7 keys?
<andrewvos> Anything predictable?
srbaker joined #ruby-lang
<rue> andrewvos: No, because it's a Hash before the world went insane
<rue> Therefore, you need to supply ordering
<injekt> ^
<andrewvos> rue: Ok. What would you do in this situation?
<andrewvos> I suppose I could not use a hash.