Method: Tetra::Subcommand#format_path

Defined in:
lib/tetra/ui/subcommand.rb

#format_path(path, project) ⇒ Object

generates a version of path relative to the current directory



77
78
79
80
81
82
83
84
85
86
# File 'lib/tetra/ui/subcommand.rb', line 77

def format_path(path, project)
  full_path = (
    if Pathname.new(path).relative?
      File.join(project.full_path, path)
    else
      path
    end
  )
  Pathname.new(full_path).relative_path_from(Pathname.new(Dir.pwd))
end