ruby_cms 1.0.0 → 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: 2c51e2bcca3bdc826fa4876db0709f8e0528be4534f2b336d9349430f7286e6c
4
- data.tar.gz: 96028a6acf6db9942132779bd45de972ae73e67d105a64e5726f1135f3e6d4b7
3
+ metadata.gz: 8378bd1d90b672968f234d5df8a7aa0e01ee7666d5470cadf6ee548925f6a3c2
4
+ data.tar.gz: 687e17784aae8bb761450c93265e8bb658d67cdcbdfaa01f5a18b60016692e6b
5
5
  SHA512:
6
- metadata.gz: 5c4b45df852da2fb69cf5842643f9e520128dd383ba951023139abd69e354587f3b0cd2460e8fa28fe19ec18765a3f0bf056f8b4bfba77f491e7f54226010894
7
- data.tar.gz: 26ae563187beb44f6af36d3926b643b3c70dd8d4495537608febf4f4fb56196a6681eeb438dc8ed72c52dd122827d56d02cef9572796279985f492780d1e758b
6
+ metadata.gz: db5f852d54f456ec852900d3cbd53b609e6f8823f10ec0fe3f06da08d7277a7134ca53add8a8b6a73309f45d7ea6c65f46f493d5e549fff254aac774a3241c82
7
+ data.tar.gz: 92ba4a9b314f01fb747948bb137d09eed69309ddb4f3a8a9b8430bc7e56c592914253d8ce5eefce8db35ba8693cc4a3b31c9dd447e8c640042100084165cb687
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
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
+
9
+ ## [1.0.1] - 2026-06-29
10
+
11
+ ### Fixed
12
+
13
+ - Installer resolves the passkeys/webauthn vs `bitwarden-sdk-secrets` `WebAuthn` constant clash by patching the host Gemfile to load `bitwarden-sdk-secrets` with `require: false` (`GemSetup#resolve_conflicts!`)
14
+
3
15
  ## [1.0.0] - 2026-06-29
4
16
 
5
17
  First public release of the modular install-only admin scaffolding gem.
@@ -71,8 +71,37 @@ module RubyCms
71
71
  added
72
72
  end
73
73
 
74
+ # Patch known Gemfile declarations that break optional modules (e.g. passkeys +
75
+ # webauthn vs bitwarden-sdk-secrets both defining `WebAuthn`).
76
+ # Returns true when the Gemfile was modified.
77
+ def resolve_conflicts!(modules: [])
78
+ return false unless @gemfile.exist?
79
+ return false unless modules.any? { |mod| mod.key == :passkeys }
80
+
81
+ content = @gemfile.read
82
+ patched = patch_bitwarden_require_false(content)
83
+ return false if patched == content
84
+
85
+ @gemfile.write(patched)
86
+ true
87
+ end
88
+
74
89
  private
75
90
 
91
+ BITWARDEN_GEM_LINE = /
92
+ ^\s*gem\s+["']bitwarden-sdk-secrets["']
93
+ (?<opts>[^\n]*)
94
+ \n
95
+ /x
96
+
97
+ def patch_bitwarden_require_false(content)
98
+ content.gsub(BITWARDEN_GEM_LINE) do |line|
99
+ next line if line.match?(/require:\s*false/)
100
+
101
+ line.sub(/(\n)\z/, ", require: false\\1")
102
+ end
103
+ end
104
+
76
105
  def gem_present?(content, name)
77
106
  content.match?(/^\s*gem\s+["']#{Regexp.escape(name)}["']/)
78
107
  end
@@ -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
@@ -44,8 +44,13 @@ module RubyCms
44
44
 
45
45
  # Gems first: base + module gems on a fresh install; on `--add`, only the newly
46
46
  # selected modules' own gems (so e.g. adding passkeys pulls in webauthn).
47
- added = GemSetup.new(app_root: @app_root).ensure_gems!(modules: modules, include_base: framework_setup)
48
- run_critical("bundle install") if added.any?
47
+ gem_setup = GemSetup.new(app_root: @app_root)
48
+ added = gem_setup.ensure_gems!(modules: modules, include_base: framework_setup)
49
+ conflicts_patched = gem_setup.resolve_conflicts!(modules: modules)
50
+ if conflicts_patched
51
+ @shell.ok("bitwarden-sdk-secrets", hint: "set require: false (conflicts with webauthn passkeys)")
52
+ end
53
+ run_critical("bundle install") if added.any? || conflicts_patched
49
54
 
50
55
  # Framework scaffolding runs on the still-vanilla app, fresh install only, so the
51
56
  # Rails generators don't collide with (and interactively prompt about) gem files.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCms
4
- VERSION = "1.0.0"
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.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codebyjob