Permalink
Browse files

Directify specs for save-file and cat

  • Loading branch information...
rf- committed Aug 19, 2012
1 parent 699c3aa commit f4c3ada10ac01bbb7e86a5f18f11f31d4f6e0992
View
@@ -36,7 +36,6 @@ class << self
# @param [Symbol] code_type The type of code the file contains.
# @return [Code]
def from_file(fn, code_type=type_from_filename(fn))
-
if fn == Pry.eval_path
new(Pry.line_buffer.drop(1), 1, code_type)
else
View
@@ -426,6 +426,7 @@ def retrieve_line(eval_string, target)
# @param [Binding] target The target of the Pry session.
# @return [Boolean] `true` if `val` is a command, `false` otherwise
def process_command(val, eval_string = '', target = binding_stack.last)
+ val = val.chomp
result = commands.process_line(val, {
:target => target,
:output => output,
View
@@ -230,6 +230,7 @@ def eval(*strs)
result = nil
strs.flatten.each do |str|
+ str = "#{str}\n" unless str.end_with?("\n")
if @pry.process_command(str)
result = last_command_result_or_output
else
@@ -268,7 +268,7 @@ def last_exception=(exception)
end
it "should edit a range of lines if a range is given" do
- pry_eval "10\n", "11\n", "edit -i 1,2"
+ pry_eval "10", "11", "edit -i 1,2"
@contents.should == "10\n11\n"
end
Oops, something went wrong.

0 comments on commit f4c3ada

Please sign in to comment.