cloner 0.8.0 → 0.9.0
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.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/cloner/ar.rb +5 -1
- data/lib/cloner/mysql.rb +1 -1
- data/lib/cloner/postgres.rb +1 -1
- data/lib/cloner/rsync.rb +9 -2
- data/lib/cloner/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 652e0cb307e408f626c4376e97480acb8bb830f3463b7272befe0eb8b6cd9b2c
|
4
|
+
data.tar.gz: 825b8ea077f10294d0a561ef75d751e4f85e0109935cafb51ec92de7bd1d74e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87ab8f908f2c9428f39bf8a2d536a54b647b4eac6393aa07c9ebe4db2149226f0d80bed75f46eb25c1359f03e097ac036cde83b847bed9e21d62c26be724d23c
|
7
|
+
data.tar.gz: 5b172cfb19ad692494218221ac0ca0dae3ebbabab08978fdaf314e911bcf334d2fd6db47ce600ebf426f0df6ff8409a9542058e9d36461d269a349b57e416b2f
|
data/README.md
CHANGED
@@ -109,6 +109,11 @@ All functions from cloner/internal.rb can be overriden, for example:
|
|
109
109
|
|
110
110
|
## Changelog
|
111
111
|
|
112
|
+
### 0.9.0
|
113
|
+
|
114
|
+
- Add option to rsync to allow sync one file (thx @AnatolyShirykalov)
|
115
|
+
- Add env_database to allow overriding database env (thx @Yarroo)
|
116
|
+
|
112
117
|
### 0.8.0
|
113
118
|
|
114
119
|
- Change default rsync flags - -z to -zz to support newer versions of rsync
|
data/lib/cloner/ar.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
module Cloner::Ar
|
2
2
|
def ar_conf
|
3
3
|
@conf ||= begin
|
4
|
-
YAML.load_file(Rails.root.join('config', 'database.yml'))[
|
4
|
+
YAML.load_file(Rails.root.join('config', 'database.yml'))[env_database]
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
+
def env_database
|
9
|
+
Rails.env
|
10
|
+
end
|
11
|
+
|
8
12
|
def ar_to
|
9
13
|
ar_conf['database']
|
10
14
|
end
|
data/lib/cloner/mysql.rb
CHANGED
data/lib/cloner/postgres.rb
CHANGED
data/lib/cloner/rsync.rb
CHANGED
@@ -10,8 +10,12 @@ module Cloner::RSync
|
|
10
10
|
"#{rsync_compression} -utvr --checksum -e \"ssh -p #{port}\""
|
11
11
|
end
|
12
12
|
|
13
|
-
def rsync(from, to)
|
14
|
-
|
13
|
+
def rsync(from, to, directory: true, raise_on_error: false)
|
14
|
+
if directory
|
15
|
+
from = "#{from}/" unless from.ends_with?('/')
|
16
|
+
to = "#{to}/" unless to.ends_with?('/')
|
17
|
+
end
|
18
|
+
cmd = "rsync #{rsync_flags} #{e ssh_user}@#{e ssh_host}:#{e from} #{e to}"
|
15
19
|
puts "Running RSync: #{cmd}"
|
16
20
|
pipe = IO.popen(cmd)
|
17
21
|
while (line = pipe.gets)
|
@@ -20,6 +24,9 @@ module Cloner::RSync
|
|
20
24
|
pipe.close
|
21
25
|
ret = $?.to_i
|
22
26
|
if ret != 0
|
27
|
+
if raise_on_error
|
28
|
+
raise "Error: local command exited with #{ret}"
|
29
|
+
end
|
23
30
|
puts "Error: local command exited with #{ret}"
|
24
31
|
end
|
25
32
|
end
|
data/lib/cloner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -111,7 +111,7 @@ homepage: https://github.com/rs-pro/cloner
|
|
111
111
|
licenses:
|
112
112
|
- MIT
|
113
113
|
metadata: {}
|
114
|
-
post_install_message:
|
114
|
+
post_install_message:
|
115
115
|
rdoc_options: []
|
116
116
|
require_paths:
|
117
117
|
- lib
|
@@ -126,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
130
|
-
signing_key:
|
129
|
+
rubygems_version: 3.1.3
|
130
|
+
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Easily clone your production Mongoid database and files for local development
|
133
133
|
test_files: []
|