unit-ruby 1.0.0 → 1.1.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 +4 -4
- data/.github/workflows/ci.yml +4 -3
- data/.github/workflows/release.yml +86 -0
- data/.gitignore +4 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +20 -2
- data/README.md +7 -9
- data/lib/unit-ruby/version.rb +1 -1
- data/unit-ruby.gemspec +2 -2
- metadata +16 -14
- data/Gemfile.lock +0 -95
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25b9811586fc39305b1c82248f0ad8f509b160f68cd1af3f4e5b8e9b39a93197
|
|
4
|
+
data.tar.gz: 160a4495282bf05385e221ae4d6a816c67669093d40de86cd8cdea6006fa1673
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b007e90dc256b5b099c2d4a665bf64335130471b6a642cf4cf276ced33d8ecec8eec2d9e9560736b53acbd847bd4320ac0a278b1d4dc867b0056664fe536513
|
|
7
|
+
data.tar.gz: 78240e4d1fa34353ea59eb2ff7f1febce20fea424a1bb4fc209f0915185f2851e357de6ae4013b42c91f325fe7daa28d1987ca740b24289bd3052e00dc5ca333
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -23,13 +23,14 @@ jobs:
|
|
|
23
23
|
test:
|
|
24
24
|
runs-on: ubuntu-latest
|
|
25
25
|
strategy:
|
|
26
|
+
fail-fast: false
|
|
26
27
|
matrix:
|
|
27
|
-
ruby-version: ["3.
|
|
28
|
+
ruby-version: ["3.4", "4.0"]
|
|
28
29
|
|
|
29
30
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
31
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
31
32
|
- name: Set up Ruby
|
|
32
|
-
uses: ruby/setup-ruby@v1
|
|
33
|
+
uses: ruby/setup-ruby@12fd324f1d0b43274fdc8130f6980590a667c455 # v1.312.0
|
|
33
34
|
with:
|
|
34
35
|
ruby-version: ${{ matrix.ruby-version }}
|
|
35
36
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Publishes the gem to RubyGems.org via OIDC trusted publishing whenever
|
|
2
|
+
# lib/unit-ruby/version.rb changes on main. No long-lived API key is stored:
|
|
3
|
+
# configure-rubygems-credentials exchanges a short-lived GitHub OIDC token for
|
|
4
|
+
# RubyGems credentials by assuming the OIDC API key role configured on
|
|
5
|
+
# rubygems.org. `bundle exec rake release` then builds the gem, creates and
|
|
6
|
+
# pushes the vX.Y.Z tag, and publishes to RubyGems.org.
|
|
7
|
+
name: Release
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
branches: [main]
|
|
12
|
+
paths:
|
|
13
|
+
- lib/unit-ruby/version.rb
|
|
14
|
+
|
|
15
|
+
# Never run two releases at once.
|
|
16
|
+
concurrency:
|
|
17
|
+
group: release
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
push:
|
|
22
|
+
name: Push gem to RubyGems.org
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write # push the version tag
|
|
26
|
+
id-token: write # mint the OIDC token for trusted publishing
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
fetch-tags: true
|
|
32
|
+
persist-credentials: false
|
|
33
|
+
- name: Set up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@12fd324f1d0b43274fdc8130f6980590a667c455 # v1.312.0
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: "3.4"
|
|
37
|
+
bundler-cache: true
|
|
38
|
+
- name: Read and validate gem version
|
|
39
|
+
id: version
|
|
40
|
+
run: |
|
|
41
|
+
version="$(ruby -e 'require "./lib/unit-ruby/version"; print Unit::VERSION')"
|
|
42
|
+
# Enforce semver before the value is used anywhere else, so a crafted
|
|
43
|
+
# version string can't smuggle shell metacharacters into later steps.
|
|
44
|
+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
|
|
45
|
+
echo "Invalid version format: $version" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
49
|
+
- name: Check whether this version is already tagged
|
|
50
|
+
id: tag
|
|
51
|
+
env:
|
|
52
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
53
|
+
run: |
|
|
54
|
+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
|
55
|
+
echo "Version v$VERSION already released; skipping."
|
|
56
|
+
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
57
|
+
else
|
|
58
|
+
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
59
|
+
fi
|
|
60
|
+
- name: Configure RubyGems credentials
|
|
61
|
+
if: steps.tag.outputs.exists == 'false'
|
|
62
|
+
uses: rubygems/configure-rubygems-credentials@762a4b77c3300434bb57c7ce80b20e36231927aa # v2.0.0
|
|
63
|
+
with:
|
|
64
|
+
role-to-assume: rg_oidc_akr_54hgswsa4knajxk89skj
|
|
65
|
+
- name: Set git identity and push URL
|
|
66
|
+
if: steps.tag.outputs.exists == 'false'
|
|
67
|
+
run: |
|
|
68
|
+
# Attribute the release tag to the last committer on HEAD.
|
|
69
|
+
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
|
|
70
|
+
git config --global user.name "$(git log -1 --pretty=format:'%an')"
|
|
71
|
+
# Restore push credentials (checkout ran with persist-credentials: false)
|
|
72
|
+
# so `rake release` can push the tag.
|
|
73
|
+
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
|
|
74
|
+
- name: Release
|
|
75
|
+
if: steps.tag.outputs.exists == 'false'
|
|
76
|
+
run: bundle exec rake release
|
|
77
|
+
- name: Wait for release to propagate
|
|
78
|
+
if: steps.tag.outputs.exists == 'false'
|
|
79
|
+
run: |
|
|
80
|
+
gem install rubygems-await
|
|
81
|
+
gem_tuple="$(ruby -rbundler/setup -rbundler -e '
|
|
82
|
+
spec = Bundler.definition.specs.find {|s| s.name == ARGV[0] }
|
|
83
|
+
raise "No spec for #{ARGV[0]}" unless spec
|
|
84
|
+
print [spec.name, spec.version, spec.platform].join(":")
|
|
85
|
+
' "unit-ruby")"
|
|
86
|
+
gem await "${gem_tuple}"
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.1.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Publish releases automatically to RubyGems.org via OIDC trusted publishing when `version.rb` changes on `main`.
|
|
6
|
+
|
|
7
|
+
## 1.1.0
|
|
8
|
+
|
|
9
|
+
- Support Rails 8 / Active Support 8 (widen the `activesupport` dependency to `>= 7.0, < 9`).
|
|
10
|
+
- Stop committing `Gemfile.lock` so applications resolve dependencies against the gemspec
|
|
11
|
+
|
|
12
|
+
## 1.0.1
|
|
13
|
+
|
|
14
|
+
- Resolve dependency vulnerabilities by bumping vulnerable transitive dependencies.
|
|
15
|
+
|
|
16
|
+
## 1.0.0
|
|
17
|
+
|
|
18
|
+
- First stable release, promoting the 0.12.x API to 1.0 with no breaking changes.
|
|
19
|
+
- Expanded README documentation and cleaned up the gemspec and CI configuration.
|
|
20
|
+
|
|
21
|
+
## 0.1.0
|
|
22
|
+
|
|
23
|
+
Initial release
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Unit Ruby
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[](https://rubygems.org/gems/unit-ruby/)
|
|
4
4
|
[](https://github.com/retirable/unit-ruby/actions/workflows/ci.yml)
|
|
5
5
|

|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ A Ruby SDK for the [Unit's Banking-as-a-Service API](https://docs.unit.co/).
|
|
|
8
8
|
|
|
9
9
|
> [!IMPORTANT]
|
|
10
10
|
>
|
|
11
|
-
> The development of the `unit-ruby` gem is sponsored and used in production by [Retirable](https://retirable).
|
|
11
|
+
> The development of the [`unit-ruby`](https://rubygems.org/gems/unit-ruby/) gem is sponsored and used in production by [Retirable](https://retirable).
|
|
12
12
|
>
|
|
13
13
|
> If you are starting a new project, you might want to consider Unit's officially supported gem, [`unit-ruby-sdk`](https://github.com/unit-finance/unit-ruby-sdk)
|
|
14
14
|
|
|
@@ -129,15 +129,13 @@ $ bundle exec rake install
|
|
|
129
129
|
|
|
130
130
|
## Releasing
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Releases are minted automatically. When a change to `lib/unit-ruby/version.rb` lands on `main`, the [Release workflow](.github/workflows/release.yml) builds the gem, tags the commit `vX.Y.Z`, and publishes to [RubyGems.org](https://rubygems.org/gems/unit-ruby/). No manual `gem push` is required, and no RubyGems API key is stored — the workflow authenticates via [OIDC trusted publishing](https://guides.rubygems.org/trusted-publishing/).
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
To cut a release:
|
|
135
135
|
|
|
136
|
-
1.
|
|
137
|
-
2.
|
|
138
|
-
3.
|
|
139
|
-
4. Push this latest version of the gem to RubyGems.org by calling `gem push unit-ruby-[gem version number].gem`
|
|
140
|
-
5. Merge PR into `main` branch
|
|
136
|
+
1. Make your changes, then bump the version in `lib/unit-ruby/version.rb` following [semantic versioning](https://semver.org/) and add an entry to `CHANGELOG.md`.
|
|
137
|
+
2. Open a PR and get it approved by the appropriate member(s) of the engineering team.
|
|
138
|
+
3. Merge to `main`. The Release workflow publishes the new version automatically. If the version is unchanged, no release is cut.
|
|
141
139
|
|
|
142
140
|
## Contributing
|
|
143
141
|
|
data/lib/unit-ruby/version.rb
CHANGED
data/unit-ruby.gemspec
CHANGED
|
@@ -29,11 +29,11 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
|
|
30
30
|
spec.required_ruby_version = '>= 3.3'
|
|
31
31
|
|
|
32
|
-
spec.add_dependency 'activesupport', '
|
|
32
|
+
spec.add_dependency 'activesupport', '>= 7.0', '< 9'
|
|
33
33
|
spec.add_dependency 'faraday', '~> 2'
|
|
34
34
|
spec.add_dependency 'faraday-retry', '~> 2'
|
|
35
35
|
|
|
36
|
-
spec.add_development_dependency 'dotenv', '~>
|
|
36
|
+
spec.add_development_dependency 'dotenv', '~> 3'
|
|
37
37
|
spec.add_development_dependency 'pry', '~> 0.15'
|
|
38
38
|
spec.add_development_dependency 'rake', '~> 13'
|
|
39
39
|
spec.add_development_dependency 'rspec', '~> 3'
|
metadata
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unit-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chloe Isacke
|
|
8
8
|
- Ian Yamey
|
|
9
9
|
- Trevor Nelson
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: exe
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: activesupport
|
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
|
18
17
|
requirements:
|
|
19
|
-
- - "
|
|
18
|
+
- - ">="
|
|
19
|
+
- !ruby/object:Gem::Version
|
|
20
|
+
version: '7.0'
|
|
21
|
+
- - "<"
|
|
20
22
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '
|
|
23
|
+
version: '9'
|
|
22
24
|
type: :runtime
|
|
23
25
|
prerelease: false
|
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
27
|
requirements:
|
|
26
|
-
- - "
|
|
28
|
+
- - ">="
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
version: '7.0'
|
|
31
|
+
- - "<"
|
|
27
32
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: '
|
|
33
|
+
version: '9'
|
|
29
34
|
- !ruby/object:Gem::Dependency
|
|
30
35
|
name: faraday
|
|
31
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,14 +65,14 @@ dependencies:
|
|
|
60
65
|
requirements:
|
|
61
66
|
- - "~>"
|
|
62
67
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '
|
|
68
|
+
version: '3'
|
|
64
69
|
type: :development
|
|
65
70
|
prerelease: false
|
|
66
71
|
version_requirements: !ruby/object:Gem::Requirement
|
|
67
72
|
requirements:
|
|
68
73
|
- - "~>"
|
|
69
74
|
- !ruby/object:Gem::Version
|
|
70
|
-
version: '
|
|
75
|
+
version: '3'
|
|
71
76
|
- !ruby/object:Gem::Dependency
|
|
72
77
|
name: pry
|
|
73
78
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -138,7 +143,6 @@ dependencies:
|
|
|
138
143
|
- - "~>"
|
|
139
144
|
- !ruby/object:Gem::Version
|
|
140
145
|
version: '1'
|
|
141
|
-
description:
|
|
142
146
|
email:
|
|
143
147
|
- chloe@retirable.com
|
|
144
148
|
- ian@retirable.com
|
|
@@ -149,13 +153,13 @@ extra_rdoc_files: []
|
|
|
149
153
|
files:
|
|
150
154
|
- ".env.example"
|
|
151
155
|
- ".github/workflows/ci.yml"
|
|
156
|
+
- ".github/workflows/release.yml"
|
|
152
157
|
- ".gitignore"
|
|
153
158
|
- ".rspec"
|
|
154
159
|
- ".rubocop.yml"
|
|
155
160
|
- CHANGELOG.md
|
|
156
161
|
- CODE_OF_CONDUCT.md
|
|
157
162
|
- Gemfile
|
|
158
|
-
- Gemfile.lock
|
|
159
163
|
- LICENSE.txt
|
|
160
164
|
- README.md
|
|
161
165
|
- Rakefile
|
|
@@ -220,7 +224,6 @@ metadata:
|
|
|
220
224
|
source_code_uri: https://github.com/retirable/unit-ruby
|
|
221
225
|
changelog_uri: https://github.com/retirable/unit-ruby/blob/main/CHANGELOG.md
|
|
222
226
|
rubygems_mfa_required: 'true'
|
|
223
|
-
post_install_message:
|
|
224
227
|
rdoc_options: []
|
|
225
228
|
require_paths:
|
|
226
229
|
- lib
|
|
@@ -235,8 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
235
238
|
- !ruby/object:Gem::Version
|
|
236
239
|
version: '0'
|
|
237
240
|
requirements: []
|
|
238
|
-
rubygems_version: 3.
|
|
239
|
-
signing_key:
|
|
241
|
+
rubygems_version: 3.6.9
|
|
240
242
|
specification_version: 4
|
|
241
243
|
summary: A Ruby gem for communicating with the Unit API.
|
|
242
244
|
test_files: []
|
data/Gemfile.lock
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
unit-ruby (1.0.0)
|
|
5
|
-
activesupport (~> 7)
|
|
6
|
-
faraday (~> 2)
|
|
7
|
-
faraday-retry (~> 2)
|
|
8
|
-
|
|
9
|
-
GEM
|
|
10
|
-
remote: https://rubygems.org/
|
|
11
|
-
specs:
|
|
12
|
-
activesupport (7.0.8.7)
|
|
13
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
14
|
-
i18n (>= 1.6, < 2)
|
|
15
|
-
minitest (>= 5.1)
|
|
16
|
-
tzinfo (~> 2.0)
|
|
17
|
-
ast (2.4.2)
|
|
18
|
-
coderay (1.1.3)
|
|
19
|
-
concurrent-ruby (1.3.4)
|
|
20
|
-
diff-lcs (1.5.1)
|
|
21
|
-
dotenv (2.7.6)
|
|
22
|
-
faraday (2.12.2)
|
|
23
|
-
faraday-net_http (>= 2.0, < 3.5)
|
|
24
|
-
json
|
|
25
|
-
logger
|
|
26
|
-
faraday-net_http (3.4.0)
|
|
27
|
-
net-http (>= 0.5.0)
|
|
28
|
-
faraday-retry (2.2.1)
|
|
29
|
-
faraday (~> 2.0)
|
|
30
|
-
i18n (1.14.6)
|
|
31
|
-
concurrent-ruby (~> 1.0)
|
|
32
|
-
json (2.9.1)
|
|
33
|
-
logger (1.6.4)
|
|
34
|
-
method_source (1.1.0)
|
|
35
|
-
minitest (5.25.4)
|
|
36
|
-
net-http (0.6.0)
|
|
37
|
-
uri
|
|
38
|
-
parallel (1.26.3)
|
|
39
|
-
parser (3.3.6.0)
|
|
40
|
-
ast (~> 2.4.1)
|
|
41
|
-
racc
|
|
42
|
-
pry (0.15.2)
|
|
43
|
-
coderay (~> 1.1)
|
|
44
|
-
method_source (~> 1.0)
|
|
45
|
-
racc (1.8.1)
|
|
46
|
-
rainbow (3.1.1)
|
|
47
|
-
rake (13.2.1)
|
|
48
|
-
regexp_parser (2.10.0)
|
|
49
|
-
rexml (3.4.0)
|
|
50
|
-
rspec (3.13.0)
|
|
51
|
-
rspec-core (~> 3.13.0)
|
|
52
|
-
rspec-expectations (~> 3.13.0)
|
|
53
|
-
rspec-mocks (~> 3.13.0)
|
|
54
|
-
rspec-core (3.13.2)
|
|
55
|
-
rspec-support (~> 3.13.0)
|
|
56
|
-
rspec-expectations (3.13.3)
|
|
57
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
58
|
-
rspec-support (~> 3.13.0)
|
|
59
|
-
rspec-file_fixtures (0.1.9)
|
|
60
|
-
rspec (~> 3.12)
|
|
61
|
-
rspec-mocks (3.13.2)
|
|
62
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
63
|
-
rspec-support (~> 3.13.0)
|
|
64
|
-
rspec-support (3.13.2)
|
|
65
|
-
rubocop (1.24.1)
|
|
66
|
-
parallel (~> 1.10)
|
|
67
|
-
parser (>= 3.0.0.0)
|
|
68
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
69
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
70
|
-
rexml
|
|
71
|
-
rubocop-ast (>= 1.15.1, < 2.0)
|
|
72
|
-
ruby-progressbar (~> 1.7)
|
|
73
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
|
74
|
-
rubocop-ast (1.37.0)
|
|
75
|
-
parser (>= 3.3.1.0)
|
|
76
|
-
ruby-progressbar (1.13.0)
|
|
77
|
-
tzinfo (2.0.6)
|
|
78
|
-
concurrent-ruby (~> 1.0)
|
|
79
|
-
unicode-display_width (2.6.0)
|
|
80
|
-
uri (1.0.3)
|
|
81
|
-
|
|
82
|
-
PLATFORMS
|
|
83
|
-
ruby
|
|
84
|
-
|
|
85
|
-
DEPENDENCIES
|
|
86
|
-
dotenv (~> 2)
|
|
87
|
-
pry (~> 0.15)
|
|
88
|
-
rake (~> 13)
|
|
89
|
-
rspec (~> 3)
|
|
90
|
-
rspec-file_fixtures (~> 0.1.9)
|
|
91
|
-
rubocop (~> 1)
|
|
92
|
-
unit-ruby!
|
|
93
|
-
|
|
94
|
-
BUNDLED WITH
|
|
95
|
-
2.4.19
|