figjam 2.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2bdd74d285355760c2cc7e9091fb84667ef5d121ccc92b9a918d26e0384b5d2
4
- data.tar.gz: 2b65309cad65436ece834fe9b809c50aa5f08992cf66173ce57ab7759ec27707
3
+ metadata.gz: eb55c0209ee029e45d1868e1eb32d159ac3b50b6bdbc8ba469a818c1058c4f00
4
+ data.tar.gz: 3c7febb9ba1368b82458221f2914348a344474cf50c5ef1bbbfd4247d853d18d
5
5
  SHA512:
6
- metadata.gz: 940cf5491a377bab7bd40c75fbac6259f97b90aeca541cc625b88f4e2b763183fe7b87953b28ac2d4d143dce6125719ea3bf3b5c4780a306f318fa3a79169bd9
7
- data.tar.gz: 14e68610f4d3511f2814bea78e8a549f0db93c1e251b1fb205fd112d1e9315aefc4a870e98f9c8a36661c4f6d22256899c8a68a6da7023abbacdaefd691ad18e
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 initializer:
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
- Figjam::Application.new(
66
- environment: ::Rails.env,
67
- path: File.expand_path("../application.yml", __dir__)
68
- ).load
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
@@ -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
@@ -6,6 +6,7 @@ rescue LoadError
6
6
  # Cater for no Rails
7
7
  else
8
8
  require "figjam/rails/application"
9
+ require "figjam/rails/engine"
9
10
 
10
11
  Figjam.adapter = Figjam::Rails::Application
11
12
  require "figjam/rails/railtie"
@@ -1,3 +1,3 @@
1
1
  module Figjam
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.2.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.1.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-07-15 00:00:00.000000000 Z
11
+ date: 2025-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -336,6 +336,7 @@ files:
336
336
  - lib/figjam/figaro_alias.rb
337
337
  - lib/figjam/rails.rb
338
338
  - lib/figjam/rails/application.rb
339
+ - lib/figjam/rails/engine.rb
339
340
  - lib/figjam/rails/railtie.rb
340
341
  - lib/figjam/version.rb
341
342
  homepage: https://github.com/hlascelles/figjam