class Leftovers::File

Public Instance Methods

relative_path() click to toggle source
# File lib/leftovers/file.rb, line 7
def relative_path
  @relative_path ||= relative_path_from(Leftovers.pwd)
end
ruby() click to toggle source
# File lib/leftovers/file.rb, line 17
def ruby
  case extname
  when '.haml'
    ::Leftovers::Haml.precompile(read, self)
  when '.rhtml', '.rjs', '.erb'
    ::Leftovers::ERB.precompile(read)
  else
    read
  end
end
test?() click to toggle source
# File lib/leftovers/file.rb, line 11
def test?
  return @test if defined?(@test)

  @test = Leftovers.config.test_paths.allowed?(relative_path)
end