blower 3.3 → 3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blow +10 -3
- data/lib/blower/context.rb +4 -4
- data/lib/blower/host.rb +5 -5
- data/lib/blower/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2038dcb8532a933ded5b0e986f5c219a4d5749b
|
4
|
+
data.tar.gz: cf04e56b0a72200cfeceefeecbd4b2688e0f8b17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1de9c6423f7b5e3692c46b49ea69801a080ff8c770a49d5add4b447c1cee61fdb8a49f35ee1357651dd07ba524d8795898bc37a3c1b44fac33c5ed523569991d
|
7
|
+
data.tar.gz: a4bd0455c23e6ae2024d92e02f8ca958a139f1c2965b5f5dc8c66135ff72b23abdae682f0a113ee4c6c7f30e4fb265853c53b10e72c32dfa73cc3c721c9f88c5
|
data/bin/blow
CHANGED
@@ -7,11 +7,18 @@ $LOGLEVEL = :info
|
|
7
7
|
|
8
8
|
OptionParser.new do |opts|
|
9
9
|
opts.banner = "Usage: blow [options] task..."
|
10
|
-
opts.on "-d DIR", "
|
10
|
+
opts.on "-d DIR", "Set working directory" do |v|
|
11
11
|
Dir.chdir v
|
12
12
|
end
|
13
|
-
opts.on "-l LEVEL", "Minimal log level" do |
|
14
|
-
$LOGLEVEL =
|
13
|
+
opts.on "-l LEVEL", "Minimal log level" do |v|
|
14
|
+
$LOGLEVEL = v.downcase.to_sym
|
15
|
+
end
|
16
|
+
opts.on "-I DIR", "Add directory to search path" do |v|
|
17
|
+
$LOGLEVEL = v.downcase.to_sym
|
18
|
+
end
|
19
|
+
opts.on "-v", "Show version and exit" do |v|
|
20
|
+
puts Blower::VERSION
|
21
|
+
exit
|
15
22
|
end
|
16
23
|
end.order!
|
17
24
|
|
data/lib/blower/context.rb
CHANGED
@@ -148,11 +148,11 @@ module Blower
|
|
148
148
|
|
149
149
|
# Execute a command on the remote host.
|
150
150
|
# @return false if the command exits with a non-zero status
|
151
|
-
def ping (quiet: false)
|
151
|
+
def ping (quiet: false, **args)
|
152
152
|
log.debug "ping" unless quiet
|
153
153
|
win = true
|
154
154
|
each do |host|
|
155
|
-
win &&= host.ping
|
155
|
+
win &&= host.ping(**args)
|
156
156
|
end
|
157
157
|
win
|
158
158
|
end
|
@@ -162,7 +162,7 @@ module Blower
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def rebase_path (path)
|
165
|
-
path.gsub(/^(
|
165
|
+
path.gsub(/^(?!\/|.\/)/, File.dirname(@file) + "/")
|
166
166
|
end
|
167
167
|
|
168
168
|
# Copy a file or readable to the host filesystem.
|
@@ -213,7 +213,7 @@ module Blower
|
|
213
213
|
name = File.join(dir, task)
|
214
214
|
name += ".rb" unless File.exist?(name)
|
215
215
|
if File.directory?(name)
|
216
|
-
dirtask = File.join(name, @
|
216
|
+
dirtask = File.join(name, @basename)
|
217
217
|
dirtask += ".rb" unless File.exist?(dirtask)
|
218
218
|
name = dirtask
|
219
219
|
blowfile = File.join(name, "Blowfile")
|
data/lib/blower/host.rb
CHANGED
@@ -30,15 +30,15 @@ module Blower
|
|
30
30
|
super()
|
31
31
|
end
|
32
32
|
|
33
|
-
def ping
|
33
|
+
def ping (retries: 0)
|
34
34
|
Timeout.timeout(1) do
|
35
35
|
TCPSocket.new(address, 22).close
|
36
36
|
end
|
37
37
|
true
|
38
|
-
rescue Timeout::Error
|
39
|
-
false
|
40
|
-
|
41
|
-
|
38
|
+
rescue Timeout::Error, Errno::ECONNREFUSED
|
39
|
+
return false if retries == 0
|
40
|
+
retries -= 1
|
41
|
+
retry
|
42
42
|
end
|
43
43
|
|
44
44
|
def cp (froms, to, output = "", user: nil, rsync_command: nil, sh_command: nil)
|
data/lib/blower/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '3.
|
4
|
+
version: '3.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Baum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|