pry 0.9.4pre1-i386-mswin32 → 0.9.4pre2-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG +23 -0
  2. data/CONTRIBUTORS +13 -11
  3. data/README.markdown +2 -0
  4. data/Rakefile +16 -2
  5. data/TODO +8 -0
  6. data/lib/pry.rb +58 -9
  7. data/lib/pry/command_context.rb +11 -0
  8. data/lib/pry/command_processor.rb +43 -6
  9. data/lib/pry/command_set.rb +14 -4
  10. data/lib/pry/completion.rb +5 -5
  11. data/lib/pry/config.rb +6 -2
  12. data/lib/pry/default_commands/context.rb +83 -35
  13. data/lib/pry/default_commands/documentation.rb +37 -31
  14. data/lib/pry/default_commands/easter_eggs.rb +5 -0
  15. data/lib/pry/default_commands/input.rb +13 -10
  16. data/lib/pry/default_commands/introspection.rb +54 -40
  17. data/lib/pry/default_commands/shell.rb +9 -5
  18. data/lib/pry/helpers/base_helpers.rb +16 -5
  19. data/lib/pry/helpers/command_helpers.rb +41 -17
  20. data/lib/pry/helpers/text.rb +2 -1
  21. data/lib/pry/history.rb +61 -0
  22. data/lib/pry/plugins.rb +19 -8
  23. data/lib/pry/pry_class.rb +25 -62
  24. data/lib/pry/pry_instance.rb +105 -120
  25. data/lib/pry/version.rb +1 -1
  26. data/pry.gemspec +15 -14
  27. data/test/helper.rb +31 -0
  28. data/test/test_command_set.rb +7 -2
  29. data/test/test_completion.rb +7 -3
  30. data/test/test_default_commands/test_context.rb +185 -1
  31. data/test/test_default_commands/test_documentation.rb +10 -0
  32. data/test/test_default_commands/test_input.rb +16 -11
  33. data/test/test_default_commands/test_introspection.rb +10 -0
  34. data/test/test_default_commands/test_shell.rb +18 -0
  35. data/test/test_pry.rb +189 -40
  36. data/test/test_pry_history.rb +13 -13
  37. data/test/test_pry_output.rb +44 -0
  38. data/test/test_special_locals.rb +35 -0
  39. metadata +182 -173
@@ -0,0 +1,44 @@
1
+
2
+ describe Pry do
3
+ describe "output failsafe" do
4
+ after do
5
+ Pry.config.print = Pry::DEFAULT_PRINT
6
+ end
7
+
8
+ it "should catch serialization exceptions" do
9
+ Pry.config.print = lambda { |*a| raise "catch-22" }
10
+
11
+ lambda {
12
+ mock_pry("1")
13
+ }.should.not.raise
14
+ end
15
+
16
+ it "should display serialization exceptions" do
17
+ Pry.config.print = lambda { |*a| raise "catch-22" }
18
+
19
+ mock_pry("1").should =~ /output error: #<RuntimeError: catch-22>/
20
+ end
21
+
22
+ it "should catch errors serializing exceptions" do
23
+ Pry.config.print = lambda do |*a|
24
+ raise Exception.new("catch-22").tap{ |e| class << e; def inspect; raise e; end; end }
25
+ end
26
+
27
+ mock_pry("1").should =~ /output error: failed to show result/
28
+ end
29
+ end
30
+
31
+ describe "DEFAULT_PRINT" do
32
+ it "should output the right thing" do
33
+ mock_pry("{:a => 1}").should =~ /\{:a=>1\}/
34
+ end
35
+
36
+ it "should not be phased by un-inspectable things" do
37
+ mock_pry("class NastyClass; undef pretty_inspect; end", "NastyClass.new").should =~ /#<NastyClass:0x[0-9a-f]+>/
38
+ end
39
+
40
+ it "should warn you about un-inspectable things" do
41
+ mock_pry("class NastyClass; undef pretty_inspect; end", "NastyClass.new").should =~ /output error: #<(NoMethodError|NameError): undefined method `pretty_inspect'/
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,35 @@
1
+ require 'helper'
2
+
3
+ describe "Special locals (_file_ and friends)" do
4
+ it 'locals should all exist upon initialization' do
5
+ mock_pry("_file_").should.not =~ /NameError/
6
+ mock_pry("_dir_").should.not =~ /NameError/
7
+ mock_pry("_ex_").should.not =~ /NameError/
8
+ mock_pry("_pry_").should.not =~ /NameError/
9
+ mock_pry("_").should.not =~ /NameError/
10
+ end
11
+
12
+ it 'locals should still exist after cd-ing into a new context' do
13
+ mock_pry("cd 0", "_file_").should.not =~ /NameError/
14
+ mock_pry("cd 0","_dir_").should.not =~ /NameError/
15
+ mock_pry("cd 0","_ex_").should.not =~ /NameError/
16
+ mock_pry("cd 0","_pry_").should.not =~ /NameError/
17
+ mock_pry("cd 0","_").should.not =~ /NameError/
18
+ end
19
+
20
+ it 'locals should keep value after cd-ing(_pry_ and _ex_)' do
21
+ mock_pry("$x = _pry_;", "cd 0", "_pry_ == $x").should =~ /true/
22
+ mock_pry("error blah;", "$x = _ex_;", "cd 0", "_ex_ == $x").should =~ /true/
23
+ end
24
+
25
+ it 'locals should keep value after cd-ing (_file_ and _dir_)' do
26
+ Pry.commands.command "file-and-dir-test" do
27
+ set_file_and_dir_locals("/blah/ostrich.rb")
28
+ end
29
+
30
+ mock_pry("file-and-dir-test", "cd 0", "_file_").should =~ /\/blah\/ostrich\.rb/
31
+ a = mock_pry("file-and-dir-test", "cd 0", "_dir_").should =~ /\/blah/
32
+ Pry.commands.delete "file-and-dir-test"
33
+ end
34
+
35
+ end
metadata CHANGED
@@ -2,171 +2,177 @@
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 5
5
- version: 0.9.4pre1
5
+ version: 0.9.4pre2
6
6
  platform: i386-mswin32
7
7
  authors:
8
- - John Mair (banisterfiend)
8
+ - John Mair (banisterfiend)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-19 00:00:00 Z
13
+ date: 2011-09-07 00:00:00 +12:00
14
+ default_executable:
14
15
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: ruby_parser
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 2.0.5
24
- type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: coderay
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 0.9.8
35
- type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: slop
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 1.9.0
46
- type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: method_source
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 0.6.0
57
- type: :runtime
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: bacon
61
- prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 1.1.0
68
- type: :development
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: open4
72
- prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: 1.0.1
79
- type: :development
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
82
- name: win32console
83
- prerelease: false
84
- requirement: &id007 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 1.3.0
90
- type: :runtime
91
- version_requirements: *id007
16
+ - !ruby/object:Gem::Dependency
17
+ name: ruby_parser
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 2.0.5
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: coderay
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 0.9.8
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: slop
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 2.1.0
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: method_source
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 0.6.5
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: bacon
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.0
69
+ type: :development
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: open4
73
+ prerelease: false
74
+ requirement: &id006 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: 1.0.1
80
+ type: :development
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: win32console
84
+ prerelease: false
85
+ requirement: &id007 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 1.3.0
91
+ type: :runtime
92
+ version_requirements: *id007
92
93
  description: An IRB alternative and runtime developer console
93
94
  email: jrmair@gmail.com
94
95
  executables:
95
- - pry
96
+ - pry
96
97
  extensions: []
97
98
 
98
99
  extra_rdoc_files: []
99
100
 
100
101
  files:
101
- - .document
102
- - .gemtest
103
- - .gitignore
104
- - .yardopts
105
- - CHANGELOG
106
- - CONTRIBUTORS
107
- - LICENSE
108
- - README.markdown
109
- - Rakefile
110
- - TODO
111
- - bin/pry
112
- - examples/example_basic.rb
113
- - examples/example_command_override.rb
114
- - examples/example_commands.rb
115
- - examples/example_hooks.rb
116
- - examples/example_image_edit.rb
117
- - examples/example_input.rb
118
- - examples/example_input2.rb
119
- - examples/example_output.rb
120
- - examples/example_print.rb
121
- - examples/example_prompt.rb
122
- - examples/helper.rb
123
- - lib/pry.rb
124
- - lib/pry/command_context.rb
125
- - lib/pry/command_processor.rb
126
- - lib/pry/command_set.rb
127
- - lib/pry/commands.rb
128
- - lib/pry/completion.rb
129
- - lib/pry/config.rb
130
- - lib/pry/core_extensions.rb
131
- - lib/pry/custom_completions.rb
132
- - lib/pry/default_commands/basic.rb
133
- - lib/pry/default_commands/context.rb
134
- - lib/pry/default_commands/documentation.rb
135
- - lib/pry/default_commands/easter_eggs.rb
136
- - lib/pry/default_commands/gems.rb
137
- - lib/pry/default_commands/input.rb
138
- - lib/pry/default_commands/introspection.rb
139
- - lib/pry/default_commands/ls.rb
140
- - lib/pry/default_commands/shell.rb
141
- - lib/pry/extended_commands/experimental.rb
142
- - lib/pry/extended_commands/user_command_api.rb
143
- - lib/pry/helpers.rb
144
- - lib/pry/helpers/base_helpers.rb
145
- - lib/pry/helpers/command_helpers.rb
146
- - lib/pry/helpers/text.rb
147
- - lib/pry/history_array.rb
148
- - lib/pry/plugins.rb
149
- - lib/pry/pry_class.rb
150
- - lib/pry/pry_instance.rb
151
- - lib/pry/version.rb
152
- - pry.gemspec
153
- - test/helper.rb
154
- - test/test_command_helpers.rb
155
- - test/test_command_processor.rb
156
- - test/test_command_set.rb
157
- - test/test_completion.rb
158
- - test/test_default_commands.rb
159
- - test/test_default_commands/test_context.rb
160
- - test/test_default_commands/test_documentation.rb
161
- - test/test_default_commands/test_gems.rb
162
- - test/test_default_commands/test_input.rb
163
- - test/test_default_commands/test_introspection.rb
164
- - test/test_history_array.rb
165
- - test/test_pry.rb
166
- - test/test_pry_history.rb
167
- - test/testrc
168
- - wiki/Customizing-pry.md
169
- - wiki/Home.md
102
+ - .document
103
+ - .gemtest
104
+ - .gitignore
105
+ - .yardopts
106
+ - CHANGELOG
107
+ - CONTRIBUTORS
108
+ - LICENSE
109
+ - README.markdown
110
+ - Rakefile
111
+ - TODO
112
+ - bin/pry
113
+ - examples/example_basic.rb
114
+ - examples/example_command_override.rb
115
+ - examples/example_commands.rb
116
+ - examples/example_hooks.rb
117
+ - examples/example_image_edit.rb
118
+ - examples/example_input.rb
119
+ - examples/example_input2.rb
120
+ - examples/example_output.rb
121
+ - examples/example_print.rb
122
+ - examples/example_prompt.rb
123
+ - examples/helper.rb
124
+ - lib/pry.rb
125
+ - lib/pry/command_context.rb
126
+ - lib/pry/command_processor.rb
127
+ - lib/pry/command_set.rb
128
+ - lib/pry/commands.rb
129
+ - lib/pry/completion.rb
130
+ - lib/pry/config.rb
131
+ - lib/pry/core_extensions.rb
132
+ - lib/pry/custom_completions.rb
133
+ - lib/pry/default_commands/basic.rb
134
+ - lib/pry/default_commands/context.rb
135
+ - lib/pry/default_commands/documentation.rb
136
+ - lib/pry/default_commands/easter_eggs.rb
137
+ - lib/pry/default_commands/gems.rb
138
+ - lib/pry/default_commands/input.rb
139
+ - lib/pry/default_commands/introspection.rb
140
+ - lib/pry/default_commands/ls.rb
141
+ - lib/pry/default_commands/shell.rb
142
+ - lib/pry/extended_commands/experimental.rb
143
+ - lib/pry/extended_commands/user_command_api.rb
144
+ - lib/pry/helpers.rb
145
+ - lib/pry/helpers/base_helpers.rb
146
+ - lib/pry/helpers/command_helpers.rb
147
+ - lib/pry/helpers/text.rb
148
+ - lib/pry/history.rb
149
+ - lib/pry/history_array.rb
150
+ - lib/pry/plugins.rb
151
+ - lib/pry/pry_class.rb
152
+ - lib/pry/pry_instance.rb
153
+ - lib/pry/version.rb
154
+ - pry.gemspec
155
+ - test/helper.rb
156
+ - test/test_command_helpers.rb
157
+ - test/test_command_processor.rb
158
+ - test/test_command_set.rb
159
+ - test/test_completion.rb
160
+ - test/test_default_commands.rb
161
+ - test/test_default_commands/test_context.rb
162
+ - test/test_default_commands/test_documentation.rb
163
+ - test/test_default_commands/test_gems.rb
164
+ - test/test_default_commands/test_input.rb
165
+ - test/test_default_commands/test_introspection.rb
166
+ - test/test_default_commands/test_shell.rb
167
+ - test/test_history_array.rb
168
+ - test/test_pry.rb
169
+ - test/test_pry_history.rb
170
+ - test/test_pry_output.rb
171
+ - test/test_special_locals.rb
172
+ - test/testrc
173
+ - wiki/Customizing-pry.md
174
+ - wiki/Home.md
175
+ has_rdoc: true
170
176
  homepage: http://pry.github.com
171
177
  licenses: []
172
178
 
@@ -174,39 +180,42 @@ post_install_message:
174
180
  rdoc_options: []
175
181
 
176
182
  require_paths:
177
- - lib
183
+ - lib
178
184
  required_ruby_version: !ruby/object:Gem::Requirement
179
185
  none: false
180
186
  requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- version: "0"
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: "0"
184
190
  required_rubygems_version: !ruby/object:Gem::Requirement
185
191
  none: false
186
192
  requirements:
187
- - - ">"
188
- - !ruby/object:Gem::Version
189
- version: 1.3.1
193
+ - - ">"
194
+ - !ruby/object:Gem::Version
195
+ version: 1.3.1
190
196
  requirements: []
191
197
 
192
198
  rubyforge_project:
193
- rubygems_version: 1.7.2
199
+ rubygems_version: 1.5.1
194
200
  signing_key:
195
201
  specification_version: 3
196
202
  summary: An IRB alternative and runtime developer console
197
203
  test_files:
198
- - test/helper.rb
199
- - test/test_command_helpers.rb
200
- - test/test_command_processor.rb
201
- - test/test_command_set.rb
202
- - test/test_completion.rb
203
- - test/test_default_commands.rb
204
- - test/test_default_commands/test_context.rb
205
- - test/test_default_commands/test_documentation.rb
206
- - test/test_default_commands/test_gems.rb
207
- - test/test_default_commands/test_input.rb
208
- - test/test_default_commands/test_introspection.rb
209
- - test/test_history_array.rb
210
- - test/test_pry.rb
211
- - test/test_pry_history.rb
212
- - test/testrc
204
+ - test/helper.rb
205
+ - test/test_command_helpers.rb
206
+ - test/test_command_processor.rb
207
+ - test/test_command_set.rb
208
+ - test/test_completion.rb
209
+ - test/test_default_commands.rb
210
+ - test/test_default_commands/test_context.rb
211
+ - test/test_default_commands/test_documentation.rb
212
+ - test/test_default_commands/test_gems.rb
213
+ - test/test_default_commands/test_input.rb
214
+ - test/test_default_commands/test_introspection.rb
215
+ - test/test_default_commands/test_shell.rb
216
+ - test/test_history_array.rb
217
+ - test/test_pry.rb
218
+ - test/test_pry_history.rb
219
+ - test/test_pry_output.rb
220
+ - test/test_special_locals.rb
221
+ - test/testrc