<commit_before># Middleman Sync

Synchronise your Middleman build to S3 and more

Middleman Sync is post build hook and cli for Middleman to allow you to use [Asset Sync](https://raw.github.com/rumblelabs/asset_sync) for your static build deployments.

## Installation

If you already have a Middleman project:

Add `middleman-sync` to your `Gemfile` then open up your `config.rb` and add:

``` ruby
# Activate sync extension
activate :sync do |sync|
  sync.fog_provider = 'AWS'
  sync.fog_directory = 'bucket-name'
  sync.fog_region = 'bucket-region-name'
  sync.aws_access_key_id = 'super'
  sync.aws_secret_access_key = 'secret'
  # sync.after_build = true # Run sync after running build
  # sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
end
```


## Usage

Once you've bundled you should be able to run:

``` ruby
# Sync your current build directory
middleman sync

# Turn on after_build in your sync config to run middleman sync after each build
middleman build
```

## Todo

1. Replace AssetSync's logger to use Middleman's Thor builder.say_status

## Credits

Is essentially :

 - [https://github.com/rumblelabs/asset_sync](https://github.com/rumblelabs/asset_sync)

Cribbed :<commit_msg>AWS readme<commit_after># Middleman Sync

Synchronise your Middleman build to S3 and more

Middleman Sync is post build hook and cli for Middleman to allow you to use [Asset Sync](https://raw.github.com/rumblelabs/asset_sync) for your static build deployments.

## Installation

If you already have a Middleman project:

Add `middleman-sync` to your `Gemfile` then open up your `config.rb` and add:

### AWS

``` ruby
# Activate sync extension
activate :sync do |sync|
  sync.fog_provider = 'AWS' # Your storage provider
  sync.fog_directory = 'bucket-name' # Your bucket name
  sync.fog_region = 'bucket-region-name' # The region your storage bucket is in
  sync.aws_access_key_id = 'super' # Your Amazon S3 access key
  sync.aws_secret_access_key = 'secret' # Your Amazon S3 access secret
  # sync.after_build = true # Run sync after build
  # sync.existing_remote_files = 'keep' # What to do with your existing remote files? (keep or delete)
end
```

## Usage

Once you've bundled you should be able to run:

``` ruby
# Sync your current build directory
middleman sync

# Turn on after_build in your sync config to run middleman sync after each build
middleman build
```

## Todo

1. Replace AssetSync's logger to use Middleman's Thor builder.say_status

## Credits

Is essentially :

 - [https://github.com/rumblelabs/asset_sync](https://github.com/rumblelabs/asset_sync)

Cribbed :
{'fraction_non_alphanumeric': 0.0888382687927107, 'fraction_numerical': 0.002277904328018223, 'mean_word_length': 4.3885480572597135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1803866', 'n_tokens_mistral': 858, 'n_tokens_neox': 824, 'n_words': 306}