hammer_cli 0.17.0 → 0.17.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 025b01a30fd003ed027068563ad6971163cdfaea6a65749d775837df3552ea5e
4
- data.tar.gz: 99177e6377a8fecf639cfe80fd6c79868a2ef24b6638c692d54da3ed8297c9d6
3
+ metadata.gz: 541191afc24c45034d93c4c8adb074510ecc29dbf511becc8b1ba0ef4b2cac6c
4
+ data.tar.gz: 33e1685510fc9e0e4c7d8dafe1a9e78ccbd08f73008681dc8686a5d802e4b2af
5
5
  SHA512:
6
- metadata.gz: b9d259322165498e492bed10e91e8a73b200b8ca78a72fd3011af3cb7fec4d73861274f9a6c23d597c3b4294a25facc7cec1bb4e02c719856a6ecc1de4c15387
7
- data.tar.gz: 8e09c9a846262861b6a86f9ea4dc4dbaeb9bde089f35fe6f8f30b2066ab4e611ed9a8557b25d063bd2158a9811d5f73f4541f65b57e4104072551055015928b4
6
+ metadata.gz: 6a775fe77ed8459c6f223606da43d060ae618eb5c1c599d656f4b7774d42cba9169617681577dbb23d7c0e7e124d3da53a4f5e153a3dc720acf0fa09f550ca1f
7
+ data.tar.gz: c095b66a7155e2ca6b8ae8d00fc183ecf8e45071c258a00d1a109792d1cbf7300f38c5fe5f9d7b285d393f36057867ff4be182cdfb747c5fc44e1e1f5009b9cb
data/doc/release_notes.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Release notes
2
2
  =============
3
+ ### 0.17.1 (2019-05-02)
4
+ * Make sure list opts return a list ([#26703](http://projects.theforeman.org/issues/26703))
5
+
3
6
  ### 0.17.0 (2019-04-24)
4
7
  * Extended capabilities for list type options ([#26120](http://projects.theforeman.org/issues/26120))
5
8
  * Document how to deprecate commands ([PR #301](https://github.com/theforeman/hammer-cli/pull/301)) ([#24964](http://projects.theforeman.org/issues/24964))
@@ -102,7 +102,7 @@ module HammerCLI
102
102
  def format(val)
103
103
  return [] unless val.is_a?(String) && !val.empty?
104
104
  begin
105
- JSON.parse(val)
105
+ [JSON.parse(val)].flatten(1)
106
106
  rescue JSON::ParserError
107
107
  HammerCLI::CSVParser.new.parse(val)
108
108
  end
@@ -1,5 +1,5 @@
1
1
  module HammerCLI
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.17.0'
3
+ @version ||= Gem::Version.new '0.17.1'
4
4
  end
5
5
  end
@@ -50,6 +50,10 @@ describe HammerCLI::Options::Normalizers do
50
50
  formatter.format("a").must_equal ['a']
51
51
  end
52
52
 
53
+ it "should parse a number" do
54
+ formatter.format("2").must_equal [2]
55
+ end
56
+
53
57
  it "should parse a comma separated string" do
54
58
  formatter.format("a,b,c").must_equal ['a', 'b', 'c']
55
59
  end
@@ -71,9 +75,8 @@ describe HammerCLI::Options::Normalizers do
71
75
  end
72
76
 
73
77
  it "should accept and parse JSON" do
74
- formatter.format("{\"name\":\"bla\", \"value\":1}").must_equal(
75
- JSON.parse("{\"name\":\"bla\", \"value\":1}")
76
- )
78
+ value = {'name' => 'bla', 'value' => 1}
79
+ formatter.format(value.to_json).must_equal([value])
77
80
  end
78
81
  end
79
82
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bačovský
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-04-24 00:00:00.000000000 Z
12
+ date: 2019-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp