Class: Sass::Exec::SassConvert
Overview
The ‘sass-convert` executable.
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.
912 913 914 915 916 917 |
# File 'lib/sassmagic/reset.rb', line 912 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.
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 |
# File 'lib/sassmagic/reset.rb', line 940 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.
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 |
# File 'lib/sassmagic/reset.rb', line 922 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 |