Module: Duple::CLI::Helpers::ClassMethods
- Defined in:
- lib/duple/cli/helpers.rb
Instance Method Summary collapse
- #capture_option ⇒ Object
- #config_option ⇒ Object
- #dry_run_option ⇒ Object
- #group_option ⇒ Object
- #source_option ⇒ Object
- #source_root ⇒ Object
- #tables_option(opts = nil) ⇒ Object
- #target_option ⇒ Object
Instance Method Details
#capture_option ⇒ Object
46 47 48 49 50 |
# File 'lib/duple/cli/helpers.rb', line 46 def capture_option class_option :capture, desc: 'Capture a new source snapshot before refreshing.', type: :boolean end |
#config_option ⇒ Object
18 19 20 21 22 23 |
# File 'lib/duple/cli/helpers.rb', line 18 def config_option class_option :config, desc: 'The location of the config file.', type: :string, aliases: '-c' end |
#dry_run_option ⇒ Object
52 53 54 55 56 57 |
# File 'lib/duple/cli/helpers.rb', line 52 def dry_run_option class_option :dry_run, desc: 'Perform a dry run of the command. No data will be moved.', type: :boolean, aliases: '--dry-run' end |
#group_option ⇒ Object
39 40 41 42 43 44 |
# File 'lib/duple/cli/helpers.rb', line 39 def group_option class_option :group, desc: 'The group configuration to use when dumping source data.', type: :string, aliases: '-g' end |
#source_option ⇒ Object
25 26 27 28 29 30 |
# File 'lib/duple/cli/helpers.rb', line 25 def source_option class_option :source, desc: 'The name of the source environment.', type: :string, aliases: '-s' end |
#source_root ⇒ Object
14 15 16 |
# File 'lib/duple/cli/helpers.rb', line 14 def source_root File.(File.join(File.dirname(__FILE__), '../../..')) end |
#tables_option(opts = nil) ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/duple/cli/helpers.rb', line 59 def tables_option(opts = nil) opts ||= {} opts = { desc: 'A list of tables to include when dumping source data.', required: false, type: :array, aliases: '-t' }.merge(opts) class_option :tables, opts end |
#target_option ⇒ Object
32 33 34 35 36 37 |
# File 'lib/duple/cli/helpers.rb', line 32 def target_option class_option :target, desc: 'The name of the target environment.', type: :string, aliases: '-t' end |