Class: Kdep::Preset
- Inherits:
-
Object
- Object
- Kdep::Preset
- Defined in:
- lib/kdep/preset.rb
Constant Summary collapse
- BUILT_IN =
%w[web worker job cronjob statefulset statefulset_svc helm custom].freeze
Instance Method Summary collapse
-
#initialize(preset_name, deploy_dir) ⇒ Preset
constructor
A new instance of Preset.
- #resources ⇒ Object
Constructor Details
#initialize(preset_name, deploy_dir) ⇒ Preset
Returns a new instance of Preset.
5 6 7 8 9 10 |
# File 'lib/kdep/preset.rb', line 5 def initialize(preset_name, deploy_dir) raise "preset: is required in app.yml" if preset_name.to_s.strip.empty? @preset_name = preset_name @deploy_dir = deploy_dir end |
Instance Method Details
#resources ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/kdep/preset.rb', line 12 def resources path = resolve_preset_path raise "Preset not found: #{@preset_name}" unless path File.readlines(path).map(&:strip).reject do |line| line.empty? || line.start_with?("#") end end |