class Sass::Exec::SassConvert
def process_file(input, output)
def process_file(input, output) input_path, output_path = path_for(input), path_for(output) if input_path @options[:from] ||= case input_path when /\.scss$/; :scss when /\.sass$/; :sass when /\.less$/; raise "sass-convert no longer supports LessCSS." when /\.css$/; :css end elsif @options[:in_place] raise "Error: the --in-place option requires a filename." end if output_path @options[:to] ||= case output_path when /\.scss$/; :scss when /\.sass$/; :sass end end @options[:from] ||= :css @options[:to] ||= :sass @options[:for_engine][:syntax] = @options[:from] out = Sass::Util.silence_sass_warnings do if @options[:from] == :css require 'sass/css' Sass::CSS.new(read(input), @options[:for_tree]).render(@options[:to]) else if input_path Sass::Engine.for_file(input_path, @options[:for_engine]) else Sass::Engine.new(read(input), @options[:for_engine]) end.to_tree.send("to_#{@options[:to]}", @options[:for_tree]) end end output = input_path if @options[:in_place] write_output(out, output) rescue Sass::SyntaxError => e raise e if @options[:trace] file = " of #{e.sass_filename}" if e.sass_filename raise "Error on line #{e.sass_line}#{file}: #{e.message}\n Use --trace for backtrace" rescue LoadError => err handle_load_error(err) end