plan_my_stuff 0.21.0 → 0.21.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: 0d33c652f54d9d078276d12baac63134e8bba4064185f61626c66fd924ea958a
4
- data.tar.gz: 54f5c69130890fa5ae807d642cd8d89d2f0d74c4d12b638ed892d8f9b2df22d8
3
+ metadata.gz: 4eda8634e75b318cd847d512405f71d4ffe2b0d7a6beccd6404912a6c64f1c2b
4
+ data.tar.gz: 80c7edb2a0e861c3dc0f76b06ae23232bde0ed52d04f4cdada69bd29aa8107dd
5
5
  SHA512:
6
- metadata.gz: 36d2a9a1624279d818d6c1a16fcfd51cd8e047e4f02d51044673fecb0ef3433b4a953290eb51deb868b9a8959fe365abf4dcb0645883466941047c6915c070d3
7
- data.tar.gz: fbadf2e2e8337a7014e148e898291de7ef4453729332f2c8d2609942487ebec7359a97a687e44340edac1a0d7c8e36fdeddcd3cc90c8fe30a108f76f7ba74a49
6
+ metadata.gz: 3336630d6d5ee6b8bad51fdfa08a647aa58933e0f30a36241fd137a4d3f5b67656386d36fd0990d289499a7cf2643469e32c1642d4f2d5811be5fc671ea9d420
7
+ data.tar.gz: 15db293bc2203d60ca7e2b5d102035b1a8d064a74b84666e13d0fbcad1ab15dbe576f02af2f7582c56c9f65246dbb23e41043f6036e304801722c40890c463fc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.1
4
+
5
+ ### Added
6
+
7
+ - `config.eager_load_controllers_on_boot` (default `false`). When `true`, the engine eager-loads
8
+ `app/controllers/` in `after_initialize` so consuming apps with `eager_load = false` (dev mode) see
9
+ `PlanMyStuff::*Controller` constants without having to reference them first. Opt in if the host app
10
+ probes engine controllers via `defined?`, e.g. `defined?(PlanMyStuff::Issues::TakesController)` would
11
+ otherwise return `nil` until something triggered Zeitwerk autoload. Falls back to `Kernel#require` on
12
+ Zeitwerk < 2.6.2 (which lacks `eager_load_dir`).
13
+
3
14
  ## 0.21.0
4
15
 
5
16
  ### Breaking
data/CONFIGURATION.md CHANGED
@@ -49,6 +49,19 @@ config.repo_nicknames = { safety: 'Compliance' } # :element -> "Element", :under
49
49
  `Issue#to_param` then returns `"Element-1234"` / `"Compliance-567"`, encoding both repo and number in a single
50
50
  URL segment so `youtrack_issue_path(@issue)` works without a `repo:` query param.
51
51
 
52
+ ## Attachments
53
+
54
+ | Option | Type | Default | Description |
55
+ |---|---|---|---|
56
+ | `attachment_repo` | `String` | `'pms-attachments'` | Bare repo (under `organization`) for uploaded attachments. |
57
+
58
+ The repo must already exist; the uploader does not create it. Attachments commit onto
59
+ `config.main_branch` under `<repo_key_or_name>/issue-<number>/<uuid>.<ext>`.
60
+
61
+ ```ruby
62
+ config.attachment_repo = 'pms-attachments'
63
+ ```
64
+
52
65
  ## Projects
53
66
 
54
67
  | Option | Type | Default | Description |
@@ -337,6 +350,20 @@ config.cache_version = Rails.configuration.x.image_tag
337
350
  config.mount_groups = { webhooks: true, issues: true, projects: true }
338
351
  ```
339
352
 
353
+ ## Boot behavior
354
+
355
+ | Option | Type | Default | Description |
356
+ |---|---|---|---|
357
+ | `eager_load_controllers_on_boot` | `Boolean` | `false` | Eager-load engine controllers in `after_initialize`. |
358
+
359
+ Opt in if the host app probes engine controllers via `defined?` in dev mode. When `true`, the
360
+ engine walks `app/controllers` once on boot so `defined?(PlanMyStuff::SomeController)` resolves
361
+ without first referencing the constant.
362
+
363
+ ```ruby
364
+ config.eager_load_controllers_on_boot = true
365
+ ```
366
+
340
367
  ## Controller overrides
341
368
 
342
369
  | Option | Type | Default | Description |
@@ -30,6 +30,15 @@ PlanMyStuff.configure do |config|
30
30
  # need an entry.
31
31
  # config.repo_nicknames = { safety: 'Compliance' }
32
32
 
33
+ # --------------------------------------------------------------------------
34
+ # Attachments
35
+ # --------------------------------------------------------------------------
36
+ # Bare repo name (under `organization`) that stores uploaded attachment
37
+ # binaries. The repo must already exist; the uploader does not create it.
38
+ # Attachments commit onto `config.main_branch` under
39
+ # `<repo_key_or_name>/issue-<number>/<uuid>.<ext>`.
40
+ # config.attachment_repo = 'pms-attachments'
41
+
33
42
  # --------------------------------------------------------------------------
34
43
  # Projects
35
44
  # --------------------------------------------------------------------------
@@ -184,6 +193,16 @@ PlanMyStuff.configure do |config|
184
193
  #
185
194
  # config.issue_fields_enabled = false
186
195
 
196
+ # --------------------------------------------------------------------------
197
+ # Boot behavior
198
+ # --------------------------------------------------------------------------
199
+ # Eager-load the engine's controllers in after_initialize so that
200
+ # `defined?(PlanMyStuff::SomeController)` resolves without first referencing
201
+ # the constant. Opt in if the host app probes engine controllers via
202
+ # `defined?` in dev mode.
203
+ #
204
+ # config.eager_load_controllers_on_boot = true
205
+
187
206
  # --------------------------------------------------------------------------
188
207
  # Release pipeline
189
208
  # --------------------------------------------------------------------------
@@ -373,6 +373,15 @@ module PlanMyStuff
373
373
  #
374
374
  attr_accessor :issue_fields_enabled
375
375
 
376
+ # Whether to eager-load the engine's controllers on host boot. Defaults to +false+ (opt-in). When +true+, the engine
377
+ # walks +app/controllers+ during +after_initialize+ so +defined?(PlanMyStuff::SomeController)+ resolves without
378
+ # first referencing the constant. Enable in host apps that rely on +defined?+ probes against engine controllers in
379
+ # dev mode.
380
+ #
381
+ # @return [Boolean]
382
+ #
383
+ attr_accessor :eager_load_controllers_on_boot
384
+
376
385
  # @return [Configuration]
377
386
  def initialize
378
387
  @repos = {}
@@ -413,6 +422,7 @@ module PlanMyStuff
413
422
  @pipeline_completion_purge_enabled = true
414
423
  @pipeline_completion_ttl_hours = 24
415
424
  @issue_fields_enabled = true
425
+ @eager_load_controllers_on_boot = false
416
426
  @process_aws_webhooks = Rails.env.production?
417
427
  @sns_verifier_class = ::Aws::SNS::MessageVerifier if defined?(::Aws::SNS::MessageVerifier)
418
428
  @sns_verifier_error =
@@ -3,5 +3,21 @@
3
3
  module PlanMyStuff
4
4
  class Engine < ::Rails::Engine
5
5
  isolate_namespace PlanMyStuff
6
+
7
+ # Opt-in (via +config.eager_load_controllers_on_boot+): eager-load the engine's controllers regardless of the host
8
+ # app's eager_load setting. Without this, `defined?(PlanMyStuff::SomeController)` returns nil in host-app dev mode
9
+ # until something explicitly references the constant, since `defined?` does not trigger Zeitwerk autoload.
10
+ config.after_initialize do
11
+ next unless PlanMyStuff.configuration.eager_load_controllers_on_boot
12
+
13
+ controllers_dir = File.expand_path('../../app/controllers', __dir__)
14
+ loader = Rails.autoloaders.main
15
+
16
+ if loader.respond_to?(:eager_load_dir)
17
+ loader.eager_load_dir(controllers_dir)
18
+ else
19
+ Dir.glob(File.join(controllers_dir, '**/*.rb')).sort.each { |path| require path }
20
+ end
21
+ end
6
22
  end
7
23
  end
@@ -4,7 +4,7 @@ module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 21
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
10
10
  PRE = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plan_my_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-20 00:00:00.000000000 Z
11
+ date: 2026-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails