pry 0.9.8.4 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG +26 -0
  3. data/README.markdown +3 -3
  4. data/lib/pry.rb +9 -1
  5. data/lib/pry/code.rb +93 -0
  6. data/lib/pry/command.rb +35 -22
  7. data/lib/pry/command_set.rb +97 -67
  8. data/lib/pry/config.rb +63 -10
  9. data/lib/pry/core_extensions.rb +24 -18
  10. data/lib/pry/default_commands/context.rb +72 -12
  11. data/lib/pry/default_commands/easter_eggs.rb +4 -0
  12. data/lib/pry/default_commands/editing.rb +43 -15
  13. data/lib/pry/default_commands/find_method.rb +171 -0
  14. data/lib/pry/default_commands/hist.rb +10 -6
  15. data/lib/pry/default_commands/introspection.rb +183 -30
  16. data/lib/pry/default_commands/ls.rb +77 -7
  17. data/lib/pry/default_commands/misc.rb +1 -0
  18. data/lib/pry/default_commands/navigating_pry.rb +1 -8
  19. data/lib/pry/helpers/base_helpers.rb +10 -2
  20. data/lib/pry/helpers/command_helpers.rb +23 -40
  21. data/lib/pry/helpers/documentation_helpers.rb +65 -0
  22. data/lib/pry/indent.rb +17 -4
  23. data/lib/pry/method.rb +61 -45
  24. data/lib/pry/pry_class.rb +9 -3
  25. data/lib/pry/pry_instance.rb +99 -65
  26. data/lib/pry/rbx_method.rb +2 -9
  27. data/lib/pry/version.rb +1 -1
  28. data/lib/pry/wrapped_module.rb +236 -1
  29. data/pry.gemspec +5 -5
  30. data/test/helper.rb +22 -0
  31. data/test/test_command.rb +29 -0
  32. data/test/test_command_integration.rb +193 -10
  33. data/test/test_command_set.rb +82 -17
  34. data/test/test_default_commands/test_cd.rb +16 -0
  35. data/test/test_default_commands/test_context.rb +61 -0
  36. data/test/test_default_commands/test_documentation.rb +163 -43
  37. data/test/test_default_commands/test_find_method.rb +42 -0
  38. data/test/test_default_commands/test_input.rb +32 -0
  39. data/test/test_default_commands/test_introspection.rb +50 -197
  40. data/test/test_default_commands/test_ls.rb +22 -0
  41. data/test/test_default_commands/test_show_source.rb +306 -0
  42. data/test/test_pry.rb +3 -3
  43. data/test/test_pry_defaults.rb +21 -0
  44. data/test/test_sticky_locals.rb +81 -1
  45. data/test/test_syntax_checking.rb +7 -6
  46. metadata +22 -14
@@ -24,10 +24,11 @@ describe Pry do
24
24
  ["end"],
25
25
  ["puts )("],
26
26
  ["1 1"],
27
- ["puts :"],
28
- # in this case the syntax error is "expecting ')'".
29
- (Pry::Helpers::BaseHelpers.rbx? ? nil : ["def", "method(1"])
30
- ].compact.each do |foo|
27
+ ["puts :"]
28
+ ] + (Pry::Helpers::BaseHelpers.rbx? ? [] : [
29
+ ["def", "method(1"], # in this case the syntax error is "expecting ')'".
30
+ ["o = Object.new.tap{ def o.render;","'MEH'", "}"] # in this case the syntax error is "expecting keyword_end".
31
+ ]).compact.each do |foo|
31
32
  it "should raise an error on invalid syntax like #{foo.inspect}" do
32
33
  output = StringIO.new
33
34
  redirect_pry_io(InputTester.new(*foo), output) do
@@ -48,12 +49,12 @@ describe Pry do
48
49
  it "should allow trailing , to continue the line" do
49
50
  pry = Pry.new
50
51
 
51
- pry.complete_expression?("puts 1, 2,").should == false
52
+ Pry::Code.complete_expression?("puts 1, 2,").should == false
52
53
  end
53
54
 
54
55
  it "should complete an expression that contains a line ending with a ," do
55
56
  pry = Pry.new
56
- pry.complete_expression?("puts 1, 2,\n3").should == true
57
+ Pry::Code.complete_expression?("puts 1, 2,\n3").should == true
57
58
  end
58
59
 
59
60
  it "should not clobber _ex_ on a SyntaxError in the repl" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.4
4
+ version: 0.9.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-06 00:00:00.000000000 Z
12
+ date: 2012-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: coderay
16
- requirement: &70279435041480 !ruby/object:Gem::Requirement
16
+ requirement: &70238787968520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70279435041480
24
+ version_requirements: *70238787968520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: slop
27
- requirement: &70279435040980 !ruby/object:Gem::Requirement
27
+ requirement: &70238787966120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: '3'
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *70279435040980
38
+ version_requirements: *70238787966120
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: method_source
41
- requirement: &70279435040260 !ruby/object:Gem::Requirement
41
+ requirement: &70238787977980 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 0.7.1
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *70279435040260
49
+ version_requirements: *70238787977980
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: bacon
52
- requirement: &70279435039800 !ruby/object:Gem::Requirement
52
+ requirement: &70238787977300 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ~>
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: '1.1'
58
58
  type: :development
59
59
  prerelease: false
60
- version_requirements: *70279435039800
60
+ version_requirements: *70238787977300
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: open4
63
- requirement: &70279435039340 !ruby/object:Gem::Requirement
63
+ requirement: &70238787976480 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ~>
@@ -68,10 +68,10 @@ dependencies:
68
68
  version: '1.3'
69
69
  type: :development
70
70
  prerelease: false
71
- version_requirements: *70279435039340
71
+ version_requirements: *70238787976480
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: rake
74
- requirement: &70279435038880 !ruby/object:Gem::Requirement
74
+ requirement: &70238787975900 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
77
  - - ~>
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: '0.9'
80
80
  type: :development
81
81
  prerelease: false
82
- version_requirements: *70279435038880
82
+ version_requirements: *70238787975900
83
83
  description: An IRB alternative and runtime developer console
84
84
  email: jrmair@gmail.com
85
85
  executables:
@@ -126,6 +126,7 @@ files:
126
126
  - lib/pry/default_commands/context.rb
127
127
  - lib/pry/default_commands/easter_eggs.rb
128
128
  - lib/pry/default_commands/editing.rb
129
+ - lib/pry/default_commands/find_method.rb
129
130
  - lib/pry/default_commands/gems.rb
130
131
  - lib/pry/default_commands/help.rb
131
132
  - lib/pry/default_commands/hist.rb
@@ -138,6 +139,7 @@ files:
138
139
  - lib/pry/helpers.rb
139
140
  - lib/pry/helpers/base_helpers.rb
140
141
  - lib/pry/helpers/command_helpers.rb
142
+ - lib/pry/helpers/documentation_helpers.rb
141
143
  - lib/pry/helpers/options_helpers.rb
142
144
  - lib/pry/helpers/text.rb
143
145
  - lib/pry/history.rb
@@ -164,14 +166,17 @@ files:
164
166
  - test/test_command_integration.rb
165
167
  - test/test_command_set.rb
166
168
  - test/test_completion.rb
169
+ - test/test_default_commands/test_cd.rb
167
170
  - test/test_default_commands/test_context.rb
168
171
  - test/test_default_commands/test_documentation.rb
172
+ - test/test_default_commands/test_find_method.rb
169
173
  - test/test_default_commands/test_gems.rb
170
174
  - test/test_default_commands/test_help.rb
171
175
  - test/test_default_commands/test_input.rb
172
176
  - test/test_default_commands/test_introspection.rb
173
177
  - test/test_default_commands/test_ls.rb
174
178
  - test/test_default_commands/test_shell.rb
179
+ - test/test_default_commands/test_show_source.rb
175
180
  - test/test_exception_whitelist.rb
176
181
  - test/test_history_array.rb
177
182
  - test/test_hooks.rb
@@ -222,14 +227,17 @@ test_files:
222
227
  - test/test_command_integration.rb
223
228
  - test/test_command_set.rb
224
229
  - test/test_completion.rb
230
+ - test/test_default_commands/test_cd.rb
225
231
  - test/test_default_commands/test_context.rb
226
232
  - test/test_default_commands/test_documentation.rb
233
+ - test/test_default_commands/test_find_method.rb
227
234
  - test/test_default_commands/test_gems.rb
228
235
  - test/test_default_commands/test_help.rb
229
236
  - test/test_default_commands/test_input.rb
230
237
  - test/test_default_commands/test_introspection.rb
231
238
  - test/test_default_commands/test_ls.rb
232
239
  - test/test_default_commands/test_shell.rb
240
+ - test/test_default_commands/test_show_source.rb
233
241
  - test/test_exception_whitelist.rb
234
242
  - test/test_history_array.rb
235
243
  - test/test_hooks.rb