lib/pry-moves/formatter.rb in pry-moves-1.0.11 vs lib/pry-moves/formatter.rb in pry-moves-1.0.12
- old
+ new
@@ -55,15 +55,12 @@
def cut_string str
return str unless str
str.length > 50 ? "#{str.first 50}..." : str
end
- def path_trash
- @path_trash ||= defined?(Rails) ? Rails.root.to_s : Dir.pwd
- end
-
def shorten_path(path)
- path = path.gsub( /^#{path_trash}\//, '')
+ project_root = PryMoves.project_root
+ path = path.gsub( /^#{project_root}\//, '')
PryMoves::Backtrace.trim_path ?
File.basename(path, ".*") : path
end
def format_obj(obj)