blower 3.3 → 3.4

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
2
  SHA1:
3
- metadata.gz: d43f77f4efc9572fa69117d03e7793d8c869d4b3
4
- data.tar.gz: 05327fae8c7b571f9772cc562e75374a62aa9503
3
+ metadata.gz: e2038dcb8532a933ded5b0e986f5c219a4d5749b
4
+ data.tar.gz: cf04e56b0a72200cfeceefeecbd4b2688e0f8b17
5
5
  SHA512:
6
- metadata.gz: 7eaa7613ca255291f565ad486bed17bf9196be643ffbe82fd80f11b6267c96acab444947c1d56002c7b07a3b80ab51fca7f55bc91b25e35f0261ca38313cd715
7
- data.tar.gz: be057592658bb8120745c9690e777c7a4652723b06b97ed555c9123a053f948881c526b77bf0c2a3e54d4f31b2dccef4323d1c9b3dcd8ca912077eec3307b52c
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", "Change directory" do |v|
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 |l|
14
- $LOGLEVEL = l.downcase.to_sym
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
 
@@ -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(/^(?!\/)/, File.dirname(@file) + "/")
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, @task ? File.basename(@task) : @basename)
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
- rescue Errno::ECONNREFUSED
41
- false
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)
@@ -1,3 +1,3 @@
1
1
  module Blower
2
- VERSION = "3.3"
2
+ VERSION = "3.4"
3
3
  end
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.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-04-22 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh