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:
369 370 371 372 373 374 375 |
# File 'lib/haml/exec.rb', line 369 def initialize(args) super @module_opts = {} require 'sass/css' end |
Instance Method Details
#process_result ⇒ Object
393 394 395 396 397 398 399 400 |
# File 'lib/haml/exec.rb', line 393 def process_result super input = @options[:input] output = @options[:output] output.write(::Sass::CSS.new(input, @module_opts).render) end |
#set_opts(opts) ⇒ Object
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/haml/exec.rb', line 377 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 |