Class: DearS3::Authentication

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dears3/authentication.rb

Instance Method Summary collapse

Instance Method Details

#connectObject

TODO: Give option to upload once without storing credentials.



10
11
12
13
# File 'lib/dears3/authentication.rb', line 10

def connect
  # TODO: Raise error if no credentials file available
  ::AWS::S3.new aws_credentials
end

#create_credentials_file!(credentials) ⇒ Object



15
16
17
18
19
20
# File 'lib/dears3/authentication.rb', line 15

def create_credentials_file! credentials
  File.open credentials_path, "w" do |f|
    f.write credentials.to_json
    f.write "\n"
  end
end