class Guard::Tilt::OutputPath

Public Instance Methods

basename(*args) click to toggle source
# File lib/guard/tilt/output_path.rb, line 19
def basename(*args)
  new File.basename(to_str, *args)
end
dirname() click to toggle source
# File lib/guard/tilt/output_path.rb, line 22
def dirname
  new File.dirname(to_str)
end
expand(*args) click to toggle source
# File lib/guard/tilt/output_path.rb, line 25
def expand(*args)
  new File.expand_path(to_str, *args)
end
extname() click to toggle source
# File lib/guard/tilt/output_path.rb, line 16
def extname
  new File.extname(to_str)
end
join(other) click to toggle source
# File lib/guard/tilt/output_path.rb, line 9
def join(other)
  new File.join(to_str, other.to_str)
end
open(mode = 'r', &block) click to toggle source
# File lib/guard/tilt/output_path.rb, line 41
def open(mode = 'r', &block)
  File.open(to_s, mode, &block)
end
sanitize() click to toggle source

Template Method

# File lib/guard/tilt/output_path.rb, line 5
def sanitize
  strip_extname
end
strip_extname() click to toggle source
# File lib/guard/tilt/output_path.rb, line 29
def strip_extname
  expand.dirname.join basename(extname)
end
sub(base, root) click to toggle source
# File lib/guard/tilt/output_path.rb, line 12
def sub(base, root)
  new to_str.sub(base, root)
end
to_s(base = nil) click to toggle source
# File lib/guard/tilt/output_path.rb, line 33
def to_s(base = nil)
  unless base
    sanitize.to_str
  else
    base += File::Separator if base !~ /\/$/
    sanitize.sub(base, '').to_str
  end
end

Protected Instance Methods

new(str) click to toggle source
# File lib/guard/tilt/output_path.rb, line 47
def new(str)
  instance = dup
  instance.to_str = str
  instance
end