pry-exception_explorer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -26,7 +26,6 @@ def apply_spec_defaults(s)
26
26
  s.add_dependency('pry-stack_explorer', ">=0.4.6")
27
27
  s.add_development_dependency("bacon","~>1.1.0")
28
28
  s.add_development_dependency('rake', '~> 0.9')
29
- s.executables = ['pry-shim']
30
29
 
31
30
  s.files = `git ls-files`.split("\n")
32
31
  s.test_files = `git ls-files -- test/*`.split("\n")
@@ -1,3 +1,3 @@
1
1
  module PryExceptionExplorer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -2,14 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "pry-exception_explorer"
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Mair (banisterfiend)"]
9
9
  s.date = "2012-10-04"
10
10
  s.description = "Enter the context of exceptions"
11
11
  s.email = "jrmair@gmail.com"
12
- s.executables = ["pry-shim"]
13
12
  s.files = [".gemtest", ".gitignore", ".travis.yml", ".yardopts", "CHANGELOG", "Gemfile", "LICENSE", "README.md", "Rakefile", "bin/pry-shim", "examples/example_c_inline.rb", "examples/example_inline.rb", "examples/example_wrap.rb", "lib/pry-exception_explorer.rb", "lib/pry-exception_explorer/cli.rb", "lib/pry-exception_explorer/commands.rb", "lib/pry-exception_explorer/core_ext.rb", "lib/pry-exception_explorer/intercept.rb", "lib/pry-exception_explorer/lazy_frame.rb", "lib/pry-exception_explorer/shim_builder.rb", "lib/pry-exception_explorer/version.rb", "pry-exception_explorer.gemspec", "test/helper.rb", "test/test_exceptions_in_pry.rb", "test/test_inline_exceptions.rb", "test/test_raise.rb", "test/test_wrapped_exceptions.rb"]
14
13
  s.homepage = "https://github.com/banister/pry-exception_explorer"
15
14
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-exception_explorer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry-stack_explorer
16
- requirement: &70365346977560 !ruby/object:Gem::Requirement
16
+ requirement: &70308505646200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.4.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70365346977560
24
+ version_requirements: *70308505646200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
27
- requirement: &70365346976800 !ruby/object:Gem::Requirement
27
+ requirement: &70308505645560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70365346976800
35
+ version_requirements: *70308505645560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70365347034540 !ruby/object:Gem::Requirement
38
+ requirement: &70308505644820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,11 +43,10 @@ dependencies:
43
43
  version: '0.9'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70365347034540
46
+ version_requirements: *70308505644820
47
47
  description: Enter the context of exceptions
48
48
  email: jrmair@gmail.com
49
- executables:
50
- - pry-shim
49
+ executables: []
51
50
  extensions: []
52
51
  extra_rdoc_files: []
53
52
  files:
@@ -60,7 +59,6 @@ files:
60
59
  - LICENSE
61
60
  - README.md
62
61
  - Rakefile
63
- - bin/pry-shim
64
62
  - examples/example_c_inline.rb
65
63
  - examples/example_inline.rb
66
64
  - examples/example_wrap.rb
@@ -70,7 +68,6 @@ files:
70
68
  - lib/pry-exception_explorer/core_ext.rb
71
69
  - lib/pry-exception_explorer/intercept.rb
72
70
  - lib/pry-exception_explorer/lazy_frame.rb
73
- - lib/pry-exception_explorer/shim_builder.rb
74
71
  - lib/pry-exception_explorer/version.rb
75
72
  - pry-exception_explorer.gemspec
76
73
  - test/helper.rb
data/bin/pry-shim DELETED
@@ -1,20 +0,0 @@
1
- require 'pry'
2
- require 'pry-exception_explorer'
3
- require 'pry-exception_explorer/shim_builder'
4
-
5
- binary_name = "lib_overrides.#{PryExceptionExplorer::ShimBuilder::Dyname}"
6
-
7
- if !File.exists? File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
8
- puts "First run, building shim"
9
- PryExceptionExplorer::ShimBuilder.compile
10
- puts "Hopefully built...!"
11
- end
12
-
13
- if RUBY_PLATFORM =~ /darwin/
14
- ENV['DYLD_FORCE_FLAT_NAMESPACE'] = "1"
15
- ENV['DYLD_INSERT_LIBRARIES'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
16
- else
17
- ENV['LD_PRELOAD'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
18
- end
19
-
20
- exec(*ARGV)
@@ -1,81 +0,0 @@
1
- require 'rbconfig'
2
- require 'fileutils'
3
-
4
- module PryExceptionExplorer
5
- CompileError = Class.new(StandardError)
6
-
7
- module ShimBuilder
8
- class << self
9
- attr_reader :dir, :file
10
- end
11
-
12
- @dir = File.expand_path("~/.pry-exception_explorer/#{RUBY_VERSION}")
13
- @file = File.join(@dir, "raise_shim.c")
14
-
15
- if RUBY_PLATFORM =~ /darwin/
16
- Dyname = "dylib"
17
- else
18
- Dyname = "so"
19
- end
20
-
21
- ShimCode = <<-EOF
22
- #include <stdio.h>
23
- #include <dlfcn.h>
24
- #include <stdlib.h>
25
- #include <unistd.h>
26
- #include <ruby.h>
27
-
28
- void
29
- rb_raise(VALUE exc, const char *fmt, ...)
30
- {
31
- va_list args;
32
- VALUE mesg;
33
-
34
- va_start(args, fmt);
35
- mesg = rb_vsprintf(fmt, args);
36
- va_end(args);
37
- rb_funcall(rb_cObject, rb_intern("raise"), 2, exc, mesg);
38
- }
39
-
40
- void
41
- rb_name_error(ID id, const char *fmt, ...)
42
- {
43
- rb_funcall(rb_cObject, rb_intern("raise"), 2, rb_eNameError, rb_str_new2("hooked exception (pry)"));
44
- }
45
-
46
- EOF
47
-
48
- def self.create_directory_and_source_file
49
- FileUtils.mkdir_p(@dir)
50
- File.open(@file, 'w') do |f|
51
- f.puts(ShimCode)
52
- end
53
- end
54
-
55
- def self.compile
56
- create_directory_and_source_file
57
-
58
- # -L
59
- lib_dir = RbConfig::CONFIG['libdir']
60
-
61
- # -I
62
- arch_include = File.join RbConfig::CONFIG['includedir'], "ruby-1.9.1", RbConfig::CONFIG['arch']
63
- backward_include = File.join RbConfig::CONFIG['includedir'], "ruby-1.9.1", "ruby/backward"
64
- ruby191_include = File.join RbConfig::CONFIG['includedir'], "ruby-1.9.1"
65
-
66
- if RUBY_PLATFORM =~ /darwin/
67
- compile_line = "gcc -Wall -L#{lib_dir} -lruby -I#{arch_include} -I#{backward_include} -I#{ruby191_include} -o lib_overrides.dylib -dynamiclib #{@file}"
68
- else
69
- compile_line = "gcc -Wall -O2 -fpic -shared -ldl -g -I#{arch_include} -I#{backward_include} -I#{ruby191_include} -o lib_overrides.so #{@file}"
70
- end
71
-
72
- FileUtils.chdir @dir do
73
- if !system(compile_line)
74
- raise CompileError, "There was a problem building the shim, aborted!"
75
- end
76
- end
77
-
78
- end
79
- end
80
- end
81
-