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' [:for_tree] = {} [: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 [:recursive] process_directory return end super input = [:input] if File.directory?(input) raise "Error: '#{input.path}' is a directory (did you mean to use --recursive?)" end output = [:output] output = input if [: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. = "Usage: sass-convert [options] [INPUT] [OUTPUT]\n\nDescription:\n Converts between CSS, indented syntax, and SCSS files. For example,\n this can convert from the indented syntax to SCSS, or from CSS to\n SCSS (adding appropriate nesting).\n" (opts) style(opts) input_and_output(opts) miscellaneous(opts) end |