module Dire::Module::Path

Public Instance Methods

absolute_path() click to toggle source
# File lib/dire/module/path.rb, line 2
def absolute_path
  path
end
name() click to toggle source
# File lib/dire/module/path.rb, line 6
def name
  absolute_path.basename.to_s
end
param() click to toggle source
# File lib/dire/module/path.rb, line 10
def param
  relative_path.to_s
end
relative_path() click to toggle source
# File lib/dire/module/path.rb, line 14
def relative_path
  chop path
end

Private Instance Methods

chop(pth) click to toggle source
# File lib/dire/module/path.rb, line 20
def chop pth
  expand(pth).relative_path_from(root)
end
expand(pth) click to toggle source
# File lib/dire/module/path.rb, line 24
def expand pth
  path.join(pth).expand_path
end
ignore?(path) click to toggle source
# File lib/dire/module/path.rb, line 28
def ignore? path
  Dire::IGNORE.any? do |ignore|
    File.fnmatch? ignore, path, File::FNM_DOTMATCH | File::FNM_PATHNAME
  end
end
inside?(path) click to toggle source
# File lib/dire/module/path.rb, line 34
def inside? path
  expand(path).to_s.index(root.to_s) == 0
end