Class: Credman::Init

Inherits:
Object
  • Object
show all
Defined in:
lib/credman/init.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInit

Returns a new instance of Init.



7
8
9
# File 'lib/credman/init.rb', line 7

def initialize
  @config_path = "config/credman.yml"
end

Instance Attribute Details

#config_pathObject (readonly)

Returns the value of attribute config_path.



5
6
7
# File 'lib/credman/init.rb', line 5

def config_path
  @config_path
end

Instance Method Details

#perform(force_rewrite) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/credman/init.rb', line 11

def perform(force_rewrite)
  if config_exists? && !force_rewrite
    abort "[SKIPPED] config/credman.yml already exist. You can run with `--force-rewrite` option to rewrite it"
  end

  save_config(available_environments: available_environments, default_diff_branch: default_diff_branch)
  puts "[CREATED] config/credman.yml"
end