Rack::Rsync
A rack middleware to sync files using rsync.
Installation
Add this line to your application's Gemfile:
gem 'rack-rsync'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-rsync
Usage
Sync when any request:
# config.ru
require "rack/rsync"
use Rack::Rsync, source, destination, "-a", "--delete"
run App
Sync with conditions:
# config.ru
require "rack/rsync"
use Rack::Rsync, source, destination, "-a", "--delete" do |env|
env["REQUEST_METHOD"] == "POST"
end
run App
Contributing
- Fork it ( https://github.com/nownabe/rack-rsync/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request