blower 4.3 → 4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blower/context.rb +17 -1
- data/lib/blower/host.rb +4 -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: 3c6367491fa2a0b915044247edee33154deb5868
|
4
|
+
data.tar.gz: dd912a9d63a01284959b004aa9b3939a4c33a604
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a4979929ad2f8e36b6ee0a1c0ff92bbc7b75abbd8033d07fa2e9aeb5d6068aae4ab02360c33116d330dde7e20e087e34885582b4b753edb5b315e110538b69
|
7
|
+
data.tar.gz: 8324bbf1b404b50d6a922e5c60d75fbf63d2b49ab4dd517ffdeabaa5c9a60cb6d750692fbe2dcdb067e1fabb1ecd1938343c9dae30b88343151cc9f9e395b01e
|
data/lib/blower/context.rb
CHANGED
@@ -265,8 +265,24 @@ module Blower
|
|
265
265
|
|
266
266
|
private
|
267
267
|
|
268
|
+
class HostHash < Hash
|
269
|
+
|
270
|
+
def to_s
|
271
|
+
map do |host, data|
|
272
|
+
"#{host.name.blue} (#{host.address.green})\n" + data.strip.to_s.gsub(/^/, " ")
|
273
|
+
end.join("\n")
|
274
|
+
end
|
275
|
+
|
276
|
+
def stash (key)
|
277
|
+
each do |host, data|
|
278
|
+
host[key] = data.strip
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
|
268
284
|
def hash_map (hosts = self.hosts)
|
269
|
-
|
285
|
+
HostHash.new.tap do |result|
|
270
286
|
each(hosts) do |host|
|
271
287
|
result[host] = yield(host)
|
272
288
|
end
|
data/lib/blower/host.rb
CHANGED
@@ -17,23 +17,22 @@ module Blower
|
|
17
17
|
# The host adress.
|
18
18
|
attr_accessor :address
|
19
19
|
|
20
|
+
attr_accessor :name
|
21
|
+
|
20
22
|
# The gateway host
|
21
23
|
attr_accessor :via
|
22
24
|
|
23
25
|
def_delegators :data, :[], :[]=
|
24
26
|
|
25
|
-
def initialize (address, data: {}, user: "root", via: nil)
|
27
|
+
def initialize (address, data: {}, user: "root", via: nil, name: address)
|
26
28
|
@address = address
|
29
|
+
@name = name
|
27
30
|
@user = user
|
28
31
|
@data = data
|
29
32
|
@via = via
|
30
33
|
super()
|
31
34
|
end
|
32
35
|
|
33
|
-
def name
|
34
|
-
to_s
|
35
|
-
end
|
36
|
-
|
37
36
|
# Represent the host as a string.
|
38
37
|
def to_s
|
39
38
|
"#{@user}@#{@address}"
|
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: '4.
|
4
|
+
version: '4.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-08-
|
11
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|