hotdog 0.27.1 → 0.28.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: c50905e95a355910d2c5b79718f9eeb2a979b8b1
4
- data.tar.gz: d1b32b0865160e303e6912125ae13a711b58fca3
3
+ metadata.gz: 767a3a461352d6a061a8a7541c63485b8aa93a82
4
+ data.tar.gz: d10b581aefae9b078c25560de2eac8f7102cdb36
5
5
  SHA512:
6
- metadata.gz: 6b53a6a4ff7e6069d0238c1ad915af5678755e1152a761d3939a77056b149cd4ad77058137bbe111090e585d3dcd839927c820bf9844dcab7bcb23a95837a1a0
7
- data.tar.gz: 794ec26214132db55833ba020452fb551baab5e7a5bebc4266b39c84ec8ae800ec7a72c9f3f7f645bd363b635cf3c2cf3f0aa4335588a0ba7ca0816a29a3b2c3
6
+ metadata.gz: d448f39a939e75d2063e435b6b883d5fc9b77b13070a7d7478505201cfad1e8f36fcce91b5088323fff2a7ba6bcfb1bcc44ae164804b1e6149983bd3c8f983e0
7
+ data.tar.gz: 130e2134cb73948d096006ac9b2443be9a0f3ceafae62c4fd6c004337e5ee697bd2327cd45ba53d4eceaacd8938e21067cb2bd5166b8117ac5d96dc867a55f29
@@ -231,10 +231,13 @@ module Hotdog
231
231
  @optparse.on("--primary-tag TAG", "Use specified tag as the primary tag") do |tag|
232
232
  options[:primary_tag] = tag
233
233
  end
234
+ @optparse.on("-q", "--[no-]quiet", "Decrease verbosity") do |v|
235
+ options[:verbosity] -= 1
236
+ end
234
237
  @optparse.on("-x", "--display-search-tags", "Show tags used in search expression") do |v|
235
238
  options[:display_search_tags] = v
236
239
  end
237
- @optparse.on("-V", "-v", "--[no-]verbose", "Enable verbose mode") do |v|
240
+ @optparse.on("-V", "-v", "--[no-]verbose", "Increase verbosity") do |v|
238
241
  options[:verbosity] += 1
239
242
  end
240
243
  @optparse.on("--[no-]offline", "Enable offline mode") do |v|
@@ -8,9 +8,13 @@ module Hotdog
8
8
  def format(result, options={})
9
9
  result = prepare(result)
10
10
  if options[:headers] and options[:fields]
11
- result.unshift(options[:fields])
11
+ result.map! do |record|
12
+ Hash[options[:fields].zip(record)]
13
+ end
14
+ JSON.pretty_generate(result) + newline
15
+ else
16
+ JSON.pretty_generate(result) + newline
12
17
  end
13
- JSON.pretty_generate(result) + newline
14
18
  end
15
19
  end
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.27.1"
2
+ VERSION = "0.28.0"
3
3
  end
@@ -40,26 +40,21 @@ describe "json" do
40
40
  }
41
41
  expect(fmt.format([["foo", "aaa", 1], ["bar", "bbb", 2], ["baz", "ccc", 3]], options)).to eq(<<-EOS)
42
42
  [
43
- [
44
- "key1",
45
- "key2",
46
- "val1"
47
- ],
48
- [
49
- "foo",
50
- "aaa",
51
- 1
52
- ],
53
- [
54
- "bar",
55
- "bbb",
56
- 2
57
- ],
58
- [
59
- "baz",
60
- "ccc",
61
- 3
62
- ]
43
+ {
44
+ "key1": "foo",
45
+ "key2": "aaa",
46
+ "val1": 1
47
+ },
48
+ {
49
+ "key1": "bar",
50
+ "key2": "bbb",
51
+ "val1": 2
52
+ },
53
+ {
54
+ "key1": "baz",
55
+ "key2": "ccc",
56
+ "val1": 3
57
+ }
63
58
  ]
64
59
  EOS
65
60
  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.27.1
4
+ version: 0.28.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-15 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler