icasework 0.1.1 → 0.1.2

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: 5007353ea06c31011698aa7ee52dda3a6a80b40999d5a1d2c1335fef9bfa0259
4
- data.tar.gz: 940b15961849e0f6db5b067991932cde3e8ab90efe85ed642f32b0c696fed791
3
+ metadata.gz: 9d7c01809c26bc11e21fbb16abf7b2ca6463283f706fe520c5b51e13c12decfc
4
+ data.tar.gz: 2d29bedbb013def90d2c7faa9d8824383a53b900f895d79019719c7ee6d666dc
5
5
  SHA512:
6
- metadata.gz: bee9b0073ec4718b823ed4d181b05010b893edc0a5f358818c7f5cbc2e30621cb4ed1237afb3263a4af327e4fd5cdf361f01aad45af311c797af6abb1d62d9de
7
- data.tar.gz: cf85176d4ab2bd5d6689a99b7f493dbd9b6b1c5d2192ed7c1804262596e04459f4428b33555fc76ec8884c5115013eaab66c799f51a6544ab7961bb904f3d4e6
6
+ metadata.gz: 15e1f082a25a6ef31528ba55988b6699ca5b88470b3196c9c51e4760803fe6d715f87ea99f90e52dbb88163d0a0f192bd6705b5bc0393e8b481a29f73cedcdbb
7
+ data.tar.gz: 3506c109ac9751eb559f5c385d9d10d7c1f958f98b8bbcac14f7fd52b77beb5a29879d43ce574e9b170787275a73111e5021a55ae159cfad0be58eb7cfa15317
@@ -3,6 +3,6 @@ updates:
3
3
  - package-ecosystem: bundler
4
4
  directory: "/"
5
5
  schedule:
6
- interval: weekly
6
+ interval: monthly
7
7
  open-pull-requests-limit: 99
8
8
  rebase-strategy: "disabled"
@@ -14,7 +14,6 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  include:
17
- - { ruby: 2.6 }
18
17
  - { ruby: 2.7 }
19
18
 
20
19
  steps:
@@ -4,18 +4,25 @@ on: [pull_request]
4
4
 
5
5
  jobs:
6
6
  build:
7
- runs-on: ubuntu-20.04
7
+ runs-on: ubuntu-latest
8
+ env:
9
+ BUNDLE_ONLY: rubocop
8
10
  steps:
9
- - uses: actions/checkout@v2
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.6
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@v1
23
+ uses: reviewdog/action-rubocop@v2
18
24
  with:
19
25
  github_token: ${{ secrets.github_token }}
20
- rubocop_version: 1.10.0
26
+ reporter: github-pr-review
27
+ rubocop_version: gemfile
21
28
  rubocop_extensions: rubocop-performance:gemfile rubocop-rspec:gemfile
data/.rubocop.yml CHANGED
@@ -11,7 +11,7 @@ AllCops:
11
11
  - 'bin/rubocop'
12
12
  NewCops: enable
13
13
  SuggestExtensions: false
14
- TargetRubyVersion: 2.6
14
+ TargetRubyVersion: 2.7
15
15
 
16
16
  Metrics/BlockLength:
17
17
  Exclude:
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gemspec
8
8
  gem 'pry'
9
9
  gem 'rake', '~> 13.0'
10
10
  gem 'rspec', '~> 3.0'
11
- gem 'rubocop', '~> 1.11.0', require: false
11
+ gem 'rubocop', '~> 1.12.0', require: false
12
12
  gem 'rubocop-performance', require: false
13
13
  gem 'rubocop-rspec', require: false
14
14
  gem 'timecop'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- icasework (0.1.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.11.0)
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.1)
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.1)
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.11.0)
129
+ rubocop (~> 1.12.0)
128
130
  rubocop-performance
129
131
  rubocop-rspec
130
132
  timecop
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Graeme Porteous
3
+ Copyright (c) 2021 mySociety
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Icasework
1
+ # iCasework - Ruby client library
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/icasework`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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/[USERNAME]/icasework. 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).
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.6.0')
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
 
@@ -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: [data[:classifications][:classification]].flatten,
34
- documents: [data[:documents][:document]].flatten
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Icasework
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
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.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.6.0
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.1.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.