The `sass` and `scss` executables.
@param args [Array<String>] The command-line arguments
# File lib/sass/exec/sass_scss.rb, line 7 def initialize(args, default_syntax) super(args) @options[:sourcemap] = :auto @options[:for_engine] = { :load_paths => default_sass_path } @default_syntax = default_syntax end
Processes the options set by the command-line arguments, and runs the Sass compiler appropriately.
# File lib/sass/exec/sass_scss.rb, line 37 def process_result require 'sass' if !@options[:update] && !@options[:watch] && @args.first && colon_path?(@args.first) if @args.size == 1 @args = split_colon_path(@args.first) else @fake_update = true @options[:update] = true end end load_compass if @options[:compass] return interactive if @options[:interactive] return watch_or_update if @options[:watch] || @options[:update] super if @options[:sourcemap] != :none && @options[:output_filename] @options[:sourcemap_filename] = Sass::Util.sourcemap_name(@options[:output_filename]) end @options[:for_engine][:filename] = @options[:filename] @options[:for_engine][:css_filename] = @options[:output] if @options[:output].is_a?(String) @options[:for_engine][:sourcemap_filename] = @options[:sourcemap_filename] @options[:for_engine][:sourcemap] = @options[:sourcemap] run end
Tells optparse how to parse the arguments.
@param opts [OptionParser]
# File lib/sass/exec/sass_scss.rb, line 21 def set_opts(opts) opts.banner = Usage: #{default_syntax} [options] [INPUT] [OUTPUT]Description: Converts SCSS or Sass files to CSS. common_options(opts) watching_and_updating(opts) input_and_output(opts) miscellaneous(opts) end
Generated with the Darkfish Rdoc Generator 2.