smooth_operator 1.30.9 → 1.30.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- M2ExMjI4NTIwZGI3MjZiYWRiODBhZWMyMDI4M2M2ZDQxZWU3MmVhZA==
5
- data.tar.gz: !binary |-
6
- M2JjYmM4ODM0M2FiZTJkNzgxZTZjNzk1NjgyMTJjNWE1MGEwOTllNg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZDA1MDEzNzZiN2M1OWZkNzk3MGEwOGMwOTk4YzE1Y2FiODE3NTRlMTRjOGI5
10
- NzRlYjJhZDkzNzFmOWY1YTYyZTU2YTI5ZWQ2NzI4ZTBjNzJkMjc2OTQ3NmU0
11
- MjQ2Zjk5NmQ3MzhkNWJkY2FkYzJkZDhhMDdmNGRkOTA0OGU4NTU=
12
- data.tar.gz: !binary |-
13
- ZTMyM2JhNjU3MjE5OTRiNzFjZDIzNzJiNzA4ZDcxOTM5MzY3NjU1NTEyNGU2
14
- NzhjNWJlOWU4ZDMzY2M2YWI2NDUxNjZiMTE0NzVjNTY5ZTk2Y2Q3NDA3ZjUz
15
- ODllMGViZDIzYTZkNDczYWFmYzUzYzNlYTZlNTI3ZjdiZDU2ZmE=
2
+ SHA1:
3
+ metadata.gz: 29ccd2ee4a60cc1009b9c20abfdf084357eac9fa
4
+ data.tar.gz: bdb5f66ff2af842a08ce154511acd22f0fbda5f5
5
+ SHA512:
6
+ metadata.gz: 41e93e4f1ebfbd1dfef98ed74a2e1d7157c3cce3545a2e9161c957ed2876b15e11398234a799979dff6ffbc6e97866867abe7cd4d88fa10e40d8cb8dea686da9
7
+ data.tar.gz: d26326fe16d4e74394c29b278ad523f2006d698ccd6c0ccefb41dd33b0d27fbc1574bc5a63f3b53859569c974142e8568fb36ecfcf57bdcefdfe3305cee30d21
data/.gitignore CHANGED
@@ -18,3 +18,5 @@ tmp
18
18
 
19
19
  .DS_Store
20
20
  .rvmrc
21
+ .ruby-version
22
+ .ruby-gemset
@@ -8,11 +8,16 @@ require "smooth_operator/remote_call/errors/connection_failed"
8
8
  module SmoothOperator
9
9
  module Operator
10
10
 
11
+ def headers
12
+ {}
13
+ end
14
+
11
15
  def make_the_call(http_verb, relative_path = '', data = {}, options = {})
12
16
  options ||= {}
13
17
 
14
18
  relative_path = resource_path(relative_path)
15
19
 
20
+ options[:headers] = headers.merge(options[:headers] || {})
16
21
  options[:parent_object] ||= _options[:parent_object]
17
22
 
18
23
  call_args = before_request(http_verb, relative_path, data, options)
@@ -1,3 +1,3 @@
1
1
  module SmoothOperator
2
- VERSION = '1.30.9'
2
+ VERSION = '1.30.10'
3
3
  end
@@ -3,6 +3,14 @@ require "spec_helper"
3
3
  describe SmoothOperator::Operator do
4
4
  subject { User::Base }
5
5
 
6
+ describe "#headers" do
7
+ it 'should send the costum headers' do
8
+ remote_call = subject.new.get('test_headers')
9
+
10
+ expect(remote_call.status).to eq(true)
11
+ end
12
+ end
13
+
6
14
  describe "#get" do
7
15
 
8
16
  context "submiting a hash, with an array" do
@@ -13,6 +13,10 @@ module User
13
13
  params
14
14
  end
15
15
 
16
+ def headers
17
+ { 'PING' => 'PONG' }
18
+ end
19
+
16
20
  end
17
21
 
18
22
  module UnknownHashClass
@@ -18,6 +18,9 @@ class TestServer < Sinatra::Base
18
18
  json post_data
19
19
  end
20
20
 
21
+ get '/users/test_headers' do
22
+ status request.env['HTTP_PING'] == 'PONG' ? 200 : 422
23
+ end
21
24
 
22
25
  get '/users/test_hash_with_array' do
23
26
  status test_hash_with_array
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smooth_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.9
4
+ version: 1.30.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Gonçalves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: typhoeus
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.6'
69
69
  description: ActiveResource alternative
@@ -73,8 +73,8 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .rspec
76
+ - ".gitignore"
77
+ - ".rspec"
78
78
  - Gemfile
79
79
  - LICENSE.txt
80
80
  - README.md
@@ -144,17 +144,17 @@ require_paths:
144
144
  - lib
145
145
  required_ruby_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ! '>='
147
+ - - ">="
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ! '>='
152
+ - - ">="
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.0.7
157
+ rubygems_version: 2.4.3
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Simple and fully customizable alternative to ActiveResource, using faraday
@@ -180,4 +180,3 @@ test_files:
180
180
  - spec/support/models/user.rb
181
181
  - spec/support/models/user_with_address_and_posts.rb
182
182
  - spec/support/test_server.rb
183
- has_rdoc: