Class: DbFork
Class Method Summary collapse
Methods inherited from DbHelper
dump!, fork!, get_configs, load!, save_db_config!
Class Method Details
.run(args = []) ⇒ Object
6 7 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 |
# File 'lib/fork.rb', line 6 def self.run(args=[]) = { relative: false, branch: :dev } opt_parser = OptionParser.new do |opts| opts. = "Usage: .. fork [options]" opts.separator "" opts.separator "Specific options:" opts.on("-b", "--branch [dev|test|stag|prod|all]", "Set branch for fork, default: development.") do |arg| arg = arg.downcase.to_sym [:branch] = arg if [:dev, :test, :prod, :stag, :all].include?(arg) end opts.on("-n [new name]", "--name [new name]", "Set new database name.") do |arg| [:name] = arg.split('.')[0] end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end end opt_parser.parse!(args) get_configs() fork!() # pp options end |