Pry::Command::Cat::FileFormatter: make format() private

This commit is contained in:
John Mair 2013-01-07 23:10:16 +01:00
parent 4c56c73e9d
commit 86206767f0
2 changed files with 10 additions and 9 deletions

View File

@ -11,6 +11,15 @@ class Pry
@_pry_ = _pry_
end
def format
raise CommandError, "Must provide a filename, --in, or --ex." if !file_with_embedded_line
set_file_and_dir_locals(file_name, _pry_, _pry_.current_context)
decorate(Pry::Code.from_file(file_name))
end
private
def file_and_line
file_name, line_num = file_with_embedded_line.split(':')
@ -29,15 +38,6 @@ class Pry
Pry.config.default_window_size || 7
end
def format
raise CommandError, "Must provide a filename, --in, or --ex." if !file_with_embedded_line
set_file_and_dir_locals(file_name, _pry_, _pry_.current_context)
decorate(Pry::Code.from_file(file_name))
end
private
def decorate(content)
line_number ? super.around(line_number, code_window_size) : super
end

View File

@ -25,6 +25,7 @@ class Pry
end
private
def selected_input_items
input_expressions[normalized_expression_range] || []
end