saddle 0.0.22 → 0.0.23

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Njg5M2M1ODIxZjAxMmQ1NGRiOWU5MDMyN2RhMWNhOGZhNjc4NjRkMQ==
4
+ ZWZjMDk3MDczMTlkYjllMDk3MmQ2NDRlNWY1ODE3Yjk5NTFiNmQ0Mw==
5
5
  data.tar.gz: !binary |-
6
- OWViOGE0MThmNGU1OGYwM2VhZWFkNjY0NGJjNjhiMTIwMDZhNmRkOQ==
6
+ ODlkYTE3OGJhNjU3Mjc3ODUwYmVjODEyNWRhMzNlMTA0MzczOGEzZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mjg3MDI3ZTA2MDRjNzMyODM5MzM5YmE0NDA0MzI5NDQwNDBhMTY1ZDc5ZjEz
10
- NWE5OGZhZGE4NGM4OTQyMGZkODMyMTkzNmE4ZTRhM2M5YWJhYjVlYWYzZTBj
11
- ZjE3MGM1MGQ3MTE5ODE1YmJhYjg3ODQwYjBkNTI4ZDk2NjQ3ZDQ=
9
+ OTY1MTFiZmIxYTIyOWZhNWZhZGY5ZTA5NTE5ZDdjMWExOGNmNGU0M2Q5ODUx
10
+ NjFjYzM0MjFhOGVjNjkxZTYyYTkyMzc0MTY2YTEzYzBiMDVlYTAyMTBlMmEz
11
+ OTdlNjc0OWFmNGU4OWVhMTY5MTg0ODUzODBiM2JlNTY5M2U2MzI=
12
12
  data.tar.gz: !binary |-
13
- OWNjZDVjZGQ0MTA3NGZhYmNmYTc3YmFiYjE3N2FmOGY0NDI3NzVmOGRkMDE4
14
- MTlmYjU1YzY1YTk5MWVmY2YxOTY0ZWUxMmE5NmFlZGU5ZDBjMDg0NTYxY2Vj
15
- ZmIxYWJkZTVmNjBkMGM3NTNjMTJhZjQ3Y2E3YTU0YzIyMDg5YzY=
13
+ Y2QyNTVjMjllZGY3MTlmYjI5NmQ2ZDYzODhmM2ZkYmFjYmNkN2RjYjljNjc3
14
+ MjdmYjc5ZDE1N2MyM2Q2ZDRkMDVhMzhiM2RmNjhkOWZiM2U5ODRlMGQ1MTM2
15
+ NDkyYzFlZTE1M2IyYjZlZTRhY2M1NGUxYWUwMGQ1ODk5OGZhZmE=
@@ -30,6 +30,8 @@ module Saddle
30
30
  ## - each middleware consists of hash of klass, and optionally args (an array)
31
31
  ## stubs - test stubs for specs
32
32
  def initialize(opt={})
33
+ # Store the options for later use
34
+ @options = opt
33
35
  @host = opt[:host] || 'localhost'
34
36
  raise ':host must be a string' unless @host.is_a?(String)
35
37
  @port = opt[:port] || 80
@@ -58,8 +60,8 @@ module Saddle
58
60
  # Make a GET request
59
61
  def get(url, params={}, options={})
60
62
  response = connection.get do |req|
61
- req.options.merge! options
62
- req.url url, params
63
+ req.options.merge!(options)
64
+ req.url(url, params)
63
65
  end
64
66
  response.body
65
67
  end
@@ -67,8 +69,8 @@ module Saddle
67
69
  # Make a POST request
68
70
  def post(url, data={}, options={})
69
71
  response = connection.post do |req|
70
- req.options.merge! options
71
- req.url url
72
+ req.options.merge!(options)
73
+ req.url(url)
72
74
  req.body = data
73
75
  end
74
76
  response.body
@@ -77,8 +79,8 @@ module Saddle
77
79
  # Make a PUT request
78
80
  def put(url, data={}, options={})
79
81
  response = connection.put do |req|
80
- req.options.merge! options
81
- req.url url
82
+ req.options.merge!(options)
83
+ req.url(url)
82
84
  req.body = data
83
85
  end
84
86
  response.body
@@ -87,8 +89,8 @@ module Saddle
87
89
  # Make a DELETE request
88
90
  def delete(url, params={}, options={})
89
91
  response = connection.delete do |req|
90
- req.options.merge! options
91
- req.url url, params
92
+ req.options.merge!(options)
93
+ req.url(url, params)
92
94
  end
93
95
  response.body
94
96
  end
@@ -105,6 +107,9 @@ module Saddle
105
107
  # Build a connection instance, wrapped in the middleware that we want
106
108
  def connection
107
109
  @connection ||= Faraday.new(base_url) do |builder|
110
+ # Include the requester level options
111
+ builder.options[:client_options] = @options
112
+
108
113
  # Config options
109
114
  unless @timeout.nil?
110
115
  builder.options[:timeout] = @timeout
@@ -1,3 +1,3 @@
1
1
  module Saddle
2
- VERSION = '0.0.22'
2
+ VERSION = '0.0.23'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Lewis