restafari 0.7.5 → 0.7.6
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/lib/restafari/action.rb +3 -1
- data/lib/restafari/version.rb +1 -1
- data/spec/restafari/action_spec.rb +2 -1
- metadata +3 -3
data/lib/restafari/action.rb
CHANGED
@@ -44,8 +44,10 @@ module Restafari
|
|
44
44
|
def execute!(path, params, &block)
|
45
45
|
conn = Faraday.new(url: Restafari.config.url)
|
46
46
|
Restafari.config.run_before_request_hook(params)
|
47
|
+
headers = params[:headers] || {}
|
48
|
+
params.delete(:headers) #so we dont send it as part of the params
|
47
49
|
result = conn.send(Restafari.config.http_method, path, params) do |req|
|
48
|
-
req.headers.update(
|
50
|
+
req.headers.update(headers)
|
49
51
|
@req = req
|
50
52
|
yield req if block_given?
|
51
53
|
end
|
data/lib/restafari/version.rb
CHANGED
@@ -79,7 +79,8 @@ describe Restafari::Action do
|
|
79
79
|
action :some_method
|
80
80
|
end
|
81
81
|
|
82
|
-
SomeAction.some_method(headers:{cookie:"aaa"}) do |req|
|
82
|
+
SomeAction.some_method(test:2, headers:{cookie:"aaa"}) do |req|
|
83
|
+
|
83
84
|
@headers = req.headers
|
84
85
|
end
|
85
86
|
@headers[:cookie].should eq "aaa"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restafari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 6
|
10
|
+
version: 0.7.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Danni Friedland
|