malsh 0.1.7 → 0.1.8

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/malsh/version.rb +1 -1
  3. data/lib/malsh.rb +6 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bc1c3a356c2adcf0d6fe93e26215d5ec733b762
4
- data.tar.gz: 3f647317f7a914ce6c0409972c22effa21ff8a69
3
+ metadata.gz: 0fa06d731f4c92e454a03334fa7c3964ca767371
4
+ data.tar.gz: b44f30a0dbaac3f827206cb03065b87b176aca18
5
5
  SHA512:
6
- metadata.gz: 5d09534b84899e65215a60a6a3fbf977c5e21988b1187157c3812b7435b6c6da62cdf37e0be6c5b5240551139a289d9b5fdb96a60f2306e75e28488bbf606198
7
- data.tar.gz: 486cb75698d3d3a2e17321275c03977cdd014b3c33bec5b11ad16d792401cb0aa49a2e5c2f48b1dff161fea30f0a776b2d0e5fcebc93df7ce5c9ef17eef3f011
6
+ metadata.gz: e82b0c6a6924df2d1b3905ae08d01c50814cf8f031560571aac52e67786ce7cd5724a74d094f356cab1a76de75ecdfe4d7ae897eac6fe1725a430d1201698a3a
7
+ data.tar.gz: 9cf7bb1593c2edf7489e44ce0d20e476225b71eb48fa490faed22fb69f4a8fe2b69bdca7976439c2ead7f28186fcaad120b8cfdd0502a81b501a2590f2c054f0
data/lib/malsh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Malsh
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/malsh.rb CHANGED
@@ -32,12 +32,16 @@ module Malsh
32
32
 
33
33
  def hosts(options = {})
34
34
  @_hosts ||= Mackerel.hosts(options).reject do |h|
35
- Malsh.options[:invert_match] && Malsh.options[:invert_match].find {|v| h.name.match(/#{v}/) }
35
+ Malsh.options[:invert_match] && Malsh.options[:invert_match].find {|v| host_name(h).match(/#{v}/) }
36
36
  end.reject do |h|
37
- Malsh.options[:regexp] && Malsh.options[:regexp].all? {|r| !h.name.match(/#{r}/)}
37
+ Malsh.options[:regexp] && Malsh.options[:regexp].all? {|r| !host_name(h).match(/#{r}/)}
38
38
  end
39
39
  end
40
40
 
41
+ def host_name(host)
42
+ host.displayName || host.name
43
+ end
44
+
41
45
  def host_by_id(id)
42
46
  Mackerel.host(id)
43
47
  end
@@ -59,5 +63,3 @@ module Malsh
59
63
  end
60
64
  end
61
65
  end
62
-
63
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuhiko yamahsita
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor