Class: Haml::Exec::CSS2Sass
Overview
A class encapsulating executable functionality specific to the css2sass executable.
Instance Method Summary collapse
-
#initialize(args) ⇒ CSS2Sass
constructor
:nodoc:.
- #process_result ⇒ Object
- #set_opts(opts) ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize(args) ⇒ CSS2Sass
:nodoc:
361 362 363 364 365 366 367 |
# File 'lib/haml/exec.rb', line 361 def initialize(args) super @module_opts = {} require 'sass/css' end |
Instance Method Details
#process_result ⇒ Object
385 386 387 388 389 390 391 392 |
# File 'lib/haml/exec.rb', line 385 def process_result super input = @options[:input] output = @options[:output] output.write(::Sass::CSS.new(input, @module_opts).render) end |
#set_opts(opts) ⇒ Object
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/haml/exec.rb', line 369 def set_opts(opts) opts. = <<END Usage: css2sass [options] [INPUT] [OUTPUT] Description: Transforms a CSS file into corresponding Sass code. Options: END opts.on('-a', '--alternate', 'Output using alternative Sass syntax (margin: 1px)') do @module_opts[:alternate] = true end super end |