debug_inspector 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +14 -6
- data/LICENSE +21 -0
- data/README.md +8 -28
- data/Rakefile +2 -2
- data/debug_inspector.gemspec +3 -5
- data/ext/debug_inspector/debug_inspector.c +1 -2
- data/ext/debug_inspector/extconf.rb +3 -4
- data/lib/{rubyvm/debug_inspector → debug_inspector}/version.rb +2 -2
- data/lib/debug_inspector.rb +10 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1361eb77ee247a591556611867b536d99b6cda075c96d35cf1759fb7bc150b8d
|
4
|
+
data.tar.gz: 466a358f77fed62bedb72ae999cf77f19db2c375c6a57cef16e399f919151c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1dde9bce363e812b18ff8fb8d7bd852dfc3f7acf1e0670c98001eb5a4643c33af5fb9a0cf40cc2af05760d38b01b529a5c3b40d70e5ae06a75c190da732bd8f
|
7
|
+
data.tar.gz: b3d379e4e88c2d0a7d336a95a18563ee42fbd59d87797b02f5c2ff9bed1d253223100b9f819cd41182066fcd4d40d36e798f9101c0c02f76dab7577b648365f5
|
data/.github/workflows/test.yml
CHANGED
@@ -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
|
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@
|
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'
|
111
|
-
run: bundle exec ruby -e "require 'debug_inspector';
|
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
|
-
[](https://github.com/banister/debug_inspector/actions/workflows/test.yml)
|
2
2
|
[](https://rubygems.org/gems/debug_inspector)
|
3
3
|
|
4
4
|
debug_inspector
|
5
5
|
===============
|
6
6
|
|
7
|
-
_A Ruby wrapper for the
|
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
|
16
|
-
* Only works on
|
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
|
-
|
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`.
|
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
|
-
|
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
data/debug_inspector.gemspec
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "debug_inspector"
|
5
|
-
spec.version = "1.
|
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
|
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
|
-
|
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
|
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
|
10
|
-
|
11
|
-
RUBY_VERSION =~ /^[23]/
|
9
|
+
def can_compile_extensions?
|
10
|
+
RUBY_ENGINE == "ruby" or RUBY_ENGINE == "truffleruby"
|
12
11
|
end
|
13
12
|
|
14
|
-
if
|
13
|
+
if can_compile_extensions?
|
15
14
|
require 'mkmf'
|
16
15
|
create_makefile('debug_inspector')
|
17
16
|
else
|
data/lib/debug_inspector.rb
CHANGED
@@ -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 "
|
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 "
|
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.
|
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:
|
11
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
|
-
Adds methods to
|
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/
|
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.
|
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: []
|