Module: Pulsar::Options::ConfRepo

Included in:
ListCommand, MainCommand
Defined in:
lib/pulsar/options/conf_repo.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pulsar/options/conf_repo.rb', line 4

def self.included(base)
  base.option ['-c', '--conf-repo'], 'REPO URL',
              'a git repository with deploy configurations, mainly apps and recipes',
              environment_variable: 'PULSAR_CONF_REPO',
              required: true

  base.option ['-k', '--keep-capfile'], :flag,
              'don\'t remove the generated capfile in the TMP DIR directory',
              default: false

  base.option ['-r', '--keep-repo'], :flag,
              'don\'t remove the downloaded configuration repository from the TMP DIR directory',
              default: false

  base.option ['-b', '--conf-branch'], 'REPO BRANCH',
              'specify a branch for the configuration repository',
              default: 'master'

  base.option ['-h', '--home-dir'], 'HOME DIR',
              'a directory to store per-user state',
              environment_variable: 'PULSAR_HOME',
              default: File.join(Dir.home, '.pulsar')
end

Instance Method Details

#parse(arguments) ⇒ Object

TODO: find a way to fix this hack. This is made so that load_configuration() is called before Clamp parses command line arguments (and runs into errors because no conf repo is defined).



34
35
36
37
38
# File 'lib/pulsar/options/conf_repo.rb', line 34

def parse(arguments)
  self.class.send(:include, Pulsar::Helpers::Clamp)
  load_configuration
  super
end