cap_sync 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -6
- data/cap_sync.gemspec +1 -1
- data/lib/cap_sync.rb +5 -3
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -4,17 +4,15 @@ Recipes to clone database & public data from production server to developement m
|
|
4
4
|
|
5
5
|
= Installation
|
6
6
|
|
7
|
-
|
7
|
+
Add this to your Gemfile
|
8
8
|
|
9
|
-
|
9
|
+
group :development do
|
10
|
+
gem 'cap_sync', :require => false
|
11
|
+
end
|
10
12
|
|
11
13
|
Add following line to your Capfile:
|
12
14
|
|
13
|
-
if gem 'cap_sync'
|
14
15
|
require 'cap_sync'
|
15
|
-
else
|
16
|
-
puts '* Warning: Execute "gem install cap_sync" to make sync:db and sync:data work'
|
17
|
-
end
|
18
16
|
|
19
17
|
= Syncing database
|
20
18
|
|
data/cap_sync.gemspec
CHANGED
data/lib/cap_sync.rb
CHANGED
@@ -35,14 +35,16 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
desc "Sync remote production data with local development machine"
|
38
|
-
task :data do
|
38
|
+
task :data do
|
39
|
+
folders_to_sync = Hash[*ENV['FOLDERS'].split(',')] || sync_folders
|
40
|
+
|
39
41
|
if sync_method == :rsync
|
40
|
-
|
42
|
+
folders_to_sync.each do |remote, local|
|
41
43
|
host = find_servers(:roles => :web).first.host
|
42
44
|
system("#{rsync_cmd} #{rsync_flags} #{user}@#{host}:#{remote}/. #{local}")
|
43
45
|
end
|
44
46
|
elsif sync_method == :cap
|
45
|
-
|
47
|
+
folders_to_sync.each do |remote, local|
|
46
48
|
::FileUtils.rm_rf(local, :verbose => true)
|
47
49
|
download(remote, local, :recursive => true) do |event, downloader, *args|
|
48
50
|
case event
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Sokolov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-09-14 00:00:00 +04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements: []
|
65
65
|
|
66
66
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.6.
|
67
|
+
rubygems_version: 1.6.2
|
68
68
|
signing_key:
|
69
69
|
specification_version: 3
|
70
70
|
summary: Recipes to clone database & public data from production server to developement machine
|