dynomite 2.0.0 → 2.0.1
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/dynomite/config.rb +1 -1
- data/lib/dynomite/engine.rb +3 -33
- data/lib/dynomite/migration/runner.rb +1 -0
- data/lib/dynomite/seed.rb +1 -0
- data/lib/dynomite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99f5b950767f598fa9c97b4028d9d7d8c8796e4fdc80ff508cbcde2e9e64a5de
|
4
|
+
data.tar.gz: 23140abd59f31218017100ec8ef5eccd9573667d78a8dc1992082f28bb5948da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e1d67deea755d6afa6a8c46c1a34bfcdf0008acea08b712b237fc8df48fba845979409d060bc4cc7779a1fe7f57db273cc101f365633705c733438a36dcf4db
|
7
|
+
data.tar.gz: c81946b90d932c162d550c2adf1615a34459ac633ebc9ee7fc42102ca4bd98456bd5b18e7b6416890ee233b20b2d0750e0547396dae0dee4233220725cbd3d00
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [2.0.1] - 2023-12-08
|
7
|
+
- [#36](https://github.com/tongueroo/dynomite/pull/36) set log level info as default
|
8
|
+
|
6
9
|
## [2.0.0] - 2023-12-03
|
7
10
|
- [#35](https://github.com/tongueroo/dynomite/pull/35) ActiveModel compatible
|
8
11
|
- Breaking change interface to be ActiveModel compatible
|
data/lib/dynomite/config.rb
CHANGED
@@ -6,7 +6,7 @@ module Dynomite
|
|
6
6
|
def initialize
|
7
7
|
@logger = Logger.new($stderr)
|
8
8
|
@logger.formatter = ActiveSupport::Logger::SimpleFormatter.new
|
9
|
-
@log_level =
|
9
|
+
@log_level = :info
|
10
10
|
@namespace_separator = "_"
|
11
11
|
@endpoint = ENV['DYNOMITE_ENDPOINT'] # allow to use local dynamodb
|
12
12
|
@env = ActiveSupport::StringInquirer.new(ENV['DYNOMITE_ENV'] || "development")
|
data/lib/dynomite/engine.rb
CHANGED
@@ -7,39 +7,9 @@ module Dynomite
|
|
7
7
|
# Discover all the fields for all the models from attribute_definitions
|
8
8
|
# and create field methods. Has to be done after_initialize because
|
9
9
|
# need model names for the table_name.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end if Dynomite.config.discover_fields
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.default_log_level
|
18
|
-
# Note: On AWS Lambda, ARGV[0] is nil
|
19
|
-
if ARGV[0]&.include?("dynamodb") # IE: dynamodb:migrate dynamodb:seed
|
20
|
-
:info
|
21
|
-
else
|
22
|
-
Jets.env.development? ? :debug : :info
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.quiet_dynamodb_logging
|
27
|
-
if ENV['DYNOMITE_DEBUG']
|
28
|
-
# If in debug mode, then leave the log level alone which is debug in development
|
29
|
-
# This shows the describe_table calls on jets console bootup
|
30
|
-
Dynomite.config.log_level = default_log_level
|
31
|
-
else
|
32
|
-
# Otherwise, set the log level to info temporarily to quiet the describe_table calls
|
33
|
-
# Then reset the log level back to the user's configured log level.
|
34
|
-
user_log_level = Dynomite.config.log_level
|
35
|
-
Dynomite.config.log_level = :info
|
36
|
-
end
|
37
|
-
|
38
|
-
yield
|
39
|
-
|
40
|
-
Dynomite::Item.client = nil # reset client. Need to reset the client since it's cached
|
41
|
-
# Go back to the user's configured log level or the default log level if user did not set it.
|
42
|
-
Dynomite.config.log_level = user_log_level || default_log_level
|
10
|
+
Dynomite::Item.descendants.each do |klass|
|
11
|
+
klass.discover_fields!
|
12
|
+
end if Dynomite.config.discover_fields
|
43
13
|
end
|
44
14
|
end
|
45
15
|
end
|
data/lib/dynomite/seed.rb
CHANGED
data/lib/dynomite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynomite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|