command_helpers.rb: move `set_file_and_dir_locals` from BaseHelpers
Partially fixes (probaby not at all) #705 (Helpers can't be used on their own) `set_file_and_dir_locals` is used *only* in commands.
This commit is contained in:
parent
022ca374af
commit
b867523247
|
@ -42,15 +42,6 @@ class Pry
|
|||
end
|
||||
end
|
||||
|
||||
def set_file_and_dir_locals(file_name, _pry_=_pry_(), target=target())
|
||||
return if !target or !file_name
|
||||
_pry_.last_file = File.expand_path(file_name)
|
||||
_pry_.inject_local("_file_", _pry_.last_file, target)
|
||||
|
||||
_pry_.last_dir = File.dirname(_pry_.last_file)
|
||||
_pry_.inject_local("_dir_", _pry_.last_dir, target)
|
||||
end
|
||||
|
||||
def use_ansi_codes?
|
||||
windows_ansi? || ENV['TERM'] && ENV['TERM'] != "dumb"
|
||||
end
|
||||
|
|
|
@ -149,6 +149,16 @@ class Pry
|
|||
|
||||
Range.new(a, b)
|
||||
end
|
||||
|
||||
def set_file_and_dir_locals(file_name, _pry_=_pry_(), target=target())
|
||||
return if !target or !file_name
|
||||
_pry_.last_file = File.expand_path(file_name)
|
||||
_pry_.inject_local("_file_", _pry_.last_file, target)
|
||||
|
||||
_pry_.last_dir = File.dirname(_pry_.last_file)
|
||||
_pry_.inject_local("_dir_", _pry_.last_dir, target)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue