waz-sync 0.0.3 → 0.0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -35,6 +35,31 @@ Create a config file to /app/config/azure.yml to hold your Azure credentials
35
35
 
36
36
  This simple code will sync all your assets unders "images", "javascripts" and "stylesheets" to Windows Azure CDN
37
37
 
38
+ === Rake task
39
+
40
+ There is a rake task included to this Gem. To use it you first have to include this line into your Rakefile
41
+ require 'waz_sync/tasks'
42
+
43
+ Then you can use the rake task
44
+ rake waz:sync
45
+
46
+ By default it does sync your images, javascripts and stylesheets folders, but you can specify which folder to sync
47
+ rake waz:sync folders=images,foo,bar
48
+
49
+ === capistrano recipe
50
+
51
+ If you use capistrano to deploy you app it's a good idea to sync you assets during each deploy.
52
+ Add this line to your deploy.rb
53
+ require "waz_sync/recipes"
54
+
55
+ Then you can add these callbacks
56
+ before "deploy:stop", "waz_sync:sync"
57
+ before "deploy:start", "waz_sync:sync"
58
+ before "deploy:restart", "waz_sync:sync"
59
+
60
+ There is also a variable :waz_sync_args where you can specify which folder to sync
61
+ set :waz_sync_args, "images,foo,bar"
62
+
38
63
  === Remarks
39
64
  This Gem use a modified version of the waz-storage gem that you can find there : https://github.com/johnnyhalife/waz-storage
40
65
 
@@ -0,0 +1,35 @@
1
+ # Capistrano Recipes for managing waz_sync
2
+ #
3
+ # Add these callbacks to have the waz_sync process run
4
+ #
5
+ # before "deploy:stop", "waz_sync:sync"
6
+ # before "deploy:start", "waz_sync:sync"
7
+ # before "deploy:restart", "waz_sync:sync"
8
+ #
9
+ # If you want to use command line options, for example to sync only images and stylesheets folders,
10
+ # define a Capistrano variable waz_sync_args:
11
+ #
12
+ # set :waz_sync_args, "stylesheets,folders"
13
+ #
14
+
15
+ Capistrano::Configuration.instance.load do
16
+ namespace :waz_sync do
17
+ def rails_env
18
+ fetch(:rails_env, false) ? "RAILS_ENV=#{fetch(:rails_env)}" : ''
19
+ end
20
+
21
+ def args
22
+ fetch(:waz_sync_args, "")
23
+ end
24
+
25
+ def roles
26
+ fetch(:delayed_job_server_role, :master)
27
+ end
28
+
29
+ desc "Sync your assets to Windows Azure"
30
+ task :sync, :roles => lambda { roles } do
31
+ run "cd #{current_path};#{rails_env} bundle exec rake waz:sync folders=#{args}"
32
+ end
33
+
34
+ end
35
+ end
data/waz-sync.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = 'waz-sync'
4
- gem.version = '0.0.3'
4
+ gem.version = '0.0.3.2'
5
5
  gem.date = '2012-04-20'
6
6
  gem.description = %q{A simple client library aim to sync assets to Windows Azure CDN, using a modified version of the great waz-storage gem}
7
7
  gem.summary = %q{Client library for Syncing assets to Windows Azure CDN}
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 3
9
- version: 0.0.3
9
+ - 2
10
+ version: 0.0.3.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Guillaume MONTARD
@@ -31,6 +32,7 @@ files:
31
32
  - LICENCE
32
33
  - README.rdoc
33
34
  - lib/waz_sync.rb
35
+ - lib/waz_sync/recipes.rb
34
36
  - lib/waz_sync/tasks.rb
35
37
  - rakefile
36
38
  - waz-sync.gemspec