ruby_cms 1.0.1 → 1.0.2
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/CHANGELOG.md +6 -0
- data/lib/ruby_cms/helper_wiring.rb +16 -7
- data/lib/ruby_cms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8378bd1d90b672968f234d5df8a7aa0e01ee7666d5470cadf6ee548925f6a3c2
|
|
4
|
+
data.tar.gz: 687e17784aae8bb761450c93265e8bb658d67cdcbdfaa01f5a18b60016692e6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db5f852d54f456ec852900d3cbd53b609e6f8823f10ec0fe3f06da08d7277a7134ca53add8a8b6a73309f45d7ea6c65f46f493d5e549fff254aac774a3241c82
|
|
7
|
+
data.tar.gz: 92ba4a9b314f01fb747948bb137d09eed69309ddb4f3a8a9b8430bc7e56c592914253d8ce5eefce8db35ba8693cc4a3b31c9dd447e8c640042100084165cb687
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.0.2] - 2026-06-29
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `HelperWiring` no longer wires `Pagy::Frontend` (removed in Pagy 43+); admin pagination uses `Pagy::Offset` via `AdminPagination` / `RubyUI::DataTable`. The installer now also strips an obsolete `include Pagy::Frontend` from the host app's `application_helper.rb`
|
|
8
|
+
|
|
3
9
|
## [1.0.1] - 2026-06-29
|
|
4
10
|
|
|
5
11
|
### Fixed
|
|
@@ -7,10 +7,12 @@ module RubyCms
|
|
|
7
7
|
# * RubyUI — Phlex::Kit, makes components callable as methods in ERB
|
|
8
8
|
# (e.g. AdminPageHeader(...)); defined by ruby_ui:install
|
|
9
9
|
# * CmsApplicationHelpers / ContentBlocksHelper — shipped by the gem
|
|
10
|
-
#
|
|
10
|
+
# Pagy 43+ has no Pagy::Frontend; admin pagination uses Pagy::Offset in
|
|
11
|
+
# AdminPagination and RubyUI::DataTable components instead.
|
|
11
12
|
# Idempotent: only adds includes that are missing.
|
|
12
13
|
class HelperWiring
|
|
13
|
-
INCLUDES = %w[CmsApplicationHelpers RubyUI ContentBlocksHelper
|
|
14
|
+
INCLUDES = %w[CmsApplicationHelpers RubyUI ContentBlocksHelper].freeze
|
|
15
|
+
OBSOLETE_INCLUDES = %w[Pagy::Frontend].freeze
|
|
14
16
|
|
|
15
17
|
def initialize(app_root:)
|
|
16
18
|
@path = Pathname.new(app_root).join("app/helpers/application_helper.rb")
|
|
@@ -20,12 +22,19 @@ module RubyCms
|
|
|
20
22
|
return false unless @path.exist?
|
|
21
23
|
|
|
22
24
|
content = @path.read
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
cleaned = OBSOLETE_INCLUDES.reduce(content) do |text, mod|
|
|
26
|
+
text.gsub(/^\s*include #{Regexp.escape(mod)}\n/, "")
|
|
27
|
+
end
|
|
28
|
+
missing = INCLUDES.reject {|mod| cleaned.include?("include #{mod}") }
|
|
29
|
+
changed = cleaned != content
|
|
30
|
+
return false if missing.empty? && !changed
|
|
31
|
+
return false unless cleaned.include?("module ApplicationHelper\n")
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
if missing.any?
|
|
34
|
+
lines = missing.map {|mod| " include #{mod}" }.join("\n")
|
|
35
|
+
cleaned = cleaned.sub("module ApplicationHelper\n", "module ApplicationHelper\n#{lines}\n")
|
|
36
|
+
end
|
|
37
|
+
@path.write(cleaned)
|
|
29
38
|
true
|
|
30
39
|
end
|
|
31
40
|
end
|
data/lib/ruby_cms/version.rb
CHANGED