Skip to content

Commit

Permalink
Add Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cintamani committed Jun 6, 2019
1 parent e5682f8 commit 94b8b9d
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,43 @@ Or install it yourself as:

$ gem install defra_ruby_aws

## Configuration

Add a new bucket with:

```
# config/initializers/defra-ruby-aws.rb
require "defra-ruby-aws"
DefraRuby::Aws.configure do |config|
config.buckets = [{
# bucket's name, required
name: "defra-ruby-aws",
# AWS bucket access credentials, required
credentials: {
access_key_id: "ACCES_KEY_ID",
secret_access_key: "SECRET_ACCESS_KEY"
},
# optional - Default to "eu-west-1"
region: "eu-west-1"
}]
end
```

## Usage

TBD
```
file_to_upload = Tempfile.new("test-upload-file.csv")
bucket = DefraRuby::Aws.get_bucket("defra-ruby-aws")
response = bucket.load(file_to_upload)
if response.successful?
# Do something
else
response.error # return the failure error
# Do something else
end
```

## Contributing to this project

Expand Down

0 comments on commit 94b8b9d

Please sign in to comment.