occams 1.0.7.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/coveralls.yml +11 -9
  3. data/.github/workflows/rubyonrails.yml +18 -15
  4. data/.gitignore +19 -16
  5. data/CHANGELOG.md +29 -12
  6. data/CONTRIBUTING.md +3 -4
  7. data/Gemfile +8 -6
  8. data/README.md +4 -5
  9. data/app/controllers/concerns/occams/reorder_action.rb +3 -0
  10. data/app/controllers/occams/admin/cms/pages_controller.rb +8 -0
  11. data/app/models/concerns/occams/cms/with_fragments.rb +1 -1
  12. data/app/models/occams/cms/fragment.rb +1 -1
  13. data/app/models/occams/cms/layout.rb +3 -1
  14. data/app/models/occams/cms/revision.rb +1 -1
  15. data/app/views/layouts/occams/admin/cms/_left.html.haml +1 -1
  16. data/bin/rails +3 -3
  17. data/bin/rake +2 -2
  18. data/bin/setup +11 -11
  19. data/config/application.rb +23 -6
  20. data/config/boot.rb +1 -4
  21. data/config/database.yml +30 -1
  22. data/config/environments/development.rb +9 -11
  23. data/config/environments/production.rb +26 -22
  24. data/config/environments/test.rb +18 -7
  25. data/config/initializers/content_security_policy.rb +2 -3
  26. data/config/initializers/filter_parameter_logging.rb +3 -3
  27. data/config/initializers/inflections.rb +0 -1
  28. data/config/initializers/new_framework_defaults_7_1.rb +224 -0
  29. data/config/initializers/permissions_policy.rb +10 -9
  30. data/config/locales/en.yml +3 -3
  31. data/gemfiles/6.1.gemfile +7 -4
  32. data/gemfiles/7.0.gemfile +6 -4
  33. data/gemfiles/7.1.gemfile +37 -0
  34. data/lib/generators/occams/cms/README +10 -2
  35. data/lib/occams/configuration.rb +1 -1
  36. data/lib/occams/content/tags/asset.rb +2 -2
  37. data/lib/occams/content/tags/audio.rb +2 -2
  38. data/lib/occams/content/tags/breadcrumbs.rb +2 -2
  39. data/lib/occams/content/tags/checkbox.rb +2 -2
  40. data/lib/occams/content/tags/children.rb +2 -2
  41. data/lib/occams/content/tags/date.rb +2 -2
  42. data/lib/occams/content/tags/datetime.rb +2 -2
  43. data/lib/occams/content/tags/file.rb +3 -3
  44. data/lib/occams/content/tags/file_link.rb +3 -3
  45. data/lib/occams/content/tags/files.rb +2 -2
  46. data/lib/occams/content/tags/fragment.rb +2 -2
  47. data/lib/occams/content/tags/helper.rb +2 -2
  48. data/lib/occams/content/tags/markdown.rb +2 -2
  49. data/lib/occams/content/tags/mixins/file_content.rb +1 -1
  50. data/lib/occams/content/tags/number.rb +2 -2
  51. data/lib/occams/content/tags/page_file_link.rb +3 -3
  52. data/lib/occams/content/tags/partial.rb +2 -2
  53. data/lib/occams/content/tags/siblings.rb +5 -2
  54. data/lib/occams/content/tags/snippet.rb +2 -2
  55. data/lib/occams/content/tags/template.rb +2 -2
  56. data/lib/occams/content/tags/text.rb +2 -2
  57. data/lib/occams/content/tags/textarea.rb +3 -2
  58. data/lib/occams/content/tags/wysiwyg.rb +2 -2
  59. data/lib/occams/content/tags.rb +28 -0
  60. data/lib/occams/content.rb +1 -26
  61. data/lib/occams/extensions/acts_as_tree.rb +3 -3
  62. data/lib/occams/extensions/has_revisions.rb +3 -3
  63. data/lib/occams/extensions.rb +8 -0
  64. data/lib/occams/routing.rb +74 -5
  65. data/lib/occams/version.rb +1 -1
  66. data/lib/occams.rb +3 -3
  67. data/occams.gemspec +13 -13
  68. metadata +9 -7
  69. data/lib/occams/routes/cms.rb +0 -16
  70. data/lib/occams/routes/cms_admin.rb +0 -56
@@ -6,7 +6,7 @@ defined?(Occams::Application) && Occams::Application.configure do
6
6
  # Settings specified here will take precedence over those in config/application.rb.
7
7
 
8
8
  # Code is not reloaded between requests.
9
- config.cache_classes = true
9
+ config.enable_reloading = false
10
10
 
11
11
  # Eager load code on boot. This eager loads most of Rails and
12
12
  # your application in memory, allowing both threaded web servers
@@ -18,12 +18,11 @@ defined?(Occams::Application) && Occams::Application.configure do
18
18
  config.consider_all_requests_local = false
19
19
  config.action_controller.perform_caching = true
20
20
 
21
- # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
22
- # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
22
+ # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
23
23
  # config.require_master_key = true
24
24
 
25
- # Disable serving static files from the `/public` folder by default since
26
- # Apache or NGINX already handles this.
25
+ # Enable static file serving from the `/public` folder (turn off if using NGINX/Apache for it).
27
26
  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
28
27
 
29
28
  # Compress CSS using a preprocessor.
@@ -47,16 +46,26 @@ defined?(Occams::Application) && Occams::Application.configure do
47
46
  # config.action_cable.url = "wss://example.com/cable"
48
47
  # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
49
48
 
49
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
50
+ # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
51
+ # config.assume_ssl = true
52
+
50
53
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51
- # config.force_ssl = true
54
+ config.force_ssl = true
52
55
 
53
- # Include generic and useful information about system operation, but avoid logging too much
54
- # information to avoid inadvertent exposure of personally identifiable information (PII).
55
- config.log_level = :info
56
+ # Log to STDOUT by default
57
+ config.logger = ActiveSupport::Logger.new($stdout)
58
+ .tap { |logger| logger.formatter = Logger::Formatter.new }
59
+ .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
56
60
 
57
61
  # Prepend all log lines with the following tags.
58
62
  config.log_tags = [:request_id]
59
63
 
64
+ # Info include generic and useful information about system operation, but avoids logging too much
65
+ # information to avoid inadvertent exposure of personally identifiable information (PII). If you
66
+ # want to log everything, set the level to "debug".
67
+ config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
68
+
60
69
  # Use a different cache store in production.
61
70
  # config.cache_store = :mem_cache_store
62
71
 
@@ -77,19 +86,14 @@ defined?(Occams::Application) && Occams::Application.configure do
77
86
  # Don't log any deprecations.
78
87
  config.active_support.report_deprecations = false
79
88
 
80
- # Use default logging formatter so that PID and timestamp are not suppressed.
81
- config.log_formatter = Logger::Formatter.new
82
-
83
- # Use a different logger for distributed setups.
84
- # require "syslog/logger"
85
- # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
86
-
87
- if ENV['RAILS_LOG_TO_STDOUT'].present?
88
- logger = ActiveSupport::Logger.new($stdout)
89
- logger.formatter = config.log_formatter
90
- config.logger = ActiveSupport::TaggedLogging.new(logger)
91
- end
92
-
93
89
  # Do not dump schema after migrations.
94
90
  config.active_record.dump_schema_after_migration = false
91
+
92
+ # Enable DNS rebinding protection and other `Host` header attacks.
93
+ # config.hosts = [
94
+ # "example.com", # Allow requests from example.com
95
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
96
+ # ]
97
+ # Skip DNS rebinding protection for the default health check endpoint.
98
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
95
99
  end
@@ -10,12 +10,15 @@ require 'active_support/core_ext/integer/time'
10
10
  defined?(Occams::Application) && Occams::Application.configure do
11
11
  # Settings specified here will take precedence over those in config/application.rb.
12
12
 
13
- # Turn false under Spring and add config.action_view.cache_template_loading = true.
14
- config.cache_classes = true
13
+ config.active_job.queue_adapter = :test # added for Rails 7.1
15
14
 
16
- # Eager loading loads your whole application. When running a single test locally,
17
- # this probably isn't necessary. It's a good idea to do in a continuous integration
18
- # system, or in some way before deploying your code.
15
+ # While tests run files are not watched, reloading is not necessary.
16
+ config.enable_reloading = false
17
+
18
+ # Eager loading loads your entire application. When running a single test locally,
19
+ # this is usually not necessary, and can slow down your test suite. However, it's
20
+ # recommended that you enable it in continuous integration systems to ensure eager
21
+ # loading is working properly before deploying your code.
19
22
  config.eager_load = ENV['CI'].present?
20
23
 
21
24
  # Configure public file server for tests with Cache-Control for performance.
@@ -30,7 +33,11 @@ defined?(Occams::Application) && Occams::Application.configure do
30
33
  config.cache_store = :null_store
31
34
 
32
35
  # Raise exceptions instead of rendering exception templates.
33
- config.action_dispatch.show_exceptions = false
36
+ config.action_dispatch.show_exceptions = if Gem::Version.new(Rails.version) < Gem::Version.new('7.1.0')
37
+ false
38
+ else
39
+ :none
40
+ end
34
41
 
35
42
  # Disable request forgery protection in test environment.
36
43
  config.action_controller.allow_forgery_protection = false
@@ -48,7 +55,6 @@ defined?(Occams::Application) && Occams::Application.configure do
48
55
  # Print deprecation notices to the stderr.
49
56
  config.active_support.deprecation = :stderr
50
57
 
51
- config.active_job.queue_adapter = :inline
52
58
  # Raise exceptions for disallowed deprecations.
53
59
  config.active_support.disallowed_deprecation = :raise
54
60
 
@@ -60,4 +66,9 @@ defined?(Occams::Application) && Occams::Application.configure do
60
66
 
61
67
  # Annotate rendered view with file names.
62
68
  # config.action_view.annotate_rendered_view_with_filenames = true
69
+
70
+ if Gem::Version.new(Rails.version) >= Gem::Version.new('7.1.0')
71
+ # Raise error when a before_action's only/except options reference missing actions
72
+ config.action_controller.raise_on_missing_callback_actions = true
73
+ end
63
74
  end
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  # Be sure to restart your server when you modify this file.
4
3
 
5
4
  # Define an application-wide content security policy.
@@ -18,9 +17,9 @@
18
17
  # # policy.report_uri "/csp-violation-report-endpoint"
19
18
  # end
20
19
  #
21
- # # Generate session nonces for permitted importmap and inline scripts
20
+ # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
22
21
  # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
23
- # config.content_security_policy_nonce_directives = %w(script-src)
22
+ # config.content_security_policy_nonce_directives = %w(script-src style-src)
24
23
  #
25
24
  # # Report violations without enforcing the policy.
26
25
  # # config.content_security_policy_report_only = true
@@ -2,9 +2,9 @@
2
2
 
3
3
  # Be sure to restart your server when you modify this file.
4
4
 
5
- # Configure parameters to be filtered from the log file. Use this to limit dissemination of
6
- # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
7
- # notations and behaviors.
5
+ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
6
+ # Use this to limit dissemination of sensitive information.
7
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
8
8
  Rails.application.config.filter_parameters += %i[
9
9
  passw secret token _key crypt salt certificate otp ssn
10
10
  ]
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  # Be sure to restart your server when you modify this file.
4
3
 
5
4
  # Add new inflection rules using the following format. Inflections
@@ -0,0 +1,224 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+ #
4
+ # This file eases your Rails 7.1 framework defaults upgrade.
5
+ #
6
+ # Uncomment each configuration one by one to switch to the new default.
7
+ # Once your application is ready to run with all new defaults, you can remove
8
+ # this file and set the `config.load_defaults` to `7.1`.
9
+ #
10
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
11
+ # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
12
+
13
+ # No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able
14
+ # to manually require files that are managed by the autoloader, which you shouldn't do anyway.
15
+ # This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size
16
+ # of the bootsnap cache if you use it.
17
+ # Rails.application.config.add_autoload_paths_to_load_path = false
18
+
19
+ # Remove the default X-Download-Options headers since it is used only by Internet Explorer.
20
+ # If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`.
21
+ # Rails.application.config.action_dispatch.default_headers = {
22
+ # "X-Frame-Options" => "SAMEORIGIN",
23
+ # "X-XSS-Protection" => "0",
24
+ # "X-Content-Type-Options" => "nosniff",
25
+ # "X-Permitted-Cross-Domain-Policies" => "none",
26
+ # "Referrer-Policy" => "strict-origin-when-cross-origin"
27
+ # }
28
+
29
+ # Do not treat an `ActionController::Parameters` instance
30
+ # as equal to an equivalent `Hash` by default.
31
+ # Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
32
+
33
+ # Active Record Encryption now uses SHA-256 as its hash digest algorithm. Important: If you have
34
+ # data encrypted with previous Rails versions, there are two scenarios to consider:
35
+ #
36
+ # 1. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default
37
+ # before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too:
38
+ # Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1
39
+ # 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default
40
+ # in 7.0), then you need to configure SHA-256 for Active Record Encryption:
41
+ # Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
42
+ #
43
+ # If you don't currently have data encrypted with Active Record encryption, you can disable this setting to
44
+ # configure the default behavior starting 7.1+:
45
+ # Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false
46
+
47
+ # No longer run after_commit callbacks on the first of multiple Active Record
48
+ # instances to save changes to the same database row within a transaction.
49
+ # Instead, run these callbacks on the instance most likely to have internal
50
+ # state which matches what was committed to the database, typically the last
51
+ # instance to save.
52
+ # Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
53
+
54
+ # Configures SQLite with a strict strings mode, which disables double-quoted string literals.
55
+ #
56
+ # SQLite has some quirks around double-quoted string literals.
57
+ # It first tries to consider double-quoted strings as identifier names, but if they don't exist
58
+ # it then considers them as string literals. Because of this, typos can silently go unnoticed.
59
+ # For example, it is possible to create an index for a non existing column.
60
+ # See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details.
61
+ # Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true
62
+
63
+ # Disable deprecated singular associations names
64
+ # Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
65
+
66
+ # Enable the Active Job `BigDecimal` argument serializer, which guarantees
67
+ # roundtripping. Without this serializer, some queue adapters may serialize
68
+ # `BigDecimal` arguments as simple (non-roundtrippable) strings.
69
+ #
70
+ # When deploying an application with multiple replicas, old (pre-Rails 7.1)
71
+ # replicas will not be able to deserialize `BigDecimal` arguments from this
72
+ # serializer. Therefore, this setting should only be enabled after all replicas
73
+ # have been successfully upgraded to Rails 7.1.
74
+ # Rails.application.config.active_job.use_big_decimal_serializer = true
75
+
76
+ # Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or
77
+ # `write` are given an invalid `expires_at` or `expires_in` time.
78
+ # Options are `true`, and `false`. If `false`, the exception will be reported
79
+ # as `handled` and logged instead.
80
+ # Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true
81
+
82
+ # Specify whether Query Logs will format tags using the SQLCommenter format
83
+ # (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format.
84
+ # Options are `:legacy` and `:sqlcommenter`.
85
+ # Rails.application.config.active_record.query_log_tags_format = :sqlcommenter
86
+
87
+ # Specify the default serializer used by `MessageEncryptor` and `MessageVerifier`
88
+ # instances.
89
+ #
90
+ # The legacy default is `:marshal`, which is a potential vector for
91
+ # deserialization attacks in cases where a message signing secret has been
92
+ # leaked.
93
+ #
94
+ # In Rails 7.1, the new default is `:json_allow_marshal` which serializes and
95
+ # deserializes with `ActiveSupport::JSON`, but can fall back to deserializing
96
+ # with `Marshal` so that legacy messages can still be read.
97
+ #
98
+ # In Rails 7.2, the default will become `:json` which serializes and
99
+ # deserializes with `ActiveSupport::JSON` only.
100
+ #
101
+ # Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`,
102
+ # which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack`
103
+ # can roundtrip some Ruby types that are not supported by JSON, and may provide
104
+ # improved performance, but it requires the `msgpack` gem.
105
+ #
106
+ # For more information, see
107
+ # https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer
108
+ #
109
+ # If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers
110
+ # that have not yet been upgraded must be able to read messages from upgraded
111
+ # servers, first deploy without changing the serializer, then set the serializer
112
+ # in a subsequent deploy.
113
+ # Rails.application.config.active_support.message_serializer = :json_allow_marshal
114
+
115
+ # Enable a performance optimization that serializes message data and metadata
116
+ # together. This changes the message format, so messages serialized this way
117
+ # cannot be read by older versions of Rails. However, messages that use the old
118
+ # format can still be read, regardless of whether this optimization is enabled.
119
+ #
120
+ # To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
121
+ # not yet been upgraded must be able to read messages from upgraded servers,
122
+ # leave this optimization off on the first deploy, then enable it on a
123
+ # subsequent deploy.
124
+ # Rails.application.config.active_support.use_message_serializer_for_metadata = true
125
+
126
+ # Set the maximum size for Rails log files.
127
+ #
128
+ # `config.load_defaults 7.1` does not set this value for environments other than
129
+ # development and test.
130
+ #
131
+ # if Rails.env.local?
132
+ # Rails.application.config.log_file_size = 100 * 1024 * 1024
133
+ # end
134
+
135
+ # Enable raising on assignment to attr_readonly attributes. The previous
136
+ # behavior would allow assignment but silently not persist changes to the
137
+ # database.
138
+ # Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true
139
+
140
+ # Enable validating only parent-related columns for presence when the parent is mandatory.
141
+ # The previous behavior was to validate the presence of the parent record, which performed an extra query
142
+ # to get the parent every time the child record was updated, even when parent has not changed.
143
+ # Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false
144
+
145
+ # Enable precompilation of `config.filter_parameters`. Precompilation can
146
+ # improve filtering performance, depending on the quantity and types of filters.
147
+ # Rails.application.config.precompile_filter_parameters = true
148
+
149
+ # Enable before_committed! callbacks on all enrolled records in a transaction.
150
+ # The previous behavior was to only run the callbacks on the first copy of a record
151
+ # if there were multiple copies of the same record enrolled in the transaction.
152
+ # Rails.application.config.active_record.before_committed_on_all_records = true
153
+
154
+ # Disable automatic column serialization into YAML.
155
+ # To keep the historic behavior, you can set it to `YAML`, however it is
156
+ # recommended to explicitly define the serialization method for each column
157
+ # rather than to rely on a global default.
158
+ # Rails.application.config.active_record.default_column_serializer = nil
159
+
160
+ # Enable a performance optimization that serializes Active Record models
161
+ # in a faster and more compact way.
162
+ #
163
+ # To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
164
+ # not yet been upgraded must be able to read caches from upgraded servers,
165
+ # leave this optimization off on the first deploy, then enable it on a
166
+ # subsequent deploy.
167
+ # Rails.application.config.active_record.marshalling_format_version = 7.1
168
+
169
+ # Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model.
170
+ # This matches the behaviour of all other callbacks.
171
+ # In previous versions of Rails, they ran in the inverse order.
172
+ # Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
173
+
174
+ # Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
175
+ #
176
+ # Rails.application.config.active_record.commit_transaction_on_non_local_return = true
177
+
178
+ # Controls when to generate a value for <tt>has_secure_token</tt> declarations.
179
+ #
180
+ # Rails.application.config.active_record.generate_secure_token_on = :initialize
181
+
182
+ # ** Please read carefully, this must be configured in config/application.rb **
183
+ # Change the format of the cache entry.
184
+ # Changing this default means that all new cache entries added to the cache
185
+ # will have a different format that is not supported by Rails 7.0
186
+ # applications.
187
+ # Only change this value after your application is fully deployed to Rails 7.1
188
+ # and you have no plans to rollback.
189
+ # When you're ready to change format, add this to `config/application.rb` (NOT
190
+ # this file):
191
+ # config.active_support.cache_format_version = 7.1
192
+
193
+ # Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your
194
+ # platform.
195
+ #
196
+ # `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action View to use HTML5-compliant
197
+ # sanitizers if they are supported, else fall back to HTML4 sanitizers.
198
+ #
199
+ # In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor.
200
+ #
201
+ # Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
202
+
203
+ # Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
204
+ # platform.
205
+ #
206
+ # `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action Text to use HTML5-compliant
207
+ # sanitizers if they are supported, else fall back to HTML4 sanitizers.
208
+ #
209
+ # In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor.
210
+ #
211
+ # Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
212
+
213
+ # Configure the log level used by the DebugExceptions middleware when logging
214
+ # uncaught exceptions during requests
215
+ # Rails.application.config.action_dispatch.debug_exception_log_level = :error
216
+
217
+ # Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
218
+ # parsers.
219
+ #
220
+ # Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4.
221
+ #
222
+ # In previous versions of Rails, these test helpers always used an HTML4 parser.
223
+ #
224
+ # Rails.application.config.dom_testing_default_html_version = :html5
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
2
3
 
3
4
  # Define an application-wide HTTP permissions policy. For further
4
- # information see https://developers.google.com/web/updates/2018/06/feature-policy
5
- #
6
- # Rails.application.config.permissions_policy do |f|
7
- # f.camera :none
8
- # f.gyroscope :none
9
- # f.microphone :none
10
- # f.usb :none
11
- # f.fullscreen :self
12
- # f.payment :self, "https://secure.example.com"
5
+ # information see: https://developers.google.com/web/updates/2018/06/feature-policy
6
+
7
+ # Rails.application.config.permissions_policy do |policy|
8
+ # policy.camera :none
9
+ # policy.gyroscope :none
10
+ # policy.microphone :none
11
+ # policy.usb :none
12
+ # policy.fullscreen :self
13
+ # policy.payment :self, "https://secure.example.com"
13
14
  # end
@@ -116,11 +116,11 @@ en:
116
116
  update: Update Layout
117
117
 
118
118
  pages:
119
- created: Page created
119
+ created: Page created, siblings, and parent updated
120
120
  creation_failure: Failed to create page
121
- updated: Page updated
121
+ updated: Page, siblings, and parent updated
122
122
  update_failure: Failed to update page
123
- deleted: Page deleted
123
+ deleted: Page deleted, siblings, and parent updated
124
124
  not_found: Page not found
125
125
  layout_not_found: No Layouts found. Please create one.
126
126
 
data/gemfiles/6.1.gemfile CHANGED
@@ -10,11 +10,8 @@ gem 'rails', '~> 6.1.0'
10
10
  group :development, :test do
11
11
  gem 'autoprefixer-rails', '~> 8.1.0'
12
12
  gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
13
- gem 'capybara', '~> 3.39.0'
14
13
  gem 'image_processing', '>= 1.2'
15
- gem 'kaminari', '~> 1.2', '>= 1.2.2'
16
- gem 'selenium-webdriver', '~> 4.9.0'
17
- gem 'sqlite3', '~> 1.4.2'
14
+ gem 'sqlite3', '~> 1.6.7'
18
15
  end
19
16
 
20
17
  group :development do
@@ -25,11 +22,17 @@ end
25
22
  group :test do
26
23
  gem 'brakeman', '~> 5.4.1'
27
24
  gem 'bundler-audit', '~> 0.9.1'
25
+ gem 'capybara', '~> 3.39.0'
28
26
  gem 'coveralls_reborn', '~> 0.28.0', require: false
27
+ gem 'cuprite', '~> 0.14.3'
29
28
  gem 'diffy', '~> 3.4.2'
30
29
  gem 'equivalent-xml', '~> 0.6.0'
30
+ gem 'minitest', '~> 5.20.0'
31
31
  gem 'minitest-reporters', '~> 1.6.1'
32
32
  gem 'mocha', '~> 2.1.0', require: false
33
+ gem 'puma', '~> 6.4.0'
33
34
  gem 'rails-controller-testing', '~> 1.0.5'
34
35
  gem 'rubocop', '~> 1.56.0', require: false
36
+ gem 'selenium-webdriver', '~> 4.9.0'
37
+ gem 'simplecov', '~> 0.22.0', require: false
35
38
  end
data/gemfiles/7.0.gemfile CHANGED
@@ -10,11 +10,8 @@ gem 'rails', '~> 7.0.0'
10
10
  group :development, :test do
11
11
  gem 'autoprefixer-rails', '~> 8.1.0'
12
12
  gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
13
- gem 'capybara', '~> 3.39.0'
14
13
  gem 'image_processing', '>= 1.2'
15
- gem 'kaminari', '~> 1.2', '>= 1.2.2'
16
- gem 'selenium-webdriver', '~> 4.9.0'
17
- gem 'sqlite3', '~> 1.4.2'
14
+ gem 'sqlite3', '~> 1.6.7'
18
15
  end
19
16
 
20
17
  group :development do
@@ -25,11 +22,16 @@ end
25
22
  group :test do
26
23
  gem 'brakeman', '~> 5.4.1'
27
24
  gem 'bundler-audit', '~> 0.9.1'
25
+ gem 'capybara', '~> 3.39.0'
28
26
  gem 'coveralls_reborn', '~> 0.28.0', require: false
27
+ gem 'cuprite', '~> 0.14.3'
29
28
  gem 'diffy', '~> 3.4.2'
30
29
  gem 'equivalent-xml', '~> 0.6.0'
30
+ gem 'minitest', '~> 5.20.0'
31
31
  gem 'minitest-reporters', '~> 1.6.1'
32
32
  gem 'mocha', '~> 2.1.0', require: false
33
+ gem 'puma', '~> 6.4.0'
33
34
  gem 'rails-controller-testing', '~> 1.0.5'
34
35
  gem 'rubocop', '~> 1.56.0', require: false
36
+ gem 'simplecov', '~> 0.22.0', require: false
35
37
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
+
6
+ gemspec path: '../'
7
+
8
+ gem 'rails', '~> 7.1.0', '>= 7.1.1'
9
+
10
+ group :development, :test do
11
+ gem 'autoprefixer-rails', '~> 8.1.0'
12
+ gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
13
+ gem 'image_processing', '>= 1.2'
14
+ gem 'sqlite3', '~> 1.6.7'
15
+ end
16
+
17
+ group :development do
18
+ gem 'listen', '~> 3.8.0'
19
+ gem 'web-console', '~> 4.2'
20
+ end
21
+
22
+ group :test do
23
+ gem 'brakeman', '~> 5.4.1'
24
+ gem 'bundler-audit', '~> 0.9.1'
25
+ gem 'capybara', '~> 3.39.0'
26
+ gem 'coveralls_reborn', '~> 0.28.0', require: false
27
+ gem 'cuprite', '~> 0.14.3'
28
+ gem 'diffy', '~> 3.4.2'
29
+ gem 'equivalent-xml', '~> 0.6.0'
30
+ gem 'minitest', '~> 5.20.0'
31
+ gem 'minitest-reporters', '~> 1.6.1'
32
+ gem 'mocha', '~> 2.1.0', require: false
33
+ gem 'puma', '~> 6.4.0'
34
+ gem 'rails-controller-testing', '~> 1.0.5'
35
+ gem 'rubocop', '~> 1.56.0', require: false
36
+ gem 'simplecov', '~> 0.22.0', require: false
37
+ end
@@ -11,7 +11,15 @@ You are almost done. Don't forget to:
11
11
  [Optional] - If you want to store files in your CMS with ActiveStorage: `rails active_storage:install`
12
12
  [Mandatory] - Create the tables in your database: `rails db:migrate`
13
13
 
14
- Then you can go to http://your-rails-app/admin to start adding content.
14
+ Then go to http://your-rails-app/admin to start adding content.
15
15
 
16
- Default username and password are: user/pass
16
+ Default username and password are: user / pass
17
17
  Change these defaults in config/initializers/occams.rb
18
+
19
+ ----------------------------
20
+ IF YOU ARE ON RAILS 6.x
21
+ ----------------------------
22
+ and encounter errors referencing webpacker:
23
+ ensure that you have nvm installed, and then run
24
+ - nvm install 13.7 && nvm use 13.7
25
+ - rails webpacker:install
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Occams::Configuration
4
- # Don't like Occams? Set it to whatever you like. :(
4
+ # Don't like Occams? Set it to whatever you like.
5
5
  attr_accessor :cms_title
6
6
 
7
7
  # Controller that is inherited from CmsAdmin::BaseController
@@ -7,7 +7,7 @@
7
7
  # `type` - css | js - what we're outputting here
8
8
  # `as` - url (default) | tag - output url or wrap it in the appropriate tag
9
9
  #
10
- class Occams::Content::Tag::Asset < Occams::Content::Tag
10
+ class Occams::Content::Tags::Asset < Occams::Content::Tag
11
11
  attr_reader :identifier, :type, :as
12
12
 
13
13
  def initialize(context:, params: [], source: nil)
@@ -53,5 +53,5 @@ class Occams::Content::Tag::Asset < Occams::Content::Tag
53
53
  end
54
54
 
55
55
  Occams::Content::Renderer.register_tag(
56
- :asset, Occams::Content::Tag::Asset
56
+ :asset, Occams::Content::Tags::Asset
57
57
  )
@@ -14,7 +14,7 @@
14
14
  # }
15
15
  # and/or pass in style overrides with the 'style' parameter, as above
16
16
 
17
- class Occams::Content::Tag::Audio < Occams::Content::Tag
17
+ class Occams::Content::Tags::Audio < Occams::Content::Tag
18
18
  attr_reader :path, :style, :locals
19
19
 
20
20
  def initialize(context:, params: [], source: nil)
@@ -35,5 +35,5 @@ class Occams::Content::Tag::Audio < Occams::Content::Tag
35
35
  end
36
36
 
37
37
  Occams::Content::Renderer.register_tag(
38
- :audio, Occams::Content::Tag::Audio
38
+ :audio, Occams::Content::Tags::Audio
39
39
  )
@@ -15,7 +15,7 @@
15
15
  # }
16
16
  # and/or pass in style overrides with the 'style' parameter, as above
17
17
 
18
- class Occams::Content::Tag::Breadcrumbs < Occams::Content::Tag
18
+ class Occams::Content::Tags::Breadcrumbs < Occams::Content::Tag
19
19
  attr_reader :links, :style, :locals
20
20
 
21
21
  def initialize(context:, params: [], source: nil)
@@ -39,5 +39,5 @@ class Occams::Content::Tag::Breadcrumbs < Occams::Content::Tag
39
39
  end
40
40
 
41
41
  Occams::Content::Renderer.register_tag(
42
- :breadcrumbs, Occams::Content::Tag::Breadcrumbs
42
+ :breadcrumbs, Occams::Content::Tags::Breadcrumbs
43
43
  )
@@ -3,7 +3,7 @@
3
3
  # Tag for boolean content that is going to be rendered using checkbox
4
4
  # {{ cms:checkbox identifier }}
5
5
  #
6
- class Occams::Content::Tag::Checkbox < Occams::Content::Tag::Fragment
6
+ class Occams::Content::Tags::Checkbox < Occams::Content::Tags::Fragment
7
7
  def content
8
8
  fragment.boolean
9
9
  end
@@ -23,5 +23,5 @@ class Occams::Content::Tag::Checkbox < Occams::Content::Tag::Fragment
23
23
  end
24
24
 
25
25
  Occams::Content::Renderer.register_tag(
26
- :checkbox, Occams::Content::Tag::Checkbox
26
+ :checkbox, Occams::Content::Tags::Checkbox
27
27
  )
@@ -15,7 +15,7 @@
15
15
  # To exclude children, list their slugs with the 'exclude' parameter
16
16
  # as comma-delimited string, e.g. as above - exclude: "404-page, search-page"
17
17
 
18
- class Occams::Content::Tag::Children < Occams::Content::Tag
18
+ class Occams::Content::Tags::Children < Occams::Content::Tag
19
19
  attr_reader :style, :page_children, :locals
20
20
  attr_accessor :list
21
21
 
@@ -48,5 +48,5 @@ class Occams::Content::Tag::Children < Occams::Content::Tag
48
48
  end
49
49
 
50
50
  Occams::Content::Renderer.register_tag(
51
- :children, Occams::Content::Tag::Children
51
+ :children, Occams::Content::Tags::Children
52
52
  )