plan_my_stuff 0.10.4 → 0.10.5

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: 7050eff0771b80d52e75bf81bd9338bb19a99d319cca6e292a00e0634001cca7
4
- data.tar.gz: ac99ee79695ea601cae8696c6610dffc50cda5a2ccadfd45c704f013be73f028
3
+ metadata.gz: ce0e2f02e6063ab2fe3238671d06182fc5447f428e6dc01d336ba6e00379e86a
4
+ data.tar.gz: f80f58ce32e19ea6e7b8aca34a62110379e6ea65f10c943fd108c409ec50a669
5
5
  SHA512:
6
- metadata.gz: b74d03033ea955d72b672ee5bef8e4a79b65fc54f849dcfaddb88b1e9b8bab8e3d6711458ebac3c120df1dc04023810b4ef420ef3898282a42260e14d1172a19
7
- data.tar.gz: 356a558f9d98f26e442f0db365c4e8bb7c5503f2e60643e6bbf71743b431c03b3916c9ef4399ac1993abb6101ce8913278a37a262e1689cc5cb398707dd755a6
6
+ metadata.gz: 3aaf1478091d45cbf8caa72a8a0f14b6cc445c5ec7c17382b92d50bb593d36b04ab00ade2973b2e8c67e19b3dfe1b7841022a9f336da2fe7ba3d27ea6c6b7eb5
7
+ data.tar.gz: 680bbb80160eaa20b20c05d4585e167e143c5be6c4735869bf8d138605cd11a52bacc1f3564cc6b8ea57e772b13aa22bdc7cd720c8254f5cf576c3207b15826e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.5
4
+
5
+ ### Added
6
+
7
+ - `config.parent_controller` (default `'::ApplicationController'`) lets consuming apps that don't use the
8
+ `ApplicationController` name (e.g. `ActionController::Base`, `RawrApplicationController`) tell the engine
9
+ what to inherit from. The `plan_my_stuff:verify` rake task now reports whether the configured class
10
+ resolves.
11
+
12
+ ### Fixed
13
+
14
+ - Example config option showed `url_options = Rails.application.config.action_mailer.default_url_options`. Now it shows
15
+ `url_options = Rails.application.routes.default_url_options`
16
+
3
17
  ## 0.10.4
4
18
 
5
19
  ### Changed
data/CONFIGURATION.md CHANGED
@@ -67,7 +67,7 @@ config.testing_template_project_number = 42
67
67
  ```ruby
68
68
  config.app_name = 'MyApp'
69
69
 
70
- url_options = Rails.application.config.action_mailer.default_url_options
70
+ url_options = Rails.application.routes.default_url_options
71
71
  config.issues_url_prefix = "#{url_options[:protocol] || 'http'}://#{url_options[:host]}/issues"
72
72
  ```
73
73
 
@@ -349,3 +349,16 @@ Controllable keys (with gem defaults):
349
349
  | `:'testing_project_items/results'` | `plan_my_stuff/testing_project_items/results` |
350
350
  | `:'webhooks/github'` | `plan_my_stuff/webhooks/github` |
351
351
  | `:'webhooks/aws'` | `plan_my_stuff/webhooks/aws` |
352
+
353
+ ### Parent controller
354
+
355
+ | Option | Type | Default | Description |
356
+ |---|---|---|---|
357
+ | `parent_controller` | `String` | `'::ApplicationController'` | Parent of `PlanMyStuff::ApplicationController`. |
358
+
359
+ Set this in `config/initializers/plan_my_stuff.rb`; Rails resolves the superclass once at class definition, so the
360
+ value must be set before the engine's controllers load.
361
+
362
+ ```ruby
363
+ config.parent_controller = 'RawrApplicationController'
364
+ ```
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlanMyStuff
4
- class ApplicationController < ::ApplicationController
4
+ class ApplicationController < PlanMyStuff.configuration.parent_controller.constantize
5
5
  protect_from_forgery with: :exception
6
6
  helper Rails.application.routes.url_helpers
7
7
 
@@ -101,7 +101,7 @@ PlanMyStuff.configure do |config|
101
101
  # number is appended to form `Issue#user_link`, which the gem also
102
102
  # writes as the visible body of the GitHub issue.
103
103
  # Recommended default:
104
- # url_options = Rails.application.config.action_mailer.default_url_options
104
+ # url_options = Rails.application.routes.default_url_options
105
105
  # config.issues_url_prefix =
106
106
  # "#{url_options[:protocol] || 'http'}://#{url_options[:host]}/issues"
107
107
 
@@ -321,4 +321,11 @@ PlanMyStuff.configure do |config|
321
321
  # :'testing_project_items/results' => 'plan_my_stuff/testing_project_items/results'
322
322
  # :'webhooks/github' => 'plan_my_stuff/webhooks/github'
323
323
  # :'webhooks/aws' => 'plan_my_stuff/webhooks/aws'
324
+
325
+ # --------------------------------------------------------------------------
326
+ # Parent controller
327
+ # --------------------------------------------------------------------------
328
+ # Parent class for PlanMyStuff::ApplicationController. Override when the
329
+ # consuming app does not use the `ApplicationController` name.
330
+ # config.parent_controller = 'MyOtherApplicationController'
324
331
  end
@@ -227,6 +227,16 @@ module PlanMyStuff
227
227
  #
228
228
  attr_accessor :controllers
229
229
 
230
+ # Parent class string for +PlanMyStuff::ApplicationController+. Defaults to +'::ApplicationController'+. Override
231
+ # when the consuming app does not use the +ApplicationController+ name (e.g. +'ActionController::Base'+,
232
+ # +'RawrApplicationController'+). Must be set before the gem's controllers load - the standard
233
+ # +config/initializers/plan_my_stuff.rb+ location is correct, since Rails resolves the superclass once at class
234
+ # definition time.
235
+ #
236
+ # @return [String]
237
+ #
238
+ attr_accessor :parent_controller
239
+
230
240
  # Whether to use Rails.cache for ETag-based HTTP caching of GitHub reads. Defaults to true; set to false to bypass
231
241
  # the cache entirely.
232
242
  #
@@ -361,6 +371,7 @@ module PlanMyStuff
361
371
  @production_branch = 'production'
362
372
  @mount_groups = { webhooks: true, issues: true, projects: true }
363
373
  @controllers = {}
374
+ @parent_controller = '::ApplicationController'
364
375
  @cache_enabled = true
365
376
  @github_login_for = {}
366
377
  @reminders_enabled = true
@@ -23,6 +23,7 @@ module PlanMyStuff
23
23
  check_organization
24
24
  check_repos
25
25
  check_default_project
26
+ check_parent_controller
26
27
  self
27
28
  end
28
29
 
@@ -80,6 +81,15 @@ module PlanMyStuff
80
81
  @results << Result.new("Repo :#{key}", false, "#{full_name}: #{e.message}")
81
82
  end
82
83
 
84
+ # @return [void]
85
+ def check_parent_controller
86
+ parent = PlanMyStuff.configuration.parent_controller.to_s
87
+ klass = parent.constantize
88
+ @results << Result.new('Parent controller', true, "#{parent} resolved to #{klass}")
89
+ rescue NameError => e
90
+ @results << Result.new('Parent controller', false, "#{parent.inspect}: #{e.message}")
91
+ end
92
+
83
93
  # @return [void]
84
94
  def check_default_project
85
95
  project_number = PlanMyStuff.configuration.default_project_number
@@ -4,7 +4,7 @@ module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 10
7
- TINY = 4
7
+ TINY = 5
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.10.4
4
+ version: 0.10.5
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-12 00:00:00.000000000 Z
11
+ date: 2026-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails