pry 0.8.0pre8-i386-mswin32 → 0.8.0pre9-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/lib/pry/commands.rb CHANGED
@@ -23,9 +23,34 @@ class Pry
23
23
  Pry.start(target)
24
24
  end
25
25
 
26
+ # this cannot be accessed, it's just for help purposed.
26
27
  command ".<shell command>", "All text following a '.' is forwarded to the shell." do
27
28
  end
28
29
 
30
+ command "hist", "Show and replay Readline history" do |*args|
31
+ require 'slop'
32
+ if args.empty?
33
+ text = add_line_numbers(Readline::HISTORY.to_a.join("\n"), 0)
34
+ stagger_output(text)
35
+ next
36
+ end
37
+
38
+ opts = Slop.parse(args) do
39
+ banner "Usage: hist [-rSTART..END]"
40
+ on :r, :replay, 'The line (or range of lines) to replay.', true, :as => Range do |r|
41
+ options[:r].argument_value = r.to_i if r.is_a?(String)
42
+ end
43
+ on :h, :help, 'Show this message.', :tail => true do
44
+ output.puts help
45
+ end
46
+ end
47
+
48
+ next if opts.h?
49
+
50
+ actions = Array(Readline::HISTORY.to_a[opts[:r]]).join("\n") + "\n"
51
+ Pry.active_instance.input = StringIO.new(actions)
52
+ end
53
+
29
54
  command "exit-program", "End the current program. Aliases: quit-program, !!!" do
30
55
  exit
31
56
  end
@@ -193,10 +193,7 @@ class Pry
193
193
  loop do
194
194
  val = retrieve_line(eval_string, target)
195
195
  process_line(val, eval_string, target)
196
- if valid_expression?(eval_string)
197
- redo if null_input?(val)
198
- break
199
- end
196
+ break if valid_expression?(eval_string) && !null_input?(val)
200
197
  end
201
198
 
202
199
  @suppress_output = true if eval_string =~ /;\Z/
@@ -276,10 +273,22 @@ class Pry
276
273
  # as it has a second parameter.
277
274
  input.readline(current_prompt, true)
278
275
  else
279
- if input.method(:readline).arity == 1
280
- input.readline(current_prompt)
281
- else
282
- input.readline
276
+ begin
277
+ if input.method(:readline).arity == 1
278
+ input.readline(current_prompt)
279
+ else
280
+ input.readline
281
+ end
282
+ rescue Exception => ex
283
+ self.input = Readline
284
+ ""
285
+
286
+ # FIX ME!!!
287
+ # failing test is due to null_input?() being true for a
288
+ # command that doesn't return a value. This causes a EOFError
289
+ # exception for a 'rep' (as in test) as it makes the read loop
290
+ # redo and so it tries to read from a non-existent string
291
+ # binding.pry
283
292
  end
284
293
  end
285
294
  end
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.8.0pre8"
2
+ VERSION = "0.8.0pre9"
3
3
  end
data/test/test.rb CHANGED
@@ -380,7 +380,7 @@ describe Pry do
380
380
  end
381
381
  end
382
382
  str_output = StringIO.new
383
- Pry.new(:input => StringIO.new("hello"), :output => str_output, :commands => Command68).rep
383
+ Pry.new(:input => StringIO.new("hello\n"), :output => str_output, :commands => Command68).rep
384
384
  str_output.string.should =~ /:kept_hello/
385
385
 
386
386
  Object.remove_const(:Command68)
@@ -393,7 +393,7 @@ describe Pry do
393
393
  end
394
394
  end
395
395
  str_output = StringIO.new
396
- Pry.new(:input => StringIO.new("hello"), :output => str_output, :commands => Command68).rep
396
+ Pry.new(:input => StringIO.new("hello\n"), :output => str_output, :commands => Command68).rep
397
397
  (str_output.string =~ /:kept_hello/).should == nil
398
398
 
399
399
  Object.remove_const(:Command68)
metadata CHANGED
@@ -1,142 +1,118 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
5
- segments:
6
- - 0
7
- - 8
8
- - 0pre8
9
- version: 0.8.0pre8
4
+ prerelease: 5
5
+ version: 0.8.0pre9
10
6
  platform: i386-mswin32
11
7
  authors:
12
- - John Mair (banisterfiend)
8
+ - John Mair (banisterfiend)
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-04-13 00:00:00 +12:00
13
+ date: 2011-04-15 00:00:00 +12:00
18
14
  default_executable:
19
15
  dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: ruby_parser
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 2
30
- - 0
31
- - 5
32
- version: 2.0.5
33
- type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: coderay
37
- prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 9
46
- - 7
47
- version: 0.9.7
48
- type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: bacon
52
- prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 1
60
- - 1
61
- - 0
62
- version: 1.1.0
63
- type: :development
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: method_source
67
- prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 0
75
- - 4
76
- - 0
77
- version: 0.4.0
78
- type: :runtime
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: win32console
82
- prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
84
- none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- segments:
89
- - 1
90
- - 3
91
- - 0
92
- version: 1.3.0
93
- type: :runtime
94
- version_requirements: *id005
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.7
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: bacon
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.1.0
47
+ type: :development
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.4.0
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: win32console
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.0
69
+ type: :runtime
70
+ version_requirements: *id005
95
71
  description: attach an irb-like session to any object at runtime
96
72
  email: jrmair@gmail.com
97
73
  executables:
98
- - pry
74
+ - pry
99
75
  extensions: []
100
76
 
101
77
  extra_rdoc_files: []
102
78
 
103
79
  files:
104
- - lib/pry/commands.rb
105
- - lib/pry/version.rb
106
- - lib/pry/TAGS
107
- - lib/pry/command_base.rb
108
- - lib/pry/prompts.rb
109
- - lib/pry/hooks.rb
110
- - lib/pry/custom_completions.rb
111
- - lib/pry/core_extensions.rb
112
- - lib/pry/command_helpers.rb
113
- - lib/pry/command_processor.rb
114
- - lib/pry/completion.rb
115
- - lib/pry/print.rb
116
- - lib/pry/pry_class.rb
117
- - lib/pry/command_base_helpers.rb
118
- - lib/pry/pry_instance.rb
119
- - lib/pry.rb
120
- - examples/example_commands.rb
121
- - examples/example_image_edit.rb
122
- - examples/example_input2.rb
123
- - examples/example_prompt.rb
124
- - examples/example_command_override.rb
125
- - examples/example_output.rb
126
- - examples/example_hooks.rb
127
- - examples/example_print.rb
128
- - examples/example_basic.rb
129
- - examples/example_input.rb
130
- - test/test.rb
131
- - test/test_helper.rb
132
- - test/testrc
133
- - CHANGELOG
134
- - LICENSE
135
- - README.markdown
136
- - Rakefile
137
- - .gemtest
138
- - bin/pry
139
- has_rdoc: yard
80
+ - lib/pry.rb
81
+ - lib/pry/commands.rb
82
+ - lib/pry/version.rb
83
+ - lib/pry/TAGS
84
+ - lib/pry/command_base.rb
85
+ - lib/pry/prompts.rb
86
+ - lib/pry/hooks.rb
87
+ - lib/pry/custom_completions.rb
88
+ - lib/pry/core_extensions.rb
89
+ - lib/pry/command_helpers.rb
90
+ - lib/pry/command_processor.rb
91
+ - lib/pry/completion.rb
92
+ - lib/pry/print.rb
93
+ - lib/pry/pry_class.rb
94
+ - lib/pry/command_base_helpers.rb
95
+ - lib/pry/pry_instance.rb
96
+ - examples/example_commands.rb
97
+ - examples/example_image_edit.rb
98
+ - examples/example_input2.rb
99
+ - examples/example_prompt.rb
100
+ - examples/example_command_override.rb
101
+ - examples/example_output.rb
102
+ - examples/example_hooks.rb
103
+ - examples/example_print.rb
104
+ - examples/example_basic.rb
105
+ - examples/example_input.rb
106
+ - test/test.rb
107
+ - test/test_helper.rb
108
+ - test/testrc
109
+ - CHANGELOG
110
+ - LICENSE
111
+ - README.markdown
112
+ - Rakefile
113
+ - .gemtest
114
+ - bin/pry
115
+ has_rdoc: true
140
116
  homepage: http://banisterfiend.wordpress.com
141
117
  licenses: []
142
118
 
@@ -144,29 +120,23 @@ post_install_message:
144
120
  rdoc_options: []
145
121
 
146
122
  require_paths:
147
- - lib
123
+ - lib
148
124
  required_ruby_version: !ruby/object:Gem::Requirement
149
125
  none: false
150
126
  requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- segments:
154
- - 0
155
- version: "0"
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: "0"
156
130
  required_rubygems_version: !ruby/object:Gem::Requirement
157
131
  none: false
158
132
  requirements:
159
- - - ">"
160
- - !ruby/object:Gem::Version
161
- segments:
162
- - 1
163
- - 3
164
- - 1
165
- version: 1.3.1
133
+ - - ">"
134
+ - !ruby/object:Gem::Version
135
+ version: 1.3.1
166
136
  requirements: []
167
137
 
168
138
  rubyforge_project:
169
- rubygems_version: 1.3.7
139
+ rubygems_version: 1.5.1
170
140
  signing_key:
171
141
  specification_version: 3
172
142
  summary: attach an irb-like session to any object at runtime