Class: ComfortableMexicanSofa::Configuration
- Inherits:
-
Object
- Object
- ComfortableMexicanSofa::Configuration
- Defined in:
- lib/comfortable_mexican_sofa/configuration.rb
Instance Attribute Summary collapse
-
#admin_auth ⇒ Object
Module that will handle authentication to access cms-admin area.
-
#admin_cache_sweeper ⇒ Object
A class that is included as a sweeper to admin base controller if it’s set.
-
#admin_locale ⇒ Object
Admin interface will respect the locale of the site being managed.
-
#admin_route_redirect ⇒ Object
When arriving at /cms-admin you may chose to redirect to arbirtary path, for example ‘/cms-admin/users’.
-
#allow_irb ⇒ Object
Not allowing irb code to be run inside page content.
-
#allowed_helpers ⇒ Object
Whitelist of all helper methods that can be used via {cms:helper} tag.
-
#allowed_partials ⇒ Object
Whitelist of partials paths that can be used via {cms:partial} tag.
-
#allowed_templates ⇒ Object
Whitelist of template paths that can be used via {cms:template} tag.
-
#base_controller ⇒ Object
Controller that is inherited from CmsAdmin::BaseController ‘ApplicationController’ is the default.
-
#cms_title ⇒ Object
Don’t like ComfortableMexicanSofa? Set it to whatever you like.
-
#enable_fixtures ⇒ Object
With each page load, files will be synched with the database.
-
#fixtures_path ⇒ Object
Path where fixtures can be located.
-
#hostname_aliases ⇒ Object
Site aliases, if you want to have aliases for your site.
-
#locales ⇒ Object
Locale definitions.
-
#public_auth ⇒ Object
Module that will handle authentication for public pages.
-
#reveal_cms_partials ⇒ Object
Reveal partials that can be overwritten in the admin area.
-
#revisions_limit ⇒ Object
Number of revisions kept.
-
#upload_file_options ⇒ Object
Upload settings.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Configuration defaults.
Constructor Details
#initialize ⇒ Configuration
Configuration defaults
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 73 def initialize @cms_title = 'ComfortableMexicanSofa CMS Engine' @base_controller = 'ApplicationController' @admin_auth = 'ComfortableMexicanSofa::HttpAuth' @public_auth = 'ComfortableMexicanSofa::DummyAuth' @seed_data_path = nil @admin_route_redirect = '' @enable_sitemap = true @upload_file_options = { } @enable_fixtures = false @fixtures_path = File.('db/cms_fixtures', Rails.root) @revisions_limit = 25 @locales = { 'en' => 'English', 'fr' => 'Français', 'es' => 'Español', 'pt-BR' => 'Português Brasileiro', 'zh-CN' => '简体中文', 'zh-TW' => '正體中文', 'ja' => '日本語', 'sv' => 'Svenska', 'ru' => 'Русский', 'pl' => 'Polski', 'de' => 'Deutsch', 'nl' => 'Nederlands', 'it' => 'Italiano', 'da' => 'Dansk', 'cs' => 'Česky', 'nb' => 'Norsk' } @admin_locale = nil @admin_cache_sweeper = nil @allow_irb = false @allowed_helpers = nil @allowed_partials = nil @hostname_aliases = nil @reveal_cms_partials = false end |
Instance Attribute Details
#admin_auth ⇒ Object
Module that will handle authentication to access cms-admin area
13 14 15 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 13 def admin_auth @admin_auth end |
#admin_cache_sweeper ⇒ Object
A class that is included as a sweeper to admin base controller if it’s set
44 45 46 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 44 def admin_cache_sweeper @admin_cache_sweeper end |
#admin_locale ⇒ Object
Admin interface will respect the locale of the site being managed. However you can force it to English by setting this to ‘:en`
41 42 43 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 41 def admin_locale @admin_locale end |
#admin_route_redirect ⇒ Object
When arriving at /cms-admin you may chose to redirect to arbirtary path, for example ‘/cms-admin/users’
20 21 22 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 20 def admin_route_redirect @admin_route_redirect end |
#allow_irb ⇒ Object
Not allowing irb code to be run inside page content. False by default.
47 48 49 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 47 def allow_irb @allow_irb end |
#allowed_helpers ⇒ Object
Whitelist of all helper methods that can be used via {cms:helper} tag. By default all helpers are allowed except ‘eval`, `send`, `call` and few others. Empty array will prevent rendering of all helpers.
52 53 54 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 52 def allowed_helpers @allowed_helpers end |
#allowed_partials ⇒ Object
Whitelist of partials paths that can be used via {cms:partial} tag. All partials are accessible by default. Empty array will prevent rendering of all partials.
56 57 58 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 56 def allowed_partials @allowed_partials end |
#allowed_templates ⇒ Object
Whitelist of template paths that can be used via {cms:template} tag. All templates are accessible by default. Empty array will prevent rendering of all templates.
60 61 62 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 60 def allowed_templates @allowed_templates end |
#base_controller ⇒ Object
Controller that is inherited from CmsAdmin::BaseController ‘ApplicationController’ is the default
10 11 12 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 10 def base_controller @base_controller end |
#cms_title ⇒ Object
Don’t like ComfortableMexicanSofa? Set it to whatever you like. :(
6 7 8 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 6 def cms_title @cms_title end |
#enable_fixtures ⇒ Object
With each page load, files will be synched with the database. Database entries are destroyed if there’s no corresponding file. Fixtures are disabled by default.
27 28 29 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 27 def enable_fixtures @enable_fixtures end |
#fixtures_path ⇒ Object
Path where fixtures can be located.
30 31 32 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 30 def fixtures_path @fixtures_path end |
#hostname_aliases ⇒ Object
Site aliases, if you want to have aliases for your site. Good for harmonizing production env with dev/testing envs. e.g. config.site_aliases = => ‘host.inv’, ‘host_a.com’ => [‘host.lvh.me’, ‘host.dev’] Default is nil (not used)
66 67 68 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 66 def hostname_aliases @hostname_aliases end |
#locales ⇒ Object
Locale definitions. If you want to define your own locale merge => ‘Locale Title’ with this.
37 38 39 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 37 def locales @locales end |
#public_auth ⇒ Object
Module that will handle authentication for public pages
16 17 18 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 16 def public_auth @public_auth end |
#reveal_cms_partials ⇒ Object
Reveal partials that can be overwritten in the admin area. Default is false.
70 71 72 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 70 def reveal_cms_partials @reveal_cms_partials end |
#revisions_limit ⇒ Object
Number of revisions kept. Default is 25. If you wish to disable: set this to 0.
33 34 35 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 33 def revisions_limit @revisions_limit end |
#upload_file_options ⇒ Object
Upload settings
23 24 25 |
# File 'lib/comfortable_mexican_sofa/configuration.rb', line 23 def @upload_file_options end |