ruby_cms 0.2.0 → 0.2.0.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: 2a8d714a6a977cef96bd1eb99a4efd56e66da9ea9aebf81f61e982731bed9bda
4
- data.tar.gz: 2543ebcfcef9083b33a69f7346ba921c087691aa46d6e1f1b7490d57bf9edfc8
3
+ metadata.gz: f997170922c55751d5a99a10253efbeaa4cc8c7f82ffa18e7083b5a932cacc26
4
+ data.tar.gz: 179a045dd39b70960801f6b3901e218bc4103ffd767dbc48202d9722c2467d67
5
5
  SHA512:
6
- metadata.gz: 8625f68d914febc4c00a551f6d48ac0dfa0305a79248ce6faabc95e1641bc8794fef469f4480bfdb3869966011e59977e6be9cc9fdf048e7f1a7d95c01eb7372
7
- data.tar.gz: 81354dff69046ca0ea0d94dceccd4c682070b768ef6bbf640dc19d2478d7dfe8b3b78e8351fba8c19814781a489a22e2175352ebfd38bda01d1bf50b0cf4e22a
6
+ metadata.gz: aa897c7d17c24754544357dea2d82797506f11623a4125fc1ca49653f9daa21aeed9e97c703016efee4a8003a64b8ee4f4060bedcbe25977b80c83268f633f62
7
+ data.tar.gz: 7245bb0f650775224383ac1d4588241fe5f084713525a13003706ce27acc25dff00a6dd485cefb816b7faec02a4f03d66c89f3528a7ab39ee9feca9925205687
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0.9] - 2026-04-02
3
+ ## [0.2.0.1] - 2026-04-02
4
+
5
+ - Fix compile
6
+
7
+
8
+ ## [0.2.0] - 2026-04-02
4
9
 
5
10
  - Update add page generator, dashboard blocks and some ui tweaks.
6
11
 
data/README.md CHANGED
@@ -490,6 +490,20 @@ Tests use an in-memory SQLite database via `spec/support/dummy_app.rb`. No separ
490
490
  rails ruby_cms:css:compile_gem
491
491
  ```
492
492
 
493
+ ### Faster Docker Builds (`assets:precompile`)
494
+
495
+ `assets:precompile` loads the Rails app in production mode and can be slow in Docker/Fly builds.
496
+ RubyCMS now skips non-asset runtime initializers during this phase (navigation registration,
497
+ dashboard registration, versioning hook, settings import, and permission seeding), which reduces
498
+ precompile overhead.
499
+
500
+ Recommended Docker layer order:
501
+
502
+ 1. Copy `Gemfile` / `Gemfile.lock`
503
+ 2. Run `bundle install`
504
+ 3. Copy app source
505
+ 4. Run `SECRET_KEY_BASE=DUMMY bin/rails assets:precompile`
506
+
493
507
  ### Architecture
494
508
 
495
509
  ```
data/config/importmap.rb CHANGED
@@ -34,3 +34,5 @@ pin "ruby_cms/auto_save_preference_controller",
34
34
  pin "ruby_cms/nav_order_sortable_controller",
35
35
  to: "controllers/ruby_cms/nav_order_sortable_controller.js"
36
36
  pin "ruby_cms/page_preview_controller", to: "controllers/ruby_cms/page_preview_controller.js"
37
+ pin "ruby_cms/content_block_history_controller",
38
+ to: "controllers/ruby_cms/content_block_history_controller.js"
@@ -66,6 +66,8 @@ module RubyCms
66
66
 
67
67
  # Ensure Ahoy is loaded before host's config/initializers/ahoy.rb runs
68
68
  initializer "ruby_cms.require_ahoy", before: :load_config_initializers do
69
+ next if RubyCms::Engine.assets_precompile_phase?
70
+
69
71
  require "ahoy_matey"
70
72
  end
71
73
 
@@ -103,6 +105,8 @@ module RubyCms
103
105
  end
104
106
 
105
107
  initializer "ruby_cms.nav" do
108
+ next if RubyCms::Engine.assets_precompile_phase?
109
+
106
110
  Rails.application.config.to_prepare do
107
111
  RubyCms::Engine.register_main_nav_items
108
112
  RubyCms::Engine.register_settings_nav_items
@@ -110,22 +114,30 @@ module RubyCms
110
114
  end
111
115
 
112
116
  initializer "ruby_cms.dashboard_blocks" do
117
+ next if RubyCms::Engine.assets_precompile_phase?
118
+
113
119
  RubyCms::Engine.register_default_dashboard_blocks
114
120
  end
115
121
 
116
122
  initializer "ruby_cms.versionable" do
123
+ next if RubyCms::Engine.assets_precompile_phase?
124
+
117
125
  Rails.application.config.to_prepare do
118
126
  ContentBlock.include(ContentBlock::Versionable) unless ContentBlock <= ContentBlock::Versionable
119
127
  end
120
128
  end
121
129
 
122
130
  initializer "ruby_cms.settings_import", after: :load_config_initializers do
131
+ next if RubyCms::Engine.assets_precompile_phase?
132
+
123
133
  RubyCms::Settings.import_initializer_values!
124
134
  end
125
135
 
126
136
  # After host initializers (e.g. register_permission_keys), ensure Permission rows exist
127
137
  # so can?(:manage_backups) and other keys do not fail on Permission.exists? checks.
128
138
  initializer "ruby_cms.ensure_permission_rows", after: :load_config_initializers do
139
+ next if RubyCms::Engine.assets_precompile_phase?
140
+
129
141
  RubyCms::Permission.ensure_defaults!
130
142
  rescue StandardError => e
131
143
  Rails.logger.warn("[RubyCMS] Permission.ensure_defaults! skipped: #{e.message}")
@@ -249,5 +261,13 @@ module RubyCms
249
261
  app.config.paths["db/migrate"] << path
250
262
  end
251
263
  end
264
+
265
+ def self.assets_precompile_phase?
266
+ command = File.basename($PROGRAM_NAME.to_s)
267
+ rake_assets_precompile = command == "rake" && ARGV.include?("assets:precompile")
268
+ rails_assets_precompile = command == "rails" && ARGV.include?("assets:precompile")
269
+
270
+ rake_assets_precompile || rails_assets_precompile
271
+ end
252
272
  end
253
273
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCms
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.0.1"
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: 0.2.0
4
+ version: 0.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codebyjob