chimera_http_client 1.1.0 → 1.1.1

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
  SHA256:
3
- metadata.gz: 01402cd235d413d16acc9adb72267b7a244898b5913d14d07e039ad6b1bd830b
4
- data.tar.gz: 3909459cb620e544da67ee5864f39ab7ea51a6c33b6dd1b3fcddda5a56ec4dd5
3
+ metadata.gz: 245adb27237d0970454580b14f6973ed7bf732a8ce3f4426b35978ff27eed9d8
4
+ data.tar.gz: 02e8646e5757b60b7d4617d58f3413bdd4b5675d8d307342fabc7ce03c90471b
5
5
  SHA512:
6
- metadata.gz: 655127ba58b327eb2bc9f2ff6342ad3c93bd84c9cfa08fc262a4628005643e2562ae76ee68378331a92edb11cd9fb91fe0cf942f45d4ce911f176bfae8392c02
7
- data.tar.gz: b3b282c08dc802b187ee95e974deb996ee833d3350f86ef4d6c89818ef1b182bedee2f043aaad50f392157829559b18b579480d7d50beef154617bb744e6cf9e
6
+ metadata.gz: 0caca4f777876526ab8fb4f1652b0643e545bd768e7722424e2007e3e1e79f397cc043dd5ad81d4319ec0703242c72a9481bcac589a48d82374a7e646cef2974
7
+ data.tar.gz: caf3dc496a546c75a07475148a063caf8b312f9fb63f9a65de02577c3f7b4398e8c05660660d003c6dc7a14bf50b33e5e46cba6d7c2599901b265d3df3f5155c
@@ -19,6 +19,7 @@ Metrics/AbcSize:
19
19
 
20
20
  Metrics/BlockLength:
21
21
  Exclude:
22
+ - chimera_http_client.gemspec
22
23
  - spec/**/*
23
24
 
24
25
  # Configuration parameters: CountComments.
@@ -387,6 +387,8 @@ When updating the version, do not forget to run
387
387
 
388
388
  After checking out the repo, run `bundle install` and then `bundle execute rake` to run the **tests and rubocop**.
389
389
 
390
+ > The test suite uses a Sinatra server to make real HTTP requests. It is mounted via Capybara_discoball and running in the same process.
391
+
390
392
  You can also run `rake console` to open an irb session with the `ChimeraHttpClient` pre-loaded that will allow you to experiment.
391
393
 
392
394
  To build and install this gem onto your local machine, run `bundle exec rake install`.
data/Rakefile CHANGED
@@ -3,7 +3,11 @@ require "bundler/gem_tasks"
3
3
  require "rspec/core/rake_task"
4
4
 
5
5
  Bundler::Audit::Task.new
6
- RSpec::Core::RakeTask.new(:rspec)
6
+
7
+ RSpec::Core::RakeTask.new(:rspec) do |t|
8
+ # t.exclude_pattern = "**/server/*_spec.rb" # skip real http server specs
9
+ # t.exclude_pattern = "**/stubbed/*_spec.rb" # skip the stubbed Typhoeus specs
10
+ end
7
11
 
8
12
  desc "Open a console with the ChimeraHttpClient loaded"
9
13
  task :console do
@@ -31,11 +31,16 @@ _none known_
31
31
 
32
32
  ### Add server for testing
33
33
 
34
- * [ ] add a simple (Sinatra) server for testing
35
- * [ ] run (all?) tests against the server (with capybara_discoball?)
34
+ * [x] ~~add a simple (Sinatra) server for testing~~
35
+ * [x] ~~run (all?) tests against the server (with capybara_discoball)~~
36
36
  * [ ] make server also available for console testing
37
37
  * [ ] add example to README
38
38
 
39
+ ### Miscellaneous
40
+
41
+ - [ ] Determine by parameter if 3xx Redirects should be handled as an Error or not
42
+ - [ ] Add a longer description to the gemspec file
43
+
39
44
  ### Enable more Typhoeus functionality
40
45
 
41
46
  * [ ] accept_encoding: "gzip"
@@ -52,13 +57,6 @@ _none known_
52
57
  * [ ] or enable to access the Typhoeos directly through Chimera?
53
58
  * [ ] add example to README
54
59
 
55
- ### Custom Serializer
56
-
57
- * [ ] allow to pass custom serializer
58
- * [ ] use custom serializer instead of expecting a JSON (or other) body
59
- * [ ] set header for the serializer
60
- * [ ] add example to README
61
-
62
60
  ### File Uploads
63
61
 
64
62
  * [ ] add example to README
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["webmaster@mediafinger.com"]
10
10
 
11
11
  spec.summary = "Http Client to connect to REST APIs"
12
- spec.description = "General http client functionality to easily connect to JSON endpoints"
12
+ spec.description = "General http client functionality to easily connect to JSON endpoints" # TODO: extend and polish
13
13
  spec.homepage = "https://github.com/mediafinger/chimera_http_client"
14
14
  spec.license = "MIT"
15
15
 
@@ -18,15 +18,24 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ # the only sub-dependencies
21
22
  spec.add_runtime_dependency "typhoeus", "~> 1.1"
22
23
  spec.add_runtime_dependency "zeitwerk", ">= 2.0"
23
24
 
24
- spec.add_development_dependency "awesome_print", "~> 1.8"
25
- spec.add_development_dependency "bundler", ">= 1.0"
26
- spec.add_development_dependency "bundler-audit", "~> 0.6"
27
- spec.add_development_dependency "irb", "~> 1.0"
28
- spec.add_development_dependency "rake", ">= 10.0"
29
- spec.add_development_dependency "rspec", "~> 3.0"
30
- spec.add_development_dependency "rubocop", "~> 0.50"
31
- spec.add_development_dependency "rubocop-rspec", "~> 1.4"
25
+ # general development and test dependencies
26
+ spec.add_development_dependency "awesome_print", "~> 1.8"
27
+ spec.add_development_dependency "bundler", ">= 1.0"
28
+ spec.add_development_dependency "bundler-audit", "~> 0.6"
29
+ spec.add_development_dependency "irb", "~> 1.0"
30
+ spec.add_development_dependency "rake", ">= 10.0"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ spec.add_development_dependency "rubocop", "~> 0.50"
33
+ spec.add_development_dependency "rubocop-rspec", "~> 1.4"
34
+
35
+ # only for server specs with real HTTP requests
36
+ spec.add_development_dependency "capybara", "~> 3.0"
37
+ spec.add_development_dependency "capybara_discoball", "~> 0.1"
38
+ spec.add_development_dependency "sinatra", "~> 2.0"
39
+ spec.add_development_dependency "sinatra-contrib", "~> 2.0"
40
+ spec.add_development_dependency "webmock", "~> 3.0"
32
41
  end
@@ -5,4 +5,7 @@ module ChimeraHttpClient
5
5
 
6
6
  loader = Zeitwerk::Loader.for_gem
7
7
  loader.setup
8
+
9
+ # as Zeitwerk can't handle innner classes properly :-/
10
+ require_relative "./chimera_http_client/error.rb"
8
11
  end
@@ -61,7 +61,7 @@ module ChimeraHttpClient
61
61
 
62
62
  case response.code.to_i
63
63
  when 301, 302, 303, 307
64
- RedirectionError.new(response, @options)
64
+ RedirectionError.new(response, @options) # TODO: throw error conditionally
65
65
  when 200..399
66
66
  nil
67
67
  when 400
@@ -1,3 +1,3 @@
1
1
  module ChimeraHttpClient
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimera_http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Finger
@@ -150,6 +150,76 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.4'
153
+ - !ruby/object:Gem::Dependency
154
+ name: capybara
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: capybara_discoball
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.1'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.1'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sinatra
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '2.0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: sinatra-contrib
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '2.0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '2.0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: webmock
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '3.0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '3.0'
153
223
  description: General http client functionality to easily connect to JSON endpoints
154
224
  email:
155
225
  - webmaster@mediafinger.com