dynamo-record 1.4.2 → 2.0.0.rc1

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: 193614a73977889190f759bb367f89d72ea36965a093488dc2203be83f28e37e
4
- data.tar.gz: cc792d8f2d367b0fd14b7af1578d6f0a3f249b589fd8e7e880d9f40e9715b383
3
+ metadata.gz: 3e7004f14e0eef3abddcf32bc09a52fdebcc684c64489d965d74e19a1bede687
4
+ data.tar.gz: 22d131f7cdd7d09824cf70e91270244648784da9ddc25b45a1cb37f6fc8f1282
5
5
  SHA512:
6
- metadata.gz: 9d2e98eeafd27be2c4e00e861515cd03c222de15a8eff4196377113d7791fa311b873b389037c8834cd039ab3df3590ff1e6bbdcf9c99ba09f8f567c8040acc4
7
- data.tar.gz: 8250e400b5c6a63dd0d33daedf9f5d1bba2ba8f5fdba1326543075dbc2c90a91bf4c7530a1edea2b4112ee2c8f56bba8c33e115efdc6d94177c11833a784245b
6
+ metadata.gz: d0978ad6b8d7dc2046a3306729e6601096ec833233f5953b3590dee1d0d61f51c4ed612484ed7fbb394a2d8cb6a2aed7c033f252cb990ea2a6b9a2b90d76a714
7
+ data.tar.gz: bbf39b630c8e7b8016713946181c62b94dad0181537f4862aa018fcde74dd809b63641beee9b4604c0767099dc8fd4b6b623a604b6a2ddb3857f3ea504c99329
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Instructure, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -7,7 +7,7 @@ module Dynamo
7
7
 
8
8
  def self.included(sub_class)
9
9
  sub_class.extend(ClassMethods)
10
- super(sub_class)
10
+ super
11
11
  end
12
12
 
13
13
  module ClassMethods
@@ -27,7 +27,7 @@ module Dynamo
27
27
  opts[:dynamodb_type] = 'S'
28
28
 
29
29
  # It is very unfortunate that Aws::Record used `attr`
30
- attr(name, Aws::Record::Marshalers::StringMarshaler.new(opts), opts)
30
+ attr(name, Aws::Record::Marshalers::StringMarshaler.new(opts), opts) # rubocop:disable Style/Attr
31
31
  end
32
32
 
33
33
  def define_readers(name, parts, cast_function)
@@ -28,7 +28,7 @@ module Dynamo
28
28
  end
29
29
 
30
30
  def find(opts)
31
- super(opts).tap do |record|
31
+ super.tap do |record|
32
32
  unless record
33
33
  name = self.name.demodulize
34
34
  conditions = opts.map { |k, v| "#{k}=#{v}" }.join(', ')
@@ -6,7 +6,7 @@ module Dynamo
6
6
  def validate_each(record, attribute, value)
7
7
  return if options[:model].exists? value
8
8
 
9
- record.errors[attribute] << (options[:message] || "#{attribute}:#{value} is not a valid #{options[:model]}")
9
+ record.errors[attribute] << (options[:message] || "#{attribute}:#{value} is not a valid #{options[:model]}") # rubocop:disable Rails/DeprecatedActiveModelErrorsMethods
10
10
  end
11
11
  end
12
12
  end
@@ -9,7 +9,7 @@ module Dynamo
9
9
  filename_regexp = /\A([0-9]+)_([_a-z0-9]*)\.?([_a-z0-9]*)?\.rb\z/
10
10
 
11
11
  # Sorts the files located in `db/dynamo_migrate` to ensure order is preserved
12
- Dir[Rails.root.join("#{path}/*.rb")].sort.each do |file|
12
+ Rails.root.glob("#{path}/*.rb").sort.each do |file|
13
13
  migration = migration(file, filename_regexp, constants)
14
14
 
15
15
  # starts the migration
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dynamo
4
4
  module Record
5
- VERSION = '1.4.2'
5
+ VERSION = '2.0.0.rc1'
6
6
  end
7
7
  end
data/lib/dynamo/record.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'logger'
3
4
  require 'active_model'
4
5
  require 'aws-record'
5
6
  require 'rails/railtie'
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec path: '../../'
6
6
 
7
- gem 'rails', '~> 5.2.0'
7
+ gem 'rails', '~> 7.1.0'
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Limit coverage reporting to one build:
4
- if /^2\.6/ =~ RUBY_VERSION && /6\.0/ =~ ENV['BUNDLE_GEMFILE']
4
+ if /^3\.2/ =~ RUBY_VERSION && /7\.1/ =~ ENV.fetch('BUNDLE_GEMFILE', nil)
5
5
  require 'simplecov'
6
6
 
7
7
  SimpleCov.start do
@@ -20,7 +20,7 @@ Combustion.initialize! do
20
20
  config.dynamo = { 'prefix' => 'test' }
21
21
  end
22
22
 
23
- Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
23
+ Dir['./spec/support/**/*.rb'].each { |f| require f }
24
24
 
25
25
  RSpec.configure do |config|
26
26
  # Enable flags like --only-failures and --next-failure
@@ -32,7 +32,7 @@ RSpec.configure do |config|
32
32
  end
33
33
 
34
34
  Aws.config.update(
35
- dynamodb: { endpoint: ENV['DYNAMO_ENDPOINT'] }
35
+ dynamodb: { endpoint: ENV.fetch('DYNAMO_ENDPOINT', nil) }
36
36
  )
37
37
 
38
38
  WebMock.disable_net_connect!(allow: ['dynamo:8000'])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamo-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 2.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Slaughter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-22 00:00:00.000000000 Z
11
+ date: 2025-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
19
+ version: '7.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.2'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '5.2'
29
+ version: '7.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.2'
32
+ version: '7.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-record
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,54 +50,54 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '5.2'
53
+ version: '7.1'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '6.2'
56
+ version: '7.2'
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '5.2'
63
+ version: '7.1'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: '6.2'
66
+ version: '7.2'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: activesupport
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: '5.2'
73
+ version: '7.1'
74
74
  - - "<"
75
75
  - !ruby/object:Gem::Version
76
- version: '6.2'
76
+ version: '7.2'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '5.2'
83
+ version: '7.1'
84
84
  - - "<"
85
85
  - !ruby/object:Gem::Version
86
- version: '6.2'
86
+ version: '7.2'
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: bundler
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - "~>"
92
92
  - !ruby/object:Gem::Version
93
- version: '2.2'
93
+ version: 2.4.22
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '2.2'
100
+ version: 2.4.22
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: byebug
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -160,28 +160,28 @@ dependencies:
160
160
  requirements:
161
161
  - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: 1.8.1
163
+ version: 1.75.2
164
164
  type: :development
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - "~>"
169
169
  - !ruby/object:Gem::Version
170
- version: 1.8.1
170
+ version: 1.75.2
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: rubocop-rails
173
173
  requirement: !ruby/object:Gem::Requirement
174
174
  requirements:
175
175
  - - "~>"
176
176
  - !ruby/object:Gem::Version
177
- version: 2.9.1
177
+ version: 2.31.0
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: 2.9.1
184
+ version: 2.31.0
185
185
  - !ruby/object:Gem::Dependency
186
186
  name: simplecov
187
187
  requirement: !ruby/object:Gem::Requirement
@@ -231,6 +231,7 @@ executables: []
231
231
  extensions: []
232
232
  extra_rdoc_files: []
233
233
  files:
234
+ - LICENSE.txt
234
235
  - README.md
235
236
  - lib/dynamo/record.rb
236
237
  - lib/dynamo/record/batch_get.rb
@@ -249,9 +250,7 @@ files:
249
250
  - lib/dynamo/record/task_helpers/scale.rb
250
251
  - lib/dynamo/record/version.rb
251
252
  - lib/tasks/dynamo.rake
252
- - spec/gemfiles/rails-5.2.gemfile
253
- - spec/gemfiles/rails-6.0.gemfile
254
- - spec/gemfiles/rails-6.1.gemfile
253
+ - spec/gemfiles/rails-7.1.gemfile
255
254
  - spec/internal/app/models/model1.rb
256
255
  - spec/internal/app/models/model2.rb
257
256
  - spec/internal/config/database.yml
@@ -275,7 +274,8 @@ files:
275
274
  homepage: https://github.com/instructure/dynamo-record
276
275
  licenses:
277
276
  - MIT
278
- metadata: {}
277
+ metadata:
278
+ rubygems_mfa_required: 'true'
279
279
  post_install_message:
280
280
  rdoc_options: []
281
281
  require_paths:
@@ -284,38 +284,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
284
  requirements:
285
285
  - - ">="
286
286
  - !ruby/object:Gem::Version
287
- version: '2.6'
287
+ version: '3.1'
288
288
  required_rubygems_version: !ruby/object:Gem::Requirement
289
289
  requirements:
290
- - - ">="
290
+ - - ">"
291
291
  - !ruby/object:Gem::Version
292
- version: '0'
292
+ version: 1.3.1
293
293
  requirements: []
294
294
  rubygems_version: 3.4.10
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: Extensions to Aws::Record for working with DynamoDB.
298
- test_files:
299
- - spec/gemfiles/rails-5.2.gemfile
300
- - spec/gemfiles/rails-6.0.gemfile
301
- - spec/gemfiles/rails-6.1.gemfile
302
- - spec/internal/app/models/model1.rb
303
- - spec/internal/app/models/model2.rb
304
- - spec/internal/config/database.yml
305
- - spec/internal/db/dynamo_migrate/20170402163638_create_model_1.rb
306
- - spec/internal/db/dynamo_migrate/20170402163639_create_model_2.rb
307
- - spec/internal/db/invalid_dynamo_migrate/add_model_1_stream.rb
308
- - spec/lib/dynamo/record/batch_get_spec.rb
309
- - spec/lib/dynamo/record/batch_write_spec.rb
310
- - spec/lib/dynamo/record/model_existence_vaildator_spec.rb
311
- - spec/lib/dynamo/record/model_spec.rb
312
- - spec/lib/dynamo/record/table_migration_spec.rb
313
- - spec/lib/dynamo/record/task_helpers/cleanup_spec.rb
314
- - spec/lib/dynamo/record/task_helpers/drop_all_tables_spec.rb
315
- - spec/lib/dynamo/record/task_helpers/drop_table_spec.rb
316
- - spec/lib/dynamo/record/task_helpers/list_tables_spec.rb
317
- - spec/lib/dynamo/record/task_helpers/migration_runner_spec.rb
318
- - spec/lib/dynamo/record/task_helpers/scale_spec.rb
319
- - spec/lib/dynamo/record/version_spec.rb
320
- - spec/spec_helper.rb
321
- - spec/support/shared_contexts/with_dummy_model.rb
298
+ test_files: []
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '../../'
6
-
7
- gem 'rails', '~> 6.0.0'
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '../../'
6
-
7
- gem 'rails', '~> 6.1.0'