Class: Sass::Exec::SassConvert
- Inherits:
-
Base
- Object
- Base
- Sass::Exec::SassConvert
- Defined in:
- .ruby-sass/lib/sass/exec/sass_convert.rb
Overview
The `sass-convert` executable.
Constant Summary
Instance Method Summary (collapse)
-
#initialize(args) ⇒ SassConvert
constructor
A new instance of SassConvert.
-
#process_result ⇒ Object
Processes the options set by the command-line arguments, and runs the CSS compiler appropriately.
-
#set_opts(opts) ⇒ Object
Tells optparse how to parse the arguments.
Methods inherited from Base
Constructor Details
#initialize(args) ⇒ SassConvert
Returns a new instance of SassConvert
8 9 10 11 12 13 |
# File '.ruby-sass/lib/sass/exec/sass_convert.rb', line 8 def initialize(args) super require 'sass' @options[:for_tree] = {} @options[:for_engine] = {:cache => false, :read_cache => true} end |
Constructor Details
#initialize(args) ⇒ SassConvert
Returns a new instance of SassConvert
8 9 10 11 12 13 |
# File '.ruby-sass/lib/sass/exec/sass_convert.rb', line 8 def initialize(args) super require 'sass' @options[:for_tree] = {} @options[:for_engine] = {:cache => false, :read_cache => true} end |
Instance Method Details
#process_result ⇒ Object
Processes the options set by the command-line arguments, and runs the CSS compiler appropriately.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File '.ruby-sass/lib/sass/exec/sass_convert.rb', line 36 def process_result require 'sass' if @options[:recursive] process_directory return end super input = @options[:input] if File.directory?(input) raise "Error: '#{input.path}' is a directory (did you mean to use --recursive?)" end output = @options[:output] output = input if @options[:in_place] process_file(input, output) end |
#set_opts(opts) ⇒ Object
Tells optparse how to parse the arguments.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File '.ruby-sass/lib/sass/exec/sass_convert.rb', line 18 def set_opts(opts) opts. = <<END Usage: sass-convert [options] [INPUT] [OUTPUT] Description: Converts between CSS, indented syntax, and SCSS files. For example, this can convert from the indented syntax to SCSS, or from CSS to SCSS (adding appropriate nesting). END (opts) style(opts) input_and_output(opts) miscellaneous(opts) end |