appydays 0.3.2 → 0.4.0

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: 28e26d2090ae5a2026a2e0be984ef8eb9e9d0e77064805fd54e50579477e6b76
4
- data.tar.gz: c42cd9bf6a052604a1a61b5188aef8ed052ff9312f0c737eae07825fb9ec0a7c
3
+ metadata.gz: fa853f6dccbb995b590e7a13204f7e02f7c8bb992630fa19344a15e751149bcf
4
+ data.tar.gz: 235896b58a7e3a1fac6fa742cf01dfd8d129a54182d09ae1dfb65ad31b60448c
5
5
  SHA512:
6
- metadata.gz: 69bb8e1c9f07c649c9e0d16a0b82ff50fc4a06810d122a49d78a312244dd62d2c5296c158a2fc3317dee90c1ab1c7ff0f8f25bbad5b5e35ffdd0e4cc99d61269
7
- data.tar.gz: 92bd69f37dfdd3b28b6626a5203b53c1dc353587a784d77cd32cb0a316272575403063adf2e6f0fbb47529a73c4cbae925018047c7354ebf69b278e2e4631cc3
6
+ metadata.gz: 931e7d037f44b697864b519f3efe6577a02f9923e814c2201f4c1ab1aea9430416f3cfc6dd63b26f116916b32ba08d608b03919cb7be52f173b11514e73d860a
7
+ data.tar.gz: 161d5c8a250623e558426ee6be2dae1135717c6599de90d4ff38e2276f2d5b2b65de729eaf16443ae18e92f6bb923771762d9c92ab8c2bec33731c7ed154645d
@@ -86,6 +86,8 @@ module Appydays::Configurable
86
86
  # If convert is passed, that is used as the converter so the default value can be any type.
87
87
  # key: The key to lookup the config value from the environment.
88
88
  # If nil, use an auto-generated combo of the configuration key and method name.
89
+ # If key is an array, look up each (string) value as a key.
90
+ # The first non-nil (ie, `ENV.fetch(x, nil)`) value will be used.
89
91
  # convert: If provided, call it with the string value so it can be parsed.
90
92
  # For example, you can parse a string JSON value here.
91
93
  # Convert will not be called with the default value.
@@ -106,7 +108,8 @@ module Appydays::Configurable
106
108
  end
107
109
 
108
110
  key ||= "#{@group_key}_#{name}".upcase
109
- env_value = ENV.fetch(key, nil)
111
+ keys = Array(key)
112
+ env_value = keys.filter_map { |k| ENV.fetch(k, nil) }.first
110
113
  converter = self._converter(default, convert)
111
114
  value = env_value.nil? ? default : converter[env_value]
112
115
  value = installer._set_value(name, value, side_effect)
@@ -5,8 +5,9 @@ require "sequel/database/logging"
5
5
 
6
6
  class Sequel::Database
7
7
  def log_exception(exception, message)
8
+ level = message.match?(/^SELECT NULL AS "?nil"? FROM .* LIMIT 1$/i) ? :debug : :error
8
9
  log_each(
9
- :error,
10
+ level,
10
11
  proc { "#{exception.class}: #{exception.message.strip if exception.message}: #{message}" },
11
12
  proc { ["sequel_exception", {sequel_message: message}, exception] },
12
13
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appydays
4
- VERSION = "0.3.2"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lithic Tech
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv