pry 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +21 -0
- data/Gemfile +2 -0
- data/README.markdown +15 -17
- data/Rakefile +1 -1
- data/bin/pry +8 -6
- data/examples/example_command_override.rb +1 -1
- data/lib/pry.rb +19 -4
- data/lib/pry/command_context.rb +1 -0
- data/lib/pry/command_processor.rb +1 -0
- data/lib/pry/command_set.rb +2 -2
- data/lib/pry/config.rb +15 -0
- data/lib/pry/default_commands/context.rb +8 -4
- data/lib/pry/default_commands/documentation.rb +18 -12
- data/lib/pry/default_commands/input.rb +120 -67
- data/lib/pry/default_commands/introspection.rb +112 -67
- data/lib/pry/default_commands/shell.rb +28 -17
- data/lib/pry/helpers/command_helpers.rb +73 -40
- data/lib/pry/history_array.rb +4 -0
- data/lib/pry/pry_class.rb +10 -6
- data/lib/pry/pry_instance.rb +57 -25
- data/lib/pry/version.rb +1 -1
- data/pry.gemspec +8 -8
- data/test/helper.rb +35 -1
- data/test/test_command_set.rb +1 -1
- data/test/test_default_commands/test_input.rb +30 -17
- data/test/test_default_commands/test_introspection.rb +334 -1
- data/test/test_default_commands/test_shell.rb +100 -5
- data/test/test_exception_whitelist.rb +17 -0
- data/test/test_input_stack.rb +70 -0
- data/test/test_pry.rb +26 -22
- data/test/test_pry_output.rb +2 -6
- metadata +66 -67
data/lib/pry/history_array.rb
CHANGED
data/lib/pry/pry_class.rb
CHANGED
@@ -6,7 +6,7 @@ require 'pry/config'
|
|
6
6
|
class Pry
|
7
7
|
|
8
8
|
# The RC Files to load.
|
9
|
-
RC_FILES = ["~/.pryrc"]
|
9
|
+
RC_FILES = ["~/.pryrc", "./.pryrc"]
|
10
10
|
|
11
11
|
# class accessors
|
12
12
|
class << self
|
@@ -51,7 +51,7 @@ class Pry
|
|
51
51
|
def_delegators :@plugin_manager, :plugins, :load_plugins, :locate_plugins
|
52
52
|
|
53
53
|
delegate_accessors :@config, :input, :output, :commands, :prompt, :print, :exception_handler,
|
54
|
-
:hooks, :color, :pager, :editor, :memory_size
|
54
|
+
:hooks, :color, :pager, :editor, :memory_size, :input_stack
|
55
55
|
end
|
56
56
|
|
57
57
|
# Load the rc files given in the `Pry::RC_FILES` array.
|
@@ -95,17 +95,17 @@ class Pry
|
|
95
95
|
new(options).repl(target)
|
96
96
|
end
|
97
97
|
|
98
|
-
#
|
99
|
-
# In case of > `
|
98
|
+
# An inspector that clips the output to `max_length` chars.
|
99
|
+
# In case of > `max_length` chars the `#<Object...> notation is used.
|
100
100
|
# @param obj The object to view.
|
101
|
-
# @param
|
101
|
+
# @param max_length The maximum number of chars before clipping occurs.
|
102
102
|
# @return [String] The string representation of `obj`.
|
103
103
|
def self.view_clip(obj, max_length = 60)
|
104
104
|
if obj.kind_of?(Module) && obj.name.to_s != "" && obj.name.to_s.length <= max_length
|
105
105
|
obj.name.to_s
|
106
106
|
elsif TOPLEVEL_BINDING.eval('self') == obj
|
107
107
|
# special case for 'main' object :)
|
108
|
-
obj.
|
108
|
+
obj.to_s
|
109
109
|
elsif [String, Numeric, Symbol, nil, true, false].any? { |v| v === obj } && obj.inspect.length <= max_length
|
110
110
|
obj.inspect
|
111
111
|
else
|
@@ -181,9 +181,13 @@ class Pry
|
|
181
181
|
config.prompt = DEFAULT_PROMPT
|
182
182
|
config.print = DEFAULT_PRINT
|
183
183
|
config.exception_handler = DEFAULT_EXCEPTION_HANDLER
|
184
|
+
config.exception_window_size = 5
|
185
|
+
config.exception_whitelist = DEFAULT_EXCEPTION_WHITELIST
|
184
186
|
config.hooks = DEFAULT_HOOKS
|
187
|
+
config.input_stack = []
|
185
188
|
config.color = true
|
186
189
|
config.pager = true
|
190
|
+
config.system = DEFAULT_SYSTEM
|
187
191
|
config.editor = default_editor_for_platform
|
188
192
|
config.should_load_rc = true
|
189
193
|
config.disable_auto_reload = false
|
data/lib/pry/pry_instance.rb
CHANGED
@@ -8,6 +8,8 @@ class Pry
|
|
8
8
|
attr_accessor :print
|
9
9
|
attr_accessor :exception_handler
|
10
10
|
attr_accessor :hooks
|
11
|
+
attr_accessor :input_stack
|
12
|
+
|
11
13
|
attr_accessor :custom_completions
|
12
14
|
|
13
15
|
attr_accessor :binding_stack
|
@@ -20,6 +22,7 @@ class Pry
|
|
20
22
|
attr_reader :input_array
|
21
23
|
attr_reader :output_array
|
22
24
|
|
25
|
+
|
23
26
|
# Create a new `Pry` object.
|
24
27
|
# @param [Hash] options The optional configuration parameters.
|
25
28
|
# @option options [#readline] :input The object to use for input.
|
@@ -45,7 +48,7 @@ class Pry
|
|
45
48
|
attributes = [
|
46
49
|
:input, :output, :commands, :print,
|
47
50
|
:exception_handler, :hooks, :custom_completions,
|
48
|
-
:prompt, :memory_size
|
51
|
+
:prompt, :memory_size, :input_stack
|
49
52
|
]
|
50
53
|
|
51
54
|
attributes.each do |attribute|
|
@@ -140,7 +143,7 @@ class Pry
|
|
140
143
|
exec_hook :before_session, output, target, self
|
141
144
|
initialize_special_locals(target)
|
142
145
|
|
143
|
-
@input_array << nil # add empty input so
|
146
|
+
@input_array << nil # add empty input so _in_ and _out_ match
|
144
147
|
|
145
148
|
Pry.active_sessions += 1
|
146
149
|
binding_stack.push target
|
@@ -148,14 +151,12 @@ class Pry
|
|
148
151
|
|
149
152
|
# Clean-up after the repl session.
|
150
153
|
# @param [Binding] target The target binding for the session.
|
151
|
-
|
152
|
-
def repl_epilogue(target, break_data)
|
154
|
+
def repl_epilogue(target)
|
153
155
|
exec_hook :after_session, output, target, self
|
154
156
|
|
155
157
|
Pry.active_sessions -= 1
|
156
158
|
binding_stack.pop
|
157
159
|
Pry.save_history if Pry.config.history.should_save && Pry.active_sessions == 0
|
158
|
-
break_data
|
159
160
|
end
|
160
161
|
|
161
162
|
# Start a read-eval-print-loop.
|
@@ -178,8 +179,8 @@ class Pry
|
|
178
179
|
end
|
179
180
|
end
|
180
181
|
|
181
|
-
|
182
|
-
|
182
|
+
repl_epilogue(target)
|
183
|
+
break_data || target_self
|
183
184
|
end
|
184
185
|
|
185
186
|
# Perform a read-eval-print.
|
@@ -254,7 +255,7 @@ class Pry
|
|
254
255
|
# Output the result or pass to an exception handler (if result is an exception).
|
255
256
|
def show_result(result)
|
256
257
|
if last_result_is_exception?
|
257
|
-
exception_handler.call output, result
|
258
|
+
exception_handler.call output, result, self
|
258
259
|
else
|
259
260
|
print.call output, result
|
260
261
|
end
|
@@ -263,12 +264,12 @@ class Pry
|
|
263
264
|
# serialize something in the user's program, let's not assume we can serialize
|
264
265
|
# the exception either.
|
265
266
|
begin
|
266
|
-
output.puts "output error: #{e.inspect}"
|
267
|
+
output.puts "(pry) output error: #{e.inspect}"
|
267
268
|
rescue RescuableException => e
|
268
269
|
if last_result_is_exception?
|
269
|
-
output.puts "output error: failed to show exception"
|
270
|
+
output.puts "(pry) output error: failed to show exception"
|
270
271
|
else
|
271
|
-
output.puts "output error: failed to show result"
|
272
|
+
output.puts "(pry) output error: failed to show result"
|
272
273
|
end
|
273
274
|
end
|
274
275
|
end
|
@@ -319,6 +320,16 @@ class Pry
|
|
319
320
|
end
|
320
321
|
end
|
321
322
|
|
323
|
+
# Run the specified command.
|
324
|
+
# @param [String] The command (and its params) to execute.
|
325
|
+
# @param [Binding] The binding to use..
|
326
|
+
# @example
|
327
|
+
# pry_instance.run_command("ls -m")
|
328
|
+
def run_command(val, target = binding_stack.last)
|
329
|
+
process_line(val, "", target)
|
330
|
+
Pry::CommandContext::VOID_VALUE
|
331
|
+
end
|
332
|
+
|
322
333
|
# Set the last result of an eval.
|
323
334
|
# This method should not need to be invoked directly.
|
324
335
|
# @param [Object] result The result.
|
@@ -336,11 +347,15 @@ class Pry
|
|
336
347
|
# @param [Binding] target The binding to set `_ex_` on.
|
337
348
|
def set_last_exception(ex, target)
|
338
349
|
class << ex
|
339
|
-
attr_accessor :file, :line
|
350
|
+
attr_accessor :file, :line, :bt_index
|
351
|
+
def bt_source_location_for(index)
|
352
|
+
backtrace[index] =~ /(.*):(\d+)/
|
353
|
+
[$1, $2.to_i]
|
354
|
+
end
|
340
355
|
end
|
341
356
|
|
342
|
-
ex.
|
343
|
-
ex.file, ex.line =
|
357
|
+
ex.bt_index = 0
|
358
|
+
ex.file, ex.line = ex.bt_source_location_for(0)
|
344
359
|
|
345
360
|
@last_result_is_exception = true
|
346
361
|
@output_array << ex
|
@@ -367,27 +382,44 @@ class Pry
|
|
367
382
|
@last_result_is_exception
|
368
383
|
end
|
369
384
|
|
385
|
+
# Manage switching of input objects on encountering EOFErrors
|
386
|
+
def handle_read_errors
|
387
|
+
should_retry = true
|
388
|
+
begin
|
389
|
+
yield
|
390
|
+
rescue EOFError
|
391
|
+
if input_stack.empty?
|
392
|
+
self.input = Pry.config.input
|
393
|
+
if !should_retry
|
394
|
+
output.puts "Error: Pry ran out of things to read from! Attempting to break out of REPL."
|
395
|
+
throw(:breakout)
|
396
|
+
end
|
397
|
+
should_retry = false
|
398
|
+
else
|
399
|
+
self.input = input_stack.pop
|
400
|
+
end
|
401
|
+
retry
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
private :handle_read_errors
|
406
|
+
|
370
407
|
# Returns the next line of input to be used by the pry instance.
|
371
408
|
# This method should not need to be invoked directly.
|
372
409
|
# @param [String] current_prompt The prompt to use for input.
|
373
410
|
# @return [String] The next line of input.
|
374
411
|
def readline(current_prompt="> ")
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
begin
|
412
|
+
handle_read_errors do
|
413
|
+
if input == Readline
|
414
|
+
line = input.readline(current_prompt, false)
|
415
|
+
Pry.history << line.dup if line
|
416
|
+
line
|
417
|
+
else
|
382
418
|
if input.method(:readline).arity == 1
|
383
419
|
input.readline(current_prompt)
|
384
420
|
else
|
385
421
|
input.readline
|
386
422
|
end
|
387
|
-
|
388
|
-
rescue EOFError
|
389
|
-
self.input = Pry.input
|
390
|
-
""
|
391
423
|
end
|
392
424
|
end
|
393
425
|
end
|
data/lib/pry/version.rb
CHANGED
data/pry.gemspec
CHANGED
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{pry}
|
5
|
-
s.version = "0.9.
|
5
|
+
s.version = "0.9.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date = %q{2011-09-
|
8
|
+
s.authors = [%q{John Mair (banisterfiend)}]
|
9
|
+
s.date = %q{2011-09-19}
|
10
10
|
s.description = %q{An IRB alternative and runtime developer console}
|
11
11
|
s.email = %q{jrmair@gmail.com}
|
12
|
-
s.executables = [
|
13
|
-
s.files = [
|
12
|
+
s.executables = [%q{pry}]
|
13
|
+
s.files = [%q{.document}, %q{.gemtest}, %q{.gitignore}, %q{.yardopts}, %q{CHANGELOG}, %q{CONTRIBUTORS}, %q{Gemfile}, %q{LICENSE}, %q{README.markdown}, %q{Rakefile}, %q{TODO}, %q{bin/pry}, %q{examples/example_basic.rb}, %q{examples/example_command_override.rb}, %q{examples/example_commands.rb}, %q{examples/example_hooks.rb}, %q{examples/example_image_edit.rb}, %q{examples/example_input.rb}, %q{examples/example_input2.rb}, %q{examples/example_output.rb}, %q{examples/example_print.rb}, %q{examples/example_prompt.rb}, %q{examples/helper.rb}, %q{lib/pry.rb}, %q{lib/pry/command_context.rb}, %q{lib/pry/command_processor.rb}, %q{lib/pry/command_set.rb}, %q{lib/pry/commands.rb}, %q{lib/pry/completion.rb}, %q{lib/pry/config.rb}, %q{lib/pry/core_extensions.rb}, %q{lib/pry/custom_completions.rb}, %q{lib/pry/default_commands/basic.rb}, %q{lib/pry/default_commands/context.rb}, %q{lib/pry/default_commands/documentation.rb}, %q{lib/pry/default_commands/easter_eggs.rb}, %q{lib/pry/default_commands/gems.rb}, %q{lib/pry/default_commands/input.rb}, %q{lib/pry/default_commands/introspection.rb}, %q{lib/pry/default_commands/ls.rb}, %q{lib/pry/default_commands/shell.rb}, %q{lib/pry/extended_commands/experimental.rb}, %q{lib/pry/extended_commands/user_command_api.rb}, %q{lib/pry/helpers.rb}, %q{lib/pry/helpers/base_helpers.rb}, %q{lib/pry/helpers/command_helpers.rb}, %q{lib/pry/helpers/text.rb}, %q{lib/pry/history.rb}, %q{lib/pry/history_array.rb}, %q{lib/pry/plugins.rb}, %q{lib/pry/pry_class.rb}, %q{lib/pry/pry_instance.rb}, %q{lib/pry/version.rb}, %q{pry.gemspec}, %q{test/helper.rb}, %q{test/test_command_helpers.rb}, %q{test/test_command_processor.rb}, %q{test/test_command_set.rb}, %q{test/test_completion.rb}, %q{test/test_default_commands.rb}, %q{test/test_default_commands/test_context.rb}, %q{test/test_default_commands/test_documentation.rb}, %q{test/test_default_commands/test_gems.rb}, %q{test/test_default_commands/test_input.rb}, %q{test/test_default_commands/test_introspection.rb}, %q{test/test_default_commands/test_shell.rb}, %q{test/test_exception_whitelist.rb}, %q{test/test_history_array.rb}, %q{test/test_input_stack.rb}, %q{test/test_pry.rb}, %q{test/test_pry_history.rb}, %q{test/test_pry_output.rb}, %q{test/test_special_locals.rb}, %q{test/testrc}, %q{wiki/Customizing-pry.md}, %q{wiki/Home.md}]
|
14
14
|
s.homepage = %q{http://pry.github.com}
|
15
|
-
s.require_paths = [
|
16
|
-
s.rubygems_version = %q{1.
|
15
|
+
s.require_paths = [%q{lib}]
|
16
|
+
s.rubygems_version = %q{1.8.6}
|
17
17
|
s.summary = %q{An IRB alternative and runtime developer console}
|
18
|
-
s.test_files = [
|
18
|
+
s.test_files = [%q{test/helper.rb}, %q{test/test_command_helpers.rb}, %q{test/test_command_processor.rb}, %q{test/test_command_set.rb}, %q{test/test_completion.rb}, %q{test/test_default_commands.rb}, %q{test/test_default_commands/test_context.rb}, %q{test/test_default_commands/test_documentation.rb}, %q{test/test_default_commands/test_gems.rb}, %q{test/test_default_commands/test_input.rb}, %q{test/test_default_commands/test_introspection.rb}, %q{test/test_default_commands/test_shell.rb}, %q{test/test_exception_whitelist.rb}, %q{test/test_history_array.rb}, %q{test/test_input_stack.rb}, %q{test/test_pry.rb}, %q{test/test_pry_history.rb}, %q{test/test_pry_output.rb}, %q{test/test_special_locals.rb}, %q{test/testrc}]
|
19
19
|
|
20
20
|
if s.respond_to? :specification_version then
|
21
21
|
s.specification_version = 3
|
data/test/helper.rb
CHANGED
@@ -3,6 +3,8 @@ unless Object.const_defined? 'Pry'
|
|
3
3
|
require 'pry'
|
4
4
|
end
|
5
5
|
|
6
|
+
puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), Pry v#{Pry::VERSION}, method_source v#{MethodSource::VERSION}"
|
7
|
+
|
6
8
|
require 'bacon'
|
7
9
|
require 'open4'
|
8
10
|
|
@@ -25,6 +27,25 @@ class << Pry
|
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
30
|
+
class MockPryException
|
31
|
+
attr_accessor :bt_index
|
32
|
+
attr_accessor :backtrace
|
33
|
+
|
34
|
+
def initialize(*backtrace)
|
35
|
+
@backtrace = backtrace
|
36
|
+
@bt_index = 0
|
37
|
+
end
|
38
|
+
|
39
|
+
def message
|
40
|
+
"mock exception"
|
41
|
+
end
|
42
|
+
|
43
|
+
def bt_source_location_for(index)
|
44
|
+
backtrace[index] =~ /(.*):(\d+)/
|
45
|
+
[$1, $2.to_i]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
28
49
|
# are we on Jruby platform?
|
29
50
|
def jruby?
|
30
51
|
defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
|
@@ -52,7 +73,11 @@ def another_sample_method
|
|
52
73
|
:another_sample
|
53
74
|
end
|
54
75
|
|
55
|
-
|
76
|
+
# Set I/O streams.
|
77
|
+
#
|
78
|
+
# Out defaults to an anonymous StringIO.
|
79
|
+
#
|
80
|
+
def redirect_pry_io(new_in, new_out = StringIO.new)
|
56
81
|
old_in = Pry.input
|
57
82
|
old_out = Pry.output
|
58
83
|
|
@@ -130,6 +155,15 @@ class Pry
|
|
130
155
|
end
|
131
156
|
end
|
132
157
|
|
158
|
+
# Open a temp file and yield it to the block, closing it after
|
159
|
+
# @return [String] The path of the temp file
|
160
|
+
def temp_file
|
161
|
+
file = Tempfile.new("tmp")
|
162
|
+
yield file
|
163
|
+
ensure
|
164
|
+
file.close
|
165
|
+
end
|
166
|
+
|
133
167
|
|
134
168
|
CommandTester = Pry::CommandSet.new do
|
135
169
|
command "command1", "command 1 test" do
|
data/test/test_command_set.rb
CHANGED
@@ -99,7 +99,7 @@ describe Pry::CommandSet do
|
|
99
99
|
|
100
100
|
@set.alias_command 'bar', 'foo'
|
101
101
|
@set.commands['bar'].name.should == 'bar'
|
102
|
-
@set.commands['bar'].description.should == '
|
102
|
+
@set.commands['bar'].description.should == ''
|
103
103
|
|
104
104
|
@set.run_command nil, 'bar'
|
105
105
|
run.should == true
|
@@ -55,7 +55,7 @@ describe "Pry::DefaultCommands::Input" do
|
|
55
55
|
pry
|
56
56
|
end
|
57
57
|
|
58
|
-
str_output.string.should =~ /\A\d+: def hello\n\d+: puts :bing\n\d+: puts \"
|
58
|
+
str_output.string.should =~ /\A\d+: def hello\n\d+: puts :bing\n\d+: puts \"\#\{goodbye\}\"/
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'should display error if nothing to amend' do
|
@@ -184,35 +184,54 @@ describe "Pry::DefaultCommands::Input" do
|
|
184
184
|
$o = nil
|
185
185
|
end
|
186
186
|
|
187
|
+
it 'should APPEND to the input buffer when playing a line with play -m, not replace it' do
|
188
|
+
$o = Object.new
|
189
|
+
def $o.test_method
|
190
|
+
:test_method_content
|
191
|
+
end
|
192
|
+
|
193
|
+
redirect_pry_io(InputTester.new('def another_test_method', 'play -m $o.test_method --lines 2', 'show-input', 'exit-all'), str_output = StringIO.new) do
|
194
|
+
pry
|
195
|
+
end
|
196
|
+
str_output.string.should =~ /def another_test_method/
|
197
|
+
str_output.string.should =~ /:test_method_content/
|
198
|
+
$o = nil
|
199
|
+
end
|
200
|
+
|
201
|
+
|
187
202
|
it 'should play a method with the -m switch (multiple line)' do
|
188
203
|
$o = Object.new
|
204
|
+
class << $o
|
205
|
+
attr_accessor :var1, :var2
|
206
|
+
end
|
207
|
+
|
189
208
|
def $o.test_method
|
190
|
-
|
191
|
-
|
209
|
+
@var1 = 20
|
210
|
+
@var2 = 30
|
192
211
|
end
|
193
212
|
|
213
|
+
obj = Object.new
|
214
|
+
b = Pry.binding_for(obj)
|
215
|
+
|
194
216
|
redirect_pry_io(InputTester.new('play -m $o.test_method --lines 2..3', "exit-all"), str_output = StringIO.new) do
|
195
|
-
pry
|
217
|
+
b.pry
|
196
218
|
end
|
197
219
|
|
198
|
-
|
199
|
-
|
220
|
+
obj.instance_variable_get(:@var1).should == 20
|
221
|
+
obj.instance_variable_get(:@var2).should == 30
|
222
|
+
str_output.string.should =~ /30/
|
223
|
+
str_output.string.should.not =~ /20/
|
200
224
|
end
|
201
225
|
|
202
226
|
end
|
203
227
|
|
204
228
|
describe "hist" do
|
205
|
-
push_first_hist_line = lambda do |hist, line|
|
206
|
-
hist.push line
|
207
|
-
end
|
208
|
-
|
209
229
|
before do
|
210
230
|
Pry.history.clear
|
211
231
|
@hist = Pry.history
|
212
232
|
end
|
213
233
|
|
214
234
|
it 'should display the correct history' do
|
215
|
-
push_first_hist_line.call(@hist, "'bug in 1.8 means this line is ignored'")
|
216
235
|
@hist.push "hello"
|
217
236
|
@hist.push "world"
|
218
237
|
str_output = StringIO.new
|
@@ -223,7 +242,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
223
242
|
end
|
224
243
|
|
225
244
|
it 'should replay history correctly (single item)' do
|
226
|
-
push_first_hist_line.call(@hist, ":hello")
|
227
245
|
@hist.push ":blah"
|
228
246
|
@hist.push ":bucket"
|
229
247
|
@hist.push ":ostrich"
|
@@ -235,7 +253,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
235
253
|
end
|
236
254
|
|
237
255
|
it 'should replay a range of history correctly (range of items)' do
|
238
|
-
push_first_hist_line.call(@hist, "'bug in 1.8 means this line is ignored'")
|
239
256
|
@hist.push ":hello"
|
240
257
|
@hist.push ":carl"
|
241
258
|
str_output = StringIO.new
|
@@ -246,7 +263,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
246
263
|
end
|
247
264
|
|
248
265
|
it 'should grep for correct lines in history' do
|
249
|
-
push_first_hist_line.call(@hist, "apple")
|
250
266
|
@hist.push "abby"
|
251
267
|
@hist.push "box"
|
252
268
|
@hist.push "button"
|
@@ -279,7 +295,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
279
295
|
end
|
280
296
|
|
281
297
|
it 'should return last N lines in history with --tail switch' do
|
282
|
-
push_first_hist_line.call(@hist, "0")
|
283
298
|
("a".."z").each do |v|
|
284
299
|
@hist.push v
|
285
300
|
end
|
@@ -296,7 +311,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
296
311
|
# strangeness in this test is due to bug in Readline::HISTORY not
|
297
312
|
# always registering first line of input
|
298
313
|
it 'should return first N lines in history with --head switch' do
|
299
|
-
push_first_hist_line.call(@hist, "0")
|
300
314
|
("a".."z").each do |v|
|
301
315
|
@hist.push v
|
302
316
|
end
|
@@ -313,7 +327,6 @@ describe "Pry::DefaultCommands::Input" do
|
|
313
327
|
# strangeness in this test is due to bug in Readline::HISTORY not
|
314
328
|
# always registering first line of input
|
315
329
|
it 'should show lines between lines A and B with the --show switch' do
|
316
|
-
push_first_hist_line.call(@hist, "0")
|
317
330
|
("a".."z").each do |v|
|
318
331
|
@hist.push v
|
319
332
|
end
|