debug_inspector 0.0.3 → 1.0.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 +5 -5
- data/.github/workflows/test.yml +119 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -1
- data/README.md +15 -4
- data/Rakefile +14 -63
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/debug_inspector.gemspec +26 -15
- data/ext/debug_inspector/extconf.rb +7 -6
- data/lib/debug_inspector.rb +3 -4
- data/lib/rubyvm/debug_inspector/version.rb +4 -0
- metadata +15 -28
- data/.travis.yml +0 -15
- data/lib/debug_inspector/version.rb +0 -3
- data/test/basic_test.rb +0 -7
- data/test/test_helper.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0a2c3b603eb5eb84457f77ffa41d5b97b05fbd7af4123e860dd9256771ccafad
|
4
|
+
data.tar.gz: a3f41a30dd19a66078132fee38d2f312d4490432b6e4049c40b89b2629241659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130771aebab383f849366f0d71f5860dd6713d5dc41c0d88ff92c4266c229b0598d60672da325def29cbec66a9b0079806cb05bd74b8ce23e3946e4dbf8578ba
|
7
|
+
data.tar.gz: 10ebffd9984de140ad6c0fd0700e3a70892559e0f1c665c4b7e6d28f77680694f7ff7b4aaa5d110a8be251c69e38b94914fdfff9000ad6233180116aedce8f3a
|
@@ -0,0 +1,119 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
schedule:
|
7
|
+
- cron: '0 0 11,25 * *' # roughly every two weeks to run on new Ruby versions
|
8
|
+
pull_request:
|
9
|
+
branches: [ master ]
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
name: "Unit"
|
15
|
+
runs-on: ${{ matrix.os }}
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
os:
|
20
|
+
- macos-latest
|
21
|
+
- ubuntu-latest
|
22
|
+
- windows-latest
|
23
|
+
ruby:
|
24
|
+
- "2.1"
|
25
|
+
- "2.2"
|
26
|
+
- "2.3"
|
27
|
+
- "2.4"
|
28
|
+
- "2.5"
|
29
|
+
- "2.6"
|
30
|
+
- "2.7"
|
31
|
+
- "3.0"
|
32
|
+
|
33
|
+
steps:
|
34
|
+
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
|
37
|
+
- name: Determine ruby version name
|
38
|
+
id: ruby_version
|
39
|
+
run: |
|
40
|
+
if [[ $OS == 'windows-latest' && $RUBY == '3.0' ]]; then
|
41
|
+
# Windows doesn't have 3.0, so run head there but nowhere else.
|
42
|
+
echo "::set-output name=release::head"
|
43
|
+
else
|
44
|
+
echo "::set-output name=release::$RUBY"
|
45
|
+
fi
|
46
|
+
shell: bash
|
47
|
+
env:
|
48
|
+
OS: ${{ matrix.os }}
|
49
|
+
RUBY: ${{ matrix.ruby }}
|
50
|
+
|
51
|
+
- name: Set up Ruby
|
52
|
+
uses: ruby/setup-ruby@v1
|
53
|
+
with:
|
54
|
+
ruby-version: ${{ steps.ruby_version.outputs.release }}
|
55
|
+
bundler-cache: true
|
56
|
+
|
57
|
+
- name: Test
|
58
|
+
run: bundle exec rake
|
59
|
+
|
60
|
+
system:
|
61
|
+
name: "System"
|
62
|
+
runs-on: ${{ matrix.os }}
|
63
|
+
strategy:
|
64
|
+
fail-fast: false
|
65
|
+
matrix:
|
66
|
+
os:
|
67
|
+
- macos-latest
|
68
|
+
- ubuntu-latest
|
69
|
+
- windows-latest
|
70
|
+
ruby:
|
71
|
+
- "2"
|
72
|
+
- "3.0"
|
73
|
+
- "jruby"
|
74
|
+
- "truffleruby"
|
75
|
+
exclude:
|
76
|
+
# Windows releases of jruby and truffleruby have issues. Skip them for now.
|
77
|
+
- { ruby: "jruby", os: "windows-latest" }
|
78
|
+
- { ruby: "truffleruby", os: "windows-latest" }
|
79
|
+
|
80
|
+
steps:
|
81
|
+
|
82
|
+
- uses: actions/checkout@v2
|
83
|
+
|
84
|
+
- name: Determine ruby version name
|
85
|
+
id: ruby_version
|
86
|
+
run: |
|
87
|
+
if [[ $OS == 'windows-latest' && $RUBY == '3.0' ]]; then
|
88
|
+
# Windows doesn't have 3.0, so run head there but nowhere else.
|
89
|
+
echo "::set-output name=release::head"
|
90
|
+
else
|
91
|
+
echo "::set-output name=release::$RUBY"
|
92
|
+
fi
|
93
|
+
shell: bash
|
94
|
+
env:
|
95
|
+
OS: ${{ matrix.os }}
|
96
|
+
RUBY: ${{ matrix.ruby }}
|
97
|
+
|
98
|
+
- name: Set up Ruby
|
99
|
+
uses: ruby/setup-ruby@v1
|
100
|
+
with:
|
101
|
+
ruby-version: ${{ steps.ruby_version.outputs.release }}
|
102
|
+
bundler-cache: true
|
103
|
+
|
104
|
+
- name: Install gem
|
105
|
+
run: bundle exec rake install
|
106
|
+
|
107
|
+
- name: Create directory for gem test
|
108
|
+
run: mkdir -p tmp/gem-test
|
109
|
+
|
110
|
+
- name: Create test Gemfile
|
111
|
+
run: echo "gem 'debug_inspector'" > Gemfile
|
112
|
+
working-directory: ./tmp/gem-test
|
113
|
+
|
114
|
+
- name: Test gem load
|
115
|
+
run: bundle exec ruby -e "require 'debug_inspector'"
|
116
|
+
|
117
|
+
- name: Test gem functionality
|
118
|
+
if: ${{ matrix.ruby != 'jruby' && matrix.ruby != 'truffleruby' }}
|
119
|
+
run: bundle exec ruby -e "require 'debug_inspector'; RubyVM::DebugInspector.open { |dc| dc.frame_binding(1) }"
|
data/.gitignore
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
|
1
|
+
[](https://github.com/banister/debug_inspector/actions?query=branch%3Amaster)
|
2
|
+
[](https://rubygems.org/gems/debug_inspector)
|
3
|
+
|
4
|
+
debug_inspector
|
2
5
|
===============
|
3
6
|
|
4
|
-
_A Ruby wrapper for the
|
7
|
+
_A Ruby wrapper for the MRI 2.0+ debug\_inspector API_
|
5
8
|
|
6
9
|
The `debug_inspector` C extension and API were designed and built by [Koichi Sasada](https://github.com/ko1), this project
|
7
10
|
is just a gemification of his work.
|
8
11
|
|
9
12
|
**NOTES:**
|
10
13
|
|
11
|
-
*
|
12
|
-
*
|
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
|
13
17
|
|
14
18
|
Usage
|
15
19
|
-----
|
@@ -37,6 +41,13 @@ RubyVM::DebugInspector.open { |dc|
|
|
37
41
|
}
|
38
42
|
```
|
39
43
|
|
44
|
+
Development
|
45
|
+
-----------
|
46
|
+
|
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
|
+
|
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).
|
50
|
+
|
40
51
|
Contact
|
41
52
|
-------
|
42
53
|
|
data/Rakefile
CHANGED
@@ -1,76 +1,27 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
require "debug_inspector/version"
|
4
|
-
require 'rake/testtask'
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o",
|
10
|
-
"ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "**/*#*", "**/*#*.*",
|
11
|
-
"ext/**/*.def", "ext/**/*.pdb", "**/*_flymake*.*", "**/*_flymake", "**/*.rbc")
|
4
|
+
def can_compile_extensions?
|
5
|
+
RUBY_ENGINE == "ruby"
|
6
|
+
end
|
12
7
|
|
13
8
|
Rake::TestTask.new(:test) do |t|
|
14
9
|
t.libs << "test"
|
10
|
+
t.libs << "lib"
|
15
11
|
t.test_files = FileList["test/**/*_test.rb"]
|
16
12
|
t.warning = true
|
17
13
|
t.verbose = true
|
18
14
|
end
|
19
15
|
|
20
|
-
|
21
|
-
task :version do
|
22
|
-
puts "debug_inspector version: #{DebugInspector::VERSION}"
|
23
|
-
end
|
24
|
-
|
25
|
-
desc "run tests"
|
26
|
-
task :default => [:compile, :test]
|
27
|
-
|
28
|
-
task :pry do
|
29
|
-
puts "loading debug_inspector into pry"
|
30
|
-
sh "pry -r #{direc}/lib/debug_inspector"
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "build the binaries"
|
34
|
-
task :compile do
|
35
|
-
chdir "#{direc}/ext/debug_inspector/" do
|
36
|
-
sh "ruby extconf.rb"
|
37
|
-
sh "make clean"
|
38
|
-
sh "make"
|
39
|
-
sh "cp *.#{dlext} ../../lib/"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
desc 'cleanup the extensions'
|
44
|
-
task :cleanup do
|
45
|
-
sh "rm -rf lib/debug_inspector.#{dlext}"
|
46
|
-
chdir "#{direc}/ext/debug_inspector/" do
|
47
|
-
sh 'make clean' rescue nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
desc "(re)install gem"
|
52
|
-
task :reinstall => :gem do
|
53
|
-
sh "gem uninstall debug_inspector" rescue nil
|
54
|
-
sh "gem install -l #{direc}/debug_inspector-#{DebugInspector::VERSION}.gem"
|
55
|
-
end
|
56
|
-
|
57
|
-
task :install => :reinstall
|
58
|
-
|
59
|
-
desc "build all platform gems at once"
|
60
|
-
task :gem => [:clean, :rmgems] do
|
61
|
-
sh "gem build #{direc}/debug_inspector.gemspec"
|
62
|
-
end
|
16
|
+
require "rake/extensiontask"
|
63
17
|
|
64
|
-
|
65
|
-
task :
|
66
|
-
|
18
|
+
if can_compile_extensions?
|
19
|
+
task :build => :compile
|
20
|
+
task :default => [:clobber, :compile, :test]
|
21
|
+
else
|
22
|
+
task :default => [:test]
|
67
23
|
end
|
68
24
|
|
69
|
-
|
70
|
-
|
71
|
-
chdir(direc) do
|
72
|
-
Dir["*.gem"].each do |gemfile|
|
73
|
-
sh "gem push #{gemfile}"
|
74
|
-
end
|
75
|
-
end
|
25
|
+
Rake::ExtensionTask.new("debug_inspector") do |ext|
|
26
|
+
ext.lib_dir = "lib"
|
76
27
|
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "debug_inspector"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/debug_inspector.gemspec
CHANGED
@@ -1,17 +1,28 @@
|
|
1
|
-
#
|
2
|
-
require File.expand_path('../lib/debug_inspector/version', __FILE__)
|
1
|
+
# We don't want to define any constants if the gem extension isn't loaded, so not requiring the version file.
|
3
2
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "debug_inspector"
|
5
|
+
spec.version = "1.0.0"
|
6
|
+
spec.authors = ["John Mair (banisterfiend)"]
|
7
|
+
spec.email = ["jrmair@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{A Ruby wrapper for the MRI 2.0 debug_inspector API}
|
10
|
+
spec.description = spec.summary
|
11
|
+
spec.homepage = "https://github.com/banister/debug_inspector"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.0")
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
17
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
18
|
+
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
21
|
+
end
|
22
|
+
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
if RUBY_ENGINE == "ruby"
|
26
|
+
spec.extensions = ["ext/debug_inspector/extconf.rb"]
|
27
|
+
end
|
17
28
|
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
def fake_makefile
|
2
|
-
File.open(
|
3
|
-
f.puts
|
2
|
+
File.open("Makefile", "w") { |f|
|
3
|
+
f.puts '.PHONY: install'
|
4
|
+
f.puts 'install:'
|
5
|
+
f.puts "\t" + '@echo "This Ruby not supported by/does not require debug_inspector."'
|
4
6
|
}
|
5
7
|
end
|
6
8
|
|
7
|
-
def
|
9
|
+
def mri_2_or_3?
|
8
10
|
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
|
9
|
-
RUBY_VERSION =~ /^
|
11
|
+
RUBY_VERSION =~ /^[23]/
|
10
12
|
end
|
11
13
|
|
12
|
-
|
13
|
-
if mri_2?
|
14
|
+
if mri_2_or_3?
|
14
15
|
require 'mkmf'
|
15
16
|
create_makefile('debug_inspector')
|
16
17
|
else
|
data/lib/debug_inspector.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'rbconfig'
|
2
|
-
|
3
2
|
dlext = RbConfig::CONFIG['DLEXT']
|
4
|
-
|
5
3
|
begin
|
6
|
-
|
4
|
+
require_relative "debug_inspector.#{dlext}"
|
5
|
+
# If the above require fails, we don't want to define any constants.
|
6
|
+
require_relative "rubyvm/debug_inspector/version"
|
7
7
|
rescue LoadError
|
8
8
|
end
|
9
|
-
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug_inspector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.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:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: minitest
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5'
|
11
|
+
date: 2020-12-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: A Ruby wrapper for the MRI 2.0 debug_inspector API
|
28
14
|
email:
|
29
15
|
- jrmair@gmail.com
|
@@ -32,22 +18,24 @@ extensions:
|
|
32
18
|
- ext/debug_inspector/extconf.rb
|
33
19
|
extra_rdoc_files: []
|
34
20
|
files:
|
35
|
-
- ".
|
21
|
+
- ".github/workflows/test.yml"
|
22
|
+
- ".gitignore"
|
36
23
|
- Gemfile
|
37
24
|
- README.md
|
38
25
|
- Rakefile
|
26
|
+
- bin/console
|
27
|
+
- bin/setup
|
39
28
|
- debug_inspector.gemspec
|
40
29
|
- ext/debug_inspector/debug_inspector.c
|
41
30
|
- ext/debug_inspector/extconf.rb
|
42
31
|
- lib/debug_inspector.rb
|
43
|
-
- lib/debug_inspector/version.rb
|
44
|
-
- test/basic_test.rb
|
45
|
-
- test/test_helper.rb
|
32
|
+
- lib/rubyvm/debug_inspector/version.rb
|
46
33
|
homepage: https://github.com/banister/debug_inspector
|
47
34
|
licenses:
|
48
35
|
- MIT
|
49
|
-
metadata:
|
50
|
-
|
36
|
+
metadata:
|
37
|
+
homepage_uri: https://github.com/banister/debug_inspector
|
38
|
+
post_install_message:
|
51
39
|
rdoc_options: []
|
52
40
|
require_paths:
|
53
41
|
- lib
|
@@ -55,16 +43,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
43
|
requirements:
|
56
44
|
- - ">="
|
57
45
|
- !ruby/object:Gem::Version
|
58
|
-
version: '0'
|
46
|
+
version: '2.0'
|
59
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
48
|
requirements:
|
61
49
|
- - ">="
|
62
50
|
- !ruby/object:Gem::Version
|
63
51
|
version: '0'
|
64
52
|
requirements: []
|
65
|
-
|
66
|
-
|
67
|
-
signing_key:
|
53
|
+
rubygems_version: 3.1.4
|
54
|
+
signing_key:
|
68
55
|
specification_version: 4
|
69
56
|
summary: A Ruby wrapper for the MRI 2.0 debug_inspector API
|
70
57
|
test_files: []
|
data/.travis.yml
DELETED
data/test/basic_test.rb
DELETED