lib/scss_lint/engine.rb in scss-lint-0.20.3 vs lib/scss_lint/engine.rb in scss-lint-0.21.0

- old
+ new

@@ -9,11 +9,11 @@ ENGINE_OPTIONS = { cache: false, syntax: :scss } attr_reader :contents, :filename, :lines, :tree def initialize(scss_or_filename) - if File.exists?(scss_or_filename) + if File.exist?(scss_or_filename) @filename = scss_or_filename @engine = Sass::Engine.for_file(scss_or_filename, ENGINE_OPTIONS) @contents = File.open(scss_or_filename, 'r').read else @engine = Sass::Engine.new(scss_or_filename, ENGINE_OPTIONS) @@ -24,10 +24,10 @@ @tree = @engine.to_tree rescue Encoding::UndefinedConversionError, ArgumentError => error if error.is_a?(Encoding::UndefinedConversionError) || error.message.include?('invalid byte sequence') raise FileEncodingError, - "Unable to parse SCSS file: #{error.to_s}", + "Unable to parse SCSS file: #{error}", error.backtrace else raise end end