debug_inspector 1.1.0 → 1.2.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
2
  SHA256:
3
- metadata.gz: a9c0e6d3b5bd68235adc5212ad47f99333f9522b6c4b823cb783eb94a2d59d90
4
- data.tar.gz: e90e6a29a0fdaf86d2259a825ec4bd0b1687e572b90cc24d6d6f889dcb225747
3
+ metadata.gz: 1361eb77ee247a591556611867b536d99b6cda075c96d35cf1759fb7bc150b8d
4
+ data.tar.gz: 466a358f77fed62bedb72ae999cf77f19db2c375c6a57cef16e399f919151c7b
5
5
  SHA512:
6
- metadata.gz: df09cff61314f0af4f9fe0584e7417b0faa756652f1b6157895aae17cd852125a5b8c0535adfdfcdae8fd78e6e5ad845ac6101841373eba4eb75c29894a0674d
7
- data.tar.gz: 1f329aeae5a8036e9959bdb43095ffcc92110a83f803f9835554a9b5a6b05253cf704006607d321d2abbe02847cce38f4f1f64c975197c03afa746b99c6e717f
6
+ metadata.gz: d1dde9bce363e812b18ff8fb8d7bd852dfc3f7acf1e0670c98001eb5a4643c33af5fb9a0cf40cc2af05760d38b01b529a5c3b40d70e5ae06a75c190da732bd8f
7
+ data.tar.gz: b3d379e4e88c2d0a7d336a95a18563ee42fbd59d87797b02f5c2ff9bed1d253223100b9f819cd41182066fcd4d40d36e798f9101c0c02f76dab7577b648365f5
@@ -29,10 +29,17 @@ jobs:
29
29
  - "2.6"
30
30
  - "2.7"
31
31
  - "3.0"
32
+ - "3.1"
33
+ - "3.2"
34
+ - "truffleruby"
35
+ exclude:
36
+ # 2.2 segfaults on recent Ubuntu: https://github.com/ruby/setup-ruby/issues/496
37
+ - { ruby: "2.2", os: "ubuntu-latest" }
38
+ # TruffleRuby does not support Windows.
39
+ - { ruby: "truffleruby", os: "windows-latest" }
32
40
 
33
41
  steps:
34
-
35
- - uses: actions/checkout@v2
42
+ - uses: actions/checkout@v4
36
43
 
37
44
  - name: Set up Ruby
38
45
  uses: ruby/setup-ruby@v1
@@ -61,13 +68,14 @@ jobs:
61
68
  - "jruby"
62
69
  - "truffleruby"
63
70
  exclude:
64
- # Windows releases of jruby and truffleruby have issues. Skip them for now.
71
+ # Windows releases of jruby have issues. Skip them for now.
65
72
  - { ruby: "jruby", os: "windows-latest" }
73
+ # TruffleRuby does not support Windows.
66
74
  - { ruby: "truffleruby", os: "windows-latest" }
67
75
 
68
76
  steps:
69
77
 
70
- - uses: actions/checkout@v2
78
+ - uses: actions/checkout@v4
71
79
 
72
80
  - name: Set up Ruby
73
81
  uses: ruby/setup-ruby@v1
@@ -107,6 +115,6 @@ jobs:
107
115
  working-directory: ./tmp/gem-test
108
116
 
109
117
  - name: Test gem functionality
110
- if: ${{ matrix.ruby != 'jruby' && matrix.ruby != 'truffleruby' }}
111
- run: bundle exec ruby -e "require 'debug_inspector'; RubyVM::DebugInspector.open { |dc| dc.frame_binding(1) }"
118
+ if: ${{ matrix.ruby != 'jruby' }}
119
+ run: bundle exec ruby -e "require 'debug_inspector'; DebugInspector.open { |dc| dc.frame_binding(1) }"
112
120
  working-directory: ./tmp/gem-test
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2012-2013 John Mair
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- [![Build Status](https://github.com/banister/debug_inspector/workflows/Test/badge.svg?branch=master&event=push)](https://github.com/banister/debug_inspector/actions?query=branch%3Amaster)
1
+ [![Build Status](https://github.com/banister/debug_inspector/actions/workflows/test.yml/badge.svg)](https://github.com/banister/debug_inspector/actions/workflows/test.yml)
2
2
  [![Gem Version](https://img.shields.io/gem/v/debug_inspector.svg)](https://rubygems.org/gems/debug_inspector)
3
3
 
4
4
  debug_inspector
5
5
  ===============
6
6
 
7
- _A Ruby wrapper for the MRI 2.0+ debug\_inspector API_
7
+ _A Ruby wrapper for the Ruby 2.0+ debug_inspector C API_
8
8
 
9
9
  The `debug_inspector` C extension and API were designed and built by [Koichi Sasada](https://github.com/ko1), this project
10
10
  is just a gemification of his work.
@@ -12,8 +12,8 @@ is just a gemification of his work.
12
12
  **NOTES:**
13
13
 
14
14
  * **Do not use this library outside of debugging situations**.
15
- * This library makes use of the debug inspector API which was new in MRI 2.0.0.
16
- * Only works on MRI 2 and 3. Requiring it on unsupported Rubies will result in a no-op
15
+ * This library makes use of the debug inspector API which was new in CRuby 2.0.0.
16
+ * Only works on CRuby 2+ and TruffleRuby. Requiring it on unsupported Rubies will result in a no-op.
17
17
 
18
18
  Usage
19
19
  -----
@@ -23,7 +23,7 @@ require 'debug_inspector'
23
23
 
24
24
  # Open debug context
25
25
  # Passed `dc' is only active in a block
26
- RubyVM::DebugInspector.open { |dc|
26
+ DebugInspector.open { |dc|
27
27
  # backtrace locations (returns an array of Thread::Backtrace::Location objects)
28
28
  locs = dc.backtrace_locations
29
29
 
@@ -46,7 +46,8 @@ Development
46
46
 
47
47
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
48
48
 
49
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
49
+ To install this gem onto your local machine, run `bundle exec rake install`.
50
+ To release a new version, update the version number in `version.rb` and in `debug_inspector.gemspec`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
50
51
 
51
52
  Contact
52
53
  -------
@@ -56,25 +57,4 @@ Problems or questions contact me at [github](http://github.com/banister)
56
57
  License
57
58
  -------
58
59
 
59
- (The MIT License)
60
-
61
- Copyright (c) 2012-2013 (John Mair)
62
-
63
- Permission is hereby granted, free of charge, to any person obtaining
64
- a copy of this software and associated documentation files (the
65
- 'Software'), to deal in the Software without restriction, including
66
- without limitation the rights to use, copy, modify, merge, publish,
67
- distribute, sublicense, and/or sell copies of the Software, and to
68
- permit persons to whom the Software is furnished to do so, subject to
69
- the following conditions:
70
-
71
- The above copyright notice and this permission notice shall be
72
- included in all copies or substantial portions of the Software.
73
-
74
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
75
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
76
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
77
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
78
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
79
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
80
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60
+ The `debug_inspector` is released under the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
4
  def can_compile_extensions?
5
- RUBY_ENGINE == "ruby"
6
- end
5
+ RUBY_ENGINE == "ruby" or RUBY_ENGINE == "truffleruby"
6
+ end
7
7
 
8
8
  Rake::TestTask.new(:test) do |t|
9
9
  t.libs << "test"
@@ -2,13 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "debug_inspector"
5
- spec.version = "1.1.0"
5
+ spec.version = "1.2.0"
6
6
  spec.authors = ["John Mair (banisterfiend)"]
7
7
  spec.email = ["jrmair@gmail.com"]
8
8
 
9
9
  spec.summary = %q{A Ruby wrapper for the MRI 2.0 debug_inspector API}
10
10
  spec.description = <<-TXT
11
- Adds methods to RubyVM::DebugInspector to allow for inspection of backtrace frames.
11
+ Adds methods to DebugInspector to allow for inspection of backtrace frames.
12
12
 
13
13
  The debug_inspector C extension and API were designed and built by Koichi Sasada, this project is just a gemification of his work.
14
14
 
@@ -31,7 +31,5 @@ TXT
31
31
 
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- if RUBY_ENGINE == "ruby"
35
- spec.extensions = ["ext/debug_inspector/extconf.rb"]
36
- end
34
+ spec.extensions = ["ext/debug_inspector/extconf.rb"]
37
35
  end
@@ -104,8 +104,7 @@ di_open_s(VALUE klass)
104
104
  void
105
105
  Init_debug_inspector(void)
106
106
  {
107
- VALUE rb_cRubyVM = rb_const_get(rb_cObject, rb_intern("RubyVM"));
108
- VALUE cDebugInspector = rb_define_class_under(rb_cRubyVM, "DebugInspector", rb_cObject);
107
+ VALUE cDebugInspector = rb_define_class("DebugInspector", rb_cObject);
109
108
 
110
109
  rb_undef_alloc_func(cDebugInspector);
111
110
  rb_define_singleton_method(cDebugInspector, "open", di_open_s, 0);
@@ -6,12 +6,11 @@ def fake_makefile
6
6
  }
7
7
  end
8
8
 
9
- def mri_2_or_3?
10
- defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
11
- RUBY_VERSION =~ /^[23]/
9
+ def can_compile_extensions?
10
+ RUBY_ENGINE == "ruby" or RUBY_ENGINE == "truffleruby"
12
11
  end
13
12
 
14
- if mri_2_or_3?
13
+ if can_compile_extensions?
15
14
  require 'mkmf'
16
15
  create_makefile('debug_inspector')
17
16
  else
@@ -1,4 +1,4 @@
1
- class RubyVM::DebugInspector
1
+ class DebugInspector
2
2
  # Don't forget to update the version string in the gemspec file.
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
@@ -4,14 +4,21 @@ begin
4
4
  # If the installation task did its job, the extension is in lib/ next to this file.
5
5
  require "debug_inspector.#{dlext}"
6
6
  # We only want to define constants if the extension has loaded.
7
- require_relative "rubyvm/debug_inspector/version"
7
+ require_relative "debug_inspector/version"
8
8
  rescue LoadError
9
9
  begin
10
10
  # If not, maybe the extension is in ext/
11
11
  require_relative "../ext/debug_inspector/debug_inspector.#{dlext}"
12
12
  # We only want to define constants if the extension has loaded.
13
- require_relative "rubyvm/debug_inspector/version"
13
+ require_relative "debug_inspector/version"
14
14
  rescue LoadError => e
15
- puts "debug_inspector extension was not loaded"
15
+ puts "debug_inspector extension was not loaded (#{e})"
16
+ end
17
+ end
18
+
19
+ if defined?(RubyVM) && defined?(DebugInspector)
20
+ RubyVM::DebugInspector = DebugInspector
21
+ if RubyVM.respond_to?(:deprecate_constant)
22
+ RubyVM.deprecate_constant :DebugInspector
16
23
  end
17
24
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debug_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
- Adds methods to RubyVM::DebugInspector to allow for inspection of backtrace frames.
14
+ Adds methods to DebugInspector to allow for inspection of backtrace frames.
15
15
 
16
16
  The debug_inspector C extension and API were designed and built by Koichi Sasada, this project is just a gemification of his work.
17
17
 
@@ -29,13 +29,14 @@ files:
29
29
  - ".github/workflows/test.yml"
30
30
  - ".gitignore"
31
31
  - Gemfile
32
+ - LICENSE
32
33
  - README.md
33
34
  - Rakefile
34
35
  - debug_inspector.gemspec
35
36
  - ext/debug_inspector/debug_inspector.c
36
37
  - ext/debug_inspector/extconf.rb
37
38
  - lib/debug_inspector.rb
38
- - lib/rubyvm/debug_inspector/version.rb
39
+ - lib/debug_inspector/version.rb
39
40
  homepage: https://github.com/banister/debug_inspector
40
41
  licenses:
41
42
  - MIT
@@ -43,7 +44,7 @@ metadata:
43
44
  homepage_uri: https://github.com/banister/debug_inspector
44
45
  source_code_uri: https://github.com/banister/debug_inspector
45
46
  changelog_uri: https://github.com/banister/debug_inspector/releases
46
- post_install_message:
47
+ post_install_message:
47
48
  rdoc_options: []
48
49
  require_paths:
49
50
  - lib
@@ -58,8 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  - !ruby/object:Gem::Version
59
60
  version: '0'
60
61
  requirements: []
61
- rubygems_version: 3.1.4
62
- signing_key:
62
+ rubygems_version: 3.4.10
63
+ signing_key:
63
64
  specification_version: 4
64
65
  summary: A Ruby wrapper for the MRI 2.0 debug_inspector API
65
66
  test_files: []