figjam 2.2.1 → 3.0.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: f21f8363e6489243d1b2699575890fce89c28353f144feac6ab0987aaad0dd8f
4
- data.tar.gz: 674224b331b65c0c7a778bf5be413b0189a2186a3e29fc10ec84ad147c5a8bb1
3
+ metadata.gz: f35d4e26ae4c3164769faf39273f258a55dcfee745eedf07923c6af345bee8fc
4
+ data.tar.gz: f8201735431e49c46eebd988e048684cd0d2f98f15c841c8e12696176fd88248
5
5
  SHA512:
6
- metadata.gz: 5aa4280564d35e30311e765736bff50ea661e08b69b81baedd5f99452c8465fc4498d152feb82be27d9236918bf71b03091c2e85b8d3f249b59b4f2ffc8d162a
7
- data.tar.gz: f2ed121a67a57f9669a94ac82daa52919f6faffa051261707eee3f53745e896b4b7728faed64ed558ff32b0a5f949d284b7e80ee83deeb1005de376de133e856
6
+ metadata.gz: adea20bf2faf8f66087f76b9e746bb0537e56221a2e4361136cae4b1fbf53841e3817d31ccfad89597e4dbfb5065bd72d96598c92570d29aee07a4c17145e237
7
+ data.tar.gz: 9a0b6469cc6278164d2bc07875c178fcc50629b0cb7af37326cebe12230707dabb0163e2173f3ebc522d2829c75185b6437af777a33c1346491e6a807f4126cc
data/README.md CHANGED
@@ -131,7 +131,7 @@ Note, secrets are not to be provided by figjam, so do not add them to your `appl
131
131
 
132
132
  Deeply nested configuration structures are not possible.
133
133
 
134
- ## Silencing type conversion warnings
134
+ ## Debugging Figjam
135
135
 
136
136
  Remember that `ENV` in ruby is a simple key/value store. All values will always be strings.
137
137
  This means that the following code will produce string values:
@@ -142,21 +142,18 @@ SOME_BOOLEAN: true
142
142
  ```
143
143
 
144
144
  ```ruby
145
- # WARNING: Use strings for Figjam configuration. 3 was converted to "3"
146
- # WARNING: Use strings for Figjam configuration. true was converted to "true"
147
-
148
145
  ENV["SOME_NUMBER"] == 3 # => false
149
146
  ENV["SOME_NUMBER"] == "3" # => true
150
147
  ENV["SOME_BOOLEAN"] == true # => false
151
148
  ENV["SOME_BOOLEAN"] == "true" # => true
152
149
  ```
153
150
 
154
- Because this is a possible cause of sleeper bugs, Figjam emits a warning when it does this
155
- conversion to a string. If you are confident in your abilities, you can silence it by adding this
156
- to the top of your `application.yml`:
151
+ If you are unsure about how figjam is loading your configuration, you can enable warnings
152
+ about type conversion and pre-existing ENV by setting the `FIGJAM_DEBUG` environment variable
153
+ to `true`.
157
154
 
158
155
  ```yaml
159
- FIGJAM_SILENCE_STRING_WARNINGS: true
156
+ FIGJAM_DEBUG: true
160
157
  ```
161
158
 
162
159
  ### Using `Figjam.env`
@@ -8,11 +8,6 @@ module Figjam
8
8
  # :reek:TooManyMethods
9
9
  class Application
10
10
  FIGARO_ENV_PREFIX = "_FIGARO_".freeze
11
- SILENCE_STRING_WARNINGS_KEYS = %i[
12
- FIGARO_SILENCE_STRING_WARNINGS
13
- FIGJAM_SILENCE_STRING_WARNINGS
14
- ].freeze
15
-
16
11
  include Enumerable
17
12
 
18
13
  def initialize(options = {})
@@ -93,10 +88,8 @@ module Figjam
93
88
  end
94
89
 
95
90
  private def set(key, value)
96
- unless non_string_warnings_silenced?
97
- non_string_configuration(key) unless key.is_a?(String)
98
- non_string_configuration(value) unless value.is_a?(String) || value.nil?
99
- end
91
+ non_string_configuration(key) unless key.is_a?(String)
92
+ non_string_configuration(value) unless value.is_a?(String) || value.nil?
100
93
 
101
94
  ::ENV[key.to_s] = value&.to_s
102
95
  ::ENV[FIGARO_ENV_PREFIX + key.to_s] = value&.to_s
@@ -106,19 +99,16 @@ module Figjam
106
99
  ::ENV.key?(key.to_s) && !::ENV.key?(FIGARO_ENV_PREFIX + key.to_s)
107
100
  end
108
101
 
109
- private def non_string_warnings_silenced?
110
- SILENCE_STRING_WARNINGS_KEYS.any? { |key|
111
- # Allow the silence configuration itself to use non-string keys/values.
112
- configuration.values_at(key.to_s, key).any? { |cv| cv.to_s == "true" }
113
- }
114
- end
115
-
116
102
  private def non_string_configuration(value)
117
- warn "WARNING: Use strings for Figjam configuration. #{value.inspect} was converted to #{value.to_s.inspect}." # rubocop:disable Layout/LineLength
103
+ return unless ::ENV["FIGJAM_DEBUG"] == "true"
104
+
105
+ warn "FIGJAM: Use strings for Figjam configuration. #{value.inspect} was converted to #{value.to_s.inspect}." # rubocop:disable Layout/LineLength
118
106
  end
119
107
 
120
108
  private def key_skipped(key)
121
- puts "INFO: Skipping key #{key.inspect}. Already set in ENV."
109
+ return unless ::ENV["FIGJAM_DEBUG"] == "true"
110
+
111
+ puts "FIGJAM: Skipping key #{key.inspect}. Already set in ENV."
122
112
  end
123
113
 
124
114
  private def valid_key_name?(key)
@@ -1,3 +1,3 @@
1
1
  module Figjam
2
- VERSION = "2.2.1".freeze
2
+ VERSION = "3.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: figjam
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Lascelles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-17 00:00:00.000000000 Z
11
+ date: 2025-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -86,6 +86,20 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: climate_control
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: combustion
91
105
  requirement: !ruby/object:Gem::Requirement