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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0609ff0c2a5e95266162de30b16a2c10a9be1255f1ce4ed23672fea369dc67b0'
4
- data.tar.gz: a7e2eb874c3be932c85e04f027d7c5da778bf6cc9671e1d173a169e62109ad83
3
+ metadata.gz: 99f5b950767f598fa9c97b4028d9d7d8c8796e4fdc80ff508cbcde2e9e64a5de
4
+ data.tar.gz: 23140abd59f31218017100ec8ef5eccd9573667d78a8dc1992082f28bb5948da
5
5
  SHA512:
6
- metadata.gz: 872e734331f516ae93d2c9a89452258ed448058597bfff3854e82d68b6e80bfe8a18a61a65167c3435c20776d8a58f01288787c441a2738cb126ee22db4620ca
7
- data.tar.gz: 2f572680129343676ed4a92a9aa58d979f494d2da1fb26592681959ef14a4bd670c0f5cf9ac8705e611ce1d09384ccd78f56b16fbbd6285344c25f74557f9620
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
@@ -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 = nil
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")
@@ -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
- quiet_dynamodb_logging do
11
- Dynomite::Item.descendants.each do |klass|
12
- klass.discover_fields!
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
@@ -8,6 +8,7 @@ class Dynomite::Migration
8
8
 
9
9
  def initialize(options={})
10
10
  @options = options
11
+ Dynomite.config.log_level = :info unless ENV['DYNOMITE_DEBUG']
11
12
  end
12
13
 
13
14
  def run
data/lib/dynomite/seed.rb CHANGED
@@ -2,6 +2,7 @@ module Dynomite
2
2
  class Seed
3
3
  def initialize(options={})
4
4
  @options = options
5
+ Dynomite.config.log_level = :info unless ENV['DYNOMITE_DEBUG']
5
6
  end
6
7
 
7
8
  def run
@@ -1,3 +1,3 @@
1
1
  module Dynomite
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
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.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-03 00:00:00.000000000 Z
11
+ date: 2023-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel