Module: Kubec::DSL::Stages
- Included in:
- Kubec::DSL
- Defined in:
- lib/kubec/dsl/stages.rb
Overview
Stage
Constant Summary collapse
- RESERVED_NAMES =
%w[deploy install status logs].freeze
Instance Method Summary collapse
- #assert_valid_stage_names(names) ⇒ Object
- #stage_definitions ⇒ Object
- #stage_set? ⇒ Boolean
- #stages ⇒ Object
Instance Method Details
#assert_valid_stage_names(names) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/kubec/dsl/stages.rb', line 23 def assert_valid_stage_names(names) invalid = names.find { |n| RESERVED_NAMES.include?(n) } return if invalid.nil? # TODO: I18n Support raise "Invalid stage name #{invalid}.rb" end |
#stage_definitions ⇒ Object
15 16 17 |
# File 'lib/kubec/dsl/stages.rb', line 15 def stage_definitions stage_config_path.join('*.rb') end |
#stage_set? ⇒ Boolean
19 20 21 |
# File 'lib/kubec/dsl/stages.rb', line 19 def stage_set? !fetch(:stage, nil).nil? end |
#stages ⇒ Object
9 10 11 12 13 |
# File 'lib/kubec/dsl/stages.rb', line 9 def stages names = Dir[stage_definitions].map { |f| File.basename(f, '.rb') } assert_valid_stage_names(names) names end |