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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f44433fd9e94400ce208e14151bf0a79f79f35a4c03a9e52699fd83483ce735f
4
- data.tar.gz: e99a049b39263d8cbfe4c1eaf05071652428401abd5fa1fec554c72286556dd5
3
+ metadata.gz: 8378bd1d90b672968f234d5df8a7aa0e01ee7666d5470cadf6ee548925f6a3c2
4
+ data.tar.gz: 687e17784aae8bb761450c93265e8bb658d67cdcbdfaa01f5a18b60016692e6b
5
5
  SHA512:
6
- metadata.gz: c3873c8aa83f4ff9beaf7d6f819a4e823a97518a4d68c7d15f3d9193204ab27b6f6b157944b7c8f2c1bcf7573709011598a2d025951a25e513e8f8a3ce50f1c1
7
- data.tar.gz: 57a96a51c5e91ce0e8602cde488851e023e4d5966e90b7f021b046bd2db992538bdf669fee5c7fd12018c26514adb70d5a16c976e13a5d72858ee9cc6fc0b815
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
- # * Pagy::Frontend pagination helpers
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 Pagy::Frontend].freeze
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
- missing = INCLUDES.reject {|mod| content.include?("include #{mod}") }
24
- return false if missing.empty?
25
- return false unless content.include?("module ApplicationHelper\n")
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
- lines = missing.map {|mod| " include #{mod}" }.join("\n")
28
- @path.write(content.sub("module ApplicationHelper\n", "module ApplicationHelper\n#{lines}\n"))
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCms
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codebyjob