soaspec 0.0.53 → 0.0.54

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5daa27106c98f54680acdfaf513f175a745c08cf
4
- data.tar.gz: 2eeaffbcee9233a978c6e6abb5c94e9aa4dd6bbb
3
+ metadata.gz: a989b94a49f1bd84e619031834373e765c66b143
4
+ data.tar.gz: 28fb2b5ea4a7dfd871c4c354049c4ec969f925e1
5
5
  SHA512:
6
- metadata.gz: 7014f7f8944d4ffb28ee0391800d7167544236c4e0be5827e8954ff41c0b8fd882e10ee87670a91807282927c8d266584f34e3309db6f453ccf7366c2622e30a
7
- data.tar.gz: dfb370de19a9640736b5e1f2bd365d1c8206f548b557625c62f75c4b2f023435b728c89fde95cfe414ac43d8486ef19973756d5006ec32ea2fa63d8b27cf2f4f
6
+ metadata.gz: f62f593a34c8065c71c1b23859e1e9df425c300420472b95a5bc68cba0967569ae2ef2184b9ee658320e79ca767cd9706149155179380f330d122e8824594a82
7
+ data.tar.gz: 6ad9ca4d1435e026a1f9b7ce3d283625cf29f599e7df9d6f101bad7844f80601b9716cee3c0f1492eb959abe99e1080c1bfdbf002b8496ddb3299f6e3ab3da92
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.0.54
2
+ * Enhancements
3
+ * Make 'headers' accessor for setting headers on RestHandler easier
4
+
1
5
  Version 0.0.53
2
6
  * Enhancements
3
7
  * Make attribute possible for REST methods as well (as they can use XML too)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.53)
4
+ soaspec (0.0.54)
5
5
  jsonpath
6
6
  rest-client (>= 2.0)
7
7
  rspec (~> 3.0)
@@ -86,6 +86,13 @@ module Soaspec
86
86
  oauth2 **oauth_hash
87
87
  end
88
88
 
89
+ # @param [Hash] headers Hash of REST headers used in RestClient
90
+ def headers(headers)
91
+ define_method('rest_client_headers') do
92
+ headers
93
+ end
94
+ end
95
+
89
96
  end
90
97
 
91
98
  # Wraps around Savon client defining default values dependent on the soap request
@@ -102,8 +109,14 @@ module Soaspec
102
109
  nil
103
110
  end
104
111
 
112
+ # Headers used in RestClient
113
+ def rest_client_headers
114
+ {}
115
+ end
116
+
105
117
  # Add values to here when extending this class to have default REST options.
106
118
  # See rest client resource at https://github.com/rest-client/rest-client for details
119
+ # It's easier to set headers via 'headers' accessor rather than here
107
120
  # @return [Hash] Options adding to & overriding defaults
108
121
  def rest_resource_options
109
122
  {
@@ -122,6 +135,8 @@ module Soaspec
122
135
  super
123
136
  set_remove_key(options, :default_hash)
124
137
  merged_options = rest_resource_options
138
+ merged_options[:headers] ||= {}
139
+ merged_options[:headers].merge! rest_client_headers
125
140
  merged_options.merge!(options)
126
141
  @resource = RestClient::Resource.new(base_url_value, merged_options) # @resource[url_extension].get
127
142
  end
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.53'.freeze
2
+ VERSION = '0.0.54'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.53
4
+ version: 0.0.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler