Sha256: d16a6a60a1ddc6c0e0da77456d7e225da0638841363cf63501cf24b30b94e9d9

Contents?: true

Size: 1.43 KB

Versions: 73

Compression:

Stored size: 1.43 KB

Contents

module YMDP
  module Compiler
    # Command-line options processor for Compiler module.
    #
    class Options
      # Parse command line options into an options hash.
      #
      def self.parse
        options = {
          :commit => false,
          :branch => "master",
          :base_path => BASE_PATH,
          :servers => SERVERS
        }
        OptionParser.new do |opts|
          options[:commit] = false
          options[:verbose] = CONFIG.verbose?
          opts.banner = "Usage: build.rb [options]"

          opts.on("-d", "--domain [domain]", "Force Domain") do |v|
            options[:domain] = v
          end
          opts.on("-b", "--branch [branch]", "Current Branch") do |v|
            options[:branch] = v
          end
          opts.on("-m", "--message [message]", "Commit Message") do |v|
            options[:commit] = true
            options[:message] = v
          end
          opts.on("-n", "--no-commit", "Don't Commit") do |v|
            options[:commit] = false
          end
          opts.on("-v", "--verbose", "Verbose (show all file writes)") do |v|
            options[:verbose] = true
          end
          opts.on("-r", "--rake [task]", "Execute Rake task") do |v|
            options[:rake] = v
          end
          opts.on("-c", "--compress", "Compress JavaScript and CSS") do |v|
            options[:compress] = v
          end
        end.parse!
    
        options
      end    
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
ymdp-0.2.0 lib/ymdp/compiler/options.rb
ymdp-0.1.15 lib/ymdp/compiler/options.rb
ymdp-0.1.14 lib/ymdp/compiler/options.rb
ymdp-0.1.13 lib/ymdp/compiler/options.rb
ymdp-0.1.12 lib/ymdp/compiler/options.rb
ymdp-0.1.11 lib/ymdp/compiler/options.rb
ymdp-0.1.10 lib/ymdp/compiler/options.rb
ymdp-0.1.9 lib/ymdp/compiler/options.rb
ymdp-0.1.8.1 lib/ymdp/compiler/options.rb
ymdp-0.1.8 lib/ymdp/compiler/options.rb
ymdp-0.1.7 lib/ymdp/compiler/options.rb
ymdp-0.1.6 lib/ymdp/compiler/options.rb
ymdp-0.1.4 lib/ymdp/compiler/options.rb