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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/elastomer/client.rb +3 -2
- data/lib/elastomer/version.rb +1 -1
- data/test/client_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d0dde42bf5e2cd7b2a2da696528ec66b8b44c75
|
4
|
+
data.tar.gz: 82b5315520a01408b40c97149649a197196d0d4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e73b854104d40f4d2310e78f3bb480b1c1ca6b91be50bcd93f263fc7a6373364cacdea81c00a955818788e915d20b23fd9c713cd78b410ea25bdd7d6a4eeab2c
|
7
|
+
data.tar.gz: d2091b590bb120763fbe74c6e4b4ce2fcdef423bb61dd249e39ef17c781cd78f990ebeb5382a32ffbb36808f8103eb1119381207541bfb3ceaabdb3ab9d6e4f0
|
data/CHANGELOG.md
CHANGED
data/lib/elastomer/client.rb
CHANGED
@@ -265,7 +265,8 @@ module Elastomer
|
|
265
265
|
response
|
266
266
|
end
|
267
267
|
|
268
|
-
# Internal: Ensure that the parameter has a valid value.
|
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
|
data/lib/elastomer/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|