sender 1.1.4 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -6,12 +6,19 @@ Initial release
6
6
 
7
7
  Minor detail changes
8
8
 
9
- === 1.1.0 2010-06-24
9
+ === 1.1.0 2010-06-23
10
10
 
11
11
  Added :Kernel.backtrace.
12
12
  Added :Kernel.backtrace_includes?.
13
13
  Fixed external requirement of Ruby source directory. Gem should now install transparently and painlessly.
14
14
 
15
- === 1.1.1-4 2010-06-24
15
+ === 1.1.1-4 2010-06-23
16
16
 
17
17
  Minor detail changes
18
+
19
+ === 1.1.2 2010-06-24
20
+
21
+ Fixed __caller__.
22
+ Observed that no backtrace is available for :initialize. For now this can be circumvented by subclassing new (make sure you call super);
23
+ in the long term, I am investing what needs to be done for the special case.
24
+
data/Manifest.txt CHANGED
@@ -39,6 +39,5 @@ ext/sender/vm_insnhelper.h
39
39
  ext/sender/vm_opts.h
40
40
  lib/sender.rb
41
41
  lib/sender/sender.bundle
42
- mkmf.log
43
42
  sender.gemspec
44
43
  test/test_sender.rb
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ Hoe.spec 'sender' do
11
11
  self.spec_extras = { :extensions => ["ext/sender/extconf.rb"] }
12
12
  self.extra_dev_deps << ['rake-compiler', '>= 0']
13
13
 
14
- self.version="1.1.4"
14
+ self.version="1.2"
15
15
 
16
16
  Rake::ExtensionTask.new( 'sender', spec ) do |ext|
17
17
  ext.lib_dir = File.join('lib', 'sender')
@@ -6,30 +6,32 @@
6
6
  * framePriorToCurrent *
7
7
  ************************/
8
8
 
9
- rb_control_frame_t* RPRuby_internal_framePriorTo( rb_control_frame_t* control_frame ) {
9
+ rb_control_frame_t* RPRuby_internal_framePriorTo( rb_control_frame_t* c_control_frame ) {
10
10
 
11
- rb_thread_t* c_thread = GET_THREAD();
12
- rb_control_frame_t* prior_control_frame = NULL;
11
+ rb_thread_t* c_thread = GET_THREAD();
12
+ rb_control_frame_t* c_prior_control_frame = NULL;
13
13
  // get the current frame pointer
14
- if ( control_frame == NULL ) {
15
- control_frame = c_thread->cfp;
14
+ if ( c_control_frame == NULL ) {
15
+ c_control_frame = c_thread->cfp;
16
16
  }
17
17
 
18
- if ( ( prior_control_frame = rb_vm_get_ruby_level_next_cfp( c_thread, control_frame ) ) != 0) {
18
+ if ( ( c_prior_control_frame = rb_vm_get_ruby_level_next_cfp( c_thread, c_control_frame ) ) != 0) {
19
19
 
20
- prior_control_frame = RUBY_VM_PREVIOUS_CONTROL_FRAME( prior_control_frame );
20
+ // not sure why we have to call this a second time after it was called at the end of rb_vm_get_ruby_level_next_cfp,
21
+ // but for some reason it seems to be necessary
22
+ c_prior_control_frame = RUBY_VM_PREVIOUS_CONTROL_FRAME( c_prior_control_frame );
21
23
 
22
24
  }
23
25
  else {
24
- prior_control_frame = NULL;
26
+ c_prior_control_frame = NULL;
25
27
  }
26
28
 
27
29
  // if we have a nil object we've passed main, we're done
28
- if ( prior_control_frame->self == Qnil ) {
30
+ if ( c_prior_control_frame->self == Qnil ) {
29
31
  return NULL;
30
32
  }
31
33
 
32
- return prior_control_frame;
34
+ return c_prior_control_frame;
33
35
 
34
36
  }
35
37
 
@@ -59,6 +59,14 @@ VALUE rb_RPRuby_Sender___sender__() {
59
59
  */
60
60
  VALUE rb_RPRuby_Sender___caller__() {
61
61
 
62
- return ID2SYM( rb_frame_caller() );
62
+ // get the frame prior to current frame
63
+ rb_control_frame_t* c_sending_frame = RPRuby_internal_framePriorTo( NULL );
64
+
65
+ // make sure the current frame wasn't the first frame or return nil
66
+ if ( c_sending_frame == NULL ) {
67
+ return Qnil;
68
+ }
69
+
70
+ return ID2SYM( frame_func_id( c_sending_frame ) );
63
71
  }
64
72
 
Binary file
data/sender.gemspec CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sender}
5
- s.version = "1.1.4"
5
+ s.version = "1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Asher"]
9
- s.date = %q{2010-06-23}
9
+ s.date = %q{2010-06-24}
10
10
  s.description = %q{Adds :__sender__ and :__caller__ to the built-in :__callee__ and :__method__ methods in Ruby 1.9.1, as well
11
11
  as providing object-oriented :backtrace supporting n-levels backward, and :backtrace_includes?,
12
12
  which allows contents of the backtrace to be queried.}
13
13
  s.email = ["asher@ridiculouspower.com"]
14
14
  s.extensions = ["ext/sender/extconf.rb"]
15
15
  s.extra_rdoc_files = ["Manifest.txt", "CHANGELOG.rdoc", "README.rdoc"]
16
- s.files = [".autotest", "CHANGELOG.rdoc", "Makefile", "Manifest.txt", "README.rdoc", "Rakefile", "ext/sender/RPSender_internal.c", "ext/sender/RPSender_internal.h", "ext/sender/RubySourceSupport.c", "ext/sender/RubySourceSupport.h", "ext/sender/debug.h", "ext/sender/dln.h", "ext/sender/encdb.h", "ext/sender/eval_intern.h", "ext/sender/extconf.rb", "ext/sender/gc.h", "ext/sender/id.h", "ext/sender/iseq.h", "ext/sender/main.c", "ext/sender/node.h", "ext/sender/parse.h", "ext/sender/rb_Global.c", "ext/sender/rb_Global.h", "ext/sender/rb_Global_internal.h", "ext/sender/rb_Kernel.c", "ext/sender/rb_Kernel.h", "ext/sender/regenc.h", "ext/sender/regint.h", "ext/sender/regparse.h", "ext/sender/revision.h", "ext/sender/thread_pthread.h", "ext/sender/thread_win32.h", "ext/sender/transcode_data.h", "ext/sender/transdb.h", "ext/sender/version.h", "ext/sender/vm_core.h", "ext/sender/vm_exec.h", "ext/sender/vm_insnhelper.h", "ext/sender/vm_opts.h", "lib/sender.rb", "lib/sender/sender.bundle", "mkmf.log", "sender.gemspec", "test/test_sender.rb"]
16
+ s.files = [".autotest", "CHANGELOG.rdoc", "Makefile", "Manifest.txt", "README.rdoc", "Rakefile", "ext/sender/RPSender_internal.c", "ext/sender/RPSender_internal.h", "ext/sender/RubySourceSupport.c", "ext/sender/RubySourceSupport.h", "ext/sender/debug.h", "ext/sender/dln.h", "ext/sender/encdb.h", "ext/sender/eval_intern.h", "ext/sender/extconf.rb", "ext/sender/gc.h", "ext/sender/id.h", "ext/sender/iseq.h", "ext/sender/main.c", "ext/sender/node.h", "ext/sender/parse.h", "ext/sender/rb_Global.c", "ext/sender/rb_Global.h", "ext/sender/rb_Global_internal.h", "ext/sender/rb_Kernel.c", "ext/sender/rb_Kernel.h", "ext/sender/regenc.h", "ext/sender/regint.h", "ext/sender/regparse.h", "ext/sender/revision.h", "ext/sender/thread_pthread.h", "ext/sender/thread_win32.h", "ext/sender/transcode_data.h", "ext/sender/transdb.h", "ext/sender/version.h", "ext/sender/vm_core.h", "ext/sender/vm_exec.h", "ext/sender/vm_insnhelper.h", "ext/sender/vm_opts.h", "lib/sender.rb", "lib/sender/sender.bundle", "sender.gemspec", "test/test_sender.rb"]
17
17
  s.homepage = %q{http://rubygems.org/gems/sender}
18
18
  s.rdoc_options = ["--main", "README.rdoc"]
19
19
  s.require_paths = ["lib"]
data/test/test_sender.rb CHANGED
@@ -8,7 +8,7 @@ class TestSender < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  def test___caller__
11
- assert_equal :test___caller__, __caller__
11
+ assert_equal :run, __caller__
12
12
  end
13
13
 
14
14
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sender
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
9
- - 4
10
- version: 1.1.4
8
+ - 2
9
+ version: "1.2"
11
10
  platform: ruby
12
11
  authors:
13
12
  - Asher
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-06-23 00:00:00 -04:00
17
+ date: 2010-06-24 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -120,7 +119,6 @@ files:
120
119
  - ext/sender/vm_opts.h
121
120
  - lib/sender.rb
122
121
  - lib/sender/sender.bundle
123
- - mkmf.log
124
122
  - sender.gemspec
125
123
  - test/test_sender.rb
126
124
  has_rdoc: true
data/mkmf.log DELETED
@@ -1,41 +0,0 @@
1
- find_header: checking for eval_intern.h in /usr/src/ruby... -------------------- yes
2
-
3
- "gcc -o conftest -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -L. -L/usr/local/lib -L/usr/src/ruby/lib -L. -L/usr/local/lib -lruby-static -lpthread -ldl -lobjc "
4
- checked program was:
5
- /* begin */
6
- 1: #include "ruby.h"
7
- 2:
8
- 3: int main() {return 0;}
9
- /* end */
10
-
11
- "gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -o conftest.i"
12
- conftest.c:3:25: error: eval_intern.h: No such file or directory
13
- checked program was:
14
- /* begin */
15
- 1: #include "ruby.h"
16
- 2:
17
- 3: #include <eval_intern.h>
18
- /* end */
19
-
20
- "gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -I/usr/src/ruby conftest.c -o conftest.i"
21
- checked program was:
22
- /* begin */
23
- 1: #include "ruby.h"
24
- 2:
25
- 3: #include <eval_intern.h>
26
- /* end */
27
-
28
- --------------------
29
-
30
- find_header: checking for vm_exec.h in /usr/src/ruby... -------------------- yes
31
-
32
- "gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -o conftest.i"
33
- checked program was:
34
- /* begin */
35
- 1: #include "ruby.h"
36
- 2:
37
- 3: #include <vm_exec.h>
38
- /* end */
39
-
40
- --------------------
41
-