pages_core 3.6.2 → 3.8.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/README.md +1 -3
- data/Rakefile +3 -1
- data/app/assets/builds/pages_core/admin-dist.js +55 -0
- data/app/assets/stylesheets/pages/admin/components/forms.scss +20 -0
- data/app/assets/stylesheets/pages/admin/components/image_editor.scss +1 -0
- data/app/assets/stylesheets/pages/admin/components/image_grid.scss +33 -5
- data/app/assets/stylesheets/pages/admin/components/layout.scss +2 -1
- data/app/assets/stylesheets/pages/admin/components/login.scss +6 -0
- data/app/assets/stylesheets/pages/admin/components/tabs.scss +5 -0
- data/app/assets/stylesheets/pages/admin/components/tag_editor.scss +13 -7
- data/app/assets/stylesheets/pages/admin/controllers/pages.scss +13 -5
- data/app/assets/stylesheets/pages/admin.scss +0 -1
- data/app/assets/stylesheets/pages/errors.css +2 -0
- data/app/controller_dummies/admin/admin_controller.rb +3 -1
- data/app/controller_dummies/application_controller.rb +3 -1
- data/app/controller_dummies/attachments_controller.rb +3 -1
- data/app/controller_dummies/frontend_controller.rb +3 -1
- data/app/controller_dummies/images_controller.rb +3 -1
- data/app/controller_dummies/page_files_controller.rb +3 -1
- data/app/controller_dummies/pages_controller.rb +3 -1
- data/app/controller_dummies/sitemaps_controller.rb +3 -1
- data/app/controllers/admin/attachments_controller.rb +5 -3
- data/app/controllers/admin/categories_controller.rb +2 -0
- data/app/controllers/admin/images_controller.rb +16 -8
- data/app/controllers/admin/invites_controller.rb +4 -1
- data/app/controllers/admin/pages_controller.rb +7 -19
- data/app/controllers/admin/password_resets_controller.rb +9 -5
- data/app/controllers/admin/users_controller.rb +10 -4
- data/app/controllers/concerns/pages_core/admin/news_page_controller.rb +13 -11
- data/app/controllers/concerns/pages_core/admin/persistent_params.rb +75 -0
- data/app/controllers/concerns/pages_core/authentication.rb +13 -5
- data/app/controllers/concerns/pages_core/error_renderer.rb +3 -0
- data/app/controllers/concerns/pages_core/error_reporting.rb +36 -0
- data/app/controllers/concerns/pages_core/policies_helper.rb +4 -1
- data/app/controllers/concerns/pages_core/preview_pages_controller.rb +8 -0
- data/app/controllers/concerns/pages_core/process_titler.rb +2 -0
- data/app/controllers/concerns/pages_core/rss_controller.rb +2 -0
- data/app/controllers/concerns/pages_core/static_cache_controller.rb +48 -0
- data/app/controllers/errors_controller.rb +5 -53
- data/app/controllers/pages_core/admin_controller.rb +7 -67
- data/app/controllers/pages_core/attachments_controller.rb +10 -6
- data/app/controllers/pages_core/base_controller.rb +11 -17
- data/app/controllers/pages_core/frontend/page_files_controller.rb +6 -2
- data/app/controllers/pages_core/frontend/pages_controller.rb +14 -17
- data/app/controllers/pages_core/frontend_controller.rb +3 -0
- data/app/controllers/pages_core/images_controller.rb +3 -1
- data/app/controllers/pages_core/sitemaps_controller.rb +11 -5
- data/app/controllers/sessions_controller.rb +3 -1
- data/app/formatters/pages_core/html_formatter.rb +13 -63
- data/app/formatters/pages_core/image_embedder.rb +79 -0
- data/app/formatters/pages_core/link_renderer.rb +4 -2
- data/app/helpers/admin/admin_helper.rb +2 -0
- data/app/helpers/admin/menu_helper.rb +6 -4
- data/app/helpers/admin/pages_helper.rb +4 -57
- data/app/helpers/application_helper.rb +3 -1
- data/app/helpers/frontend_helper.rb +3 -1
- data/app/helpers/pages_core/admin/admin_helper.rb +22 -106
- data/app/helpers/pages_core/admin/content_tabs_helper.rb +31 -0
- data/app/helpers/pages_core/admin/date_range_helper.rb +55 -0
- data/app/helpers/pages_core/admin/form_builder.rb +8 -0
- data/app/helpers/pages_core/admin/image_uploads_helper.rb +47 -0
- data/app/helpers/pages_core/admin/labelled_field_helper.rb +12 -9
- data/app/helpers/pages_core/admin/page_blocks_helper.rb +66 -0
- data/app/helpers/pages_core/admin/page_json_helper.rb +23 -0
- data/app/helpers/pages_core/admin/tag_editor_helper.rb +11 -39
- data/app/helpers/pages_core/application_helper.rb +3 -0
- data/app/helpers/pages_core/attachments_helper.rb +31 -27
- data/app/helpers/pages_core/form_builder.rb +17 -13
- data/app/helpers/pages_core/frontend_helper.rb +3 -3
- data/app/helpers/pages_core/head_tags_helper.rb +18 -22
- data/app/helpers/pages_core/images_helper.rb +3 -0
- data/app/helpers/pages_core/meta_tags_helper.rb +3 -1
- data/app/helpers/pages_core/open_graph_tags_helper.rb +8 -6
- data/app/helpers/pages_core/page_path_helper.rb +24 -3
- data/app/javascript/admin-dist.js +2 -0
- data/app/javascript/components/Attachments/Attachment.jsx +121 -0
- data/app/javascript/components/Attachments/AttachmentEditor.jsx +116 -0
- data/app/javascript/components/Attachments/Placeholder.jsx +10 -0
- data/app/javascript/components/Attachments.jsx +165 -0
- data/app/{assets/javascripts/pages/admin/components/date_range_select.jsx → javascript/components/DateRangeSelect.jsx} +16 -5
- data/app/javascript/components/EditableImage.jsx +61 -0
- data/app/javascript/components/FileUploadButton.jsx +47 -0
- data/app/{assets/javascripts/pages/admin/components/focal_point.jsx → javascript/components/ImageCropper/FocalPoint.jsx} +12 -1
- data/app/javascript/components/ImageCropper/Image.jsx +65 -0
- data/app/javascript/components/ImageCropper/Toolbar.jsx +73 -0
- data/app/javascript/components/ImageCropper/useCrop.js +199 -0
- data/app/javascript/components/ImageCropper.jsx +90 -0
- data/app/javascript/components/ImageEditor/Form.jsx +98 -0
- data/app/javascript/components/ImageEditor.jsx +62 -0
- data/app/javascript/components/ImageGrid/DragElement.jsx +30 -0
- data/app/javascript/components/ImageGrid/FilePlaceholder.jsx +9 -0
- data/app/javascript/components/ImageGrid/GridImage.jsx +103 -0
- data/app/javascript/components/ImageGrid/Placeholder.jsx +23 -0
- data/app/javascript/components/ImageGrid.jsx +257 -0
- data/app/javascript/components/ImageUploader.jsx +171 -0
- data/app/{assets/javascripts/pages/admin/components/modal.jsx → javascript/components/Modal.jsx} +13 -2
- data/app/{assets/javascripts/pages/admin/components/page_dates.jsx → javascript/components/PageDates.jsx} +11 -1
- data/app/{assets/javascripts/pages/admin/components/page_files.jsx → javascript/components/PageFiles.jsx} +11 -2
- data/app/{assets/javascripts/pages/admin/components/page_images.jsx → javascript/components/PageImages.jsx} +11 -2
- data/app/{assets/javascripts/pages/admin/components/page_tree_store.jsx → javascript/components/PageTree.jsx} +127 -137
- data/app/{assets/javascripts/pages/admin/components/page_tree.jsx → javascript/components/PageTreeDraggable.jsx} +44 -38
- data/app/{assets/javascripts/pages/admin/components/page_tree_node.jsx → javascript/components/PageTreeNode.jsx} +46 -31
- data/app/javascript/components/RichTextArea.jsx +213 -0
- data/app/javascript/components/RichTextToolbarButton.jsx +20 -0
- data/app/javascript/components/TagEditor/AddTagForm.jsx +42 -0
- data/app/javascript/components/TagEditor/Tag.jsx +32 -0
- data/app/javascript/components/TagEditor.jsx +61 -0
- data/app/javascript/components/Toast.jsx +72 -0
- data/app/javascript/components/drag/draggedOrder.js +51 -0
- data/app/javascript/components/drag/useDragCollection.js +84 -0
- data/app/javascript/components/drag/useDragUploader.js +112 -0
- data/app/javascript/components/drag/useDraggable.js +17 -0
- data/app/javascript/components/drag.js +6 -0
- data/app/javascript/components.js +15 -0
- data/app/javascript/controllers/EditPageController.js +20 -0
- data/app/javascript/controllers/LoginController.js +29 -0
- data/app/javascript/controllers/MainController.js +65 -0
- data/app/javascript/controllers/PageOptionsController.js +62 -0
- data/app/javascript/features/RichText.jsx +34 -0
- data/app/javascript/hooks.js +2 -0
- data/app/javascript/index.js +38 -0
- data/app/{assets/javascripts/pages/admin/lib/tree.jsx → javascript/lib/Tree.js} +64 -63
- data/app/javascript/lib/copyToClipboard.js +13 -0
- data/app/javascript/lib/readyHandler.js +22 -0
- data/app/javascript/lib/request.js +36 -0
- data/app/javascript/stores/ModalStore.jsx +12 -0
- data/app/javascript/stores/ToastStore.jsx +14 -0
- data/app/javascript/stores.js +2 -0
- data/app/jobs/pages_core/autopublish_job.rb +3 -1
- data/app/jobs/pages_core/sweep_cache_job.rb +4 -2
- data/app/mailers/admin_mailer.rb +4 -14
- data/app/models/attachment.rb +10 -8
- data/app/models/autopublisher.rb +3 -0
- data/app/models/category.rb +3 -1
- data/app/models/concerns/pages_core/has_roles.rb +2 -0
- data/app/models/concerns/pages_core/humanizable_param.rb +9 -6
- data/app/models/concerns/pages_core/page_model/attachments.rb +2 -0
- data/app/models/concerns/pages_core/page_model/autopublishable.rb +2 -0
- data/app/models/concerns/pages_core/page_model/dated_page.rb +11 -11
- data/app/models/concerns/pages_core/page_model/images.rb +8 -2
- data/app/models/concerns/pages_core/page_model/localizable.rb +2 -0
- data/app/models/concerns/pages_core/page_model/pathable.rb +26 -25
- data/app/models/concerns/pages_core/page_model/redirectable.rb +3 -1
- data/app/models/concerns/pages_core/page_model/searchable.rb +19 -0
- data/app/models/concerns/pages_core/page_model/sortable.rb +6 -5
- data/app/models/concerns/pages_core/page_model/status.rb +2 -0
- data/app/models/concerns/pages_core/page_model/templateable.rb +7 -2
- data/app/models/concerns/pages_core/page_model/tree.rb +27 -20
- data/app/models/concerns/pages_core/searchable_document.rb +71 -0
- data/app/models/concerns/pages_core/sweepable.rb +4 -2
- data/app/models/concerns/pages_core/taggable.rb +33 -12
- data/app/models/image.rb +14 -1
- data/app/models/invite.rb +3 -1
- data/app/models/invite_role.rb +5 -3
- data/app/models/page.rb +6 -3
- data/app/models/page_builder.rb +2 -0
- data/app/models/page_category.rb +3 -1
- data/app/models/page_exporter.rb +23 -10
- data/app/models/page_file.rb +3 -1
- data/app/models/page_image.rb +3 -3
- data/app/models/page_path.rb +13 -5
- data/app/models/password_reset_token.rb +3 -1
- data/app/models/role.rb +9 -6
- data/app/models/search_document.rb +72 -0
- data/app/models/tag.rb +9 -6
- data/app/models/tagging.rb +4 -2
- data/app/models/user.rb +8 -5
- data/app/policies/invite_policy.rb +2 -0
- data/app/policies/page_file_policy.rb +2 -0
- data/app/policies/page_image_policy.rb +2 -0
- data/app/policies/page_policy.rb +2 -0
- data/app/policies/policy.rb +2 -0
- data/app/policies/user_policy.rb +2 -0
- data/app/{serializers/admin/attachment_serializer.rb → resources/admin/attachment_resource.rb} +10 -7
- data/app/{serializers/admin/image_serializer.rb → resources/admin/image_resource.rb} +13 -11
- data/app/resources/admin/page_file_resource.rb +10 -0
- data/app/resources/admin/page_image_resource.rb +10 -0
- data/app/resources/export/attachment_resource.rb +10 -0
- data/app/resources/export/page_image_resource.rb +45 -0
- data/app/resources/export/page_resource.rb +42 -0
- data/app/{serializers/page_image_serializer.rb → resources/page_image_resource.rb} +10 -16
- data/app/resources/page_resource.rb +33 -0
- data/app/services/pages_core/create_user_service.rb +5 -2
- data/app/services/pages_core/destroy_invite_service.rb +25 -0
- data/app/services/pages_core/invite_service.rb +4 -2
- data/app/views/admin/images/show.json.jbuilder +2 -0
- data/app/views/admin/pages/_edit_content.html.erb +1 -1
- data/app/views/admin/pages/_edit_files.html.erb +1 -5
- data/app/views/admin/pages/_edit_images.html.erb +1 -5
- data/app/views/admin/pages/_edit_options.html.erb +74 -55
- data/app/views/admin/pages/_form.html.erb +19 -0
- data/app/views/admin/pages/edit.html.erb +35 -61
- data/app/views/admin/pages/index.html.erb +0 -1
- data/app/views/admin/pages/new.html.erb +32 -32
- data/app/views/admin/pages/news.html.erb +1 -1
- data/app/views/admin/users/_access_control.html.erb +5 -1
- data/app/views/admin/users/login.html.erb +12 -4
- data/app/views/errors/500.html.erb +2 -20
- data/app/views/errors/_generic_help.html.erb +1 -1
- data/app/views/feeds/pages.rss.builder +3 -2
- data/app/views/layouts/admin/_header.html.erb +1 -1
- data/app/views/layouts/admin/_page_header.html.erb +33 -0
- data/app/views/layouts/admin.html.erb +23 -42
- data/app/views/pages_core/_google_analytics.html.erb +8 -0
- data/app/views/sitemaps/show.xml.builder +2 -0
- data/config/routes.rb +5 -5
- data/db/migrate/20111219033112_create_pages_tables.rb +192 -271
- data/db/migrate/20180625154059_enable_search_extensions.rb +10 -0
- data/db/migrate/20210209151400_create_search_configurations.rb +35 -0
- data/db/migrate/20210210235200_create_search_documents.rb +74 -0
- data/lib/pages_core/admin_menu_item.rb +3 -0
- data/lib/pages_core/archive_finder.rb +12 -16
- data/lib/pages_core/attachment_embedder.rb +4 -6
- data/lib/pages_core/cache_sweeper.rb +10 -108
- data/lib/pages_core/configuration/base.rb +5 -0
- data/lib/pages_core/configuration/pages.rb +4 -2
- data/lib/pages_core/configuration.rb +2 -0
- data/lib/pages_core/digest_verifier.rb +5 -5
- data/lib/pages_core/engine.rb +53 -5
- data/lib/pages_core/extensions/string_extensions.rb +3 -1
- data/lib/pages_core/extensions.rb +2 -0
- data/lib/pages_core/page_path_constraint.rb +2 -0
- data/lib/pages_core/pages_plugin.rb +3 -1
- data/lib/pages_core/plugin.rb +4 -52
- data/lib/pages_core/pub_sub.rb +2 -0
- data/lib/pages_core/static_cache/null_handler.rb +17 -0
- data/lib/pages_core/static_cache/page_cache_handler.rb +56 -0
- data/lib/pages_core/static_cache/varnish_handler.rb +55 -0
- data/lib/pages_core/static_cache.rb +26 -0
- data/lib/pages_core/templates/block_configuration.rb +4 -1
- data/lib/pages_core/templates/configuration.rb +5 -1
- data/lib/pages_core/templates/configuration_handler.rb +5 -3
- data/lib/pages_core/templates/configuration_proxy.rb +2 -0
- data/lib/pages_core/templates/controller_actions.rb +2 -0
- data/lib/pages_core/templates/template_configuration.rb +18 -13
- data/lib/pages_core/templates.rb +5 -3
- data/lib/pages_core/version.rb +3 -1
- data/lib/pages_core.rb +13 -5
- data/lib/rails/generators/pages_core/frontend/frontend_generator.rb +2 -7
- data/lib/rails/generators/pages_core/install/install_generator.rb +3 -7
- data/lib/rails/generators/pages_core/install/templates/active_job_initializer.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/application_controller.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/application_helper.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/delayed_job +1 -0
- data/lib/rails/generators/pages_core/install/templates/delayed_job_initializer.rb +17 -0
- data/lib/rails/generators/pages_core/install/templates/frontend_controller.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/frontend_helper.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/gitignore.erb +12 -1
- data/lib/rails/generators/pages_core/install/templates/page_templates_initializer.rb +4 -2
- data/lib/rails/generators/pages_core/install/templates/pages_controller.rb +2 -0
- data/lib/rails/generators/pages_core/install/templates/pages_initializer.rb +2 -6
- data/lib/rails/generators/pages_core/rspec/rspec_generator.rb +18 -14
- data/lib/rails/generators/pages_core/rspec/templates/factories.rb +3 -8
- data/lib/rails/generators/pages_core/rspec/templates/mailer_macros.rb +2 -0
- data/lib/rails/generators/pages_core/rspec/templates/page_templates_spec.rb +26 -0
- data/lib/rails/generators/pages_core/rspec/templates/rails_helper.rb +91 -0
- data/lib/rails/generators/pages_core/rspec/templates/spec_helper.rb +89 -36
- data/lib/tasks/pages/cache.rake +8 -5
- data/lib/tasks/pages/export.rake +3 -1
- data/lib/tasks/pages/page_paths.rake +2 -0
- data/lib/tasks/pages.rake +3 -2
- data/template.rb +2 -0
- metadata +194 -157
- data/app/assets/javascripts/pages/admin/components/attachment.jsx +0 -130
- data/app/assets/javascripts/pages/admin/components/attachment_editor.jsx +0 -131
- data/app/assets/javascripts/pages/admin/components/attachments.jsx +0 -211
- data/app/assets/javascripts/pages/admin/components/drag_uploader.jsx +0 -174
- data/app/assets/javascripts/pages/admin/components/editable_image.jsx +0 -57
- data/app/assets/javascripts/pages/admin/components/file_upload_button.jsx +0 -44
- data/app/assets/javascripts/pages/admin/components/grid_image.jsx +0 -124
- data/app/assets/javascripts/pages/admin/components/image_editor.jsx +0 -496
- data/app/assets/javascripts/pages/admin/components/image_grid.jsx +0 -301
- data/app/assets/javascripts/pages/admin/components/image_uploader.jsx +0 -171
- data/app/assets/javascripts/pages/admin/components/modal_store.jsx +0 -20
- data/app/assets/javascripts/pages/admin/components/rich_text_area.jsx +0 -63
- data/app/assets/javascripts/pages/admin/components/rich_text_toolbar.jsx +0 -58
- data/app/assets/javascripts/pages/admin/components/toast.jsx +0 -37
- data/app/assets/javascripts/pages/admin/components/toast_store.jsx +0 -52
- data/app/assets/javascripts/pages/admin/components.jsx +0 -2
- data/app/assets/javascripts/pages/admin/features/content_tabs.jsx +0 -72
- data/app/assets/javascripts/pages/admin/features/edit_page.jsx +0 -97
- data/app/assets/javascripts/pages/admin/features/rich_text.jsx +0 -14
- data/app/assets/javascripts/pages/admin/features/tag_editor.jsx +0 -160
- data/app/assets/javascripts/pages/admin.jsx +0 -17
- data/app/assets/javascripts/pages/login_form.jsx +0 -21
- data/app/controllers/concerns/pages_core/domain_based_cache.rb +0 -26
- data/app/serializers/admin/page_file_serializer.rb +0 -6
- data/app/serializers/admin/page_image_serializer.rb +0 -6
- data/app/serializers/page_export_serializer.rb +0 -30
- data/app/serializers/page_file_export_serializer.rb +0 -4
- data/app/serializers/page_image_export_serializer.rb +0 -40
- data/app/serializers/page_serializer.rb +0 -21
- data/app/views/admin_mailer/error_report.html.erb +0 -70
- data/app/views/errors/500_critical.html.erb +0 -7
- data/app/views/errors/report.html.erb +0 -4
- data/app/views/layouts/admin/_analytics.html.erb +0 -16
- data/config/removed_migrations.yml +0 -60
- data/db/migrate/20120627033112_rename_textbits.rb +0 -17
- data/db/migrate/20121010055412_drop_removed_tables.rb +0 -81
- data/db/migrate/20130130053932_add_queue_to_delayed_jobs.rb +0 -9
- data/db/migrate/20130303053932_remove_filter_from_localizations.rb +0 -9
- data/db/migrate/20130303160632_remove_imagesets.rb +0 -22
- data/db/migrate/20130303161732_remove_sms_subscribers.rb +0 -14
- data/db/migrate/20130823133208_update_page_redirect_to.rb +0 -10
- data/db/migrate/20140203183900_create_roles.rb +0 -66
- data/db/migrate/20140414150500_change_locale_names.rb +0 -11
- data/db/migrate/20140604142100_remove_openid_url.rb +0 -9
- data/db/migrate/20140920231700_convert_images_to_dis.rb +0 -81
- data/db/migrate/20140922124600_convert_page_files_to_dis.rb +0 -50
- data/db/migrate/20141004003100_create_password_reset_tokens.rb +0 -10
- data/db/migrate/20141006181300_remove_user_cruft.rb +0 -11
- data/db/migrate/20141007173000_create_invites.rb +0 -16
- data/db/migrate/20150204130800_update_delayed_job_table.rb +0 -9
- data/db/migrate/20150401131300_localize_images.rb +0 -38
- data/db/migrate/20150520174300_add_meta_image_to_page.rb +0 -5
- data/db/migrate/20150904164200_add_pinned_to_tags.rb +0 -5
- data/db/migrate/20151002174800_create_page_paths.rb +0 -10
- data/db/migrate/20151021103400_drop_binaries_table.rb +0 -7
- data/db/migrate/20151204151000_remove_page_content_order.rb +0 -5
- data/db/migrate/20160330220900_rename_pages_categories.rb +0 -6
- data/db/migrate/20160405202700_change_localization_limit.rb +0 -9
- data/db/migrate/20170716040500_remove_page_comments.rb +0 -23
- data/db/migrate/20170716213400_remove_sessions.rb +0 -15
- data/db/migrate/20180207134000_add_dates_to_pages.rb +0 -11
- data/db/migrate/20190211154800_create_attachments.rb +0 -73
- data/db/migrate/20190318115000_fix_page_file_ids.rb +0 -34
- data/lib/rails/generators/pages_core/frontend/templates/application.js.erb +0 -15
- data/lib/rails/generators/pages_core/install/templates/cache_sweeper_initializer.rb +0 -6
- data/lib/tasks/pages/update.rake +0 -17
- data/vendor/assets/javascripts/ReactCrop.min.js +0 -1
- data/vendor/assets/javascripts/reflux.min.js +0 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module PagesCore
|
|
2
4
|
module Templates
|
|
3
5
|
class TemplateConfiguration
|
|
@@ -7,7 +9,9 @@ module PagesCore
|
|
|
7
9
|
def all_blocks
|
|
8
10
|
(config.get(:default, :blocks).keys +
|
|
9
11
|
all_templates.map { |t| configured_block_names(t) } +
|
|
10
|
-
all_templates.map
|
|
12
|
+
all_templates.map do |t|
|
|
13
|
+
enabled_block_names(t)
|
|
14
|
+
end).flatten.compact.uniq
|
|
11
15
|
end
|
|
12
16
|
|
|
13
17
|
def all_templates
|
|
@@ -94,18 +98,19 @@ module PagesCore
|
|
|
94
98
|
|
|
95
99
|
def default_block_options(block_name)
|
|
96
100
|
{
|
|
97
|
-
title:
|
|
101
|
+
title: block_name.to_s.humanize,
|
|
98
102
|
optional: true,
|
|
99
|
-
size:
|
|
103
|
+
size: :small
|
|
100
104
|
}
|
|
101
105
|
end
|
|
102
106
|
end
|
|
103
107
|
|
|
104
108
|
class << self
|
|
105
109
|
def configure(options = {}, &_block)
|
|
106
|
-
|
|
110
|
+
case options[:reset]
|
|
111
|
+
when :defaults
|
|
107
112
|
load_default_configuration
|
|
108
|
-
|
|
113
|
+
when true
|
|
109
114
|
@configuration = PagesCore::Templates::Configuration.new
|
|
110
115
|
end
|
|
111
116
|
yield configuration if block_given?
|
|
@@ -149,26 +154,26 @@ module PagesCore
|
|
|
149
154
|
|
|
150
155
|
def default_blocks
|
|
151
156
|
{
|
|
152
|
-
name:
|
|
153
|
-
body:
|
|
157
|
+
name: { size: :field, class: "page_title" },
|
|
158
|
+
body: { size: :large },
|
|
154
159
|
headline: { size: :field },
|
|
155
|
-
excerpt:
|
|
156
|
-
boxout:
|
|
160
|
+
excerpt: {},
|
|
161
|
+
boxout: {}
|
|
157
162
|
}.merge(default_meta_blocks)
|
|
158
163
|
end
|
|
159
164
|
|
|
160
165
|
def default_meta_blocks
|
|
161
166
|
{
|
|
162
|
-
meta_title:
|
|
163
|
-
meta_description:
|
|
164
|
-
open_graph_title:
|
|
167
|
+
meta_title: { size: :field },
|
|
168
|
+
meta_description: { size: :small },
|
|
169
|
+
open_graph_title: { size: :field },
|
|
165
170
|
open_graph_description: { size: :small }
|
|
166
171
|
}
|
|
167
172
|
end
|
|
168
173
|
|
|
169
174
|
def default_block_configuration(default)
|
|
170
175
|
default.blocks do |block|
|
|
171
|
-
default_blocks.
|
|
176
|
+
default_blocks.each_key do |name|
|
|
172
177
|
block.send(
|
|
173
178
|
name,
|
|
174
179
|
template_block_localization("#{name}.name"),
|
data/lib/pages_core/templates.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "pages_core/templates/block_configuration"
|
|
2
4
|
require "pages_core/templates/configuration_proxy"
|
|
3
5
|
require "pages_core/templates/configuration_handler"
|
|
@@ -16,8 +18,8 @@ module PagesCore
|
|
|
16
18
|
|
|
17
19
|
def template_paths
|
|
18
20
|
[
|
|
19
|
-
PagesCore.plugin_root.join("app
|
|
20
|
-
Rails.root.join("app
|
|
21
|
+
PagesCore.plugin_root.join("app/views/pages/templates"),
|
|
22
|
+
Rails.root.join("app/views/pages/templates")
|
|
21
23
|
]
|
|
22
24
|
end
|
|
23
25
|
|
|
@@ -28,7 +30,7 @@ module PagesCore
|
|
|
28
30
|
.uniq
|
|
29
31
|
.compact
|
|
30
32
|
.sort
|
|
31
|
-
.map { |f| f.gsub(/\.[\w
|
|
33
|
+
.map { |f| f.gsub(/\.[\w.]+$/, "") }
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
def template_files_in_dir(dir)
|
data/lib/pages_core/version.rb
CHANGED
data/lib/pages_core.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Ruby Standard Library
|
|
2
4
|
require "digest/sha1"
|
|
3
5
|
require "fileutils"
|
|
@@ -15,25 +17,31 @@ require "action_mailer"
|
|
|
15
17
|
|
|
16
18
|
# Gems
|
|
17
19
|
require "actionpack/page_caching"
|
|
18
|
-
require "active_model_serializers"
|
|
19
20
|
require "acts_as_list"
|
|
21
|
+
require "alba"
|
|
20
22
|
require "bcrypt"
|
|
21
|
-
require "coffee-script"
|
|
22
23
|
require "country_select"
|
|
23
|
-
require "
|
|
24
|
+
require "delayed_job_active_record"
|
|
24
25
|
require "dis"
|
|
25
26
|
require "dynamic_image"
|
|
27
|
+
require "healthcheck"
|
|
26
28
|
require "localizable_model"
|
|
29
|
+
require "lograge"
|
|
30
|
+
require "nokogiri"
|
|
27
31
|
require "json"
|
|
32
|
+
require "pg_search"
|
|
33
|
+
require "progress_bar"
|
|
28
34
|
require "rails_i18n"
|
|
29
35
|
require "RedCloth"
|
|
30
36
|
require "sass-rails"
|
|
37
|
+
require "typhoeus"
|
|
31
38
|
require "will_paginate"
|
|
32
39
|
|
|
40
|
+
# Must be loaded so that PagesCore::LinkRender can resolve the constant.
|
|
41
|
+
require "will_paginate/view_helpers/action_view"
|
|
42
|
+
|
|
33
43
|
# Assets
|
|
34
44
|
require "font-awesome-rails"
|
|
35
|
-
require "jquery-ui-rails"
|
|
36
|
-
require "jquery/rails/engine"
|
|
37
45
|
require "react-rails"
|
|
38
46
|
|
|
39
47
|
# Pages
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module PagesCore
|
|
2
4
|
module Generators
|
|
3
5
|
class FrontendGenerator < Rails::Generators::Base
|
|
@@ -49,13 +51,6 @@ module PagesCore
|
|
|
49
51
|
File.join("app/assets/stylesheets/components/base.scss")
|
|
50
52
|
)
|
|
51
53
|
end
|
|
52
|
-
|
|
53
|
-
def create_application_js
|
|
54
|
-
template(
|
|
55
|
-
"application.js.erb",
|
|
56
|
-
File.join("app/assets/javascripts/application.js")
|
|
57
|
-
)
|
|
58
|
-
end
|
|
59
54
|
end
|
|
60
55
|
end
|
|
61
56
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module PagesCore
|
|
2
4
|
module Generators
|
|
3
5
|
class InstallGenerator < Rails::Generators::Base
|
|
@@ -57,7 +59,7 @@ module PagesCore
|
|
|
57
59
|
|
|
58
60
|
def create_delayed_job_script
|
|
59
61
|
template "delayed_job", File.join("script/delayed_job")
|
|
60
|
-
File.chmod(0o755, Rails.root.join("script
|
|
62
|
+
File.chmod(0o755, Rails.root.join("script/delayed_job"))
|
|
61
63
|
end
|
|
62
64
|
|
|
63
65
|
def create_delayed_job_initializer
|
|
@@ -71,12 +73,6 @@ module PagesCore
|
|
|
71
73
|
File.join("config/initializers/pages.rb"))
|
|
72
74
|
end
|
|
73
75
|
|
|
74
|
-
def create_cache_sweeper_initializer
|
|
75
|
-
read_configuration!
|
|
76
|
-
template("cache_sweeper_initializer.rb",
|
|
77
|
-
File.join("config/initializers/cache_sweeper.rb"))
|
|
78
|
-
end
|
|
79
|
-
|
|
80
76
|
def create_template_initializer
|
|
81
77
|
read_configuration!
|
|
82
78
|
template("page_templates_initializer.rb",
|
|
@@ -1 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
Delayed::Worker.backend = :active_record
|
|
4
|
+
|
|
5
|
+
if Object.const_defined?("Postmark")
|
|
6
|
+
class InvalidRecipientsPlugin < Delayed::Plugin
|
|
7
|
+
callbacks do |lifecycle|
|
|
8
|
+
lifecycle.around(:invoke_job) do |job, *args, &block|
|
|
9
|
+
# Forward the call to the next callback in the callback chain
|
|
10
|
+
block.call(job, *args)
|
|
11
|
+
rescue Postmark::InactiveRecipientError => e
|
|
12
|
+
Rails.logger.error "#{e.class}: #{e.message}"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Delayed::Worker.plugins << InvalidRecipientsPlugin
|
|
18
|
+
end
|
|
@@ -19,7 +19,18 @@
|
|
|
19
19
|
|
|
20
20
|
# Ignore all logfiles and tempfiles.
|
|
21
21
|
/log/*.log
|
|
22
|
-
/log/error_reports
|
|
23
22
|
/log/*.sphinx.pid
|
|
24
23
|
/tmp
|
|
25
24
|
/public/dynamic_images
|
|
25
|
+
|
|
26
|
+
# Ignore uploaded files in development
|
|
27
|
+
/storage/*
|
|
28
|
+
|
|
29
|
+
/node_modules
|
|
30
|
+
/yarn-error.log
|
|
31
|
+
|
|
32
|
+
.byebug_history
|
|
33
|
+
/coverage
|
|
34
|
+
|
|
35
|
+
# Ignore master key for decrypting credentials and more.
|
|
36
|
+
/config/master.key
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Be sure to restart your web server when you modify this file.
|
|
2
4
|
|
|
3
5
|
# Templates configuration
|
|
@@ -10,7 +12,7 @@ PagesCore::Templates.configure do |config|
|
|
|
10
12
|
"Headline",
|
|
11
13
|
size: :field,
|
|
12
14
|
description: "The main statement, usually largest and boldest, " \
|
|
13
|
-
|
|
15
|
+
"describing the main story."
|
|
14
16
|
)
|
|
15
17
|
block.excerpt(
|
|
16
18
|
"Standfirst",
|
|
@@ -20,7 +22,7 @@ PagesCore::Templates.configure do |config|
|
|
|
20
22
|
block.boxout(
|
|
21
23
|
"Boxout",
|
|
22
24
|
description: "Part of the page, usually background info or facts " \
|
|
23
|
-
|
|
25
|
+
"related to the article."
|
|
24
26
|
)
|
|
25
27
|
end
|
|
26
28
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Be sure to restart your web server when you modify this file.
|
|
2
4
|
|
|
3
5
|
PagesCore.configure do |config|
|
|
@@ -11,12 +13,6 @@ PagesCore.configure do |config|
|
|
|
11
13
|
# Locales and names
|
|
12
14
|
# config.locales(nb: 'Norwegian', en: 'English')
|
|
13
15
|
|
|
14
|
-
# Page cache (default: enabled)
|
|
15
|
-
# config.page_cache :enabled
|
|
16
|
-
|
|
17
|
-
# Domain based page cache (default: disabled)
|
|
18
|
-
# config.domain_based_cache :disabled
|
|
19
|
-
|
|
20
16
|
# Fulltext in RSS feeds (default: disabled)
|
|
21
17
|
# config.rss_fulltext :disabled
|
|
22
18
|
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module PagesCore
|
|
2
4
|
module Generators
|
|
3
5
|
class RspecGenerator < Rails::Generators::Base
|
|
4
6
|
desc "RSpec setup"
|
|
5
7
|
source_root File.expand_path("templates", __dir__)
|
|
6
8
|
|
|
7
|
-
def setup_development_gems
|
|
8
|
-
gem_group :development do
|
|
9
|
-
gem "spring-commands-rspec"
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
9
|
def setup_test_gems
|
|
14
|
-
gem_group :
|
|
15
|
-
gem "rspec-rails"
|
|
16
|
-
gem "shoulda-matchers", require: false
|
|
17
|
-
gem "json_spec"
|
|
10
|
+
gem_group :development, :test do
|
|
18
11
|
gem "capybara"
|
|
19
|
-
gem "timecop"
|
|
20
12
|
gem "factory_bot_rails"
|
|
13
|
+
gem "fuubar"
|
|
14
|
+
gem "json_spec"
|
|
15
|
+
gem "rspec-rails"
|
|
16
|
+
gem "rspec_junit_formatter"
|
|
17
|
+
gem "selenium-webdriver"
|
|
18
|
+
gem "shoulda-matchers", require: false
|
|
19
|
+
gem "simplecov", require: false
|
|
21
20
|
end
|
|
22
21
|
end
|
|
23
22
|
|
|
24
23
|
def setup_rspec
|
|
25
|
-
create_file File.join(".rspec"), "--colour"
|
|
24
|
+
create_file File.join(".rspec"), "--format Fuubar\n--colour\n" \
|
|
25
|
+
"--require spec_helper"
|
|
26
26
|
create_file File.join("spec/controllers/.keep")
|
|
27
|
-
create_file File.join("spec/
|
|
27
|
+
create_file File.join("spec/mailers/preview/.keep")
|
|
28
28
|
create_file File.join("spec/models/.keep")
|
|
29
|
+
create_file File.join("spec/system/.keep")
|
|
29
30
|
template "spec_helper.rb", File.join("spec/spec_helper.rb")
|
|
30
|
-
template "
|
|
31
|
+
template "rails_helper.rb", File.join("spec/rails_helper.rb")
|
|
32
|
+
template "factories.rb", File.join("spec/factories.rb")
|
|
31
33
|
template "mailer_macros.rb", File.join("spec/support/mailer_macros.rb")
|
|
34
|
+
template("page_templates_spec.rb",
|
|
35
|
+
File.join("spec/system/page_templates_spec.rb"))
|
|
32
36
|
end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails_helper"
|
|
4
|
+
|
|
5
|
+
RSpec.describe "Page templates", type: :system do
|
|
6
|
+
subject { page }
|
|
7
|
+
|
|
8
|
+
let(:page_model) do
|
|
9
|
+
create(:page,
|
|
10
|
+
template: template,
|
|
11
|
+
headline: "My headline",
|
|
12
|
+
body: "My body",
|
|
13
|
+
excerpt: "My excerpt")
|
|
14
|
+
end
|
|
15
|
+
let(:template) { "index" }
|
|
16
|
+
let(:locale) { I18n.default_locale }
|
|
17
|
+
|
|
18
|
+
before do
|
|
19
|
+
visit page_path(locale, page_model)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe "default template" do
|
|
23
|
+
it { is_expected.to have_text(page_model.headline) }
|
|
24
|
+
it { is_expected.to have_text(page_model.body) }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
4
|
+
ENV["RAILS_ENV"] ||= "test"
|
|
5
|
+
|
|
6
|
+
require "simplecov"
|
|
7
|
+
SimpleCov.start "rails" if ARGV.grep(/spec\.rb/).empty?
|
|
8
|
+
|
|
9
|
+
require File.expand_path("../config/environment", __dir__)
|
|
10
|
+
|
|
11
|
+
# Prevent database truncation if the environment is production
|
|
12
|
+
if Rails.env.production?
|
|
13
|
+
abort("The Rails environment is running in production mode!")
|
|
14
|
+
end
|
|
15
|
+
require "spec_helper"
|
|
16
|
+
require "rspec/rails"
|
|
17
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
|
18
|
+
|
|
19
|
+
require "shoulda-matchers"
|
|
20
|
+
|
|
21
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
22
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
23
|
+
# run as spec files by default. This means that files in spec/support that end
|
|
24
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
25
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
|
26
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
|
27
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
28
|
+
#
|
|
29
|
+
# The following line is provided for convenience purposes. It has the downside
|
|
30
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
|
31
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
|
32
|
+
# require only the support files necessary.
|
|
33
|
+
#
|
|
34
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each do |f|
|
|
35
|
+
require f
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Checks for pending migration and applies them before tests are run.
|
|
39
|
+
# If you are not using ActiveRecord, you can remove this line.
|
|
40
|
+
ActiveRecord::Migration.maintain_test_schema!
|
|
41
|
+
|
|
42
|
+
RSpec.configure do |config|
|
|
43
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
44
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
45
|
+
|
|
46
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
47
|
+
# examples within a transaction, remove the following line or assign false
|
|
48
|
+
# instead of true.
|
|
49
|
+
config.use_transactional_fixtures = true
|
|
50
|
+
|
|
51
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
|
52
|
+
# based on their file location, for example enabling you to call `get` and
|
|
53
|
+
# `post` in specs under `spec/controllers`.
|
|
54
|
+
#
|
|
55
|
+
# You can disable this behaviour by removing the line below, and instead
|
|
56
|
+
# explicitly tag your specs with their type, e.g.:
|
|
57
|
+
#
|
|
58
|
+
# RSpec.describe UsersController, :type => :controller do
|
|
59
|
+
# # ...
|
|
60
|
+
# end
|
|
61
|
+
#
|
|
62
|
+
# The different available types are documented in the features, such as in
|
|
63
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
|
64
|
+
config.infer_spec_type_from_file_location!
|
|
65
|
+
|
|
66
|
+
# Filter lines from Rails gems in backtraces.
|
|
67
|
+
config.filter_rails_from_backtrace!
|
|
68
|
+
# arbitrary gems may also be filtered via:
|
|
69
|
+
# config.filter_gems_from_backtrace("gem name")
|
|
70
|
+
|
|
71
|
+
config.include ActiveJob::TestHelper
|
|
72
|
+
config.include MailerMacros
|
|
73
|
+
|
|
74
|
+
# Use FactoryBot shorthand
|
|
75
|
+
config.include FactoryBot::Syntax::Methods
|
|
76
|
+
|
|
77
|
+
config.before(:each, type: :system) do
|
|
78
|
+
driven_by :rack_test
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
config.before(:each, js: true) do
|
|
82
|
+
driven_by :selenium_chrome_headless
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
Shoulda::Matchers.configure do |config|
|
|
87
|
+
config.integrate do |with|
|
|
88
|
+
with.test_framework :rspec
|
|
89
|
+
with.library :rails
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -1,42 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require
|
|
7
|
-
require
|
|
3
|
+
# This file was generated by the `rails generate rspec:install`
|
|
4
|
+
# command. Conventionally, all specs live under a `spec` directory,
|
|
5
|
+
# which RSpec adds to the `$LOAD_PATH`. The generated `.rspec` file
|
|
6
|
+
# contains `--require spec_helper` which will cause this file to
|
|
7
|
+
# always be loaded, without a need to explicitly require it in any
|
|
8
|
+
# files.
|
|
9
|
+
#
|
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
11
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
12
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
13
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
|
14
|
+
# a separate helper file that requires the additional dependencies and performs
|
|
15
|
+
# the additional setup, and require it from the spec files that actually need
|
|
16
|
+
# it.
|
|
17
|
+
#
|
|
18
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
19
|
+
# users commonly want.
|
|
20
|
+
#
|
|
21
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
22
|
+
RSpec.configure do |config|
|
|
23
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
24
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
25
|
+
# assertions if you prefer.
|
|
26
|
+
config.expect_with :rspec do |expectations|
|
|
27
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
28
|
+
# and `failure_message` of custom matchers include text for helper methods
|
|
29
|
+
# defined using `chain`, e.g.:
|
|
30
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
|
31
|
+
# # => "be bigger than 2 and smaller than 4"
|
|
32
|
+
# ...rather than:
|
|
33
|
+
# # => "be bigger than 2"
|
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
35
|
+
end
|
|
8
36
|
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
|
|
37
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
38
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
39
|
+
config.mock_with :rspec do |mocks|
|
|
40
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
41
|
+
# a real object. This is generally recommended, and will default to
|
|
42
|
+
# `true` in RSpec 4.
|
|
43
|
+
mocks.verify_partial_doubles = true
|
|
44
|
+
end
|
|
12
45
|
|
|
13
|
-
|
|
14
|
-
#
|
|
46
|
+
# The settings below are suggested to provide a good initial experience
|
|
47
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
48
|
+
# # These two settings work together to allow you to limit a spec run
|
|
49
|
+
# # to individual examples or groups you care about by tagging them with
|
|
50
|
+
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
51
|
+
# # get run.
|
|
52
|
+
# config.filter_run :focus
|
|
53
|
+
# config.run_all_when_everything_filtered = true
|
|
15
54
|
#
|
|
16
|
-
#
|
|
55
|
+
# # Allows RSpec to persist some state between runs in order to support
|
|
56
|
+
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
|
57
|
+
# # you configure your source control system to ignore this file.
|
|
58
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
|
17
59
|
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
config.
|
|
41
|
-
|
|
60
|
+
# # Limits the available syntax to the non-monkey patched syntax that is
|
|
61
|
+
# # recommended. For more details, see:
|
|
62
|
+
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
|
63
|
+
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-\
|
|
64
|
+
# # expectation-syntax/
|
|
65
|
+
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-\
|
|
66
|
+
# # monkey-patching-mode
|
|
67
|
+
# config.disable_monkey_patching!
|
|
68
|
+
#
|
|
69
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
|
70
|
+
# # file, and it's useful to allow more verbose output when running an
|
|
71
|
+
# # individual spec file.
|
|
72
|
+
# if config.files_to_run.one?
|
|
73
|
+
# # Use the documentation formatter for detailed output,
|
|
74
|
+
# # unless a formatter has already been configured
|
|
75
|
+
# # (e.g. via a command-line flag).
|
|
76
|
+
# config.default_formatter = 'doc'
|
|
77
|
+
# end
|
|
78
|
+
#
|
|
79
|
+
# # Print the 10 slowest examples and example groups at the
|
|
80
|
+
# # end of the spec run, to help surface which specs are running
|
|
81
|
+
# # particularly slow.
|
|
82
|
+
# config.profile_examples = 10
|
|
83
|
+
#
|
|
84
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
|
85
|
+
# # order dependency and want to debug it, you can fix the order by
|
|
86
|
+
# # providing the seed, which is printed after each run.
|
|
87
|
+
# # --seed 1234
|
|
88
|
+
# config.order = :random
|
|
89
|
+
#
|
|
90
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
|
91
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
|
92
|
+
# # test failures related to randomization by passing the same `--seed`
|
|
93
|
+
# # value as the one that triggered the failure.
|
|
94
|
+
# Kernel.srand config.seed
|
|
42
95
|
end
|