Class: SunRaise::Config
Overview
configurator class
Class Attribute Summary collapse
-
.config_methods ⇒ Object
Returns the value of attribute config_methods.
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
Returns the value of attribute callbacks.
-
#conf ⇒ Object
Returns the value of attribute conf.
Instance Method Summary collapse
- #cl_options ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/config.rb', line 41 def initialize @callbacks = {:after => ''} @conf = { :verbose => false, :local_project_path => '.', :release => true, :test_rails_app => true, :auto_migrate => true, :help => false } end |
Class Attribute Details
.config_methods ⇒ Object
Returns the value of attribute config_methods.
12 13 14 |
# File 'lib/config.rb', line 12 def config_methods @config_methods end |
Instance Attribute Details
#callbacks ⇒ Object
Returns the value of attribute callbacks.
9 10 11 |
# File 'lib/config.rb', line 9 def callbacks @callbacks end |
#conf ⇒ Object
Returns the value of attribute conf.
9 10 11 |
# File 'lib/config.rb', line 9 def conf @conf end |
Instance Method Details
#cl_options ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/config.rb', line 54 def OptionParser.new do |opts| opts.on("-v", "--[no-]verbose", "Run verbosely") do |verbose| @conf[:verbose] = verbose end opts.on("-f", "--[no-]force", "Deploy even there are no new commits") do |force| @conf[:force] = force end opts.on("-n", "--no-reelase", "Do not replace 'current' dir and start test server") do |no_release| @conf[:release] = !no_release end opts.on("--remake", "Delete current deploy and make initial deploy") do |remake| @conf[:remake] = remake end opts.on("-d", "--destroy", "Delete current deploy and make initial deploy") do |destroy| @conf[:destroy] = destroy end opts.on("-h", "--help", "Show this help") do |help| @conf[:help] = true puts opts end end.parse! end |