hotdog 0.28.0 → 0.29.0

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: 767a3a461352d6a061a8a7541c63485b8aa93a82
4
- data.tar.gz: d10b581aefae9b078c25560de2eac8f7102cdb36
3
+ metadata.gz: cd9ee4784a5a2ae1305938dad9acffbda27344f5
4
+ data.tar.gz: ab2ae3bdce389ba30f9bb20f11b9ab5952edc19a
5
5
  SHA512:
6
- metadata.gz: d448f39a939e75d2063e435b6b883d5fc9b77b13070a7d7478505201cfad1e8f36fcce91b5088323fff2a7ba6bcfb1bcc44ae164804b1e6149983bd3c8f983e0
7
- data.tar.gz: 130e2134cb73948d096006ac9b2443be9a0f3ceafae62c4fd6c004337e5ee697bd2327cd45ba53d4eceaacd8938e21067cb2bd5166b8117ac5d96dc867a55f29
6
+ metadata.gz: 21a810b1448b94c8678e02bccf635a3716b796b2846d317cd493b092f707bc2111a1787dee5c7f6db4df8ad9d56cde2a9d95926cf177f771fec37e61bb4b2c91
7
+ data.tar.gz: b1bfbba8629422bb3ede7dee2c5b2f65c0ea1029723ab92d60b4a997656af6bc13a7bf6436600a7c72436d25d4b1ebc2eb59d0ba33052645cc1a770ca5f02781
@@ -48,15 +48,10 @@ module Hotdog
48
48
  result0 = evaluate(node, self)
49
49
  if 0 < result0.length
50
50
  result, fields = get_hosts_with_search_tags(result0, node)
51
- if options[:limit]
52
- STDOUT.print(format(result.take(options[:limit]), fields: fields))
53
- logger.info("found %d host(s), limited to %d in result." % [result.length, options[:limit]])
54
- else
55
- STDOUT.print(format(result, fields: fields))
56
- logger.info("found %d host(s)." % result.length)
57
- end
51
+ STDOUT.print(format(result, fields: fields))
52
+ logger.info("found %d host(s)." % result.length)
58
53
  else
59
- STDERR.puts("no match found: #{expression}")
54
+ logger.error("no match found: #{expression}")
60
55
  exit(1)
61
56
  end
62
57
  end
@@ -121,10 +116,13 @@ module Hotdog
121
116
 
122
117
  private
123
118
  def rewrite_expression(expression)
124
- if expression.empty?
119
+ if expression.strip.empty?
125
120
  # return everything if given expression is empty
126
121
  expression = "*"
127
122
  end
123
+ if options[:limit]
124
+ expression = "LIMIT((#{expression}), #{options[:limit]})"
125
+ end
128
126
  expression
129
127
  end
130
128
  end
@@ -108,7 +108,7 @@ module Hotdog
108
108
 
109
109
  def validate_hosts!(tuples, fields)
110
110
  if tuples.length < 1
111
- STDERR.puts("no match found")
111
+ logger.error("no match found")
112
112
  exit(1)
113
113
  end
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.28.0"
2
+ VERSION = "0.29.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamashita Yuu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-22 00:00:00.000000000 Z
11
+ date: 2017-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler