cottus 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 98294e799b9473ff9c55f0b3673ac133661a62e0
4
- data.tar.gz: 222dbb234ad98069ce4991591d4e9d9d3d6e9803
3
+ metadata.gz: ecc4ff9c7665bc9c8dd0bfd2f823b75cad6274e2
4
+ data.tar.gz: 0689ac0d84036f71550017bde201bb533215a8fb
5
5
  SHA512:
6
- metadata.gz: b4600796f17181e67de09adf662cf784306e121c110b4decc78a8853d1c136ca0e7dd4aadd92f581c5cbf5ddc27adf20d0c4061571ddb5560da7ed2d6ddc4754
7
- data.tar.gz: 444b03bf8efb611f7e0c9570d6bb917da52f037b25fa57a76db38fe5c579737044d0d677e0f2e0a3d8aa111de96d5fe7e852131d36dda78934cf585c4898245f
6
+ metadata.gz: e297a556782028c264222df3e6a3edaf657ddc9e4eaa243f238fae2188eb512e6635827edadf05a31f24350f8b4cf5ccecaa3880cc9acfcb7c5e357dafdb2b5b
7
+ data.tar.gz: bd848b6c1b94e89a97e16bf701086251bdf5cfe65af1c0a75d03782ab271ad9792134dda673186e061b45da9adc18356a18c5a2d4907db16de11149cbec21915
data/README.md CHANGED
@@ -28,11 +28,11 @@ require 'cottus'
28
28
  client = Cottus::Client.new(['http://n1.com', 'http://n2.com', 'http://n3.com'])
29
29
 
30
30
  # This request will be made against http://n1.com
31
- response = client.get('/any/path', query: {id: 1337})
31
+ response = client.get('/any/path', :query => {:id => 1337})
32
32
  puts response.body, response.code, response.message, response.headers.inspect
33
33
 
34
34
  # This request will be made against http://n2.com
35
- response = client.post('/any/path', query: {id: 1337}, body: { attribute: 'cool'})
35
+ response = client.post('/any/path', :query => {:id => 1337}, :body => { :attribute => 'cool'})
36
36
  puts response.body, response.code, response.message, response.headers.inspect
37
37
  ```
38
38
 
@@ -87,7 +87,7 @@ options hash as you create your instance, as such:
87
87
  ```ruby
88
88
  require 'cottus'
89
89
 
90
- client = Cottus::Client.new(['http://n1.com', 'http://n2.com'], strategy: MyStrategy)
90
+ client = Cottus::Client.new(['http://n1.com', 'http://n2.com'], :strategy => MyStrategy)
91
91
  ```
92
92
 
93
93
  Want some additional options passed when your strategy is initialized?
@@ -98,8 +98,14 @@ hash to the client.
98
98
  ```ruby
99
99
  require 'cottus'
100
100
 
101
- client = Cottus::Client.new(['http://n1.com', 'http://n2.com'], strategy: MyStrategy,
102
- strategy_options: { an_option: 'cool stuff!'})
101
+ options = {
102
+ :strategy => MyStrategy,
103
+ :strategy_options => {
104
+ :an_option => 'cool stuff!'
105
+ }
106
+ }
107
+
108
+ client = Cottus::Client.new(['http://n1.com', 'http://n2.com'], options)
103
109
  ```
104
110
 
105
111
  The options will be passed as an options hash to the strategy, as explained
@@ -107,7 +113,7 @@ above.
107
113
 
108
114
  Boom! That's all there is, for the moment.
109
115
 
110
- ## Cottus?
116
+ ## cottus?
111
117
 
112
118
  Cottus was one of the Hecatonchires of Greek mythology.
113
119
  The Hecatonchires, "Hundred-Handed Ones" (also with 50 heads) were figures in an
@@ -53,7 +53,9 @@ module Cottus
53
53
  end
54
54
 
55
55
  def create_strategy(options)
56
- strategy = (options[:strategy] || RoundRobinStrategy).new(hosts, http, options[:strategy_options])
56
+ strategy_options = options[:strategy_options] || {}
57
+ strategy_impl = options[:strategy] || RoundRobinStrategy
58
+ strategy_impl.new(hosts, http, strategy_options)
57
59
  end
58
60
  end
59
61
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Cottus
4
- VERSION = '0.1.3'.freeze
4
+ VERSION = '0.1.4'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cottus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Söderberg