laa-fee-calculator-client 1.0.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +9 -6
- data/bin/console +0 -1
- data/bin/ruby_version_test +55 -8
- data/laa-fee-calculator-client.gemspec +6 -8
- data/lib/laa/fee_calculator/connection.rb +2 -1
- data/lib/laa/fee_calculator/errors.rb +1 -1
- data/lib/laa/fee_calculator/version.rb +2 -2
- data/lib/laa/fee_calculator.rb +1 -0
- metadata +12 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6720e8d64a0423da427ccaec75a0bbd5bacca65634fca113ff4863a277b0065
|
4
|
+
data.tar.gz: 8a1e9ad3aca5a391316c5825e8c47296b98fc1d15a96a75cd3ec93087e40c870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a10006fdb40c4c1749031e500848c349fdc4e24cdc66c71384c1729a2d8ae63a7eaad15ac5ec32888df7ee17c0dc7bd9390a914f14b959f272adc106656cc7e5
|
7
|
+
data.tar.gz: 85b5c5aeb923f0014fee35043938fea0e239db55334f65bbfda20910202407a4a97ffd4a0cfda8f709e7c21cd28b0e6af6377846d82e6d07684da69309adaf25
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,34 @@ Add latest change log entries at top using template:
|
|
14
14
|
-
|
15
15
|
|
16
16
|
```
|
17
|
+
## Version 1.3.0
|
18
|
+
|
19
|
+
### Modified
|
20
|
+
- update Faraday dependency
|
21
|
+
|
22
|
+
### Added
|
23
|
+
- support for Ruby 3.0 and 3.1
|
24
|
+
|
25
|
+
### Removed
|
26
|
+
- removed support for Ruby 2.6
|
27
|
+
|
28
|
+
## Version 1.2.0
|
29
|
+
|
30
|
+
### Modified
|
31
|
+
- updated Faraday dependency
|
32
|
+
- updated development dependencies - rubocop, bundler
|
33
|
+
### Added
|
34
|
+
- support/testing for ruby 2.7.0
|
35
|
+
### Removed
|
36
|
+
- removed support for ruby 2.5
|
37
|
+
- removed testing against ruby versions less than 2.6
|
38
|
+
|
39
|
+
## Version 1.1.0
|
40
|
+
|
41
|
+
### Modified
|
42
|
+
- updated Faraday dependency
|
43
|
+
- Fixed deprecation warning resulting from `Faraday::Error::ClientError` being deprecated in favour of `Faraday::ClientError`
|
44
|
+
- updated development dependencies - rubocop, bundler
|
17
45
|
|
18
46
|
## Version 1.0.0
|
19
47
|
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
![RSpec](https://github.com/ministryofjustice/laa-fee-calculator-client/actions/workflows/rspec.yml/badge.svg)
|
2
|
+
![Rubocop](https://github.com/ministryofjustice/laa-fee-calculator-client/actions/workflows/rubocop.yml/badge.svg)
|
2
3
|
[![Gem Version](https://badge.fury.io/rb/laa-fee-calculator-client.svg)](https://badge.fury.io/rb/laa-fee-calculator-client)
|
3
4
|
![](https://ruby-gem-downloads-badge.herokuapp.com/laa-fee-calculator-client?type=total)
|
4
5
|
|
@@ -12,7 +13,7 @@ endpoints, providing a simple interface for querying data, in particular, the pr
|
|
12
13
|
Add this line to your application's Gemfile:
|
13
14
|
|
14
15
|
```ruby
|
15
|
-
gem 'laa-fee-calculator-client', '~>
|
16
|
+
gem 'laa-fee-calculator-client', '~> 1.2.0'
|
16
17
|
```
|
17
18
|
|
18
19
|
And then execute:
|
@@ -172,15 +173,17 @@ Bug reports and pull requests are welcome on GitHub at [ministryofjustice/laa-fe
|
|
172
173
|
|
173
174
|
1. Make required changes, run specs (rerecord vcr cassettes if necessary)
|
174
175
|
|
175
|
-
2. Run `bin/ruby_version_test` to test against ruby versions (2.
|
176
|
+
2. Run `bin/ruby_version_test` to test against ruby versions (2.7+ supported at present)
|
176
177
|
|
177
178
|
3. Update the VERSION in `lib/laa/fee_calculator/version` using [semantic versioning](https://guides.rubygems.org/patterns/#semantic-versioning).
|
178
179
|
|
179
180
|
4. Update the VERSION_RELEASED in `lib/laa/fee_calculator/version` to the date you intend to publish/release the version.
|
180
181
|
|
181
|
-
5.
|
182
|
+
5. Update the `CHANGELOG.md` - format/documentation standards specified at top of file.
|
182
183
|
|
183
|
-
6.
|
184
|
+
6. PR the change, code-review, merge.
|
185
|
+
|
186
|
+
7. Pull master and run rake task below to publish. Note, you will need a [rubygems](https://rubygems.org/) account with gem owner privileges and have configured your `~/.gem/credentials` in order for this task to complete successfully.
|
184
187
|
|
185
188
|
```bash
|
186
189
|
$ rake release
|
@@ -193,7 +196,7 @@ $ git push -u origin <branch>
|
|
193
196
|
$ git tag -a v<VERSION> -m "Version <VERSION>"
|
194
197
|
$ git push origin v<VERSION>
|
195
198
|
$ gem build laa-fee-calculator-client.gemspec
|
196
|
-
$ gem push laa-fee-calculator-client-<VERSION>.
|
199
|
+
$ gem push laa-fee-calculator-client-<VERSION>.gem
|
197
200
|
```
|
198
201
|
*`<VERSION>` is the value of `LAA::FeeCalculator::VERSION`
|
199
202
|
|
data/bin/console
CHANGED
data/bin/ruby_version_test
CHANGED
@@ -2,17 +2,64 @@
|
|
2
2
|
|
3
3
|
set -e
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
RUBIES="2.7 3.0 3.1"
|
6
|
+
|
7
|
+
if [ -e Gemfile.lock ]
|
8
|
+
then
|
9
|
+
echo Moving Gemfile.lock to Gemfile.lock.tmp
|
10
|
+
mv Gemfile.lock Gemfile.lock.tmp
|
11
|
+
fi
|
12
|
+
|
13
|
+
if (which rbenv)
|
14
|
+
then
|
15
|
+
echo "Using rbenv"
|
16
|
+
eval "$(rbenv init - bash)"
|
17
|
+
get_version() {
|
18
|
+
rbenv install --list 2> /dev/null | grep -E "^$1"
|
19
|
+
}
|
20
|
+
install_ruby() {
|
21
|
+
rbenv install --skip-existing $1
|
22
|
+
}
|
23
|
+
run_tests_with() {
|
24
|
+
rbenv shell $1
|
25
|
+
bundle install
|
26
|
+
bundle exec rspec spec
|
27
|
+
rbenv shell --unset
|
28
|
+
}
|
29
|
+
elif (which rvm)
|
30
|
+
then
|
31
|
+
echo "Using rvm"
|
32
|
+
get_version() {
|
33
|
+
echo $1
|
34
|
+
}
|
35
|
+
install_ruby() {
|
36
|
+
rvm install $1
|
37
|
+
}
|
38
|
+
run_tests_with() {
|
39
|
+
rvm $1 exec bundle install
|
40
|
+
rvm $1 exec bundle exec rspec spec
|
41
|
+
}
|
42
|
+
else
|
43
|
+
echo "No Ruby version manager found"
|
44
|
+
exit 1
|
45
|
+
fi
|
46
|
+
|
47
|
+
for r in $RUBIES
|
7
48
|
do
|
8
49
|
echo "====================================================="
|
9
|
-
echo "$
|
50
|
+
echo "$r: Start Test"
|
10
51
|
echo "====================================================="
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
52
|
+
VERSION=`get_version $r`
|
53
|
+
install_ruby $VERSION
|
54
|
+
run_tests_with $VERSION
|
55
|
+
rm Gemfile.lock
|
15
56
|
echo "====================================================="
|
16
|
-
echo "$
|
57
|
+
echo "$r: End Test"
|
17
58
|
echo "====================================================="
|
18
59
|
done
|
60
|
+
|
61
|
+
if [ -e Gemfile.lock.tmp ]
|
62
|
+
then
|
63
|
+
echo Moving Gemfile.lock.tmp to Gemfile.lock
|
64
|
+
mv Gemfile.lock.tmp Gemfile.lock
|
65
|
+
fi
|
@@ -7,8 +7,8 @@ require 'laa/fee_calculator/version'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'laa-fee-calculator-client'
|
9
9
|
spec.version = LAA::FeeCalculator::VERSION
|
10
|
-
spec.authors = ['
|
11
|
-
spec.email = ['joel.sugarman@digital.justice.gov.uk', 'tools@digital.justice.gov.uk']
|
10
|
+
spec.authors = ['Katharine Ahern', 'Ministry of Justice']
|
11
|
+
spec.email = ['katharine.ahern@digital.justice.gov.uk', 'joel.sugarman@digital.justice.gov.uk', 'tools@digital.justice.gov.uk']
|
12
12
|
spec.date = LAA::FeeCalculator::VERSION_RELEASED
|
13
13
|
spec.summary = 'Ruby client for the Legal Aid Agency fee calculator API'
|
14
14
|
spec.description = "Ruby client for the Ministry of Justices LAA fee calculator API. A simple interface for transparent calling of the API endpoints to query data and return calculated fee amounts."
|
@@ -24,18 +24,16 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
26
|
# see bin/ruby_version_test
|
27
|
-
spec.required_ruby_version = '>= 2.
|
27
|
+
spec.required_ruby_version = '>= 2.6.0'
|
28
28
|
|
29
29
|
spec.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.7'
|
30
|
-
spec.add_runtime_dependency 'faraday', '~> 0
|
30
|
+
spec.add_runtime_dependency 'faraday', '~> 1.0'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'awesome_print'
|
33
|
-
spec.add_development_dependency '
|
34
|
-
spec.add_development_dependency 'pry-byebug'
|
35
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
36
34
|
spec.add_development_dependency 'rb-readline'
|
37
35
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 0.78'
|
39
37
|
spec.add_development_dependency 'vcr'
|
40
38
|
spec.add_development_dependency 'webmock'
|
41
39
|
end
|
@@ -10,12 +10,13 @@ module LAA
|
|
10
10
|
extend Forwardable
|
11
11
|
|
12
12
|
attr_reader :conn
|
13
|
+
|
13
14
|
def_delegators :conn, :port, :headers, :url_prefix, :options, :ssl, :get
|
14
15
|
|
15
16
|
def initialize
|
16
17
|
@conn = Faraday.new(url: LAA::FeeCalculator.configuration.host, headers: default_headers) do |conn|
|
17
18
|
conn.use LAA::FeeCalculator::RaiseError
|
18
|
-
conn.
|
19
|
+
conn.adapter :net_http
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -6,7 +6,7 @@ module LAA
|
|
6
6
|
|
7
7
|
# raised for failed response status between 400 and 599 and not handled
|
8
8
|
# by classes below
|
9
|
-
class ClientError < Faraday::
|
9
|
+
class ClientError < Faraday::ClientError
|
10
10
|
# overide the e.message attribute
|
11
11
|
# e.g. raise LAA::FeeCalculator::ResponseError.new(response)
|
12
12
|
# => #<LAA::FeeCalculator::ResponseError: "`case_date` should be in the format YYYY-MM-DD">
|
data/lib/laa/fee_calculator.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: laa-fee-calculator-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Katharine Ahern
|
8
8
|
- Ministry of Justice
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
40
|
+
version: '1.0'
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '1.0'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: awesome_print
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,48 +59,20 @@ dependencies:
|
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: bundler
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0.0
|
69
|
-
type: :development
|
70
|
-
prerelease: false
|
71
|
-
version_requirements: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 2.0.0
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
name: pry-byebug
|
78
|
-
requirement: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
type: :development
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
62
|
- !ruby/object:Gem::Dependency
|
91
63
|
name: rake
|
92
64
|
requirement: !ruby/object:Gem::Requirement
|
93
65
|
requirements:
|
94
66
|
- - "~>"
|
95
67
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
68
|
+
version: '13.0'
|
97
69
|
type: :development
|
98
70
|
prerelease: false
|
99
71
|
version_requirements: !ruby/object:Gem::Requirement
|
100
72
|
requirements:
|
101
73
|
- - "~>"
|
102
74
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
75
|
+
version: '13.0'
|
104
76
|
- !ruby/object:Gem::Dependency
|
105
77
|
name: rb-readline
|
106
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,14 +107,14 @@ dependencies:
|
|
135
107
|
requirements:
|
136
108
|
- - "~>"
|
137
109
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0.
|
110
|
+
version: '0.78'
|
139
111
|
type: :development
|
140
112
|
prerelease: false
|
141
113
|
version_requirements: !ruby/object:Gem::Requirement
|
142
114
|
requirements:
|
143
115
|
- - "~>"
|
144
116
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
117
|
+
version: '0.78'
|
146
118
|
- !ruby/object:Gem::Dependency
|
147
119
|
name: vcr
|
148
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,6 +147,7 @@ description: Ruby client for the Ministry of Justices LAA fee calculator API. A
|
|
175
147
|
interface for transparent calling of the API endpoints to query data and return
|
176
148
|
calculated fee amounts.
|
177
149
|
email:
|
150
|
+
- katharine.ahern@digital.justice.gov.uk
|
178
151
|
- joel.sugarman@digital.justice.gov.uk
|
179
152
|
- tools@digital.justice.gov.uk
|
180
153
|
executables: []
|
@@ -215,14 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
188
|
requirements:
|
216
189
|
- - ">="
|
217
190
|
- !ruby/object:Gem::Version
|
218
|
-
version: 2.
|
191
|
+
version: 2.6.0
|
219
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
193
|
requirements:
|
221
194
|
- - ">="
|
222
195
|
- !ruby/object:Gem::Version
|
223
196
|
version: '0'
|
224
197
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.1.4
|
226
199
|
signing_key:
|
227
200
|
specification_version: 4
|
228
201
|
summary: Ruby client for the Legal Aid Agency fee calculator API
|