method
fetch
v8.1.1 -
Show latest stable
- Class:
Rails::Command::CredentialsCommand
fetch(path)public
No documentation available.
# File railties/lib/rails/commands/credentials/credentials_command.rb, line 61
def fetch(path)
load_environment_config!
if (yaml = credentials.read)
begin
value = YAML.load(yaml)
value = path.split(".").inject(value) do |doc, key|
doc.fetch(key)
end
say value.to_s
rescue KeyError, NoMethodError
say_error "Invalid or missing credential path: #{path}"
exit 1
end
else
missing_credentials!
end
end