elastomer-client 0.3.2 → 0.3.3

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: e82302d43fced9352f7a34365d970c5c68372244
4
- data.tar.gz: 5a5125d962c5648390e13d20ff15de07dc63d117
3
+ metadata.gz: 2d0dde42bf5e2cd7b2a2da696528ec66b8b44c75
4
+ data.tar.gz: 82b5315520a01408b40c97149649a197196d0d4e
5
5
  SHA512:
6
- metadata.gz: d1359ce4cb196c178ad8015e9b351ac5cdc227dbdd1b68b4ba0eef12fba520e6e12f83b3112dadef8b07f3977736999ada69850e853f34be366d9aa89212ed4f
7
- data.tar.gz: 9c3973a14dd4a064c15b012cde567ab12bc1692937d38969784ef728b60e61cd7f562d8cf77446beef089f6fa5fa2083ea3647c6628f5e9fc99e0f526896351d
6
+ metadata.gz: e73b854104d40f4d2310e78f3bb480b1c1ca6b91be50bcd93f263fc7a6373364cacdea81c00a955818788e915d20b23fd9c713cd78b410ea25bdd7d6a4eeab2c
7
+ data.tar.gz: d2091b590bb120763fbe74c6e4b4ce2fcdef423bb61dd249e39ef17c781cd78f990ebeb5382a32ffbb36808f8103eb1119381207541bfb3ceaabdb3ab9d6e4f0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.3 (2014-08-18)
2
+ - Allow symbols as parameter values #67
3
+ ## 0.3.2 (2014-07-02)
4
+ - Make underscore optional in bulk params #66
1
5
  ## 0.3.1 (2014-06-24)
2
6
  - First rubygems release
3
7
  - Make `update_aliases` more flexible
@@ -265,7 +265,8 @@ module Elastomer
265
265
  response
266
266
  end
267
267
 
268
- # Internal: Ensure that the parameter has a valid value. Things like `nil`
268
+ # Internal: Ensure that the parameter has a valid value. Strings, Symbols,
269
+ # Numerics, and Arrays of those things are valid. Things like `nil`
269
270
  # and empty strings are right out. This method also performs a little
270
271
  # formating on the parameter:
271
272
  #
@@ -281,7 +282,7 @@ module Elastomer
281
282
  # Raises an ArgumentError if the param is not valid.
282
283
  def assert_param_presence( param, name = 'input value' )
283
284
  case param
284
- when String, Numeric
285
+ when String, Symbol, Numeric
285
286
  param = param.to_s.strip
286
287
  raise ArgumentError, "#{name} cannot be blank: #{param.inspect}" if param =~ /\A\s*\z/
287
288
  param
@@ -1,5 +1,5 @@
1
1
  module Elastomer
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
 
4
4
  def self.version
5
5
  VERSION
data/test/client_test.rb CHANGED
@@ -82,5 +82,14 @@ describe Elastomer::Client do
82
82
  it 'flattens arrays' do
83
83
  assert_equal 'foo,bar,baz,buz', $client.assert_param_presence([" foo \t", %w[bar baz buz]])
84
84
  end
85
+
86
+ it 'allows strings' do
87
+ assert_equal 'foo', $client.assert_param_presence("foo")
88
+ end
89
+
90
+ it 'converts numbers and symbols to strings' do
91
+ assert_equal 'foo', $client.assert_param_presence(:foo)
92
+ assert_equal '9', $client.assert_param_presence(9)
93
+ end
85
94
  end
86
95
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastomer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-03 00:00:00.000000000 Z
12
+ date: 2014-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable