uc3-dmp-dynamo 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49967f4bc1c632cc96e73008e18b83f23470afa90aeae6a87d19bb2a57e9c02f
4
- data.tar.gz: 6a004146a8cc09c99984ae998efe3e1607d06347feb49e9a2a12303afdf7d13b
3
+ metadata.gz: 29958b8c7b5059fafbea4794dd5b49ed3806054b710fe8d83a5c2b9654280003
4
+ data.tar.gz: 16cbcb62b1f1586a00c7d0c1c450c91c0958fad850e321c717e6aa41cdfa33e3
5
5
  SHA512:
6
- metadata.gz: 94e50d9577ade9d2474f8c93b5dec7c7739809fcceb30383ffbfcec44c22159570a85ddba4fd646eda80dcc9a68253728f0f7f21925baf5f1318cab2768d9558
7
- data.tar.gz: 8a844f411cbda3eaa90943a287b117a4963d77776ed3fa60341f441d258bd4ac0118037adfdc5ccbc349939522eb9cd7a4ce04be2bcf4c7e7a53b171a4e15d94
6
+ metadata.gz: 2becae9f11b1f3fe3d5e94ffaf2ddc7a4a1911503cf81a83020370baeca497464f8b92d5dbfbdc928525e153a30c09312fa79cbe4188b7ef444b9e22cba89ba6
7
+ data.tar.gz: 2df58c0c2bd4d15198d9870620d64ab823cb9c4925f344cb563e5aff8252267abdf25900a96e6e541021008a13ddf51e5f40eb9a3f28cd904c8ef40ec6b48f70
@@ -24,7 +24,7 @@ module Uc3DmpDynamo
24
24
  def pk_exists?(key:, logger: nil)
25
25
  return nil unless key.is_a?(Hash) && !key['PK'].nil?
26
26
 
27
- resp = client.get_item(table_name: @table, key: key, projection_expression: 'PK', logger: logger)
27
+ resp = client.get_item(table_name: @table, key:, projection_expression: 'PK', logger:)
28
28
  resp.item.is_a?(Hash) && resp.item['PK'] == key['PK']
29
29
  end
30
30
 
@@ -35,7 +35,7 @@ module Uc3DmpDynamo
35
35
 
36
36
  resp = @connection.get_item(
37
37
  { table_name: @table,
38
- key: key,
38
+ key:,
39
39
  consistent_read: false,
40
40
  return_consumed_capacity: logger&.level == 'debug' ? 'TOTAL' : 'NONE' }
41
41
  )
@@ -53,7 +53,7 @@ module Uc3DmpDynamo
53
53
  # projection_expression: 'title, dmp_id, modified'
54
54
  #
55
55
  # See the DynamoDB docs for examples of key_conditions and projection_expressions
56
- # rubocop:disable Metrics/AbcSize
56
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
57
57
  def query(args:, logger: nil)
58
58
  raise ClientError, MSG_INVALID_KEY unless args.is_a?(Hash) && args.fetch(:key_conditions, {}).any?
59
59
 
@@ -64,7 +64,8 @@ module Uc3DmpDynamo
64
64
  return_consumed_capacity: logger&.level == 'debug' ? 'TOTAL' : 'NONE'
65
65
  }
66
66
  # Look for and add any other filtering or projection args
67
- %i[index_name filter_expression expression_attribute_values projection_expression scan_index_forward].each do |key|
67
+ %i[index_name filter_expression expression_attribute_values projection_expression
68
+ scan_index_forward].each do |key|
68
69
  next if args[key.to_sym].nil?
69
70
 
70
71
  hash[key.to_sym] = args[key.to_sym]
@@ -79,14 +80,16 @@ module Uc3DmpDynamo
79
80
  rescue Aws::Errors::ServiceError => e
80
81
  raise ClientError, format(MSG_DYNAMO_ERROR, msg: e.message, trace: e.backtrace)
81
82
  end
82
- # rubocop:enable Metrics/AbcSize
83
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
83
84
 
84
85
  # Create/Update an item
86
+ # rubocop:disable Metrics/AbcSize
85
87
  def put_item(json:, logger: nil)
86
88
  raise ClientError, MSG_INVALID_KEY unless json.is_a?(Hash) && !json['PK'].nil? && !json['SK'].nil?
87
89
 
88
90
  resp = @connection.put_item(
89
- { table_name: @table,
91
+ {
92
+ table_name: @table,
90
93
  item: json,
91
94
  return_consumed_capacity: logger&.level == 'debug' ? 'TOTAL' : 'NONE'
92
95
  }
@@ -97,6 +100,7 @@ module Uc3DmpDynamo
97
100
  rescue Aws::Errors::ServiceError => e
98
101
  raise ClientError, format(MSG_DYNAMO_ERROR, msg: e.message, trace: e.backtrace)
99
102
  end
103
+ # rubocop:enable Metrics/AbcSize
100
104
 
101
105
  # Delete an item
102
106
  def delete_item(p_key:, s_key:, logger: nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpDynamo
4
- VERSION = '0.0.18'
4
+ VERSION = '0.0.19'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-12 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -124,7 +124,7 @@ licenses:
124
124
  - MIT
125
125
  metadata:
126
126
  rubygems_mfa_required: 'false'
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -132,15 +132,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: '2.7'
135
+ version: '3.2'
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.1.6
143
- signing_key:
142
+ rubygems_version: 3.4.10
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: DMPTool gem that provides support for Dynamo DB
146
146
  test_files: []