bindex 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 857f52564dd66e79ec532373cbd5d3a7bec278c8
4
- data.tar.gz: ecc30849fa0053f3a5c81a5804e3c981472d672a
2
+ SHA256:
3
+ metadata.gz: 2867a8904ab8da23b1efdebf16b5838ff0409fca71b139b320bf793dfd37b2f5
4
+ data.tar.gz: cff287d77781d2c866a9266e6a3315b93256370d0ef0d4cdd10e785ea592855b
5
5
  SHA512:
6
- metadata.gz: 35cd0bb9a2e907f31ba7874b64b6169d6d1d6bee61e8c50cd5feb79a71f3ef2240448ff2993a800f9d9a9a8cd0ef3e1761a27d8d83a36d8afe6b849c4c6da085
7
- data.tar.gz: 3c8bf3456eb32d37503a78fe0a6a01c80ec20f1ae2ff17139496508f0d8fc645f67451973723d0041325b818bd5629db878811c2ceefbbf5b1ca566e76acdb6d
6
+ metadata.gz: 8c9e6fb660a6d8115e7f8d7dc1acc80ec326fec6ad46ac36c6456a39796f4c726ee40e74a97ae71682fc69f24d00a18bfabd75acbb19fca5da73f796c2905360
7
+ data.tar.gz: 576d1d81270f95c00d6a814b5d4f902485484526c6d12f916c23e3e9a35a46adeccc7c6611efca1e8c0a9a4cb007658a264679f0a336728d0d6b0ab1ac653ecd
@@ -1,6 +1,6 @@
1
1
  # Contributing
2
2
 
3
- 1. Fork it ( https://github.com/gsamokovarov/bindex/fork )
3
+ 1. Fork it ( https://github.com/gsamokovarov/skiptrace/fork )
4
4
  2. Create your feature branch (`git checkout -b my-new-feature`)
5
5
  3. Commit your changes (`git commit -am 'Add some feature'`)
6
6
  4. Push to the branch (`git push origin my-new-feature`)
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec name: 'skiptrace'
4
4
 
5
5
  # Rubinius 2.2.2 travis tests complain about this one.
6
6
  platforms :rbx do
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Bindex [![Build Status](https://travis-ci.org/gsamokovarov/bindex.svg?branch=master)](https://travis-ci.org/gsamokovarov/bindex)
1
+ # Skiptrace [![Build Status](https://travis-ci.org/gsamokovarov/bindex.svg?branch=master)](https://travis-ci.org/gsamokovarov/bindex)
2
2
 
3
3
  When Ruby raises an exception, it leaves you a backtrace to help you figure out
4
- where did the exception originated in. Bindex gives you the bindings as well.
4
+ where did the exception originated in. Skiptrace gives you the bindings as well.
5
5
  This can help you introspect the state of the Ruby program when at the point
6
6
  the exception occurred.
7
7
 
@@ -12,13 +12,13 @@ worth it anywhere outside of development.
12
12
 
13
13
  ### API
14
14
 
15
- Bindex defines the following API:
15
+ Skiptrace defines the following API:
16
16
 
17
17
  #### Exception#bindings
18
18
 
19
19
  Returns all the bindings up to the one in which the exception originated in.
20
20
 
21
- #### Bindex.current_bindings
21
+ #### Skiptrace.current_bindings
22
22
 
23
23
  Returns all of the current Ruby execution state bindings. The first one is the
24
24
  current one, the second is the caller one, the third is the caller of the
data/Rakefile CHANGED
@@ -1,5 +1,9 @@
1
- require 'bundler/gem_tasks'
2
1
  require 'rake/testtask'
2
+ require "rake/clean"
3
+
4
+ CLOBBER.include "pkg"
5
+
6
+ Bundler::GemHelper.install_tasks name: ENV.fetch('GEM_NAME', 'skiptrace')
3
7
 
4
8
  Rake::TestTask.new do |t|
5
9
  t.libs << 'test'
@@ -11,18 +15,18 @@ case RUBY_ENGINE
11
15
  when 'ruby'
12
16
  require 'rake/extensiontask'
13
17
 
14
- Rake::ExtensionTask.new('bindex') do |ext|
18
+ Rake::ExtensionTask.new('skiptrace') do |ext|
15
19
  ext.name = 'cruby'
16
- ext.lib_dir = 'lib/bindex'
20
+ ext.lib_dir = 'lib/skiptrace'
17
21
  end
18
22
 
19
23
  task default: [:clean, :compile, :test]
20
24
  when 'jruby'
21
25
  require 'rake/javaextensiontask'
22
26
 
23
- Rake::JavaExtensionTask.new('bindex') do |ext|
27
+ Rake::JavaExtensionTask.new('skiptrace') do |ext|
24
28
  ext.name = 'jruby_internals'
25
- ext.lib_dir = 'lib/bindex'
29
+ ext.lib_dir = 'lib/skiptrace'
26
30
  end
27
31
 
28
32
  task default: [:clean, :compile, :test]
@@ -1,13 +1,13 @@
1
1
  $LOAD_PATH << File.expand_path('../lib', __FILE__)
2
2
 
3
- require 'bindex/version'
3
+ require 'skiptrace/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "bindex"
7
- spec.version = Bindex::VERSION
7
+ spec.version = Skiptrace::VERSION
8
8
  spec.authors = ["Genadi Samokovarov"]
9
9
  spec.email = ["gsamokovarov@gmail.com"]
10
- spec.extensions = ["ext/bindex/extconf.rb"]
10
+ spec.extensions = ["ext/skiptrace/extconf.rb"]
11
11
  spec.summary = "Bindings for your Ruby exceptions"
12
12
  spec.homepage = "https://github.com/gsamokovarov/bindex"
13
13
  spec.license = "MIT"
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
- spec.extensions = ["ext/bindex/extconf.rb"]
21
+ spec.extensions = ["ext/skiptrace/extconf.rb"]
22
22
 
23
23
  spec.add_development_dependency "minitest", "~> 5.4"
24
24
  spec.add_development_dependency "bundler"
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import org.jruby.runtime.DynamicScope;
4
4
  import org.jruby.runtime.Binding;
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import org.jruby.runtime.ThreadContext;
4
4
  import org.jruby.runtime.DynamicScope;
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import org.jruby.Ruby;
4
4
  import org.jruby.RubyArray;
@@ -11,8 +11,8 @@ import org.jruby.anno.JRubyMethod;
11
11
 
12
12
  public class JRubyIntegration {
13
13
  public static void setup(Ruby runtime) {
14
- RubyModule bindex = runtime.defineModule("Bindex");
15
- bindex.defineAnnotatedMethods(BindexMethods.class);
14
+ RubyModule skiptrace = runtime.defineModule("Skiptrace");
15
+ skiptrace.defineAnnotatedMethods(SkiptraceMethods.class);
16
16
 
17
17
  RubyClass exception = runtime.getException();
18
18
  exception.defineAnnotatedMethods(ExceptionExtensionMethods.class);
@@ -26,7 +26,7 @@ public class JRubyIntegration {
26
26
  }
27
27
  }
28
28
 
29
- public static class BindexMethods {
29
+ public static class SkiptraceMethods {
30
30
  @JRubyMethod(name = "current_bindings", meta = true)
31
31
  public static IRubyObject currentBindings(ThreadContext context, IRubyObject self) {
32
32
  return RubyBindingsCollector.collectCurrentFor(context);
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import org.jruby.runtime.ThreadContext;
4
4
  import org.jruby.runtime.Binding;
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import org.jruby.runtime.EventHook;
4
4
  import org.jruby.runtime.RubyEvent;
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  class ThreadContextInterfaceException extends RuntimeException {
4
4
  private static final String MESSAGE_TEMPLATE =
@@ -1,4 +1,4 @@
1
- package com.gsamokovarov.bindex;
1
+ package com.gsamokovarov.skiptrace;
2
2
 
3
3
  import java.lang.reflect.Field;
4
4
  import org.jruby.runtime.ThreadContext;
@@ -1,7 +1,7 @@
1
1
  #include <ruby.h>
2
2
  #include <ruby/debug.h>
3
3
 
4
- VALUE bx_mBindex;
4
+ static VALUE st_mSkiptrace;
5
5
  static ID id_bindings;
6
6
 
7
7
  static VALUE
@@ -22,7 +22,7 @@ current_bindings_callback(const rb_debug_inspector_t *context, void *data)
22
22
  return bindings;
23
23
  }
24
24
 
25
- VALUE
25
+ static VALUE
26
26
  current_bindings(void)
27
27
  {
28
28
  return rb_debug_inspector_open(current_bindings_callback, NULL);
@@ -42,7 +42,7 @@ set_exception_bindings_callback(VALUE tpval, void *data)
42
42
  }
43
43
  }
44
44
 
45
- void
45
+ static void
46
46
  set_exception_bindings_on_raise(void)
47
47
  {
48
48
  VALUE tpval = rb_tracepoint_new(0, RUBY_EVENT_RAISE, set_exception_bindings_callback, 0);
@@ -50,13 +50,13 @@ set_exception_bindings_on_raise(void)
50
50
  }
51
51
 
52
52
  static VALUE
53
- bx_current_bindings(VALUE self)
53
+ st_current_bindings(VALUE self)
54
54
  {
55
55
  return current_bindings();
56
56
  }
57
57
 
58
58
  static VALUE
59
- bx_exc_bindings(VALUE self)
59
+ st_exc_bindings(VALUE self)
60
60
  {
61
61
  VALUE bindings = rb_attr_get(self, id_bindings);
62
62
 
@@ -70,11 +70,11 @@ bx_exc_bindings(VALUE self)
70
70
  void
71
71
  Init_cruby(void)
72
72
  {
73
- bx_mBindex = rb_define_module("Bindex");
73
+ st_mSkiptrace = rb_define_module("Skiptrace");
74
74
  id_bindings = rb_intern("bindings");
75
75
 
76
- rb_define_singleton_method(bx_mBindex, "current_bindings", bx_current_bindings, 0);
77
- rb_define_method(rb_eException, "bindings", bx_exc_bindings, 0);
76
+ rb_define_singleton_method(st_mSkiptrace, "current_bindings", st_current_bindings, 0);
77
+ rb_define_method(rb_eException, "bindings", st_exc_bindings, 0);
78
78
 
79
79
  set_exception_bindings_on_raise();
80
80
  }
@@ -5,7 +5,7 @@ when "ruby"
5
5
  $CFLAGS << " -Wall"
6
6
  $CFLAGS << " -g3 -O0" if ENV["DEBUG"]
7
7
 
8
- create_makefile("bindex/cruby")
8
+ create_makefile("skiptrace/cruby")
9
9
  else
10
10
  IO.write(File.expand_path("../Makefile", __FILE__), <<-END)
11
11
  all install static install-so install-rb: Makefile
@@ -1,10 +1,4 @@
1
- case RUBY_ENGINE
2
- when 'rbx'
3
- require 'bindex/rubinius'
4
- when 'jruby'
5
- require 'bindex/jruby'
6
- when 'ruby'
7
- require 'bindex/cruby'
8
- end
1
+ require_relative "skiptrace"
9
2
 
10
- require "bindex/version"
3
+ # Keep backwards compatibility with the previous name.
4
+ Bindex = Skiptrace
@@ -0,0 +1,11 @@
1
+ case RUBY_ENGINE
2
+ when 'rbx'
3
+ require 'skiptrace/rubinius'
4
+ when 'jruby'
5
+ require 'skiptrace/jruby'
6
+ when 'ruby'
7
+ require 'skiptrace/cruby'
8
+ end
9
+
10
+ require "skiptrace/version"
11
+
@@ -0,0 +1,5 @@
1
+ require 'skiptrace/jruby_internals'
2
+
3
+ java_import com.gsamokovarov.skiptrace.JRubyIntegration
4
+
5
+ JRubyIntegration.setup(JRuby.runtime)
@@ -1,4 +1,4 @@
1
- module Bindex
1
+ module Skiptrace
2
2
  module Rubinius
3
3
  # Filters internal Rubinius locations.
4
4
  #
@@ -32,11 +32,11 @@ end
32
32
 
33
33
  # Gets the current bindings for all available Ruby frames.
34
34
  #
35
- # Filters the internal Rubinius and Bindex frames.
36
- def Bindex.current_bindings
35
+ # Filters the internal Rubinius and Skiptrace frames.
36
+ def Skiptrace.current_bindings
37
37
  locations = ::Rubinius::VM.backtrace(1, true)
38
38
 
39
- Bindex::Rubinius::InternalLocationFilter.new(locations).filter.map do |location|
39
+ Skiptrace::Rubinius::InternalLocationFilter.new(locations).filter.map do |location|
40
40
  Binding.setup(
41
41
  location.variables,
42
42
  location.variables.method,
@@ -58,7 +58,7 @@ end
58
58
 
59
59
  define_method(:raise_exception) do |exc|
60
60
  if exc.bindings.empty?
61
- exc.instance_variable_set(:@bindings, Bindex.current_bindings)
61
+ exc.instance_variable_set(:@bindings, Skiptrace.current_bindings)
62
62
  end
63
63
 
64
64
  raise_exception.bind(self).call(exc)
@@ -0,0 +1,3 @@
1
+ module Skiptrace
2
+ VERSION = "0.6.0"
3
+ end
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH << File.expand_path('../lib', __FILE__)
2
+
3
+ require 'skiptrace/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "skiptrace"
7
+ spec.version = Skiptrace::VERSION
8
+ spec.authors = ["Genadi Samokovarov"]
9
+ spec.email = ["gsamokovarov@gmail.com"]
10
+ spec.extensions = ["ext/skiptrace/extconf.rb"]
11
+ spec.summary = "Bindings for your Ruby exceptions"
12
+ spec.homepage = "https://github.com/gsamokovarov/skiptrace"
13
+ spec.license = "MIT"
14
+
15
+ spec.required_ruby_version = ">= 2.0.0"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+ spec.extensions = ["ext/skiptrace/extconf.rb"]
22
+
23
+ spec.add_development_dependency "minitest", "~> 5.4"
24
+ spec.add_development_dependency "bundler"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rake-compiler"
27
+ end
@@ -2,6 +2,6 @@ require 'test_helper'
2
2
 
3
3
  class CurrentBindingsTest < BaseTest
4
4
  test 'first binding returned is the current one' do
5
- assert_equal __LINE__, Bindex.current_bindings.first.eval('__LINE__')
5
+ assert_equal __LINE__, Skiptrace.current_bindings.first.eval('__LINE__')
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH << File.expand_path('../lib', __FILE__)
2
2
 
3
3
  require 'minitest/autorun'
4
- require 'bindex'
4
+ require 'skiptrace'
5
5
 
6
6
  current_directory = File.dirname(File.expand_path(__FILE__))
7
7
 
metadata CHANGED
@@ -1,77 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bindex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genadi Samokovarov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2019-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: minitest
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
19
  version: '5.4'
19
- name: minitest
20
- prerelease: false
21
20
  type: :development
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.4'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: bundler
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: bundler
34
- prerelease: false
35
34
  type: :development
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
+ name: rake
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
- name: rake
48
- prerelease: false
49
48
  type: :development
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
+ name: rake-compiler
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
59
  - - ">="
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
- name: rake-compiler
62
- prerelease: false
63
62
  type: :development
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - gsamokovarov@gmail.com
72
72
  executables: []
73
73
  extensions:
74
- - ext/bindex/extconf.rb
74
+ - ext/skiptrace/extconf.rb
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
@@ -82,20 +82,22 @@ files:
82
82
  - README.md
83
83
  - Rakefile
84
84
  - bindex.gemspec
85
- - ext/bindex/com/gsamokovarov/bindex/BindingBuilder.java
86
- - ext/bindex/com/gsamokovarov/bindex/CurrentBindingsIterator.java
87
- - ext/bindex/com/gsamokovarov/bindex/JRubyIntegration.java
88
- - ext/bindex/com/gsamokovarov/bindex/RubyBindingsCollector.java
89
- - ext/bindex/com/gsamokovarov/bindex/SetExceptionBindingsEventHook.java
90
- - ext/bindex/com/gsamokovarov/bindex/ThreadContextInterfaceException.java
91
- - ext/bindex/com/gsamokovarov/bindex/ThreadContextInternals.java
92
- - ext/bindex/cruby.c
93
- - ext/bindex/extconf.rb
85
+ - ext/skiptrace/com/gsamokovarov/skiptrace/BindingBuilder.java
86
+ - ext/skiptrace/com/gsamokovarov/skiptrace/CurrentBindingsIterator.java
87
+ - ext/skiptrace/com/gsamokovarov/skiptrace/JRubyIntegration.java
88
+ - ext/skiptrace/com/gsamokovarov/skiptrace/RubyBindingsCollector.java
89
+ - ext/skiptrace/com/gsamokovarov/skiptrace/SetExceptionBindingsEventHook.java
90
+ - ext/skiptrace/com/gsamokovarov/skiptrace/ThreadContextInterfaceException.java
91
+ - ext/skiptrace/com/gsamokovarov/skiptrace/ThreadContextInternals.java
92
+ - ext/skiptrace/cruby.c
93
+ - ext/skiptrace/extconf.rb
94
94
  - lib/bindex.rb
95
- - lib/bindex/jruby.rb
96
- - lib/bindex/jruby_internals.jar
97
- - lib/bindex/rubinius.rb
98
- - lib/bindex/version.rb
95
+ - lib/skiptrace.rb
96
+ - lib/skiptrace/jruby.rb
97
+ - lib/skiptrace/jruby_internals.jar
98
+ - lib/skiptrace/rubinius.rb
99
+ - lib/skiptrace/version.rb
100
+ - skiptrace.gemspec
99
101
  - test/current_bindings_test.rb
100
102
  - test/exception_test.rb
101
103
  - test/fixtures/basic_nested_fixture.rb
@@ -108,7 +110,7 @@ homepage: https://github.com/gsamokovarov/bindex
108
110
  licenses:
109
111
  - MIT
110
112
  metadata: {}
111
- post_install_message:
113
+ post_install_message:
112
114
  rdoc_options: []
113
115
  require_paths:
114
116
  - lib
@@ -123,9 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
125
  - !ruby/object:Gem::Version
124
126
  version: '0'
125
127
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.6.8
128
- signing_key:
128
+ rubygems_version: 3.0.3
129
+ signing_key:
129
130
  specification_version: 4
130
131
  summary: Bindings for your Ruby exceptions
131
132
  test_files:
@@ -1,5 +0,0 @@
1
- require 'bindex/jruby_internals'
2
-
3
- java_import com.gsamokovarov.bindex.JRubyIntegration
4
-
5
- JRubyIntegration.setup(JRuby.runtime)
@@ -1,3 +0,0 @@
1
- module Bindex
2
- VERSION = "0.5.0"
3
- end