Module: Kubes::Compiler::Dsl::Core::Files
- Included in:
- Syntax::ConfigMap, Syntax::Secret
- Defined in:
- lib/kubes/compiler/dsl/core/files.rb
Instance Method Summary collapse
- #current_dir ⇒ Object
- #files(*list) ⇒ Object
- #load_data_from_file(path) ⇒ Object
- #secret_class? ⇒ Boolean
Instance Method Details
#current_dir ⇒ Object
22 23 24 25 26 |
# File 'lib/kubes/compiler/dsl/core/files.rb', line 22 def current_dir resources_line = caller.find { |l| l.include?('.kubes/resources') } path = resources_line.split(':').first File.dirname(path) # IE: /full/path/.kubes/resources end |
#files(*list) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/kubes/compiler/dsl/core/files.rb', line 3 def files(*list) dir = current_dir list.each do |file| path = "#{dir}/#{file}" load_data_from_file(path) end end |