gems.sass-3.5.5.lib.sass.exec.sass_convert.rb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sass-maven-plugin Show documentation
Show all versions of sass-maven-plugin Show documentation
A Maven Plugin that compiles Sass files.
require 'optparse'
require 'fileutils'
module Sass::Exec
# The `sass-convert` executable.
class SassConvert < Base
# @param args [Array] The command-line arguments
def initialize(args)
super
require 'sass'
@options[:for_tree] = {}
@options[:for_engine] = {:cache => false, :read_cache => true}
end
# Tells optparse how to parse the arguments.
#
# @param opts [OptionParser]
def set_opts(opts)
opts.banner = < 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
def path_for(file)
return file.path if file.is_a?(File)
return file if file.is_a?(String)
end
def read(file)
if file.respond_to?(:read)
file.read
else
open(file, 'rb') {|f| f.read}
end
end
end
end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy