restafari 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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(params[:headers]) if params.has_key?(:headers)
50
+ req.headers.update(headers)
49
51
  @req = req
50
52
  yield req if block_given?
51
53
  end
@@ -1,3 +1,3 @@
1
1
  module Restafari
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
@@ -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: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 5
10
- version: 0.7.5
9
+ - 6
10
+ version: 0.7.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Danni Friedland