Class: ChikkenInaBukket::Controllers::Configuration

Inherits:
R
  • Object
show all
Defined in:
lib/chikken_in_a_bukket.rb

Instance Method Summary collapse

Instance Method Details

#getObject



268
269
270
# File 'lib/chikken_in_a_bukket.rb', line 268

def get
  render :configuration
end

#postObject



272
273
274
275
276
277
278
279
280
281
# File 'lib/chikken_in_a_bukket.rb', line 272

def post
  open(ENV["HOME"] + "/.chikken_in_a_bukket.yml", "w") do |file|
    file << {
      "access_key_id" => @input[:access_key],
      "secret_access_key" => @input[:secret_key]
    }.to_yaml
  end
  Config.initialize
  return redirect(Index)
end