<commit_before># s3_sync

Securely sync (upload and download) files with [Amazon Simple Storage Service (s3)](http://aws.amazon.com/s3).

Specify credentials, file names, and other options during configuration.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 's3_sync'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install s3_sync

## Usage

### Configuring

Configure the gem to use the same options when uploading and downloading.

```` rb
S3Sync.configure do |config|
  config.key_id = "mykey123"
  config.key_secret = "secret456"
  config.region = "us-east-1"
  config.bucket = "my-backups"
  config.secret_phrase = "<PASSWORD>"
  config.files = [
    File.join(Dir.home,".bash_profile"),
    File.join(Dir.home,".gitconfig"),
    File.join(Dir.home,".ssh","config")
  ]
  config.downloads_dir = File.join(Dir.home,"Desktop","my-s3-downloads")
end
````

#### Configuration Options

attribute name | description | default value
--- | --- | ---
`key_id` | The s3 user's *Access Key Id*. | N/A
`key_secret` | The s3 user's *Access Key Secret*. | N/A
`region` | The s3 region. | N/A
`bucket` | The s3 bucket (top-level directory) name. | N/A
`secret_phrase` | The phrase to use when encrypting and decrypting files. | N/A
`files` | A list of local file paths to be synced. | N/A
`downloads_dir` | A staging directory to house downloaded files. | `File.join(Dir.home,"Desktop","s3-downloads")`

### Uploading

Upload files from your computer to s3.

```` rb
S3Sync::Upload.new
````

The uploads bucket gets created automatically, and can be configured with `config.bucket`.

### Downloading

Download files from s3 to your computer.

```` rb
S3Sync::Download.new
````

Files are downloaded to a staging directory, which can be configured with `config.downloads_dir`. The staging directory helps mitigate the risk of accidentally over-writing local files.

## Prerequisites

Create an [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) user and obtain its *Access Key Id* and *Secret Access Key*.

Create an AWS IAM group.
<commit_msg>revising README<commit_after># s3_sync

Securely sync (upload and download) files with [Amazon Simple Storage Service (s3)](http://aws.amazon.com/s3).

Specify credentials, file names, and other options during configuration.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 's3_sync'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install s3_sync

## Usage

### Configuring

Configure the gem to use the same options when uploading and downloading.

```` rb
S3Sync.configure do |config|
  config.key_id = "mykey123"
  config.key_secret = "secret456"
  config.region = "us-east-1"
  config.bucket = "my-backups"
  config.secret_phrase = "<PASSWORD>"
  config.files = [
    File.join(Dir.home,".bash_profile"),
    File.join(Dir.home,".gitconfig"),
    File.join(Dir.home,".ssh","config")
  ]
  config.downloads_dir = File.join(Dir.home,"Desktop","my-s3-downloads")
end
````

#### Configuration Options

attribute name | description
--- | ---
`key_id` | The s3 user's *Access Key Id*.
`key_secret` | The s3 user's *Access Key Secret*.
`region` | The s3 region.
`bucket` | The s3 bucket (top-level directory) name.
`secret_phrase` | The phrase to use when encrypting and decrypting files.
`files` | A list of local file paths to be synced.
`downloads_dir` | A staging directory to house downloaded files. Defaults to *~Desktop/s3-downloads*.

### Uploading

Upload files from your computer to s3.

```` rb
S3Sync::Upload.new
````

The uploads bucket gets created automatically, and can be configured with `config.bucket`.

### Downloading

Download files from s3 to your computer.

```` rb
S3Sync::Download.new
````

Files are downloaded to a staging directory, which can be configured with `config.downloads_dir`. The staging directory helps mitigate the risk of accidentally over-writing local files.

## Prerequisites

Create an [AWS Identity and Access Management (IAM)](http://aws.amazon.com/iam/) user and obtain its *Access Key Id* and *Secret Access Key*.

Create an AWS IAM group.

{'fraction_non_alphanumeric': 0.12397688974482426, 'fraction_numerical': 0.011073663938372653, 'mean_word_length': 4.161490683229814, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6996367', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1278, 'n_words': 455}