restforce 2.5.4 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +56 -0
  3. data/.rubocop.yml +27 -14
  4. data/.rubocop_todo.yml +128 -81
  5. data/CHANGELOG.md +37 -3
  6. data/CONTRIBUTING.md +3 -3
  7. data/Gemfile +4 -2
  8. data/Guardfile +3 -1
  9. data/LICENSE +1 -1
  10. data/README.md +120 -19
  11. data/Rakefile +2 -1
  12. data/lib/restforce.rb +23 -1
  13. data/lib/restforce/abstract_client.rb +3 -0
  14. data/lib/restforce/attachment.rb +3 -0
  15. data/lib/restforce/client.rb +2 -0
  16. data/lib/restforce/collection.rb +3 -1
  17. data/lib/restforce/concerns/api.rb +20 -14
  18. data/lib/restforce/concerns/authentication.rb +2 -0
  19. data/lib/restforce/concerns/base.rb +2 -0
  20. data/lib/restforce/concerns/batch_api.rb +87 -0
  21. data/lib/restforce/concerns/caching.rb +4 -2
  22. data/lib/restforce/concerns/canvas.rb +3 -0
  23. data/lib/restforce/concerns/connection.rb +26 -20
  24. data/lib/restforce/concerns/picklists.rb +9 -6
  25. data/lib/restforce/concerns/streaming.rb +60 -1
  26. data/lib/restforce/concerns/verbs.rb +3 -1
  27. data/lib/restforce/config.rb +4 -1
  28. data/lib/restforce/data/client.rb +2 -0
  29. data/lib/restforce/document.rb +3 -0
  30. data/lib/restforce/mash.rb +2 -0
  31. data/lib/restforce/middleware.rb +2 -0
  32. data/lib/restforce/middleware/authentication.rb +8 -6
  33. data/lib/restforce/middleware/authentication/password.rb +2 -0
  34. data/lib/restforce/middleware/authentication/token.rb +2 -0
  35. data/lib/restforce/middleware/authorization.rb +3 -1
  36. data/lib/restforce/middleware/caching.rb +3 -1
  37. data/lib/restforce/middleware/custom_headers.rb +2 -0
  38. data/lib/restforce/middleware/gzip.rb +5 -3
  39. data/lib/restforce/middleware/instance_url.rb +7 -3
  40. data/lib/restforce/middleware/logger.rb +2 -0
  41. data/lib/restforce/middleware/mashify.rb +2 -0
  42. data/lib/restforce/middleware/multipart.rb +8 -4
  43. data/lib/restforce/middleware/raise_error.rb +26 -8
  44. data/lib/restforce/patches/parts.rb +2 -0
  45. data/lib/restforce/signed_request.rb +3 -0
  46. data/lib/restforce/sobject.rb +3 -0
  47. data/lib/restforce/tooling/client.rb +5 -3
  48. data/lib/restforce/upload_io.rb +2 -0
  49. data/lib/restforce/version.rb +3 -1
  50. data/restforce.gemspec +19 -12
  51. data/spec/fixtures/sobject/sobject_describe_success_response.json +48 -1
  52. data/spec/integration/abstract_client_spec.rb +51 -7
  53. data/spec/integration/data/client_spec.rb +24 -5
  54. data/spec/spec_helper.rb +2 -0
  55. data/spec/support/client_integration.rb +2 -0
  56. data/spec/support/concerns.rb +2 -0
  57. data/spec/support/event_machine.rb +2 -0
  58. data/spec/support/fixture_helpers.rb +4 -2
  59. data/spec/support/matchers.rb +2 -0
  60. data/spec/support/middleware.rb +3 -1
  61. data/spec/support/mock_cache.rb +4 -2
  62. data/spec/unit/abstract_client_spec.rb +2 -0
  63. data/spec/unit/attachment_spec.rb +2 -0
  64. data/spec/unit/collection_spec.rb +5 -3
  65. data/spec/unit/concerns/api_spec.rb +40 -11
  66. data/spec/unit/concerns/authentication_spec.rb +4 -2
  67. data/spec/unit/concerns/base_spec.rb +2 -0
  68. data/spec/unit/concerns/batch_api_spec.rb +107 -0
  69. data/spec/unit/concerns/caching_spec.rb +2 -0
  70. data/spec/unit/concerns/canvas_spec.rb +3 -1
  71. data/spec/unit/concerns/connection_spec.rb +5 -3
  72. data/spec/unit/concerns/streaming_spec.rb +115 -1
  73. data/spec/unit/config_spec.rb +10 -8
  74. data/spec/unit/data/client_spec.rb +2 -0
  75. data/spec/unit/document_spec.rb +2 -0
  76. data/spec/unit/mash_spec.rb +3 -1
  77. data/spec/unit/middleware/authentication/password_spec.rb +2 -0
  78. data/spec/unit/middleware/authentication/token_spec.rb +2 -0
  79. data/spec/unit/middleware/authentication_spec.rb +3 -1
  80. data/spec/unit/middleware/authorization_spec.rb +2 -0
  81. data/spec/unit/middleware/custom_headers_spec.rb +3 -1
  82. data/spec/unit/middleware/gzip_spec.rb +4 -2
  83. data/spec/unit/middleware/instance_url_spec.rb +2 -0
  84. data/spec/unit/middleware/logger_spec.rb +2 -0
  85. data/spec/unit/middleware/mashify_spec.rb +3 -1
  86. data/spec/unit/middleware/raise_error_spec.rb +34 -11
  87. data/spec/unit/signed_request_spec.rb +2 -0
  88. data/spec/unit/sobject_spec.rb +5 -3
  89. data/spec/unit/tooling/client_spec.rb +2 -0
  90. metadata +38 -20
  91. data/.travis.yml +0 -16
  92. data/Gemfile.travis +0 -8
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Restforce::SignedRequest do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Restforce::SObject do
@@ -22,8 +24,8 @@ describe Restforce::SObject do
22
24
  it { should be_a Restforce::Collection }
23
25
 
24
26
  describe 'each child' do
25
- it { should be_all { |sobject| expect(sobject).to be_a Restforce::SObject } }
26
- it { should be_all { |sobject| expect(sobject).to have_client client } }
27
+ it { should(be_all { |sobject| expect(sobject).to be_a Restforce::SObject }) }
28
+ it { should(be_all { |sobject| expect(sobject).to have_client client }) }
27
29
  end
28
30
  end
29
31
 
@@ -54,7 +56,7 @@ describe Restforce::SObject do
54
56
 
55
57
  context 'when an Id is present' do
56
58
  before do
57
- hash.merge!(Id: '001D000000INjVe')
59
+ hash[:Id] = '001D000000INjVe'
58
60
  client.should_receive(receiver)
59
61
  end
60
62
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Restforce::Tooling::Client do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric J. Holmes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-05-15 00:00:00.000000000 Z
12
+ date: 2019-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -85,6 +85,20 @@ dependencies:
85
85
  - - "<"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '4.0'
88
+ - !ruby/object:Gem::Dependency
89
+ name: faye
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
88
102
  - !ruby/object:Gem::Dependency
89
103
  name: rspec
90
104
  requirement: !ruby/object:Gem::Requirement
@@ -100,61 +114,61 @@ dependencies:
100
114
  - !ruby/object:Gem::Version
101
115
  version: 2.14.0
102
116
  - !ruby/object:Gem::Dependency
103
- name: webmock
117
+ name: rspec_junit_formatter
104
118
  requirement: !ruby/object:Gem::Requirement
105
119
  requirements:
106
120
  - - "~>"
107
121
  - !ruby/object:Gem::Version
108
- version: 1.13.0
122
+ version: 0.3.0
109
123
  type: :development
110
124
  prerelease: false
111
125
  version_requirements: !ruby/object:Gem::Requirement
112
126
  requirements:
113
127
  - - "~>"
114
128
  - !ruby/object:Gem::Version
115
- version: 1.13.0
129
+ version: 0.3.0
116
130
  - !ruby/object:Gem::Dependency
117
- name: simplecov
131
+ name: rubocop
118
132
  requirement: !ruby/object:Gem::Requirement
119
133
  requirements:
120
134
  - - "~>"
121
135
  - !ruby/object:Gem::Version
122
- version: 0.7.1
136
+ version: 0.75.0
123
137
  type: :development
124
138
  prerelease: false
125
139
  version_requirements: !ruby/object:Gem::Requirement
126
140
  requirements:
127
141
  - - "~>"
128
142
  - !ruby/object:Gem::Version
129
- version: 0.7.1
143
+ version: 0.75.0
130
144
  - !ruby/object:Gem::Dependency
131
- name: rubocop
145
+ name: simplecov
132
146
  requirement: !ruby/object:Gem::Requirement
133
147
  requirements:
134
148
  - - "~>"
135
149
  - !ruby/object:Gem::Version
136
- version: 0.31.0
150
+ version: 0.17.1
137
151
  type: :development
138
152
  prerelease: false
139
153
  version_requirements: !ruby/object:Gem::Requirement
140
154
  requirements:
141
155
  - - "~>"
142
156
  - !ruby/object:Gem::Version
143
- version: 0.31.0
157
+ version: 0.17.1
144
158
  - !ruby/object:Gem::Dependency
145
- name: faye
159
+ name: webmock
146
160
  requirement: !ruby/object:Gem::Requirement
147
161
  requirements:
148
- - - ">="
162
+ - - "~>"
149
163
  - !ruby/object:Gem::Version
150
- version: '0'
164
+ version: 3.7.6
151
165
  type: :development
152
166
  prerelease: false
153
167
  version_requirements: !ruby/object:Gem::Requirement
154
168
  requirements:
155
- - - ">="
169
+ - - "~>"
156
170
  - !ruby/object:Gem::Version
157
- version: '0'
171
+ version: 3.7.6
158
172
  description: A lightweight ruby client for the Salesforce REST API.
159
173
  email:
160
174
  - eric@ejholmes.net
@@ -163,15 +177,14 @@ executables: []
163
177
  extensions: []
164
178
  extra_rdoc_files: []
165
179
  files:
180
+ - ".circleci/config.yml"
166
181
  - ".gitignore"
167
182
  - ".rubocop.yml"
168
183
  - ".rubocop_todo.yml"
169
- - ".travis.yml"
170
184
  - CHANGELOG.md
171
185
  - CODE_OF_CONDUCT.md
172
186
  - CONTRIBUTING.md
173
187
  - Gemfile
174
- - Gemfile.travis
175
188
  - Guardfile
176
189
  - LICENSE
177
190
  - README.md
@@ -184,6 +197,7 @@ files:
184
197
  - lib/restforce/concerns/api.rb
185
198
  - lib/restforce/concerns/authentication.rb
186
199
  - lib/restforce/concerns/base.rb
200
+ - lib/restforce/concerns/batch_api.rb
187
201
  - lib/restforce/concerns/caching.rb
188
202
  - lib/restforce/concerns/canvas.rb
189
203
  - lib/restforce/concerns/connection.rb
@@ -268,6 +282,7 @@ files:
268
282
  - spec/unit/concerns/api_spec.rb
269
283
  - spec/unit/concerns/authentication_spec.rb
270
284
  - spec/unit/concerns/base_spec.rb
285
+ - spec/unit/concerns/batch_api_spec.rb
271
286
  - spec/unit/concerns/caching_spec.rb
272
287
  - spec/unit/concerns/canvas_spec.rb
273
288
  - spec/unit/concerns/connection_spec.rb
@@ -292,7 +307,9 @@ files:
292
307
  homepage: http://restforce.org/
293
308
  licenses:
294
309
  - MIT
295
- metadata: {}
310
+ metadata:
311
+ source_code_uri: https://github.com/restforce/restforce
312
+ changelog_uri: https://github.com/restforce/restforce/blob/master/CHANGELOG.md
296
313
  post_install_message:
297
314
  rdoc_options: []
298
315
  require_paths:
@@ -301,7 +318,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
301
318
  requirements:
302
319
  - - ">="
303
320
  - !ruby/object:Gem::Version
304
- version: '2.0'
321
+ version: '2.4'
305
322
  required_rubygems_version: !ruby/object:Gem::Requirement
306
323
  requirements:
307
324
  - - ">="
@@ -363,6 +380,7 @@ test_files:
363
380
  - spec/unit/concerns/api_spec.rb
364
381
  - spec/unit/concerns/authentication_spec.rb
365
382
  - spec/unit/concerns/base_spec.rb
383
+ - spec/unit/concerns/batch_api_spec.rb
366
384
  - spec/unit/concerns/caching_spec.rb
367
385
  - spec/unit/concerns/canvas_spec.rb
368
386
  - spec/unit/concerns/connection_spec.rb
@@ -1,16 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 2.1
5
- - 2.2
6
- - 2.3.1
7
- - ruby-2.4.0
8
- gemfile:
9
- - Gemfile.travis
10
- script:
11
- - bundle exec rubocop
12
- - bundle exec rspec spec
13
- sudo: false
14
- before_install:
15
- - gem update --system
16
- - gem update bundler
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- gem 'rake'
5
- gem 'rack', '~> 1.6.4'
6
- gem 'faraday', '~> 0.11.0'
7
- gem 'jruby-openssl', :platforms => :jruby
8
- gem 'public_suffix', '2.0.3'