class Kontena::Plugin::Shell::PromptLoader

Public Class Methods

match?(source, parent = nil) click to toggle source
# File lib/kontena/plugin/shell/prompt_loader.rb, line 7
def self.match?(source, parent = nil)
  source.end_with?('kontena.yml') && !Kontena::Cli::Stacks::YAML::FileLoader.match?(source, parent)
end

Public Instance Methods

origin() click to toggle source
# File lib/kontena/plugin/shell/prompt_loader.rb, line 17
def origin
  "prompt"
end
read_content() click to toggle source
# File lib/kontena/plugin/shell/prompt_loader.rb, line 11
def read_content
  content = Kontena.prompt.multiline("Enter or paste a stack YAML").join
  raise "Invalid stack YAML" unless YAML.safe_load(content).kind_of?(Hash)
  content
end
registry() click to toggle source
# File lib/kontena/plugin/shell/prompt_loader.rb, line 21
def registry
  "prompt"
end