blower 4.6 → 4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 79e96973d020612b20933bb5d08a5b0b82e2c1de
4
- data.tar.gz: 37683b25be0777820a0c2bb1d74f8bec2799caff
2
+ SHA256:
3
+ metadata.gz: cd4ef69511d05d0f1ee58cd814ddc58a85102c467fe695a0520cf02345dbad69
4
+ data.tar.gz: 82aeb0b7c6ead150c17d78f50513c300b5aa326cd7ccf4c1932eb84017e712d2
5
5
  SHA512:
6
- metadata.gz: 331772a9141a5a58107c4002b248e9b7d5cea5e16931578dc9e91a8954393ce4fcfb81ea1ce575984ca4c96229fa29dbe862ce4625691bd64053474b306eeecc
7
- data.tar.gz: 98256c7a32c6221eb34dd702cd52b7c97371d3bffbbe17f0bf979ecd01f0bbc0becdaf31f22d25b3e2eb692ee95b39ab1ac46404977dd92ca322ee395b67e848
6
+ metadata.gz: e932789921c9553fbefd425a38db2d0d3db063681a660065ad9e642b0335d364e09a392fd34535fb64ba57d05d87da40f8a8f9420d7749f53a8ff5a8851efc79
7
+ data.tar.gz: 40bf21b8b30968869d6a3f425155d66a4cb562fc1f1241e40f14c5987ac1b670713e10a4bbc148373e2b3012c376ada391f6157da79df24e947790bf3aa767f1
@@ -1,3 +1,4 @@
1
+ require 'find'
1
2
  require 'erb'
2
3
  require 'json'
3
4
  require 'forwardable'
@@ -158,12 +159,12 @@ module Blower
158
159
  # @macro asable
159
160
  # @macro quietable
160
161
  # @macro onceable
161
- def cp (from, to, as: user, on: hosts, quiet: false, once: nil)
162
+ def cp (from, to, as: user, on: hosts, quiet: false, once: nil, delete: false)
162
163
  self.once once, quiet: quiet do
163
164
  log.info "cp: #{from} -> #{to}", quiet: quiet do
164
165
  Dir.chdir File.dirname(file) do
165
166
  hash_map(hosts) do |host|
166
- host.cp from, to, as: as, quiet: quiet
167
+ host.cp from, to, as: as, quiet: quiet, delete: delete
167
168
  end
168
169
  end
169
170
  end
@@ -212,12 +213,24 @@ module Blower
212
213
  def render (from, to, as: user, on: hosts, quiet: false, once: nil)
213
214
  self.once once, quiet: quiet do
214
215
  Dir.chdir File.dirname(file) do
215
- (Dir["#{from}**/*.erb"] + Dir["#{from}**/.*.erb"]).each do |path|
216
- template = ERB.new(File.read(path))
217
- to_path = to + path[from.length..-5]
218
- log.info "render: #{path} -> #{to_path}", quiet: quiet do
219
- hash_map(hosts) do |host|
220
- host.cp StringIO.new(template.result(binding)), to_path, as: as, quiet: quiet
216
+ Find.find(from).each do |path|
217
+ if File.directory?(path)
218
+ to_path = to + path[from.length..-1]
219
+ sh "mkdir -p #{to_path.shellescape}"
220
+ elsif path =~ /\.erb$/
221
+ template = ERB.new(File.read(path))
222
+ to_path = to + path[from.length..-5]
223
+ log.info "render: #{path} -> #{to_path}", quiet: quiet do
224
+ hash_map(hosts) do |host|
225
+ host.cp StringIO.new(template.result(binding)), to_path, as: as, quiet: quiet
226
+ end
227
+ end
228
+ else
229
+ to_path = to + path[from.length..-1]
230
+ log.info "copy: #{path} -> #{to_path}", quiet: quiet do
231
+ hash_map(hosts) do |host|
232
+ host.cp File.open(path), to_path, as: as, quiet: quiet
233
+ end
221
234
  end
222
235
  end
223
236
  end
@@ -316,7 +329,7 @@ module Blower
316
329
  begin
317
330
  yield host
318
331
  rescue => e
319
- host.log.error e.message
332
+ host.log.error e.full_message
320
333
  hosts.delete host
321
334
  end
322
335
  end
@@ -55,7 +55,7 @@ module Blower
55
55
 
56
56
  # Copy files or directories to the host.
57
57
  # @api private
58
- def cp (froms, to, as: nil, quiet: false)
58
+ def cp (froms, to, as: nil, quiet: false, delete: false)
59
59
  as ||= @user
60
60
  output = ""
61
61
  synchronize do
@@ -63,6 +63,10 @@ module Blower
63
63
  if from.is_a?(String)
64
64
  to += "/" if to[-1] != "/" && from.is_a?(Array)
65
65
  command = ["rsync", "-e", ssh_command, "-r"]
66
+ if File.exist?(".blowignore")
67
+ command += ["--exclude-from", ".blowignore"]
68
+ end
69
+ command += ["--delete"] if delete
66
70
  command += [*from, "#{as}@#{@address}:#{to}"]
67
71
  log.trace command.shelljoin, quiet: quiet
68
72
  IO.popen(command, in: :close, err: %i(child out)) do |io|
@@ -1,3 +1,3 @@
1
1
  module Blower
2
- VERSION = "4.6"
2
+ VERSION = "4.7"
3
3
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blower
3
3
  version: !ruby/object:Gem::Version
4
- version: '4.6'
4
+ version: '4.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Baum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-30 00:00:00.000000000 Z
11
+ date: 2018-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: net-ssh-gateway
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: net-scp
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.2'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.2'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rbnacl
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bcrypt_pbkdf
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: yard
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
144
  version: '0'
117
145
  requirements: []
118
146
  rubyforge_project:
119
- rubygems_version: 2.6.10
147
+ rubygems_version: 2.7.7
120
148
  signing_key:
121
149
  specification_version: 4
122
150
  summary: Really simple server orchestration