hotdog 0.1.12 → 0.1.13

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: 6348ddfde91219ff81265832db03891ed9d6add6
4
- data.tar.gz: 26936b0ea07053dd51b6ac52833999ce5a3b4be1
3
+ metadata.gz: 505e69a908d6c3e2ddb619720f9f79bf3217cb1d
4
+ data.tar.gz: 70f5d8ac5e652dfd43c036e7dd1e50a9c04a97a4
5
5
  SHA512:
6
- metadata.gz: cb2a0ed3534d157cdaf7535ae58c0fbc18d84c46d026b050c50be8c9a65aefe4990e2f1b4b047bc681c78f8ba43a3becd2cf113d19ce107713f6b0229c8458f3
7
- data.tar.gz: b89c70fb502bf4140ab2f0d027d7e6a773166272d305105a8a6b78da1e148d423427b0da9ef48399735ec54d9a265944351c9c8d1f86684d7fa5ae9de96c8aed
6
+ metadata.gz: dfa2a35e628a1987d6e02ba325c097634ef926cf4e47ef57c258de678ef44de0c491fa45b67736cad99c26c5b0fbcd75b35204017bd91147d91783a782f4f54c
7
+ data.tar.gz: 94ab71d98c5a0cd615bea26473b39012cc92f41efe1c333a45f0267107375025137e028256598c486a8ab62acb4a00e758a4ce5c6bb8765c1eba45fd891e79e3
@@ -5,11 +5,13 @@ require "optparse"
5
5
  require "yaml"
6
6
  require "hotdog/commands"
7
7
  require "hotdog/formatters"
8
+ require "hotdog/version"
8
9
 
9
10
  module Hotdog
10
11
  class Application
11
12
  def initialize()
12
13
  @optparse = OptionParser.new
14
+ @optparse.version = Hotdog::VERSION
13
15
  @options = {
14
16
  api_key: ENV["DATADOG_API_KEY"],
15
17
  application_key: ENV["DATADOG_APPLICATION_KEY"],
@@ -24,7 +24,7 @@ module Hotdog
24
24
  end
25
25
  }.reduce(:+)
26
26
  end
27
- if 0 < result.length
27
+ if result && (0 < result.length)
28
28
  result, fields = get_hosts(result)
29
29
  STDOUT.print(format(result, fields: fields))
30
30
  logger.info("found %d host(s)." % result.length)
@@ -77,6 +77,7 @@ module Hotdog
77
77
  | term.as(:left) >> spacing.maybe >> (str('|') >> str('|').maybe).as(:binary_op) >> spacing.maybe >> expression.as(:right) \
78
78
  | term.as(:left) >> spacing.maybe >> (match('[Aa]') >> match('[Nn]') >> match('[Dd]')).as(:binary_op) >> spacing.maybe >> expression.as(:right) \
79
79
  | term.as(:left) >> spacing.maybe >> (match('[Oo]') >> match('[Rr]')).as(:binary_op) >> spacing.maybe >> expression.as(:right) \
80
+ | term.as(:left) >> spacing.maybe.as(:binary_op) >> expression.as(:right) \
80
81
  )
81
82
  }
82
83
  rule(:unary_expression) {
@@ -184,6 +185,7 @@ module Hotdog
184
185
 
185
186
  def initialize(op, left, right)
186
187
  @op = op
188
+ @op ||= "or" # use OR expression by default
187
189
  @left = left
188
190
  @right = right
189
191
  end
@@ -202,7 +204,7 @@ module Hotdog
202
204
  right_values = @right.evaluate(environment)
203
205
  (left_values | right_values).uniq
204
206
  else
205
- raise(SyntaxError.new("unknown binary operator: #{@op}"))
207
+ raise(SyntaxError.new("unknown binary operator: #{@op.inspect}"))
206
208
  end
207
209
  end
208
210
  end
@@ -228,7 +230,7 @@ module Hotdog
228
230
  EOS
229
231
  end
230
232
  else
231
- raise(SyntaxError.new("unknown unary operator: #{@op}"))
233
+ raise(SyntaxError.new("unknown unary operator: #{@op.inspect}"))
232
234
  end
233
235
  end
234
236
  end
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
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.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamashita Yuu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,3 +154,4 @@ signing_key:
154
154
  specification_version: 4
155
155
  summary: Yet another command-line tool for Datadog
156
156
  test_files: []
157
+ has_rdoc: