icasework 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +1 -1
- data/.github/workflows/ci.yml +0 -1
- data/.github/workflows/rubocop.yml +12 -5
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +8 -6
- data/LICENSE.txt +1 -1
- data/README.md +20 -6
- data/icasework.gemspec +1 -1
- data/lib/icasework/case.rb +14 -2
- data/lib/icasework/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d7c01809c26bc11e21fbb16abf7b2ca6463283f706fe520c5b51e13c12decfc
|
4
|
+
data.tar.gz: 2d29bedbb013def90d2c7faa9d8824383a53b900f895d79019719c7ee6d666dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15e1f082a25a6ef31528ba55988b6699ca5b88470b3196c9c51e4760803fe6d715f87ea99f90e52dbb88163d0a0f192bd6705b5bc0393e8b481a29f73cedcdbb
|
7
|
+
data.tar.gz: 3506c109ac9751eb559f5c385d9d10d7c1f958f98b8bbcac14f7fd52b77beb5a29879d43ce574e9b170787275a73111e5021a55ae159cfad0be58eb7cfa15317
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ci.yml
CHANGED
@@ -4,18 +4,25 @@ on: [pull_request]
|
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
build:
|
7
|
-
runs-on: ubuntu-
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
env:
|
9
|
+
BUNDLE_ONLY: rubocop
|
8
10
|
steps:
|
9
|
-
- uses: actions/checkout@
|
11
|
+
- uses: actions/checkout@v4
|
10
12
|
|
11
13
|
- name: Set up Ruby
|
12
14
|
uses: ruby/setup-ruby@v1
|
13
15
|
with:
|
14
|
-
ruby-version: 2.
|
16
|
+
ruby-version: 2.7
|
17
|
+
|
18
|
+
- run: |
|
19
|
+
gem install securerandom -v 0.3.2
|
20
|
+
gem install activesupport -v 7.1.5.1
|
15
21
|
|
16
22
|
- name: Run RuboCop linter
|
17
|
-
uses: reviewdog/action-rubocop@
|
23
|
+
uses: reviewdog/action-rubocop@v2
|
18
24
|
with:
|
19
25
|
github_token: ${{ secrets.github_token }}
|
20
|
-
|
26
|
+
reporter: github-pr-review
|
27
|
+
rubocop_version: gemfile
|
21
28
|
rubocop_extensions: rubocop-performance:gemfile rubocop-rspec:gemfile
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
icasework (0.1.
|
4
|
+
icasework (0.1.2)
|
5
5
|
activesupport (>= 4.0.0)
|
6
6
|
jwt (~> 2.2.0)
|
7
7
|
nokogiri (~> 1.0)
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
14
|
Ascii85 (1.1.0)
|
15
|
-
activesupport (6.1.3)
|
15
|
+
activesupport (6.1.3.1)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
@@ -83,7 +83,7 @@ GEM
|
|
83
83
|
diff-lcs (>= 1.2.0, < 2.0)
|
84
84
|
rspec-support (~> 3.10.0)
|
85
85
|
rspec-support (3.10.2)
|
86
|
-
rubocop (1.
|
86
|
+
rubocop (1.12.0)
|
87
87
|
parallel (~> 1.10)
|
88
88
|
parser (>= 3.0.0.0)
|
89
89
|
rainbow (>= 2.2.2, < 4.0)
|
@@ -94,7 +94,7 @@ GEM
|
|
94
94
|
unicode-display_width (>= 1.4.0, < 3.0)
|
95
95
|
rubocop-ast (1.4.1)
|
96
96
|
parser (>= 2.7.1.5)
|
97
|
-
rubocop-performance (1.10.
|
97
|
+
rubocop-performance (1.10.2)
|
98
98
|
rubocop (>= 0.90.0, < 2.0)
|
99
99
|
rubocop-ast (>= 0.4.0)
|
100
100
|
rubocop-rspec (2.2.0)
|
@@ -110,21 +110,23 @@ GEM
|
|
110
110
|
unf_ext
|
111
111
|
unf_ext (0.0.7.7)
|
112
112
|
unicode-display_width (2.0.0)
|
113
|
-
webmock (3.12.
|
113
|
+
webmock (3.12.2)
|
114
114
|
addressable (>= 2.3.6)
|
115
115
|
crack (>= 0.3.2)
|
116
116
|
hashdiff (>= 0.4.0, < 2.0.0)
|
117
117
|
zeitwerk (2.4.2)
|
118
118
|
|
119
119
|
PLATFORMS
|
120
|
+
arm64-darwin
|
120
121
|
ruby
|
122
|
+
x82_64-darwin
|
121
123
|
|
122
124
|
DEPENDENCIES
|
123
125
|
icasework!
|
124
126
|
pry
|
125
127
|
rake (~> 13.0)
|
126
128
|
rspec (~> 3.0)
|
127
|
-
rubocop (~> 1.
|
129
|
+
rubocop (~> 1.12.0)
|
128
130
|
rubocop-performance
|
129
131
|
rubocop-rspec
|
130
132
|
timecop
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# iCasework - Ruby client library
|
2
2
|
|
3
|
-
|
3
|
+
A Ruby interface to Civica's iCasework API platform for submitting and retrieving case information. This client library provides basic methods to interact with cases and case-related data from iCasework instances.
|
4
4
|
|
5
|
-
|
5
|
+
**Note:** This gem is not officially affiliated with or supported by Civica.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,7 +22,22 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
```ruby
|
26
|
+
# setup account
|
27
|
+
Icasework.account = ...
|
28
|
+
Icasework.api_key = ...
|
29
|
+
|
30
|
+
# create a case
|
31
|
+
Icasework::Case.create(type: 'InformationRequest',
|
32
|
+
request_method: 'Online Form',
|
33
|
+
customer: { name: name, email: email },
|
34
|
+
details: body)
|
35
|
+
|
36
|
+
# retrieve cases
|
37
|
+
Icasework::Case.where(type: 'InformationRequest',
|
38
|
+
from: start_date,
|
39
|
+
until: end_date)
|
40
|
+
```
|
26
41
|
|
27
42
|
## Development
|
28
43
|
|
@@ -32,8 +47,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
47
|
|
33
48
|
## Contributing
|
34
49
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
-
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mysociety/icasework-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/icasework/blob/master/CODE_OF_CONDUCT.md).
|
37
51
|
|
38
52
|
## License
|
39
53
|
|
data/icasework.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
'organisations of all sizes to do a better job of case management'
|
14
14
|
spec.homepage = 'https://github.com/mysociety/icasework-ruby/'
|
15
15
|
spec.license = 'MIT'
|
16
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
|
17
17
|
|
18
18
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
19
19
|
|
data/lib/icasework/case.rb
CHANGED
@@ -30,8 +30,8 @@ module Icasework
|
|
30
30
|
case_status: case_status_data(data),
|
31
31
|
case_status_receipt: case_status_receipt_data(data),
|
32
32
|
attributes: data[:attributes],
|
33
|
-
classifications:
|
34
|
-
documents:
|
33
|
+
classifications: case_classifications_data(data),
|
34
|
+
documents: case_documents_data(data)
|
35
35
|
}
|
36
36
|
end
|
37
37
|
|
@@ -47,6 +47,18 @@ module Icasework
|
|
47
47
|
def case_status_data(data)
|
48
48
|
{ status: data[:status] }
|
49
49
|
end
|
50
|
+
|
51
|
+
def case_classifications_data(data)
|
52
|
+
return [] unless data[:classifications]
|
53
|
+
|
54
|
+
[data[:classifications][:classification]].flatten
|
55
|
+
end
|
56
|
+
|
57
|
+
def case_documents_data(data)
|
58
|
+
return [] unless data[:documents]
|
59
|
+
|
60
|
+
[data[:documents][:document]].flatten
|
61
|
+
end
|
50
62
|
end
|
51
63
|
|
52
64
|
def initialize(hash)
|
data/lib/icasework/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icasework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mySociety
|
@@ -135,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 2.
|
138
|
+
version: 2.7.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.
|
145
|
+
rubygems_version: 3.4.22
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Ruby library for the iCasework API.
|