and-son 0.1.0 → 0.1.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.
data/and-son.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency("sanford-protocol", ["~>0.4"])
20
+ gem.add_dependency("sanford-protocol", ["~>0.5"])
21
21
 
22
22
  gem.add_development_dependency("assert", ["~>1.0"])
23
23
  gem.add_development_dependency("assert-mocha", ["~>1.0"])
@@ -20,7 +20,13 @@ module AndSon
20
20
  if !hash.kind_of?(Hash)
21
21
  raise ArgumentError, "expected params to be a Hash instead of a #{hash.class}"
22
22
  end
23
- self.call_runner.tap{|r| r.params_value.merge!(hash) }
23
+ self.call_runner.tap{|r| r.params_value.merge!(self.stringify_keys(hash)) }
24
+ end
25
+
26
+ protected
27
+
28
+ def stringify_keys(hash)
29
+ hash.inject({}){|h, (k, v)| h.merge({ k.to_s => v }) }
24
30
  end
25
31
 
26
32
  end
@@ -12,7 +12,7 @@ module AndSon
12
12
  protocol_connection = Sanford::Protocol::Connection.new(tcp_socket)
13
13
  yield protocol_connection if block_given?
14
14
  ensure
15
- protocol_connection.close rescue false
15
+ protocol_connection.close
16
16
  end
17
17
 
18
18
  private
@@ -1,3 +1,3 @@
1
1
  module AndSon
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -39,12 +39,13 @@ class AndSon::Client
39
39
  assert_equal 10.0, runner.timeout_value
40
40
  end
41
41
 
42
- should "return a CallRunner with params_value set using #params" do
42
+ should "return a CallRunner with params_value set using #params and stringify " \
43
+ "the params hash" do
43
44
  runner = subject.params({ :api_key => 12345 })
44
45
 
45
46
  assert_kind_of AndSon::CallRunner, runner
46
47
  assert_respond_to :call, runner
47
- assert_equal({ :api_key => 12345 }, runner.params_value)
48
+ assert_equal({ "api_key" => 12345 }, runner.params_value)
48
49
  end
49
50
 
50
51
  should "raise an ArgumentError when #params is not passed a Hash" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: and-son
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Collin Redding
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-11-28 00:00:00 Z
19
+ date: 2012-11-30 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  prerelease: false
@@ -25,11 +25,11 @@ dependencies:
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- hash: 3
28
+ hash: 1
29
29
  segments:
30
30
  - 0
31
- - 4
32
- version: "0.4"
31
+ - 5
32
+ version: "0.5"
33
33
  requirement: *id001
34
34
  name: sanford-protocol
35
35
  type: :runtime