Class: Credman::Init
- Inherits:
-
Object
- Object
- Credman::Init
- Defined in:
- lib/credman/init.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
Instance Method Summary collapse
-
#initialize ⇒ Init
constructor
A new instance of Init.
- #perform(force_rewrite) ⇒ Object
Constructor Details
#initialize ⇒ Init
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_path ⇒ Object (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 |