figjam 2.0.1 → 2.2.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 +4 -4
- data/README.md +16 -5
- data/lib/figjam/application.rb +5 -3
- data/lib/figjam/env.rb +2 -2
- data/lib/figjam/rails/engine.rb +16 -0
- data/lib/figjam/rails.rb +1 -0
- data/lib/figjam/version.rb +1 -1
- metadata +46 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb55c0209ee029e45d1868e1eb32d159ac3b50b6bdbc8ba469a818c1058c4f00
|
4
|
+
data.tar.gz: 3c7febb9ba1368b82458221f2914348a344474cf50c5ef1bbbfd4247d853d18d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba7fd124b00dcaa9f789a43556ab4725d1f7a8f0ed4b4112eafe6dfad72fefb583f4779df2a5a7fed1b8062764a149890ae952d16c7dcb03680a4531d13a390
|
7
|
+
data.tar.gz: b18b0f948baf4005b858cf38c162d66fd9620c62992f52a738c682be1b3abc7548529e03de36114123ebf89d060ccd3cba11877e11c8655bf33c461d342de79e
|
data/README.md
CHANGED
@@ -59,15 +59,26 @@ overrides.
|
|
59
59
|
|
60
60
|
Figjam is perfect for Rails engines. They can have their own configuration file, and
|
61
61
|
they can be loaded independently or in addition of the main application. To do this,
|
62
|
-
you can create a `config/application.yml` file in your engine, and add this
|
62
|
+
you can create a `config/application.yml` file in your engine, and add this to the `Rails::Engine`:
|
63
63
|
|
64
64
|
```ruby
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
module MyEngine
|
66
|
+
class Engine < ::Rails::Engine
|
67
|
+
Figjam::Rails::Engine.configure(self)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Or if you wish to pass in a specific value for the environment:
|
72
|
+
module MyEngine
|
73
|
+
class Engine < ::Rails::Engine
|
74
|
+
Figjam::Rails::Engine.configure(self, "my_engine_environment")
|
75
|
+
end
|
76
|
+
end
|
69
77
|
```
|
70
78
|
|
79
|
+
This will ensure that the engine's configuration is loaded when the Rails application starts, and
|
80
|
+
before any other initializers run.
|
81
|
+
|
71
82
|
### Usage without Rails
|
72
83
|
|
73
84
|
If you are not using Rails, you can load Figjam in your gem. Note, you can
|
data/lib/figjam/application.rb
CHANGED
@@ -69,7 +69,9 @@ module Figjam
|
|
69
69
|
end
|
70
70
|
|
71
71
|
private def parse(path)
|
72
|
-
|
72
|
+
raise ArgumentError, "Figjam config path #{path} not found" unless File.exist?(path)
|
73
|
+
|
74
|
+
load_yaml(ERB.new(File.read(path)).result) # nosemgrep
|
73
75
|
end
|
74
76
|
|
75
77
|
# rubocop:disable Security/YAMLLoad
|
@@ -96,8 +98,8 @@ module Figjam
|
|
96
98
|
non_string_configuration(value) unless value.is_a?(String) || value.nil?
|
97
99
|
end
|
98
100
|
|
99
|
-
::ENV[key.to_s] = value
|
100
|
-
::ENV[FIGARO_ENV_PREFIX + key.to_s] = value
|
101
|
+
::ENV[key.to_s] = value&.to_s
|
102
|
+
::ENV[FIGARO_ENV_PREFIX + key.to_s] = value&.to_s
|
101
103
|
end
|
102
104
|
|
103
105
|
private def skip?(key)
|
data/lib/figjam/env.rb
CHANGED
@@ -29,11 +29,11 @@ module Figjam
|
|
29
29
|
method.to_s.downcase.match(/^(.+?)([!?=])?$/).captures
|
30
30
|
end
|
31
31
|
|
32
|
-
# rubocop:disable Naming/
|
32
|
+
# rubocop:disable Naming/PredicatePrefix
|
33
33
|
private def has_key?(key)
|
34
34
|
::ENV.any? { |k, _| k.downcase == key }
|
35
35
|
end
|
36
|
-
# rubocop:enable Naming/
|
36
|
+
# rubocop:enable Naming/PredicatePrefix
|
37
37
|
|
38
38
|
private def missing_key!(key)
|
39
39
|
raise MissingKey, key
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Figjam
|
2
|
+
module Rails
|
3
|
+
module Engine
|
4
|
+
class << self
|
5
|
+
def configure(engine_context, environment = ::Rails.env)
|
6
|
+
engine_context.config.before_configuration do
|
7
|
+
Figjam::Application.new(
|
8
|
+
environment: environment,
|
9
|
+
path: "#{engine_context.root}/config/application.yml"
|
10
|
+
).load
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/figjam/rails.rb
CHANGED
data/lib/figjam/version.rb
CHANGED
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.0
|
4
|
+
version: 2.2.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-
|
11
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -212,6 +212,20 @@ dependencies:
|
|
212
212
|
- - ">="
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '0'
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: rubocop-magic_numbers
|
217
|
+
requirement: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
type: :development
|
223
|
+
prerelease: false
|
224
|
+
version_requirements: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
230
|
name: rubocop-performance
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +241,7 @@ dependencies:
|
|
227
241
|
- !ruby/object:Gem::Version
|
228
242
|
version: '0'
|
229
243
|
- !ruby/object:Gem::Dependency
|
230
|
-
name: rubocop-
|
244
|
+
name: rubocop-rails
|
231
245
|
requirement: !ruby/object:Gem::Requirement
|
232
246
|
requirements:
|
233
247
|
- - ">="
|
@@ -240,8 +254,36 @@ dependencies:
|
|
240
254
|
- - ">="
|
241
255
|
- !ruby/object:Gem::Version
|
242
256
|
version: '0'
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: rubocop-rake
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">"
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: 0.7.0
|
264
|
+
type: :development
|
265
|
+
prerelease: false
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - ">"
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: 0.7.0
|
243
271
|
- !ruby/object:Gem::Dependency
|
244
272
|
name: rubocop-rspec
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - ">"
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: 3.5.0
|
278
|
+
type: :development
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
requirements:
|
282
|
+
- - ">"
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: 3.5.0
|
285
|
+
- !ruby/object:Gem::Dependency
|
286
|
+
name: rubocop-thread_safety
|
245
287
|
requirement: !ruby/object:Gem::Requirement
|
246
288
|
requirements:
|
247
289
|
- - ">="
|
@@ -294,6 +336,7 @@ files:
|
|
294
336
|
- lib/figjam/figaro_alias.rb
|
295
337
|
- lib/figjam/rails.rb
|
296
338
|
- lib/figjam/rails/application.rb
|
339
|
+
- lib/figjam/rails/engine.rb
|
297
340
|
- lib/figjam/rails/railtie.rb
|
298
341
|
- lib/figjam/version.rb
|
299
342
|
homepage: https://github.com/hlascelles/figjam
|