laa-fee-calculator-client 1.0.0 → 1.3.0

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: 3e91d89315e8d8119bb926e760828c6f9f267049dbf72130c64158a0a86fc2f8
4
- data.tar.gz: 90586ee41c12e1a473e6a725494623737e05324794168d60099e55361a7c268a
3
+ metadata.gz: a6720e8d64a0423da427ccaec75a0bbd5bacca65634fca113ff4863a277b0065
4
+ data.tar.gz: 8a1e9ad3aca5a391316c5825e8c47296b98fc1d15a96a75cd3ec93087e40c870
5
5
  SHA512:
6
- metadata.gz: '092cbda2e9b578a3c0c07b941079437c546583368131ac5698c6e5c09ad530a5e82b2c57c50bf8abef64f28303461d298b5670c3c0a50ffd7ec5dbcceb3215b5'
7
- data.tar.gz: 370b75e0bdb3cb1809ab1d0ec0df6bf64afcf13ec92c2ca84e60e8115ac15befe57928976f321bee676dfbdcca737c5e57d8afdfbeb0da8e4218aa3e4f3b03f6
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
- [![Build Status](https://travis-ci.org/ministryofjustice/laa-fee-calculator-client.svg?branch=master)](https://travis-ci.org/ministryofjustice/laa-fee-calculator-client)
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', '~> 0.1.1'
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.5+ supported at present)
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. PR the change, code-review, merge.
182
+ 5. Update the `CHANGELOG.md` - format/documentation standards specified at top of file.
182
183
 
183
- 6. Pull master and run rake task below to publish
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>.gemspec
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
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "bundler/setup"
5
- require "pry-byebug"
6
5
  require "laa/fee_calculator"
7
6
 
8
7
  # You can add fixtures and/or initialization code here to make experimenting
@@ -2,17 +2,64 @@
2
2
 
3
3
  set -e
4
4
 
5
- rubies=("ruby-2.5.5" "ruby-2.6.0" "ruby-2.6.1" "ruby-2.6.2" "ruby-2.6.3")
6
- for i in "${rubies[@]}"
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 "$i: Start Test"
50
+ echo "$r: Start Test"
10
51
  echo "====================================================="
11
- if [[ $(rvm list | grep $i) ]]; then echo "$i already installed!"; else rvm install $i; fi
12
- rvm $i exec gem install bundler
13
- rvm $i exec bundle install
14
- rvm $i exec bundle exec rspec spec
52
+ VERSION=`get_version $r`
53
+ install_ruby $VERSION
54
+ run_tests_with $VERSION
55
+ rm Gemfile.lock
15
56
  echo "====================================================="
16
- echo "$i: End Test"
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 = ['Joel Sugarman', 'Ministry of Justice']
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.5.0'
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.9.2'
30
+ spec.add_runtime_dependency 'faraday', '~> 1.0'
31
31
 
32
32
  spec.add_development_dependency 'awesome_print'
33
- spec.add_development_dependency 'bundler', '~> 2.0.0'
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.74'
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.use Faraday::Adapter::NetHttp
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::Error::ClientError
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">
@@ -2,8 +2,8 @@
2
2
 
3
3
  module LAA
4
4
  module FeeCalculator
5
- VERSION = "1.0.0"
6
- VERSION_RELEASED = "2019-08-05"
5
+ VERSION = "1.3.0"
6
+ VERSION_RELEASED = "2022-04-21"
7
7
  USER_AGENT = "laa-fee-calculator-client/#{VERSION}"
8
8
  end
9
9
  end
@@ -21,6 +21,7 @@ module LAA
21
21
  end
22
22
 
23
23
  attr_writer :configuration
24
+
24
25
  def configuration
25
26
  @configuration ||= Configuration.new
26
27
  end
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.0.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - Joel Sugarman
7
+ - Katharine Ahern
8
8
  - Ministry of Justice
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-08-05 00:00:00.000000000 Z
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.9.2
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.9.2
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: '10.0'
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: '10.0'
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.74'
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.74'
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.5.0
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.0.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