From e16f5d7c3881c4a1cd059667a2cde094a16b10e8 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Sun, 22 Aug 2010 18:57:15 -0700 Subject: [PATCH] Get rid of Haml::Exec::Generic. --- lib/haml/exec.rb | 97 +++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index e8daab90..603d4f07 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -168,64 +168,14 @@ MESSAGE end end - # An abstrac class that encapsulates the code - # specific to the `haml` and `sass` executables. - class HamlSass < Generic - # @param args [Array] The command-line arguments - def initialize(args) - super - @options[:for_engine] = {} - end - - protected - - # Tells optparse how to parse the arguments - # available for the `haml` and `sass` executables. - # - # This is meant to be overridden by subclasses - # so they can add their own options. - # - # @param opts [OptionParser] - def set_opts(opts) - opts.banner = <] The command-line arguments def initialize(args) super - @name = "Sass" - @options[:for_engine][:load_paths] = ['.'] + (ENV['SASSPATH'] || '').split(File::PATH_SEPARATOR) + @options[:for_engine] = { + :load_paths => ['.'] + (ENV['SASSPATH'] || '').split(File::PATH_SEPARATOR) + } end protected @@ -236,6 +186,15 @@ END def set_opts(opts) super + opts.banner = <] The command-line arguments def initialize(args) super - @name = "Haml" + @options[:for_engine] = {} @options[:requires] = [] @options[:load_paths] = [] end @@ -447,6 +412,21 @@ MSG def set_opts(opts) super + opts.banner = <