Sha256: 42c7f10481d66980c4b1bb040b0b02d0b178479a948499696df97c292d646626

Contents?: true

Size: 1.67 KB

Versions: 40

Compression:

Stored size: 1.67 KB

Contents

module Compass::Exec::GlobalOptionsParser
  def set_options(opts)
    super
    set_global_options(opts)
  end
  def set_global_options(opts)
    opts.on('-r LIBRARY', '--require LIBRARY',
            "Require the given ruby LIBRARY before running commands.",
            "  This is used to access compass plugins without having a",
            "  project configuration file."
      ) do |library|
        ::Compass.configuration.require library
      end

    opts.on('-l FRAMEWORK_DIR', '--load FRAMEWORK_DIR',
            "Load the framework or extensions found in the FRAMEWORK directory."
      ) do |framework_dir|
        require 'pathname'
        ::Compass.configuration.load Pathname.new(framework_dir).realpath
      end

    opts.on('-L FRAMEWORKS_DIR', '--load-all FRAMEWORKS_DIR',
            "Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory."
      ) do |frameworks_dir|
        require 'pathname'
        ::Compass.configuration.discover Pathname.new(frameworks_dir).realpath
      end

    opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do
      self.options[:quiet] = true
    end

    opts.on('--trace', :NONE, 'Show a full stacktrace on error') do
      self.options[:trace] = true
    end

    opts.on('--force', :NONE, 'Allows some failing commands to succeed instead.') do
      self.options[:force] = true
    end

    opts.on('--dry-run', :NONE, 'Dry Run. Tells you what it plans to do.') do
      self.options[:dry_run] = true
    end

    opts.on('--boring', :NONE, 'Turn off colorized output.') do
      self.options[:color_output] = false
    end

    opts.on_tail("-?", "-h", "--help", "Show this message") do
      puts opts
      exit
    end

  end

end

Version data entries

40 entries across 40 versions & 3 rubygems

Version Path
compass-0.12.1 lib/compass/exec/global_options_parser.rb
compass-0.12.0 lib/compass/exec/global_options_parser.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/compass-0.11.7/lib/compass/exec/global_options_parser.rb
compass-0.12.rc.1 lib/compass/exec/global_options_parser.rb
compass-0.12.rc.0 lib/compass/exec/global_options_parser.rb
compass-0.11.7 lib/compass/exec/global_options_parser.rb
compass-0.12.alpha.4 lib/compass/exec/global_options_parser.rb
compass-0.12.alpha.3 lib/compass/exec/global_options_parser.rb
compass-0.11.6 lib/compass/exec/global_options_parser.rb
compass-0.12.alpha.2 lib/compass/exec/global_options_parser.rb
compass-0.12.alpha.1 lib/compass/exec/global_options_parser.rb
compass-0.12.alpha.0 lib/compass/exec/global_options_parser.rb
compass-rails31-0.12.0.alpha.0.91a748a lib/compass/exec/global_options_parser.rb
compass-0.11.5 lib/compass/exec/global_options_parser.rb
compass-0.11.4 lib/compass/exec/global_options_parser.rb
compass-0.11.3 lib/compass/exec/global_options_parser.rb
compass-0.11.2 lib/compass/exec/global_options_parser.rb
compass-0.11.1 lib/compass/exec/global_options_parser.rb
compass-0.11.0 lib/compass/exec/global_options_parser.rb
compass-0.11.beta.7 lib/compass/exec/global_options_parser.rb