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-1.4.7 lib/ymdp/compiler/options.rb
ymdp-1.4.6 lib/ymdp/compiler/options.rb
ymdp-1.4.5 lib/ymdp/compiler/options.rb
ymdp-1.4.4 lib/ymdp/compiler/options.rb
ymdp-1.4.3 lib/ymdp/compiler/options.rb
ymdp-1.4.2 lib/ymdp/compiler/options.rb
ymdp-1.4.1 lib/ymdp/compiler/options.rb
ymdp-1.4.0 lib/ymdp/compiler/options.rb
ymdp-1.3.4 lib/ymdp/compiler/options.rb
ymdp-1.3.3 lib/ymdp/compiler/options.rb
ymdp-1.3.2 lib/ymdp/compiler/options.rb
ymdp-1.3.1 lib/ymdp/compiler/options.rb
ymdp-1.3.0 lib/ymdp/compiler/options.rb
ymdp-1.2.0 lib/ymdp/compiler/options.rb
ymdp-1.1.0 lib/ymdp/compiler/options.rb
ymdp-1.0.1 lib/ymdp/compiler/options.rb
ymdp-1.0.0 lib/ymdp/compiler/options.rb
ymdp-0.10.2 lib/ymdp/compiler/options.rb
ymdp-0.10.1 lib/ymdp/compiler/options.rb
ymdp-0.10.0 lib/ymdp/compiler/options.rb