cog-rb 0.1.12 → 0.1.14

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: 867cf82cbbd20868948132aa249e0e0eab1f25ea
4
- data.tar.gz: daf0cdefefac6be4c3620161c679f92ca12f83c8
3
+ metadata.gz: ca8b0c6b200dcc1d7b66fc6c2875aa1b0fe03607
4
+ data.tar.gz: 517c213a36ce698ca96a8774900829e5583ea191
5
5
  SHA512:
6
- metadata.gz: b9da0c0faad8363c035cacf9e34f041b30497608dabef4bde7f386bd470569fd1317194959383f21df2c555a36624edbc4f2ef8aa91dec294f99e45f98eac203
7
- data.tar.gz: 6a796959f65942d34c424506483d4bf0d1788230ad8bcf43a34f734300a1c776c8cd2d03ed29b13f6d5e09a629d7579e0ad16a940716c8797d9e71c6be18226f
6
+ metadata.gz: 9ae3e232b57055dbb78ef51527ec6b791d448cc0be77e77ef32c138e8dfdd57c78e81aa05edabc40e0fb1664f0825db95dfac993e683175b03906e004bf0e6ae
7
+ data.tar.gz: 4c79b451f4090c9c44279178c1c5192e06469e56a7ef51ec071e484c50d5f09169270d47c121d84cd3bf5fb2b1769593772974784285ba912b92a4a0f16fc5a2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.14
2
+
3
+ * bugfix: options with scalar values were being ignored
4
+
5
+ ## 0.1.13
6
+
7
+ * Add support for list options
8
+
1
9
  ## 0.1.9
2
10
 
3
11
  * Fix service calls for SSL enabled Cog.
data/lib/cog/request.rb CHANGED
@@ -21,7 +21,18 @@ class Cog
21
21
  return {} if ENV['COG_OPTS'].nil?
22
22
 
23
23
  options = ENV["COG_OPTS"].split(",")
24
- Hash[options.map { |opt| [ opt, ENV["COG_OPT_#{opt.upcase}"] ]}]
24
+ Hash[options.map { |opt| [ opt, opt_val(opt) ] }]
25
+ end
26
+
27
+ # Returns the value of option env var specified by 'opt'. If option is
28
+ # a list it will include a count. In that case we return an array of values.
29
+ def opt_val(opt)
30
+ count = ENV["COG_OPT_#{opt.upcase}_COUNT"]
31
+ if count
32
+ count.to_i.times.map { |i| ENV["COG_OPT_#{opt.upcase}_#{i}"] }
33
+ else
34
+ ENV["COG_OPT_#{opt.upcase}"]
35
+ end
25
36
  end
26
37
  end
27
38
  end
data/lib/cog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cog
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cog-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Imbriaco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-28 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.4.5.1
95
+ rubygems_version: 2.4.5
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Cog command helper library