lib/leftovers/file.rb in leftovers-0.3.0 vs lib/leftovers/file.rb in leftovers-0.4.0

- old
+ new

@@ -1,9 +1,7 @@ # frozen_string_literal: true -require_relative 'erb' -require_relative 'haml' require 'pathname' module Leftovers class File < Pathname def relative_path @@ -14,15 +12,15 @@ return @test if defined?(@test) @test = Leftovers.config.test_paths.allowed?(relative_path) end - def ruby # rubocop:disable Metrics/MethodLength + def ruby case extname when '.haml' - Leftovers::Haml.precompile(read, self) + ::Leftovers::Haml.precompile(read, self) when '.rhtml', '.rjs', '.erb' - Leftovers::ERB.precompile(read) + ::Leftovers::ERB.precompile(read) else read end end end