binding_of_caller 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - rbx-18mode
5
+ - rbx-19mode
6
+
7
+ notifications:
8
+ irc: "irc.freenode.org#pry"
9
+ recipients:
10
+ - jrmair@gmail.com
11
+
12
+ branches:
13
+ only:
14
+ - master
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/README.md CHANGED
@@ -3,7 +3,7 @@ binding_of_caller
3
3
 
4
4
  (C) John Mair (banisterfiend) 2011
5
5
 
6
- _Retrieve the binding of a method's caller in MRI 1.9.2_
6
+ _Retrieve the binding of a method's caller in MRI 1.9.2+_
7
7
 
8
8
  The `binding_of_caller` gem provides the `Binding#of_caller` method.
9
9
 
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- dlext = Config::CONFIG['DLEXT']
1
+ dlext = RbConfig::CONFIG['DLEXT']
2
2
  direc = File.dirname(__FILE__)
3
3
 
4
4
  $:.unshift 'lib'
@@ -17,7 +17,7 @@ CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
17
17
 
18
18
  def apply_spec_defaults(s)
19
19
  s.name = PROJECT_NAME
20
- 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+"
20
+ s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
21
21
  s.version = BindingOfCaller::VERSION
22
22
  s.date = Time.now.strftime '%Y-%m-%d'
23
23
  s.author = "John Mair (banisterfiend)"
@@ -25,15 +25,24 @@ def apply_spec_defaults(s)
25
25
  s.description = s.summary
26
26
  s.require_path = 'lib'
27
27
  s.add_development_dependency("bacon","~>1.1")
28
+ s.add_development_dependency('rake', '~> 0.9')
28
29
  s.homepage = "http://github.com/banister/binding_of_caller"
29
30
  s.has_rdoc = 'yard'
30
31
  s.files = `git ls-files`.split("\n")
31
32
  s.test_files = `git ls-files -- test/*`.split("\n")
32
33
  end
33
34
 
35
+ desc "Show version"
36
+ task :version do
37
+ puts "BindingOfCaller version: #{BindingOfCaller::VERSION}"
38
+ end
39
+
40
+ desc "run tests"
41
+ task :default => :test
42
+
34
43
  desc "Run tests"
35
44
  task :test do
36
- sh "bacon -Itest -rubygems test.rb -q"
45
+ sh "bacon -Itest -rubygems -a -q"
37
46
  end
38
47
 
39
48
  task :pry do
@@ -64,17 +73,17 @@ namespace :ruby do
64
73
  end
65
74
  end
66
75
 
67
- namespace :rbx do
68
- spec = Gem::Specification.new do |s|
69
- apply_spec_defaults(s)
70
- s.platform = Gem::Platform.new(["universal", "rubinius"])
71
- end
76
+ # namespace :rbx do
77
+ # spec = Gem::Specification.new do |s|
78
+ # apply_spec_defaults(s)
79
+ # s.platform = Gem::Platform::RUBY #.new(["universal", "rubinius"])
80
+ # end
72
81
 
73
- Gem::PackageTask.new(spec) do |pkg|
74
- pkg.need_zip = false
75
- pkg.need_tar = false
76
- end
77
- end
82
+ # Gem::PackageTask.new(spec) do |pkg|
83
+ # pkg.need_zip = false
84
+ # pkg.need_tar = false
85
+ # end
86
+ # end
78
87
 
79
88
  desc "build the binaries"
80
89
  task :compile do
@@ -93,12 +102,10 @@ task :reinstall => :gems do
93
102
  end
94
103
 
95
104
  desc "build all platform gems at once"
96
- task :gems => [:clean, :rmgems, "ruby:gem", "rbx:gem"]
105
+ task :gems => [:clean, :rmgems, "ruby:gem"]
97
106
 
98
107
  task :gem => [:gems]
99
108
 
100
- task :rbxgem => "rbx:gem"
101
-
102
109
  desc "remove all platform gems"
103
110
  task :rmgems => ["ruby:clobber_package"]
104
111
 
@@ -0,0 +1,34 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "binding_of_caller"
5
+ s.version = "0.6.4"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["John Mair (banisterfiend)"]
9
+ s.date = "2012-02-29"
10
+ s.description = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
11
+ s.email = "jrmair@gmail.com"
12
+ s.extensions = ["ext/binding_of_caller/extconf.rb"]
13
+ s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "Gemfile", "HISTORY", "LICENSE", "README.md", "Rakefile", "binding_of_caller.gemspec", "examples/example.rb", "ext/binding_of_caller/binding_of_caller.c", "ext/binding_of_caller/extconf.rb", "ext/binding_of_caller/ruby_headers/192/debug.h", "ext/binding_of_caller/ruby_headers/192/dln.h", "ext/binding_of_caller/ruby_headers/192/eval_intern.h", "ext/binding_of_caller/ruby_headers/192/gc.h", "ext/binding_of_caller/ruby_headers/192/id.h", "ext/binding_of_caller/ruby_headers/192/iseq.h", "ext/binding_of_caller/ruby_headers/192/method.h", "ext/binding_of_caller/ruby_headers/192/node.h", "ext/binding_of_caller/ruby_headers/192/regenc.h", "ext/binding_of_caller/ruby_headers/192/regint.h", "ext/binding_of_caller/ruby_headers/192/regparse.h", "ext/binding_of_caller/ruby_headers/192/thread_pthread.h", "ext/binding_of_caller/ruby_headers/192/thread_win32.h", "ext/binding_of_caller/ruby_headers/192/timev.h", "ext/binding_of_caller/ruby_headers/192/transcode_data.h", "ext/binding_of_caller/ruby_headers/192/version.h", "ext/binding_of_caller/ruby_headers/192/vm_core.h", "ext/binding_of_caller/ruby_headers/192/vm_exec.h", "ext/binding_of_caller/ruby_headers/192/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/192/vm_opts.h", "ext/binding_of_caller/ruby_headers/193/addr2line.h", "ext/binding_of_caller/ruby_headers/193/atomic.h", "ext/binding_of_caller/ruby_headers/193/constant.h", "ext/binding_of_caller/ruby_headers/193/debug.h", "ext/binding_of_caller/ruby_headers/193/dln.h", "ext/binding_of_caller/ruby_headers/193/encdb.h", "ext/binding_of_caller/ruby_headers/193/eval_intern.h", "ext/binding_of_caller/ruby_headers/193/gc.h", "ext/binding_of_caller/ruby_headers/193/id.h", "ext/binding_of_caller/ruby_headers/193/internal.h", "ext/binding_of_caller/ruby_headers/193/iseq.h", "ext/binding_of_caller/ruby_headers/193/method.h", "ext/binding_of_caller/ruby_headers/193/node.h", "ext/binding_of_caller/ruby_headers/193/parse.h", "ext/binding_of_caller/ruby_headers/193/regenc.h", "ext/binding_of_caller/ruby_headers/193/regint.h", "ext/binding_of_caller/ruby_headers/193/regparse.h", "ext/binding_of_caller/ruby_headers/193/revision.h", "ext/binding_of_caller/ruby_headers/193/thread_pthread.h", "ext/binding_of_caller/ruby_headers/193/thread_win32.h", "ext/binding_of_caller/ruby_headers/193/timev.h", "ext/binding_of_caller/ruby_headers/193/transcode_data.h", "ext/binding_of_caller/ruby_headers/193/transdb.h", "ext/binding_of_caller/ruby_headers/193/version.h", "ext/binding_of_caller/ruby_headers/193/vm_core.h", "ext/binding_of_caller/ruby_headers/193/vm_exec.h", "ext/binding_of_caller/ruby_headers/193/vm_insnhelper.h", "ext/binding_of_caller/ruby_headers/193/vm_opts.h", "lib/binding_of_caller.bundle", "lib/binding_of_caller.rb", "lib/binding_of_caller/version.rb", "lib/tester.rb", "test/test_binding_of_caller.rb"]
14
+ s.homepage = "http://github.com/banister/binding_of_caller"
15
+ s.require_paths = ["lib"]
16
+ s.rubygems_version = "1.8.12"
17
+ s.summary = "Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack."
18
+ s.test_files = ["test/test_binding_of_caller.rb"]
19
+
20
+ if s.respond_to? :specification_version then
21
+ s.specification_version = 3
22
+
23
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
24
+ s.add_development_dependency(%q<bacon>, ["~> 1.1"])
25
+ s.add_development_dependency(%q<rake>, ["~> 0.9"])
26
+ else
27
+ s.add_dependency(%q<bacon>, ["~> 1.1"])
28
+ s.add_dependency(%q<rake>, ["~> 0.9"])
29
+ end
30
+ else
31
+ s.add_dependency(%q<bacon>, ["~> 1.1"])
32
+ s.add_dependency(%q<rake>, ["~> 0.9"])
33
+ end
34
+ end
@@ -1,13 +1,24 @@
1
- require 'mkmf'
1
+ def fake_makefile
2
+ File.open(File.join(File.dirname(__FILE__), "Makefile"), "w") {|f|
3
+ f.puts %[install:\n\techo "Nada."]
4
+ }
5
+ end
6
+
7
+ if RUBY_ENGINE && RUBY_ENGINE =~ /rbx/
8
+ fake_makefile
9
+ else
10
+ require 'mkmf'
11
+
12
+ $CFLAGS += " -O0"
13
+ $CFLAGS += " -std=c99"
2
14
 
3
- $CFLAGS += " -O0"
4
- $CFLAGS += " -std=c99"
15
+ case RUBY_VERSION
16
+ when /1.9.2/
17
+ $CFLAGS += " -I./ruby_headers/192/ -DRUBY_192"
18
+ when /1.9.3/
19
+ $CFLAGS += " -I./ruby_headers/193/ -DRUBY_193"
20
+ end
5
21
 
6
- case RUBY_VERSION
7
- when /1.9.2/
8
- $CFLAGS += " -I./ruby_headers/192/ -DRUBY_192"
9
- when /1.9.3/
10
- $CFLAGS += " -I./ruby_headers/193/ -DRUBY_193"
22
+ create_makefile('binding_of_caller')
11
23
  end
12
24
 
13
- create_makefile('binding_of_caller')
Binary file
@@ -1,7 +1,8 @@
1
1
  dlext = Config::CONFIG['DLEXT']
2
+ direc = File.dirname(__FILE__)
2
3
 
3
4
  if RUBY_ENGINE && RUBY_ENGINE == "ruby"
4
- require "binding_of_caller.#{dlext}"
5
+ require File.join direc, "binding_of_caller.#{dlext}"
5
6
 
6
7
  elsif defined?(Rubinius)
7
8
  module BindingOfCaller
@@ -46,7 +47,6 @@ elsif defined?(Rubinius)
46
47
  end
47
48
 
48
49
  def frame_count
49
- ary = []
50
50
  n = 1
51
51
  loop {
52
52
  begin
@@ -68,7 +68,11 @@ elsif defined?(Rubinius)
68
68
  when /eval/
69
69
  :eval
70
70
  else
71
- :method
71
+ if frame_description =~ /__(?:class|module)_init__/
72
+ :class
73
+ else
74
+ :method
75
+ end
72
76
  end
73
77
  end
74
78
 
@@ -1,3 +1,3 @@
1
- module BindingOfCaller
2
- VERSION = "0.6.3"
3
- end
1
+ module BindingOfCaller
2
+ VERSION = "0.6.4"
3
+ end
File without changes
metadata CHANGED
@@ -1,42 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: binding_of_caller
3
- version: !ruby/object:Gem::Version
4
- version: 0.6.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 550684568609937877
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 4
10
+ version: 0.6.4
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - John Mair (banisterfiend)
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-02-29 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-03-01 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: bacon
16
- requirement: &70210333909540 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '1.1'
27
+ - !ruby/object:Gem::Version
28
+ hash: 3882215148898798703
29
+ segments:
30
+ - 1
31
+ - 1
32
+ version: "1.1"
22
33
  type: :development
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake
23
37
  prerelease: false
24
- version_requirements: *70210333909540
25
- description: Retrieve the binding of a method's caller. Can also retrieve bindings
26
- even further up the stack. Currently only works for MRI 1.9.2+
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 2854635824043747355
44
+ segments:
45
+ - 0
46
+ - 9
47
+ version: "0.9"
48
+ type: :development
49
+ version_requirements: *id002
50
+ description: Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack.
27
51
  email: jrmair@gmail.com
28
52
  executables: []
29
- extensions:
53
+
54
+ extensions:
30
55
  - ext/binding_of_caller/extconf.rb
31
56
  extra_rdoc_files: []
32
- files:
57
+
58
+ files:
33
59
  - .gemtest
34
60
  - .gitignore
61
+ - .travis.yml
35
62
  - .yardopts
63
+ - Gemfile
36
64
  - HISTORY
37
65
  - LICENSE
38
66
  - README.md
39
67
  - Rakefile
68
+ - binding_of_caller.gemspec
40
69
  - examples/example.rb
41
70
  - ext/binding_of_caller/binding_of_caller.c
42
71
  - ext/binding_of_caller/extconf.rb
@@ -92,31 +121,39 @@ files:
92
121
  - lib/binding_of_caller.rb
93
122
  - lib/binding_of_caller/version.rb
94
123
  - lib/tester.rb
95
- - test/test.rb
124
+ - test/test_binding_of_caller.rb
96
125
  homepage: http://github.com/banister/binding_of_caller
97
126
  licenses: []
127
+
98
128
  post_install_message:
99
129
  rdoc_options: []
100
- require_paths:
130
+
131
+ require_paths:
101
132
  - lib
102
- required_ruby_version: !ruby/object:Gem::Requirement
133
+ required_ruby_version: !ruby/object:Gem::Requirement
103
134
  none: false
104
- requirements:
105
- - - ! '>='
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ hash: 2002549777813010636
139
+ segments:
140
+ - 0
141
+ version: "0"
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
143
  none: false
110
- requirements:
111
- - - ! '>='
112
- - !ruby/object:Gem::Version
113
- version: '0'
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ hash: 2002549777813010636
148
+ segments:
149
+ - 0
150
+ version: "0"
114
151
  requirements: []
152
+
115
153
  rubyforge_project:
116
- rubygems_version: 1.8.16
154
+ rubygems_version: 1.8.12
117
155
  signing_key:
118
156
  specification_version: 3
119
- summary: Retrieve the binding of a method's caller. Can also retrieve bindings even
120
- further up the stack. Currently only works for MRI 1.9.2+
121
- test_files:
122
- - test/test.rb
157
+ summary: Retrieve the binding of a method's caller. Can also retrieve bindings even further up the stack.
158
+ test_files:
159
+ - test/test_binding_of_caller.rb