Method: Dbag::Client#from_file
- Defined in:
- lib/dbag/client.rb
#from_file(new_key, environment, path, encrypted = false, format = :json) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/dbag/client.rb', line 49 def from_file(new_key, environment, path, encrypted = false, format = :json) File.open(path, "r" ) do |f| if format == :json if (json = JSON.load(f)) create(new_key, environment, json, encrypted) end elsif format == :yaml if (yaml = YAML.load_file(path)) create(new_key, environment, yaml, encrypted) end end end end |