faraday_boolean 0.1.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 382b303787ce6e233a13809516b50e7975b76f7a3422303e21e283c2f8d1bea8
4
- data.tar.gz: 93b699d1d1e7191e9d3270437a92ece492d83e670f28d6d0d22a2f47d0a29204
3
+ metadata.gz: db3f3c2651fcf2bd73e628044a826ec642f7bdb9093e366e1770ce85c62c6435
4
+ data.tar.gz: ffa80b4c685f4d5445b060affbcb1e1a094062436defd0ec8d760c26cf059fb1
5
5
  SHA512:
6
- metadata.gz: 9bb2182b1185e9c34d35e842ae89ccb1d76294c27e7001d595133a517b4a9ccbd1c6e95b75f1534413b559143f1121d24b158bf3b32f968696253cafa7c33b6a
7
- data.tar.gz: 688ac08212d06c6ac24f20da76b722a17df4d613059bf635a0c67d743604b092543e5e8b7f0e1ed51f351009403edea7204a11452d9abfa8dc38f6c1aad46aff
6
+ metadata.gz: 5eb01d34ccc4290bd613cd2444e926e34467ccb364c0ec36815d76aaac0770209cbf3d020c1fcde101cbfcb7d979536ad72511e8a3c53ea69acf4fd3ab5e438d
7
+ data.tar.gz: 9f1397ef1877d9becb8f801522a2b74ffc9fe4a8fd26c74eefa9aecb731886eead7e528014ff64f1bb1513ac76280f7a9d0fbb363607db2091127958335a142a
@@ -0,0 +1,12 @@
1
+ # c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ cooldown:
10
+ default-days: 7
11
+ assignees:
12
+ - sue445
@@ -0,0 +1,59 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy static content to Pages
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches:
8
+ - master
9
+
10
+ # Allows you to run this workflow manually from the Actions tab
11
+ workflow_dispatch:
12
+
13
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
+ permissions:
15
+ contents: read
16
+ pages: write
17
+ id-token: write
18
+
19
+ # Allow one concurrent deployment
20
+ concurrency:
21
+ group: "pages"
22
+ cancel-in-progress: true
23
+
24
+ jobs:
25
+ # Single deploy job since we're just deploying
26
+ deploy:
27
+ environment:
28
+ name: github-pages
29
+ url: ${{ steps.deployment.outputs.page_url }}
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
34
+
35
+ - uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
36
+ with:
37
+ ruby-version: ruby
38
+ bundler-cache: true
39
+
40
+ - run: bundle exec yard
41
+
42
+ - name: Setup Pages
43
+ uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
44
+ - name: Upload artifact
45
+ uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
46
+ with:
47
+ # Upload entire repository
48
+ path: './doc'
49
+ - name: Deploy to GitHub Pages
50
+ id: deployment
51
+ uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
52
+
53
+ - name: Slack Notification (not success)
54
+ uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
55
+ if: "! success()"
56
+ continue-on-error: true
57
+ with:
58
+ status: ${{ job.status }}
59
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
@@ -0,0 +1,41 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ release:
8
+ if: github.repository == 'sue445/faraday_boolean'
9
+ runs-on: ubuntu-latest
10
+
11
+ environment:
12
+ name: rubygems.org
13
+ url: https://rubygems.org/gems/faraday_boolean
14
+
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+
19
+ steps:
20
+ - name: Harden Runner
21
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
22
+ with:
23
+ egress-policy: audit
24
+
25
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
29
+ with:
30
+ bundler-cache: true
31
+ ruby-version: ruby
32
+
33
+ - name: Publish to RubyGems
34
+ uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
35
+
36
+ - name: Create GitHub release
37
+ run: |
38
+ tag_name="$(git describe --tags --abbrev=0)"
39
+ gh release create "${tag_name}" --verify-tag --generate-notes
40
+ env:
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -12,86 +12,58 @@ on:
12
12
  schedule:
13
13
  - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
14
 
15
- env:
16
- CI: "true"
17
-
18
15
  jobs:
19
16
  test:
20
17
  runs-on: ubuntu-latest
21
18
 
22
- container: ${{ matrix.ruby }}
23
-
24
19
  strategy:
25
20
  fail-fast: false
26
21
 
27
22
  matrix:
28
23
  ruby:
29
- - ruby:2.1
30
- - ruby:2.2
31
- - ruby:2.3
32
- - ruby:2.4
33
- - ruby:2.5
34
- - ruby:2.6
35
- - ruby:2.7
36
- - ruby:3.0
37
- - rubylang/ruby:master-nightly-bionic
38
- include:
39
- - ruby: rubylang/ruby:master-nightly-bionic
40
- allow_failures: "true"
24
+ - "2.6"
25
+ - "2.7"
26
+ - "3.0"
27
+ - "3.1"
28
+ - "3.2"
29
+ - "3.3"
30
+ - "3.4"
41
31
 
42
32
  steps:
43
- - uses: actions/checkout@v2
33
+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
44
34
 
45
-
46
- - name: Cache vendor/bundle
47
- uses: actions/cache@v1
48
- id: cache_gem
35
+ - uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
49
36
  with:
50
- path: vendor/bundle
51
- key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
52
- restore-keys: |
53
- v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
54
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
37
+ ruby-version: ${{ matrix.ruby }}
38
+ bundler-cache: true
55
39
 
56
- - name: bundle update
57
- run: |
58
- set -xe
59
- bundle config path vendor/bundle
60
- bundle update --jobs $(nproc) --retry 3
61
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
40
+ - run: bundle update --jobs $(nproc) --retry 3
62
41
 
63
42
  - name: Setup Code Climate Test Reporter
64
- uses: aktions/codeclimate-test-reporter@v1
43
+ uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
65
44
  with:
66
45
  codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
67
46
  command: before-build
68
- if: matrix.ruby >= 'ruby:2.4'
69
47
  continue-on-error: true
70
48
 
71
- - name: Run test
72
- run: |
73
- set -xe
74
- bundle exec rspec
75
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
49
+ - run: bundle exec rspec
76
50
 
77
51
  - name: Teardown Code Climate Test Reporter
78
- uses: aktions/codeclimate-test-reporter@v1
52
+ uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
79
53
  with:
80
54
  codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
81
55
  command: after-build
82
- if: matrix.ruby >= 'ruby:2.4' && always()
56
+ if: always()
83
57
  continue-on-error: true
84
58
 
85
59
  - name: Slack Notification (not success)
86
- uses: lazy-actions/slatify@master
60
+ uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
87
61
  if: "! success()"
88
62
  continue-on-error: true
89
63
  with:
90
- job_name: ${{ format('*build* ({0})', matrix.ruby) }}
91
- type: ${{ job.status }}
92
- icon_emoji: ":octocat:"
93
- url: ${{ secrets.SLACK_WEBHOOK }}
94
- token: ${{ secrets.GITHUB_TOKEN }}
64
+ status: ${{ job.status }}
65
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
66
+ matrix: ${{ toJson(matrix) }}
95
67
 
96
68
  notify:
97
69
  needs:
@@ -101,12 +73,9 @@ jobs:
101
73
 
102
74
  steps:
103
75
  - name: Slack Notification (success)
104
- uses: lazy-actions/slatify@master
76
+ uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
105
77
  if: always()
106
78
  continue-on-error: true
107
79
  with:
108
- job_name: '*build*'
109
- type: ${{ job.status }}
110
- icon_emoji: ":octocat:"
111
- url: ${{ secrets.SLACK_WEBHOOK }}
112
- token: ${{ secrets.GITHUB_TOKEN }}
80
+ status: ${{ job.status }}
81
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --markup markdown
2
+ --no-private
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
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.1...master)
3
+
4
+ ## v1.0.1
5
+ [full changelog](http://github.com/sue445/faraday_boolean/compare/v1.0.0...v1.0.1)
6
+
7
+ * Release gem from GitHub Actions
8
+ * https://github.com/sue445/faraday_boolean/pull/49
9
+
10
+ ## v1.0.0
11
+ [full changelog](http://github.com/sue445/faraday_boolean/compare/v0.1.1...v1.0.0)
12
+
13
+ * :bomb: **[BREAKING CHANGE]** Support faraday v2+ and drop support ruby < 2.6
14
+ * https://github.com/sue445/faraday_boolean/pull/28
3
15
 
4
16
  ## v0.1.1
5
17
  [full changelog](http://github.com/sue445/faraday_boolean/compare/v0.1.0...v0.1.1)
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Faraday response parser for boolean body
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/faraday_boolean.svg)](https://badge.fury.io/rb/faraday_boolean)
6
- [![Build Status](https://github.com/sue445/faraday_boolean/workflows/test/badge.svg?branch=master)](https://github.com/sue445/faraday_boolean/actions?query=workflow%3Atest)
6
+ [![test](https://github.com/sue445/faraday_boolean/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/faraday_boolean/actions/workflows/test.yml)
7
7
  [![Coverage Status](https://coveralls.io/repos/sue445/faraday_boolean/badge.svg?branch=master&service=github)](https://coveralls.io/github/sue445/faraday_boolean?branch=master)
8
8
  [![Code Climate](https://codeclimate.com/github/sue445/faraday_boolean/badges/gpa.svg)](https://codeclimate.com/github/sue445/faraday_boolean)
9
9
 
@@ -14,9 +14,12 @@ 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"
22
+ spec.metadata["documentation_uri"] = "https://sue445.github.io/faraday_boolean/"
20
23
  spec.metadata["rubygems_mfa_required"] = "true"
21
24
 
22
25
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -24,13 +27,15 @@ Gem::Specification.new do |spec|
24
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
28
  spec.require_paths = ["lib"]
26
29
 
27
- spec.add_dependency "faraday"
30
+ spec.add_dependency "faraday", ">= 2.0"
28
31
 
29
32
  spec.add_development_dependency "bundler", ">= 1.10"
30
- spec.add_development_dependency "coveralls"
33
+ spec.add_development_dependency "coveralls_reborn"
31
34
  spec.add_development_dependency "rake", ">= 10.0"
32
35
  spec.add_development_dependency "rspec"
33
36
  spec.add_development_dependency "rspec-its"
34
37
  spec.add_development_dependency "simplecov"
38
+ spec.add_development_dependency "term-ansicolor", "!= 1.11.1" # ref. https://github.com/flori/term-ansicolor/issues/41
35
39
  spec.add_development_dependency "webmock"
40
+ spec.add_development_dependency "yard"
36
41
  end
@@ -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.1"
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,13 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2021-11-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '2.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '2.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: bundler
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +38,7 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '1.10'
41
40
  - !ruby/object:Gem::Dependency
42
- name: coveralls
41
+ name: coveralls_reborn
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
@@ -108,6 +107,20 @@ dependencies:
108
107
  - - ">="
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: term-ansicolor
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "!="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.11.1
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "!="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.11.1
111
124
  - !ruby/object:Gem::Dependency
112
125
  name: webmock
113
126
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +135,20 @@ dependencies:
122
135
  - - ">="
123
136
  - !ruby/object:Gem::Version
124
137
  version: '0'
138
+ - !ruby/object:Gem::Dependency
139
+ name: yard
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
125
152
  description: Faraday response parser for boolean body
126
153
  email:
127
154
  - sue445@sue445.net
@@ -130,9 +157,13 @@ extensions: []
130
157
  extra_rdoc_files: []
131
158
  files:
132
159
  - ".coveralls.yml"
160
+ - ".github/dependabot.yml"
161
+ - ".github/workflows/pages.yml"
162
+ - ".github/workflows/release_gem.yml"
133
163
  - ".github/workflows/test.yml"
134
164
  - ".gitignore"
135
165
  - ".rspec"
166
+ - ".yardopts"
136
167
  - CHANGELOG.md
137
168
  - Gemfile
138
169
  - LICENSE.txt
@@ -151,8 +182,8 @@ metadata:
151
182
  homepage_uri: https://github.com/sue445/faraday_boolean
152
183
  source_code_uri: https://github.com/sue445/faraday_boolean
153
184
  changelog_uri: https://github.com/sue445/faraday_boolean/blob/master/CHANGELOG.md
185
+ documentation_uri: https://sue445.github.io/faraday_boolean/
154
186
  rubygems_mfa_required: 'true'
155
- post_install_message:
156
187
  rdoc_options: []
157
188
  require_paths:
158
189
  - lib
@@ -160,15 +191,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
191
  requirements:
161
192
  - - ">="
162
193
  - !ruby/object:Gem::Version
163
- version: '0'
194
+ version: '2.6'
164
195
  required_rubygems_version: !ruby/object:Gem::Requirement
165
196
  requirements:
166
197
  - - ">="
167
198
  - !ruby/object:Gem::Version
168
199
  version: '0'
169
200
  requirements: []
170
- rubygems_version: 3.2.22
171
- signing_key:
201
+ rubygems_version: 3.6.7
172
202
  specification_version: 4
173
203
  summary: Faraday response parser for boolean body
174
204
  test_files: []