faraday_boolean 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -7
- data/CHANGELOG.md +7 -1
- data/faraday_boolean.gemspec +3 -1
- data/lib/faraday_boolean/parse_boolean.rb +9 -9
- data/lib/faraday_boolean/version.rb +1 -1
- data/lib/faraday_boolean.rb +1 -9
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1582669151441deed453d3901b35f5a291a1e94081f2ec092dca5dcd24ebf2b
|
4
|
+
data.tar.gz: 109047f2088e7d4b3cea31531a626cc2e23cc39317e6cbf9007e86e080fe5232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52620b3db50874df137e5919510eb2fc496d7aeafab981e8bf62065147a23a401402049bd0e8234640cca43c934c37f25dc9cc64815e46fbf2af5c6db0ce4f49
|
7
|
+
data.tar.gz: e5076fececdc18b1cbbdf8db5b3853370c3af7071f67bd38b4ec9dc52c465d2e6ca12646a27cc137f904b51876ab507c20518241376612b6b863e13ba97de46f
|
data/.github/workflows/test.yml
CHANGED
@@ -26,14 +26,10 @@ jobs:
|
|
26
26
|
|
27
27
|
matrix:
|
28
28
|
ruby:
|
29
|
-
- ruby:2.1
|
30
|
-
- ruby:2.2
|
31
|
-
- ruby:2.3
|
32
|
-
- ruby:2.4
|
33
|
-
- ruby:2.5
|
34
29
|
- ruby:2.6
|
35
30
|
- ruby:2.7
|
36
31
|
- ruby:3.0
|
32
|
+
- ruby:3.1
|
37
33
|
- rubylang/ruby:master-nightly-bionic
|
38
34
|
include:
|
39
35
|
- ruby: rubylang/ruby:master-nightly-bionic
|
@@ -65,7 +61,6 @@ jobs:
|
|
65
61
|
with:
|
66
62
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
67
63
|
command: before-build
|
68
|
-
if: matrix.ruby >= 'ruby:2.4'
|
69
64
|
continue-on-error: true
|
70
65
|
|
71
66
|
- name: Run test
|
@@ -79,7 +74,7 @@ jobs:
|
|
79
74
|
with:
|
80
75
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
81
76
|
command: after-build
|
82
|
-
if:
|
77
|
+
if: always()
|
83
78
|
continue-on-error: true
|
84
79
|
|
85
80
|
- name: Slack Notification (not success)
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/faraday_boolean/compare/
|
2
|
+
[full changelog](http://github.com/sue445/faraday_boolean/compare/v1.0.0...master)
|
3
|
+
|
4
|
+
## v1.0.0
|
5
|
+
[full changelog](http://github.com/sue445/faraday_boolean/compare/v0.1.1...v1.0.0)
|
6
|
+
|
7
|
+
* :bomb: [BREAKING CHANGE] Support faraday v2+ and drop support ruby < 2.6
|
8
|
+
* https://github.com/sue445/faraday_boolean/pull/28
|
3
9
|
|
4
10
|
## v0.1.1
|
5
11
|
[full changelog](http://github.com/sue445/faraday_boolean/compare/v0.1.0...v0.1.1)
|
data/faraday_boolean.gemspec
CHANGED
@@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/sue445/faraday_boolean"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.required_ruby_version = ">= 2.6"
|
18
|
+
|
17
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
20
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
21
|
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
@@ -24,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
24
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
27
|
spec.require_paths = ["lib"]
|
26
28
|
|
27
|
-
spec.add_dependency "faraday"
|
29
|
+
spec.add_dependency "faraday", ">= 2.0"
|
28
30
|
|
29
31
|
spec.add_development_dependency "bundler", ">= 1.10"
|
30
32
|
spec.add_development_dependency "coveralls"
|
@@ -1,17 +1,17 @@
|
|
1
|
+
require "faraday"
|
2
|
+
|
1
3
|
module FaradayBoolean
|
2
4
|
# When response body is "true" or "false" (String), convert to true or false (Ruby literal)
|
3
|
-
class ParseBoolean < ::Faraday::
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
case response.env[:body]
|
5
|
+
class ParseBoolean < ::Faraday::Middleware
|
6
|
+
def on_complete(env)
|
7
|
+
case env[:body]
|
8
8
|
when "true"
|
9
|
-
|
9
|
+
env[:body] = true
|
10
10
|
when "false"
|
11
|
-
|
11
|
+
env[:body] = false
|
12
12
|
end
|
13
|
-
|
14
|
-
response
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
16
|
+
|
17
|
+
Faraday::Response.register_middleware(boolean: FaradayBoolean::ParseBoolean)
|
data/lib/faraday_boolean.rb
CHANGED
@@ -1,10 +1,2 @@
|
|
1
1
|
require "faraday_boolean/version"
|
2
|
-
require "
|
3
|
-
|
4
|
-
module FaradayBoolean
|
5
|
-
autoload :ParseBoolean, "faraday_boolean/parse_boolean"
|
6
|
-
|
7
|
-
Faraday::Response.register_middleware(
|
8
|
-
boolean: -> { ParseBoolean },
|
9
|
-
)
|
10
|
-
end
|
2
|
+
require "faraday_boolean/parse_boolean"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_boolean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,14 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: '
|
163
|
+
version: '2.6'
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
170
|
+
rubygems_version: 3.3.3
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Faraday response parser for boolean body
|