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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 382b303787ce6e233a13809516b50e7975b76f7a3422303e21e283c2f8d1bea8
4
- data.tar.gz: 93b699d1d1e7191e9d3270437a92ece492d83e670f28d6d0d22a2f47d0a29204
3
+ metadata.gz: c1582669151441deed453d3901b35f5a291a1e94081f2ec092dca5dcd24ebf2b
4
+ data.tar.gz: 109047f2088e7d4b3cea31531a626cc2e23cc39317e6cbf9007e86e080fe5232
5
5
  SHA512:
6
- metadata.gz: 9bb2182b1185e9c34d35e842ae89ccb1d76294c27e7001d595133a517b4a9ccbd1c6e95b75f1534413b559143f1121d24b158bf3b32f968696253cafa7c33b6a
7
- data.tar.gz: 688ac08212d06c6ac24f20da76b722a17df4d613059bf635a0c67d743604b092543e5e8b7f0e1ed51f351009403edea7204a11452d9abfa8dc38f6c1aad46aff
6
+ metadata.gz: 52620b3db50874df137e5919510eb2fc496d7aeafab981e8bf62065147a23a401402049bd0e8234640cca43c934c37f25dc9cc64815e46fbf2af5c6db0ce4f49
7
+ data.tar.gz: e5076fececdc18b1cbbdf8db5b3853370c3af7071f67bd38b4ec9dc52c465d2e6ca12646a27cc137f904b51876ab507c20518241376612b6b863e13ba97de46f
@@ -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: matrix.ruby >= 'ruby:2.4' && always()
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/v0.1.1...master)
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)
@@ -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::Response::Middleware
4
- def call(env)
5
- response = @app.call(env)
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
- response.env[:body] = true
9
+ env[:body] = true
10
10
  when "false"
11
- response.env[:body] = false
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)
@@ -1,3 +1,3 @@
1
1
  module FaradayBoolean
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,10 +1,2 @@
1
1
  require "faraday_boolean/version"
2
- require "faraday"
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.1.1
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: 2021-11-19 00:00:00.000000000 Z
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: '0'
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.2.22
170
+ rubygems_version: 3.3.3
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Faraday response parser for boolean body