Class: Caterpillar::Config
- Inherits:
-
Object
- Object
- Caterpillar::Config
- Defined in:
- lib/caterpillar/config.rb
Overview
Portlet configuration. The config file ‘config/portlets.rb’ should be installed in your Rails application. See the comments in the configuration file for more specific information about each option.
Constant Summary collapse
- FILE =
File.join('config','portlets.rb')
- JRUBY_HOME =
override in the config file if necessary
nil
Instance Attribute Summary collapse
-
#_container ⇒ Object
Returns the value of attribute _container.
-
#category ⇒ Object
Returns the value of attribute category.
-
#edit_mode ⇒ Object
Returns the value of attribute edit_mode.
-
#host ⇒ Object
Returns the value of attribute host.
-
#include_all_named_routes ⇒ Object
Are all named routes used, or only the ones specifically defined in the config FILE?.
-
#instanceable ⇒ Object
Returns the value of attribute instanceable.
-
#instances ⇒ Object
Returns the value of attribute instances.
-
#javascripts ⇒ Object
Returns the value of attribute javascripts.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#preferences_route ⇒ Object
Returns the value of attribute preferences_route.
-
#public_render_parameters ⇒ Object
Returns the value of attribute public_render_parameters.
-
#rails_root ⇒ Object
Returns the value of attribute rails_root.
-
#routes ⇒ Object
Returns the value of attribute routes.
-
#servlet ⇒ Object
Returns the value of attribute servlet.
-
#session_secret ⇒ Object
Returns the value of attribute session_secret.
-
#warbler_conf ⇒ Object
Returns the value of attribute warbler_conf.
Instance Method Summary collapse
-
#container ⇒ Object
The container class is used for parsing XML files.
-
#container=(_class) ⇒ Object
Accepts the configuration option, and instantates the container class.
-
#initialize(detect_configuration_file = true) ⇒ Config
constructor
Sets sane defaults that are overridden in the config file.
Constructor Details
#initialize(detect_configuration_file = true) ⇒ Config
Sets sane defaults that are overridden in the config file.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/caterpillar/config.rb', line 48 def initialize(detect_configuration_file = true) # RAILS_ROOT is at least defined in Caterpillar initialization if defined? RAILS_ROOT @rails_root = File.(RAILS_ROOT) end @servlet = nil @category = nil @instances = [] @javascripts = [] @include_all_named_routes = false if @rails_root rails_conf = File.join(@rails_root,'config','environment.rb') unless File.exists?(rails_conf) #STDERR.puts 'Rails configuration file could not be found' @rails_root = nil else @servlet = File.basename(@rails_root) @category = @servlet @warbler_conf = File.join(@rails_root,'config','warble.rb') unless File.exists?(@warbler_conf) #STDERR.puts 'Warbler configuration file could not be found' end end end yield self if block_given? end |
Instance Attribute Details
#_container ⇒ Object
Returns the value of attribute _container.
35 36 37 |
# File 'lib/caterpillar/config.rb', line 35 def _container @_container end |
#category ⇒ Object
Returns the value of attribute category.
17 18 19 |
# File 'lib/caterpillar/config.rb', line 17 def category @category end |
#edit_mode ⇒ Object
Returns the value of attribute edit_mode.
19 20 21 |
# File 'lib/caterpillar/config.rb', line 19 def edit_mode @edit_mode end |
#host ⇒ Object
Returns the value of attribute host.
27 28 29 |
# File 'lib/caterpillar/config.rb', line 27 def host @host end |
#include_all_named_routes ⇒ Object
Are all named routes used, or only the ones specifically defined in the config FILE?
15 16 17 |
# File 'lib/caterpillar/config.rb', line 15 def include_all_named_routes @include_all_named_routes end |
#instanceable ⇒ Object
Returns the value of attribute instanceable.
23 24 25 |
# File 'lib/caterpillar/config.rb', line 23 def instanceable @instanceable end |
#instances ⇒ Object
Returns the value of attribute instances.
31 32 33 |
# File 'lib/caterpillar/config.rb', line 31 def instances @instances end |
#javascripts ⇒ Object
Returns the value of attribute javascripts.
37 38 39 |
# File 'lib/caterpillar/config.rb', line 37 def javascripts @javascripts end |
#logger ⇒ Object
Returns the value of attribute logger.
43 44 45 |
# File 'lib/caterpillar/config.rb', line 43 def logger @logger end |
#preferences_route ⇒ Object
Returns the value of attribute preferences_route.
21 22 23 |
# File 'lib/caterpillar/config.rb', line 21 def preferences_route @preferences_route end |
#public_render_parameters ⇒ Object
Returns the value of attribute public_render_parameters.
25 26 27 |
# File 'lib/caterpillar/config.rb', line 25 def public_render_parameters @public_render_parameters end |
#rails_root ⇒ Object
Returns the value of attribute rails_root.
33 34 35 |
# File 'lib/caterpillar/config.rb', line 33 def rails_root @rails_root end |
#routes ⇒ Object
Returns the value of attribute routes.
39 40 41 |
# File 'lib/caterpillar/config.rb', line 39 def routes @routes end |
#servlet ⇒ Object
Returns the value of attribute servlet.
29 30 31 |
# File 'lib/caterpillar/config.rb', line 29 def servlet @servlet end |
#session_secret ⇒ Object
Returns the value of attribute session_secret.
45 46 47 |
# File 'lib/caterpillar/config.rb', line 45 def session_secret @session_secret end |
#warbler_conf ⇒ Object
Returns the value of attribute warbler_conf.
41 42 43 |
# File 'lib/caterpillar/config.rb', line 41 def warbler_conf @warbler_conf end |
Instance Method Details
#container ⇒ Object
The container class is used for parsing XML files.
Possible values: Caterpillar::Liferay (default using Tomcat)
83 84 85 86 |
# File 'lib/caterpillar/config.rb', line 83 def container return self._container if self._container self._container = Caterpillar::Liferay.new end |
#container=(_class) ⇒ Object
Accepts the configuration option, and instantates the container class.
89 90 91 |
# File 'lib/caterpillar/config.rb', line 89 def container=(_class) self._container = _class.new end |