rock_rms 7.0.2 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +22 -0
  3. data/README.md +2 -2
  4. data/lib/rock_rms/error.rb +3 -0
  5. data/lib/rock_rms/response/attribute.rb +0 -1
  6. data/lib/rock_rms/response/attribute_value.rb +0 -1
  7. data/lib/rock_rms/response/base.rb +11 -3
  8. data/lib/rock_rms/response/batch.rb +0 -1
  9. data/lib/rock_rms/response/block.rb +0 -1
  10. data/lib/rock_rms/response/block_type.rb +0 -1
  11. data/lib/rock_rms/response/campus.rb +0 -1
  12. data/lib/rock_rms/response/defined_type.rb +0 -1
  13. data/lib/rock_rms/response/defined_value.rb +0 -1
  14. data/lib/rock_rms/response/fund.rb +0 -1
  15. data/lib/rock_rms/response/gateway.rb +0 -1
  16. data/lib/rock_rms/response/group.rb +0 -1
  17. data/lib/rock_rms/response/group_location.rb +0 -1
  18. data/lib/rock_rms/response/history.rb +0 -1
  19. data/lib/rock_rms/response/location.rb +0 -1
  20. data/lib/rock_rms/response/page.rb +0 -1
  21. data/lib/rock_rms/response/payment_detail.rb +0 -1
  22. data/lib/rock_rms/response/person.rb +0 -1
  23. data/lib/rock_rms/response/phone_number.rb +0 -1
  24. data/lib/rock_rms/response/recurring_donation.rb +0 -1
  25. data/lib/rock_rms/response/recurring_donation_details.rb +0 -1
  26. data/lib/rock_rms/response/registration.rb +0 -1
  27. data/lib/rock_rms/response/registration_instance.rb +0 -1
  28. data/lib/rock_rms/response/saved_payment_method.rb +0 -1
  29. data/lib/rock_rms/response/service_job.rb +0 -1
  30. data/lib/rock_rms/response/transaction.rb +0 -1
  31. data/lib/rock_rms/response/transaction_detail.rb +0 -1
  32. data/lib/rock_rms/response/workflow_activity_type.rb +0 -1
  33. data/lib/rock_rms/response/workflow_type.rb +0 -1
  34. data/lib/rock_rms/version.rb +1 -1
  35. data/rock_rms.gemspec +1 -1
  36. data/spec/rock_rms/response/attribute_value_spec.rb +1 -1
  37. data/spec/rock_rms/response/recurring_donation_spec.rb +3 -1
  38. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2a4fa58c26f7319dbc70a9caa55a0195f1f9516e941d706e0fd0d21dab41d32
4
- data.tar.gz: e73dfae38fcb5e46109e46338354a6b080f017bdbee844b363f54dd855cbd72b
3
+ metadata.gz: 46cbfa60c3a4fb4adf36a9338e608c2e7152f7d25cbca1bb94f1a0d636967e72
4
+ data.tar.gz: b90446854312d727acf35cced3bd00e97417fdd8e5c8a221923e53aec1474521
5
5
  SHA512:
6
- metadata.gz: e3b5ea27899ea899d8e4a101cac5276e7a9d7aab01892fbb23bd84f0a90bcd4025484d8f73aba87e550fb9a6722afc71eee48329f567b952f4f2f33540bce21b
7
- data.tar.gz: 222a7a3bff1c2e5d60836d916cbdfcf67985b5e569926395f3fa2c622f50de85f5cca3b6f5ff9a3fe0643108c11620ccfe5889ffb7b860749f98406d3cef02fa
6
+ metadata.gz: 0ce574e5f6b2a0f8ee784996494522bdf59d7d716dadad5b292b074efcf3d9644b3980d0f27c685b6f70362dc36f94013d4998bf56057e395e35452ccde47385
7
+ data.tar.gz: 8e023912b296c54081b726ea452c491531ec72f5be133236a7f7469f5337779123ed8d194009da22e333ededc2706fa143b8d8c575cbd18c1014d270d23abcaa
@@ -0,0 +1,22 @@
1
+ name: Run specs
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ bundler-cache: true
19
+ - name: Install dependencies
20
+ run: bundle install
21
+ - name: Run tests
22
+ run: bundle exec rspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![](https://www.rockrms.com/Themes/RockExternal/Assets/Images/rock-logo.svg)
2
2
 
3
- # Rock RMS Ruby Client [![Build Status](https://travis-ci.org/taylorbrooks/rock_rms.svg?branch=master)](https://travis-ci.org/taylorbrooks/rock_rms)
3
+ # Rock RMS Ruby Client ![example workflow](https://github.com/taylorbrooks/rock_rms/actions/workflows/test.yml/badge.svg)
4
4
 
5
5
  A Ruby wrapper for the Rock RMS API
6
6
 
@@ -14,7 +14,7 @@ I'm a big fan of Rock so if you have problems using the gem or would like to see
14
14
  Add this line to your application's Gemfile:
15
15
  ````ruby
16
16
  # in your Gemfile
17
- gem 'rock_rms', '~> 4.2'
17
+ gem 'rock_rms', '~> 7.0.3'
18
18
 
19
19
  # then...
20
20
  bundle install
@@ -2,6 +2,7 @@ module RockRMS
2
2
  class Error < StandardError; end
3
3
  class BadGateway < Error; end
4
4
  class BadRequest < Error; end
5
+ class CloudflareError < Error; end
5
6
  class Forbidden < Error; end
6
7
  class GatewayTimeout < Error; end
7
8
  class InternalServerError < Error; end
@@ -33,6 +34,8 @@ module FaradayMiddleware
33
34
  raise RockRMS::ServiceUnavailable, error_message(env)
34
35
  when 504
35
36
  raise RockRMS::GatewayTimeout, error_message(env)
37
+ when 520
38
+ raise RockRMS::CloudflareError, error_message(env)
36
39
  when ERROR_STATUSES
37
40
  raise RockRMS::Error, error_message(env)
38
41
  end
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Attribute < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  key: 'Key',
8
7
  description: 'Description'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class AttributeValue < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  value: 'Value',
7
6
  value_as_number: 'ValueAsNumeric',
8
7
  entity_id: 'EntityId'
@@ -3,6 +3,12 @@ module RockRMS
3
3
  class Base
4
4
  attr_reader :data
5
5
 
6
+ BASE_MAPPING = {
7
+ id: 'Id',
8
+ created_date_time: 'CreatedDateTime',
9
+ modified_date_time: 'ModifiedDateTime'
10
+ }.freeze
11
+
6
12
  def self.format(data)
7
13
  new(data).format
8
14
  end
@@ -22,9 +28,11 @@ module RockRMS
22
28
  def to_h(dict, data)
23
29
  return {} if data.nil?
24
30
 
25
- dict.each_with_object({}) do |(l, r), object|
26
- object[l] = data[r]
27
- end
31
+ dict
32
+ .merge(BASE_MAPPING)
33
+ .each_with_object({}) do |(l, r), object|
34
+ object[l] = data[r]
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Batch < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  control_amount: 'ControlAmount',
8
7
  transactions: 'Transactions',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Block < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  block_type: 'BlockType',
8
7
  page_id: 'PageId'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class BlockType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  category: 'Category',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Campus < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  is_active: 'IsActive',
8
7
  description: 'Description',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class DefinedType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  defined_values: 'DefinedValues',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class DefinedValue < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  defined_type_id: 'DefinedTypeId',
7
6
  description: 'Description',
8
7
  order: 'Order',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Fund < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  campus_id: 'CampusId',
7
6
  name: 'Name',
8
7
  gl_code: 'GlCode'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Gateway < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  active: 'IsActive'
8
7
  }.freeze
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Group < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  group_type_id: 'GroupTypeId',
8
7
  parent_group_id: 'ParentGroupId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class GroupLocation < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  group_id: 'GroupId',
7
6
  location_id: 'LocationId',
8
7
  guid: 'Guid'
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class History < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  verb: 'Verb',
7
6
  change_type: 'ChangeType',
8
7
  value_name: 'ValueName',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Location < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  is_active: 'IsActive',
8
7
  street1: 'Street1',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Page < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'InternalName',
7
6
  page_title: 'PageTitle',
8
7
  browser_title: 'BrowserTitle',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class PaymentDetail < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  exp_month: 'ExpirationMonth',
7
6
  exp_year: 'ExpirationYear',
8
7
  foreign_key: 'ForeignKey',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Person < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'FullName',
7
6
  email: 'Email',
8
7
  first_name: 'FirstName',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class PhoneNumber < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  person_id: 'PersonId',
7
6
  number: 'Number',
8
7
  number_type_value_id: 'NumberTypeValueId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RecurringDonation < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  active: 'IsActive',
7
6
  financial_gateway_id: 'FinancialGatewayId',
8
7
  foreign_key: 'ForeignKey',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RecurringDonationDetails < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  amount: 'Amount',
7
6
  fee_coverage_amount: 'FeeCoverageAmount',
8
7
  fund_id: 'AccountId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Registration < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  first_name: 'FirstName',
7
6
  last_name: 'LastName',
8
7
  confirmation_email: 'ConfirmationEmail',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class RegistrationInstance < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  start_date: 'StartDateTime',
8
7
  end_date: 'EndDateTime',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class SavedPaymentMethod < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  foreign_key: 'ForeignKey',
7
6
  gateway_id: 'FinancialGatewayId',
8
7
  gateway_person_id: 'GatewayPersonIdentifier',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class ServiceJob < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  active: 'IsActive',
8
7
  description: 'Description',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class Transaction < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  date: 'TransactionDateTime',
7
6
  person: 'AuthorizedPersonAlias',
8
7
  person_id: 'AuthorizedPersonAliasId',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class TransactionDetail < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  fee_amount: 'FeeAmount',
7
6
  fee_coverage_amount: 'FeeCoverageAmount',
8
7
  fund: 'Account',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class WorkflowActivityType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  name: 'Name',
7
6
  description: 'Description',
8
7
  order: 'Order',
@@ -2,7 +2,6 @@ module RockRMS
2
2
  module Response
3
3
  class WorkflowType < Base
4
4
  MAP = {
5
- id: 'Id',
6
5
  active: 'IsActive',
7
6
  name: 'Name',
8
7
  description: 'Description',
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '7.0.2'.freeze
2
+ VERSION = '7.1.1'.freeze
3
3
  end
data/rock_rms.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
17
17
  s.test_files = s.files.grep(%r{^(test)/})
18
18
 
19
- s.required_ruby_version = '~> 2.7'
19
+ s.required_ruby_version = '>= 2.7'
20
20
 
21
21
  s.require_paths = ['lib']
22
22
 
@@ -14,7 +14,7 @@ RSpec.describe RockRMS::Response::AttributeValue, type: :model do
14
14
 
15
15
  it 'has the correct number keys' do
16
16
  keys = result.first.keys
17
- expect(keys.count).to eq(4)
17
+ expect(keys.count).to eq(6)
18
18
  end
19
19
 
20
20
  it 'translates keys' do
@@ -15,7 +15,6 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
15
15
  it 'has the following keys' do
16
16
  response = result.first
17
17
  expected_keys = %i[
18
- id
19
18
  active
20
19
  financial_gateway_id
21
20
  foreign_key
@@ -30,6 +29,9 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
30
29
  transaction_code
31
30
  transaction_type_id
32
31
  summary
32
+ id
33
+ created_date_time
34
+ modified_date_time
33
35
  ]
34
36
 
35
37
  expect(response.keys).to eq(expected_keys)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-05 00:00:00.000000000 Z
11
+ date: 2022-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -173,6 +173,7 @@ executables:
173
173
  extensions: []
174
174
  extra_rdoc_files: []
175
175
  files:
176
+ - ".github/workflows/test.yml"
176
177
  - ".gitignore"
177
178
  - ".ruby-version"
178
179
  - ".travis.yml"
@@ -349,7 +350,7 @@ require_paths:
349
350
  - lib
350
351
  required_ruby_version: !ruby/object:Gem::Requirement
351
352
  requirements:
352
- - - "~>"
353
+ - - ">="
353
354
  - !ruby/object:Gem::Version
354
355
  version: '2.7'
355
356
  required_rubygems_version: !ruby/object:Gem::Requirement