Module: Duple::CLI::Helpers::ClassMethods

Defined in:
lib/duple/cli/helpers.rb

Instance Method Summary collapse

Instance Method Details

#capture_optionObject



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_optionObject



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_optionObject



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_optionObject



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_optionObject



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_rootObject



14
15
16
# File 'lib/duple/cli/helpers.rb', line 14

def source_root
  File.expand_path(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_optionObject



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