Class: Cmsimple::Configuration
- Inherits:
-
Object
- Object
- Cmsimple::Configuration
- Defined in:
- lib/cmsimple/configuration.rb
Instance Attribute Summary collapse
-
#asset_path ⇒ Object
Returns the value of attribute asset_path.
-
#editor_javascripts ⇒ Object
Returns the value of attribute editor_javascripts.
-
#editor_stylesheets ⇒ Object
Returns the value of attribute editor_stylesheets.
-
#image_processor ⇒ Object
Returns the value of attribute image_processor.
-
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
-
#parent_front_controller ⇒ Object
Returns the value of attribute parent_front_controller.
-
#template_path ⇒ Object
Returns the value of attribute template_path.
-
#template_render_options ⇒ Object
Returns the value of attribute template_render_options.
- #template_strategy ⇒ Object
Instance Method Summary collapse
- #image_processor_mixin ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cmsimple/configuration.rb', line 3 def initialize # the parent controller for the front controller self.parent_front_controller = 'ApplicationController' # the parent controller for all CRUD controllers self.parent_controller = 'ApplicationController' # where the templates are located in the project self.template_path = 'cmsimple/templates' # set a template strategy (i.e. if you wanted to build a db backed template system) self.template_strategy = :basic # the path carrierwave will use to store image assets self.asset_path = 'uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}' # the library to use for processing images in carrierwave (rmagick or mini_magick) self.image_processor = :mini_magick # stylesheets to be included in the editor layout page self.editor_stylesheets = ['cmsimple'] # javascripts to be included in the editor layout page self.editor_javascripts = ['cmsimple'] # set this to change layouts or pass other params into rendering a template self. = {} end |
Instance Attribute Details
#asset_path ⇒ Object
Returns the value of attribute asset_path.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def asset_path @asset_path end |
#editor_javascripts ⇒ Object
Returns the value of attribute editor_javascripts.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def editor_javascripts @editor_javascripts end |
#editor_stylesheets ⇒ Object
Returns the value of attribute editor_stylesheets.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def editor_stylesheets @editor_stylesheets end |
#image_processor ⇒ Object
Returns the value of attribute image_processor.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def image_processor @image_processor end |
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def parent_controller @parent_controller end |
#parent_front_controller ⇒ Object
Returns the value of attribute parent_front_controller.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def parent_front_controller @parent_front_controller end |
#template_path ⇒ Object
Returns the value of attribute template_path.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def template_path @template_path end |
#template_render_options ⇒ Object
Returns the value of attribute template_render_options.
24 25 26 |
# File 'lib/cmsimple/configuration.rb', line 24 def @template_render_options end |
#template_strategy ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/cmsimple/configuration.rb', line 35 def template_strategy case @template_strategy when :basic Cmsimple::TemplateResponder else @template_strategy.constantize end end |
Instance Method Details
#image_processor_mixin ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/cmsimple/configuration.rb', line 44 def image_processor_mixin case @image_processor when :rmagick CarrierWave::RMagick else CarrierWave::MiniMagick end end |