Class: YMDP::Compiler::Options
- Inherits:
-
Object
- Object
- YMDP::Compiler::Options
- Defined in:
- lib/ymdp/compiler/options.rb
Overview
Command-line options processor for Compiler module.
Class Method Summary collapse
-
.parse ⇒ Object
Parse command line options into an options hash.
Class Method Details
.parse ⇒ Object
Parse command line options into an options hash.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ymdp/compiler/options.rb', line 8 def self.parse = { :commit => false, :branch => "master", :base_path => BASE_PATH, :servers => SERVERS } OptionParser.new do |opts| [:commit] = false [:verbose] = CONFIG.verbose? opts. = "Usage: build.rb [options]" opts.on("-d", "--domain [domain]", "Force Domain") do |v| [:domain] = v end opts.on("-b", "--branch [branch]", "Current Branch") do |v| [:branch] = v end opts.on("-m", "--message [message]", "Commit Message") do |v| [:commit] = true [:message] = v end opts.on("-n", "--no-commit", "Don't Commit") do |v| [:commit] = false end opts.on("-v", "--verbose", "Verbose (show all file writes)") do |v| [:verbose] = true end opts.on("-r", "--rake [task]", "Execute Rake task") do |v| [:rake] = v end opts.on("-c", "--compress", "Compress JavaScript and CSS") do |v| [:compress] = v end end.parse! end |