From a419da334a232593f18821ed176011fb59bd3890 Mon Sep 17 00:00:00 2001 From: John Mair Date: Thu, 2 Feb 2012 02:58:57 +1300 Subject: [PATCH] version 0.6.2, temporary fix for segfault on 1.9.3 * see here: https://github.com/nixme/pry-nav/issues/4 --- Rakefile | 5 +++-- ext/binding_of_caller/binding_of_caller.c | 4 ++++ ext/binding_of_caller/extconf.rb | 5 ++--- lib/binding_of_caller/version.rb | 2 +- test/test.rb | 3 --- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index b41515e..9832a35 100755 --- a/Rakefile +++ b/Rakefile @@ -15,16 +15,17 @@ CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o", def apply_spec_defaults(s) s.name = PROJECT_NAME - s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack. Currently only works for MRI 1.9.2." + s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack. Currently only works for MRI 1.9.2+" s.version = BindingOfCaller::VERSION s.date = Time.now.strftime '%Y-%m-%d' s.author = "John Mair (banisterfiend)" s.email = 'jrmair@gmail.com' s.description = s.summary s.require_path = 'lib' - s.add_development_dependency("bacon","~>1.1.0") + s.add_development_dependency("bacon","~>1.1") s.homepage = "http://github.com/banister/binding_of_caller" s.has_rdoc = 'yard' + s.required_ruby_version = '>= 1.9.2' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- test/*`.split("\n") end diff --git a/ext/binding_of_caller/binding_of_caller.c b/ext/binding_of_caller/binding_of_caller.c index 784f0db..8b7d2e9 100644 --- a/ext/binding_of_caller/binding_of_caller.c +++ b/ext/binding_of_caller/binding_of_caller.c @@ -53,7 +53,11 @@ binding_mark(void *ptr) if (ptr) { bind = ptr; RUBY_MARK_UNLESS_NULL(bind->env); + +#ifdef RUBY_192 RUBY_MARK_UNLESS_NULL(bind->filename); +#endif + } RUBY_MARK_LEAVE("binding"); } diff --git a/ext/binding_of_caller/extconf.rb b/ext/binding_of_caller/extconf.rb index a2de1fb..34b887c 100755 --- a/ext/binding_of_caller/extconf.rb +++ b/ext/binding_of_caller/extconf.rb @@ -5,10 +5,9 @@ case RUBY_VERSION when /1.9.2/ - $CFLAGS += " -I./ruby_headers/192/" + $CFLAGS += " -I./ruby_headers/192/ -DRUBY_192" when /1.9.3/ - puts "hit 193" - $CFLAGS += " -I./ruby_headers/193/" + $CFLAGS += " -I./ruby_headers/193/ -DRUBY_193" end create_makefile('binding_of_caller') diff --git a/lib/binding_of_caller/version.rb b/lib/binding_of_caller/version.rb index 06d5b56..383f199 100755 --- a/lib/binding_of_caller/version.rb +++ b/lib/binding_of_caller/version.rb @@ -1,3 +1,3 @@ module BindingOfCaller - VERSION = "0.6.1" + VERSION = "0.6.2" end diff --git a/test/test.rb b/test/test.rb index 3db44f0..2f18bc1 100755 --- a/test/test.rb +++ b/test/test.rb @@ -86,9 +86,6 @@ def o.b caller_bindings[2].frame_type.should == :method end - it 'should raise when invoked on an ordinary binding (i.e one not generated through Binding#of_caller)' do - lambda { binding.frame_type }.should.raise RuntimeError - end end end