debug_inspector 0.0.3 → 1.1.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: 0055983985b3e3b9bb36058348588eac38022787
4
- data.tar.gz: 776758a397d1e33b3345588331ef3bcb8a3e4051
2
+ SHA256:
3
+ metadata.gz: a9c0e6d3b5bd68235adc5212ad47f99333f9522b6c4b823cb783eb94a2d59d90
4
+ data.tar.gz: e90e6a29a0fdaf86d2259a825ec4bd0b1687e572b90cc24d6d6f889dcb225747
5
5
  SHA512:
6
- metadata.gz: b115b41121a9a3d6220f2aa473014a577318873c99f54d53adab1f3b24a25ccdb8a7afce7629e0b6e462ed79958f1bd3df6a7b932db1564593c61e44a46ff4fd
7
- data.tar.gz: ab115e7bc09e1bb42987da24f1104ae047a7109916142ab9e855318db5aa007756f03a9c45574974149ee6065010d745e154bfb159ba6b10cec5a166549823c4
6
+ metadata.gz: df09cff61314f0af4f9fe0584e7417b0faa756652f1b6157895aae17cd852125a5b8c0535adfdfcdae8fd78e6e5ad845ac6101841373eba4eb75c29894a0674d
7
+ data.tar.gz: 1f329aeae5a8036e9959bdb43095ffcc92110a83f803f9835554a9b5a6b05253cf704006607d321d2abbe02847cce38f4f1f64c975197c03afa746b99c6e717f
@@ -0,0 +1,112 @@
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: Set up Ruby
38
+ uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: ${{ matrix.ruby }}
41
+ bundler-cache: true
42
+
43
+ - name: Test
44
+ run: bundle exec rake
45
+
46
+ system:
47
+ name: "System"
48
+ runs-on: ${{ matrix.os }}
49
+ strategy:
50
+ fail-fast: false
51
+ matrix:
52
+ os:
53
+ - macos-latest
54
+ - ubuntu-latest
55
+ - windows-latest
56
+ ruby:
57
+ # This includes rubies that are not actually extended by this gem.
58
+ # We want to make sure the gem silently fails to load on those platforms.
59
+ - "2"
60
+ - "3.0"
61
+ - "jruby"
62
+ - "truffleruby"
63
+ exclude:
64
+ # Windows releases of jruby and truffleruby have issues. Skip them for now.
65
+ - { ruby: "jruby", os: "windows-latest" }
66
+ - { ruby: "truffleruby", os: "windows-latest" }
67
+
68
+ steps:
69
+
70
+ - uses: actions/checkout@v2
71
+
72
+ - name: Set up Ruby
73
+ uses: ruby/setup-ruby@v1
74
+ with:
75
+ ruby-version: ${{ matrix.ruby }}
76
+ bundler-cache: true
77
+
78
+ - name: Build gem
79
+ run: bundle exec gem build --verbose debug_inspector.gemspec
80
+
81
+ - name: Install gem
82
+ run: gem install --verbose debug_inspector*.gem
83
+
84
+ - name: Create directory for gem test
85
+ run: mkdir -p tmp/gem-test
86
+
87
+ - name: Create test Gemfile
88
+ run: echo "gem 'debug_inspector'" > Gemfile
89
+ working-directory: ./tmp/gem-test
90
+
91
+ - name: Get gem installation path
92
+ id: gem_path
93
+ run: |
94
+ gem_path=$(bundle show debug_inspector)
95
+ echo "gem_path is ${gem_path}"
96
+ echo "::set-output name=path::${gem_path}"
97
+ shell: bash
98
+ working-directory: ./tmp/gem-test
99
+
100
+ - name: List installed gem contents
101
+ run: find .
102
+ shell: bash
103
+ working-directory: ${{ steps.gem_path.outputs.path }}
104
+
105
+ - name: Test gem load
106
+ run: bundle exec ruby -e "require 'debug_inspector'"
107
+ working-directory: ./tmp/gem-test
108
+
109
+ - 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) }"
112
+ working-directory: ./tmp/gem-test
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ Gemfile.lock
2
+
3
+ /.bundle/
4
+ /.yardoc
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
16
+ Makefile
data/Gemfile CHANGED
@@ -1,5 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ # Specify your gem's dependencies in debug_inspector.gemspec
3
4
  gemspec
4
5
 
5
- gem 'rake'
6
+ gem "rake"
7
+ gem "rake-compiler"
8
+ gem "minitest"
data/README.md CHANGED
@@ -1,15 +1,19 @@
1
- debug_inspector [![Build Status](https://travis-ci.org/banister/debug_inspector.svg?branch=master)](https://travis-ci.org/banister/debug_inspector)
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)
2
+ [![Gem Version](https://img.shields.io/gem/v/debug_inspector.svg)](https://rubygems.org/gems/debug_inspector)
3
+
4
+ debug_inspector
2
5
  ===============
3
6
 
4
- _A Ruby wrapper for the new MRI 2.0 debug\_inspector API_
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
- * This library makes use of the new debug inspector API in MRI 2.0.0, **do not use this library outside of debugging situations**.
12
- * Only works on MRI 2.0. Requiring it on unsupported Rubies will result in a no-op
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
- $:.unshift 'lib'
2
- require 'rake/clean'
3
- require "debug_inspector/version"
4
- require 'rake/testtask'
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
5
3
 
6
- dlext = RbConfig::CONFIG['DLEXT']
7
- direc = File.expand_path(File.dirname(__FILE__))
8
- CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
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
- desc "Show version"
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
- desc "remove all platform gems"
65
- task :rmgems do
66
- sh "rm #{direc}/*.gem" rescue nil
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
- desc "build and push latest gems"
70
- task :pushgems => :gem do
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
@@ -1,17 +1,37 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/debug_inspector/version', __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "debug_inspector"
6
- s.version = DebugInspector::VERSION
7
- s.authors = ["John Mair (banisterfiend)"]
8
- s.email = ["jrmair@gmail.com"]
9
- s.homepage = "https://github.com/banister/debug_inspector"
10
- s.summary = "A Ruby wrapper for the MRI 2.0 debug_inspector API"
11
- s.description = s.summary
12
- s.files = `git ls-files`.split("\n")
13
- s.platform = Gem::Platform::RUBY
14
- s.extensions = ["ext/debug_inspector/extconf.rb"]
15
- s.license = 'MIT'
16
- s.add_development_dependency 'minitest', '>= 5'
1
+ # We don't want to define any constants if the gem extension isn't loaded, so not requiring the version file.
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "debug_inspector"
5
+ spec.version = "1.1.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 = <<-TXT
11
+ Adds methods to RubyVM::DebugInspector to allow for inspection of backtrace frames.
12
+
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
+
15
+ This library makes use of the debug inspector API which was added to MRI 2.0.0.
16
+ Only works on MRI 2 and 3. Requiring it on unsupported Rubies will result in a no-op.
17
+
18
+ Recommended for use only in debugging situations. Do not use this in production apps.
19
+ TXT
20
+ spec.homepage = "https://github.com/banister/debug_inspector"
21
+ spec.license = "MIT"
22
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.0")
23
+
24
+ spec.metadata["homepage_uri"] = spec.homepage
25
+ spec.metadata["source_code_uri"] = "https://github.com/banister/debug_inspector"
26
+ spec.metadata["changelog_uri"] = "https://github.com/banister/debug_inspector/releases"
27
+
28
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|bin)/}) }
30
+ end
31
+
32
+ spec.require_paths = ["lib"]
33
+
34
+ if RUBY_ENGINE == "ruby"
35
+ spec.extensions = ["ext/debug_inspector/extconf.rb"]
36
+ end
17
37
  end
@@ -1,16 +1,17 @@
1
1
  def fake_makefile
2
- File.open(File.join(File.dirname(__FILE__), "Makefile"), "w") {|f|
3
- f.puts %[install:\n\techo "Nada."]
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 mri_2?
9
+ def mri_2_or_3?
8
10
  defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" &&
9
- RUBY_VERSION =~ /^2/
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
@@ -1,9 +1,17 @@
1
1
  require 'rbconfig'
2
-
3
2
  dlext = RbConfig::CONFIG['DLEXT']
4
-
5
3
  begin
4
+ # If the installation task did its job, the extension is in lib/ next to this file.
6
5
  require "debug_inspector.#{dlext}"
6
+ # We only want to define constants if the extension has loaded.
7
+ require_relative "rubyvm/debug_inspector/version"
7
8
  rescue LoadError
9
+ begin
10
+ # If not, maybe the extension is in ext/
11
+ require_relative "../ext/debug_inspector/debug_inspector.#{dlext}"
12
+ # We only want to define constants if the extension has loaded.
13
+ require_relative "rubyvm/debug_inspector/version"
14
+ rescue LoadError => e
15
+ puts "debug_inspector extension was not loaded"
16
+ end
8
17
  end
9
-
@@ -0,0 +1,4 @@
1
+ class RubyVM::DebugInspector
2
+ # Don't forget to update the version string in the gemspec file.
3
+ VERSION = "1.1.0"
4
+ end
metadata CHANGED
@@ -1,30 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debug_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mair (banisterfiend)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
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'
27
- description: A Ruby wrapper for the MRI 2.0 debug_inspector API
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
14
+ Adds methods to RubyVM::DebugInspector to allow for inspection of backtrace frames.
15
+
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
+
18
+ This library makes use of the debug inspector API which was added to MRI 2.0.0.
19
+ Only works on MRI 2 and 3. Requiring it on unsupported Rubies will result in a no-op.
20
+
21
+ Recommended for use only in debugging situations. Do not use this in production apps.
28
22
  email:
29
23
  - jrmair@gmail.com
30
24
  executables: []
@@ -32,7 +26,8 @@ extensions:
32
26
  - ext/debug_inspector/extconf.rb
33
27
  extra_rdoc_files: []
34
28
  files:
35
- - ".travis.yml"
29
+ - ".github/workflows/test.yml"
30
+ - ".gitignore"
36
31
  - Gemfile
37
32
  - README.md
38
33
  - Rakefile
@@ -40,13 +35,14 @@ files:
40
35
  - ext/debug_inspector/debug_inspector.c
41
36
  - ext/debug_inspector/extconf.rb
42
37
  - lib/debug_inspector.rb
43
- - lib/debug_inspector/version.rb
44
- - test/basic_test.rb
45
- - test/test_helper.rb
38
+ - lib/rubyvm/debug_inspector/version.rb
46
39
  homepage: https://github.com/banister/debug_inspector
47
40
  licenses:
48
41
  - MIT
49
- metadata: {}
42
+ metadata:
43
+ homepage_uri: https://github.com/banister/debug_inspector
44
+ source_code_uri: https://github.com/banister/debug_inspector
45
+ changelog_uri: https://github.com/banister/debug_inspector/releases
50
46
  post_install_message:
51
47
  rdoc_options: []
52
48
  require_paths:
@@ -55,15 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
51
  requirements:
56
52
  - - ">="
57
53
  - !ruby/object:Gem::Version
58
- version: '0'
54
+ version: '2.0'
59
55
  required_rubygems_version: !ruby/object:Gem::Requirement
60
56
  requirements:
61
57
  - - ">="
62
58
  - !ruby/object:Gem::Version
63
59
  version: '0'
64
60
  requirements: []
65
- rubyforge_project:
66
- rubygems_version: 2.5.1
61
+ rubygems_version: 3.1.4
67
62
  signing_key:
68
63
  specification_version: 4
69
64
  summary: A Ruby wrapper for the MRI 2.0 debug_inspector API
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- before_install:
4
- - gem install bundler
5
- rvm:
6
- - 2.0.0
7
- - 2.1.10
8
- - 2.2.7
9
- - 2.3.4
10
- - 2.4.1
11
- - ruby-head
12
- matrix:
13
- allow_failures:
14
- - rvm: ruby-head
15
- fast_finish: true
@@ -1,3 +0,0 @@
1
- module DebugInspector
2
- VERSION = "0.0.3"
3
- end
data/test/basic_test.rb DELETED
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper'
2
-
3
- class BasicTest < MiniTest::Test
4
- def test_version
5
- assert(DebugInspector::VERSION)
6
- end
7
- end
data/test/test_helper.rb DELETED
@@ -1,5 +0,0 @@
1
- lib_dir = File.dirname(__FILE__) + '/../lib'
2
-
3
- require 'minitest/autorun'
4
- $:.unshift lib_dir unless $:.include?(lib_dir)
5
- require 'debug_inspector'