pry-rescue 1.4.4 → 1.4.5

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
  SHA1:
3
- metadata.gz: 4f172010c0305bf056583be808a855b588884aa1
4
- data.tar.gz: 5a8bbae2af2a9825be0a19842215cde08c04c842
3
+ metadata.gz: f8498adfc62776fab874402fd91ff59f7a0b3811
4
+ data.tar.gz: 2efe1214b7acb9361f5c84754bad36aebfc769bd
5
5
  SHA512:
6
- metadata.gz: 9ca913249deeb8cc6916725fc8de936019a3701c9b9f8df5e087b6a953b05a3c36b975862e629fc6bc9876cec77f27ecd276c48f7d895477fc45ae7cd775e050
7
- data.tar.gz: 5b1eac518eecbafe04b4736a22beea33e666b4b9d96beeffb884f618642e7bdaf09c78224b36acfef519322552b4d2d2377dd9129e82b8cd1694f3988ddf484a
6
+ metadata.gz: a60814bf969deba350559387f5a11c79fa6b03e86bb90656cee06f1ec26dd52e3db99ea815dbe033cb10fd65dcce59a932959c838a2b1b70a40d238057f2be54
7
+ data.tar.gz: 94c9e761195dcd0c7eb01c17af7670b0eea83fa9d59e36d4b24a1612f4b49807f6f12f0463072c4f5a7838d5ff256f54fb2d4629fb896d8edc9cfc37ea8e1121
@@ -4,4 +4,8 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.0
7
- - rbx
7
+ - 2.2.2
8
+ - ruby-head
9
+ before_install:
10
+ - "gem update --system"
11
+ - "gem update bundler"
data/bin/rescue CHANGED
@@ -34,12 +34,15 @@ when '-i'
34
34
  when /\A-/
35
35
  puts USAGE
36
36
  exit
37
- when 'rails'
38
- ENV['PRY_RESCUE_RAILS'] = 'true'
39
- exec(*ARGV)
40
- when /^re?spec|rake$/
41
- ENV['SPEC_OPTS'] = "#{ENV['SPEC_OPTS']} -r pry-rescue/rspec"
42
- exec(*ARGV)
37
+ else
38
+ case File.basename(ARGV[0] || "")
39
+ when 'rails'
40
+ ENV['PRY_RESCUE_RAILS'] = 'true'
41
+ exec(*ARGV)
42
+ when /^re?spec|rake$/
43
+ ENV['SPEC_OPTS'] = "#{ENV['SPEC_OPTS']} -r pry-rescue/rspec"
44
+ exec(*ARGV)
45
+ end
43
46
  end
44
47
 
45
48
  if script = ARGV.shift
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pry-rescue'
3
- s.version = '1.4.4'
3
+ s.version = '1.4.5'
4
4
  s.summary = 'Open a pry session on any unhandled exceptions'
5
5
  s.description = 'Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions'
6
6
  s.homepage = 'https://github.com/ConradIrwin/pry-rescue'
@@ -18,7 +18,25 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.add_development_dependency 'rake'
20
20
  s.add_development_dependency 'rspec'
21
- s.add_development_dependency 'yard'
22
21
  s.add_development_dependency 'redcarpet'
23
22
  s.add_development_dependency 'capybara'
23
+
24
+ # SPECIAL DEVELOPMENT GEM FOR OLD RUBY
25
+ # DONT USE THIS TRICK FOR RUNTIME GEM
26
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
27
+ s.add_development_dependency 'yard', '< 0.9.6'
28
+ s.add_development_dependency 'rack', ['~> 1.6', '< 1.7']
29
+ else
30
+ s.add_development_dependency 'yard'
31
+ end
32
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.1")
33
+ # capybara > nokogiri
34
+ s.add_development_dependency 'nokogiri', ['~> 1.6', '< 1.7.0']
35
+ end
36
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.0")
37
+ # capybara > addressable > public_suffix
38
+ s.add_development_dependency 'public_suffix', ['~> 1.4', '< 1.5']
39
+ # capybara > mime-types
40
+ s.add_development_dependency 'mime-types', ['~> 2.6', '< 2.99']
41
+ end
24
42
  end
@@ -3,19 +3,19 @@ require './spec/spec_helper'
3
3
  describe "pry-rescue commands" do
4
4
  describe "try-again" do
5
5
  it "should throw try_again" do
6
- PryRescue.should_receive(:in_exception_context?).and_return{ true }
6
+ expect(PryRescue).to receive(:in_exception_context?).and_return(true)
7
7
 
8
- lambda{
9
- Pry.new.process_command "try-again", '', TOPLEVEL_BINDING
10
- }.should throw_symbol :try_again
8
+ expect {
9
+ Pry.new.process_command("try-again")
10
+ }.to throw_symbol(:try_again)
11
11
  end
12
12
 
13
13
  it "should raise a CommandError if not in Pry::rescue" do
14
- PryRescue.should_receive(:in_exception_context?).and_return{ false }
14
+ expect(PryRescue).to receive(:in_exception_context?).and_return(false)
15
15
 
16
- lambda{
17
- Pry.new.process_command "try-again", '', TOPLEVEL_BINDING
18
- }.should raise_error Pry::CommandError
16
+ expect {
17
+ Pry.new.process_command "try-again"
18
+ }.to raise_error Pry::CommandError
19
19
  end
20
20
  end
21
21
 
@@ -28,11 +28,11 @@ describe "pry-rescue commands" do
28
28
  b2 = binding
29
29
  end
30
30
 
31
- Pry.should_receive(:rescued).once.with{ |raised|
32
- raised.should == e1
33
- }
31
+ allow(Pry).to receive(:rescued).once do |raised|
32
+ expect(raised).to eq e1
33
+ end
34
34
 
35
- Pry.new.process_command 'cd-cause e1', '', binding
35
+ Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause e1'
36
36
  end
37
37
 
38
38
  it "should enter the context of _ex_ if no exception is given" do
@@ -47,11 +47,11 @@ describe "pry-rescue commands" do
47
47
  end
48
48
  end
49
49
 
50
- Pry.should_receive(:rescued).once.with{ |raised|
51
- raised.should == _ex_
52
- }
50
+ allow(Pry).to receive(:rescued).once do |raised|
51
+ expect(raised).to eq _ex_
52
+ end
53
53
 
54
- Pry.new.process_command 'cd-cause', '', b2
54
+ Pry.new.tap{ |p| p.push_binding(b2) }.process_command 'cd-cause'
55
55
  end
56
56
  end
57
57
 
@@ -73,9 +73,10 @@ describe "pry-rescue commands" do
73
73
  end
74
74
  end
75
75
 
76
- PryRescue.should_receive(:enter_exception_context).once.with(e1)
76
+ expect(PryRescue).to receive(:enter_exception_context).once.with(e1)
77
77
 
78
- Pry.new.process_command 'cd-cause', '', binding
78
+ Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
79
+ # PryTester.new(binding).process_command 'cd-cause'
79
80
  end
80
81
 
81
82
  it "should raise a CommandError if no previous commands" do
@@ -88,9 +89,9 @@ describe "pry-rescue commands" do
88
89
  _ex_ = e1
89
90
  end
90
91
 
91
- lambda{
92
- Pry.new.process_command 'cd-cause', '', binding
93
- }.should raise_error Pry::CommandError, /No previous exception/
92
+ expect {
93
+ Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
94
+ }.to raise_error Pry::CommandError, /No previous exception/
94
95
  end
95
96
 
96
97
  it "should raise a CommandError on a re-raise" do
@@ -107,15 +108,15 @@ describe "pry-rescue commands" do
107
108
  end
108
109
  _rescued_ = _ex_
109
110
 
110
- lambda{
111
- Pry.new.process_command 'cd-cause', '', binding
112
- }.should raise_error Pry::CommandError, /No previous exception/
111
+ expect {
112
+ Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
113
+ }.to raise_error Pry::CommandError, /No previous exception/
113
114
  end
114
115
 
115
116
  it "should raise a CommandError if not in Pry::rescue" do
116
- lambda{
117
- Pry.new.process_command 'cd-cause', '', binding
118
- }.should raise_error Pry::CommandError, /No previous exception/
117
+ expect {
118
+ Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
119
+ }.to raise_error Pry::CommandError, /No previous exception/
119
120
  end
120
121
  end
121
122
  end
@@ -53,9 +53,16 @@ describe "PryRescue.load" do
53
53
  end
54
54
 
55
55
  it "should skip pwd, even if it is a gem (but not vendor stuff)" do
56
- Gem::Specification.stub :any? do true end
57
- PryRescue.send(:user_path?, Dir.pwd + '/asdf.rb').should be_true
58
- PryRescue.send(:user_path?, Dir.pwd + '/vendor/asdf.rb').should be_false
56
+ # Gem::Specification.stub :any? do true end
57
+ allow(Gem::Specification).to receive(:any?).and_return(true)
58
+
59
+ expect(
60
+ PryRescue.send(:user_path?, Dir.pwd + '/asdf.rb')
61
+ ).to be true
62
+
63
+ expect(
64
+ PryRescue.send(:user_path?, Dir.pwd + '/vendor/asdf.rb')
65
+ ).to be false
59
66
  end
60
67
 
61
68
  it "should filter out duplicate stack frames" do
@@ -1,5 +1,4 @@
1
1
  require 'rspec'
2
- require 'rspec/autorun'
3
2
 
4
3
  require 'pry/test/helper'
5
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry-rescue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conrad Irwin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-20 00:00:00.000000000 Z
13
+ date: 2017-02-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
@@ -83,7 +83,7 @@ dependencies:
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
- name: yard
86
+ name: redcarpet
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
@@ -97,7 +97,7 @@ dependencies:
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  - !ruby/object:Gem::Dependency
100
- name: redcarpet
100
+ name: capybara
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - ">="
@@ -111,7 +111,7 @@ dependencies:
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  - !ruby/object:Gem::Dependency
114
- name: capybara
114
+ name: yard
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
@@ -202,9 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  requirements: []
204
204
  rubyforge_project:
205
- rubygems_version: 2.4.5
205
+ rubygems_version: 2.6.8
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Open a pry session on any unhandled exceptions
209
209
  test_files: []
210
- has_rdoc: