mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Pry::Command::Cat::FileFormatter: make format() private
This commit is contained in:
parent
4c56c73e9d
commit
86206767f0
2 changed files with 10 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -25,6 +25,7 @@ class Pry
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
def selected_input_items
|
||||
input_expressions[normalized_expression_range] || []
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue