Class: Anvil::Configuration
- Inherits:
-
Object
- Object
- Anvil::Configuration
- Defined in:
- lib/initializer.rb
Instance Attribute Summary collapse
-
#controller_path ⇒ Object
Returns the value of attribute controller_path.
-
#framework_root_path ⇒ Object
Default framework root path.
-
#frameworks ⇒ Object
Returns the value of attribute frameworks.
-
#load_paths ⇒ Object
Returns the value of attribute load_paths.
-
#model_path ⇒ Object
Returns the value of attribute model_path.
-
#root_path ⇒ Object
readonly
Root path of the application.
-
#view_path ⇒ Object
Returns the value of attribute view_path.
Instance Method Summary collapse
-
#default_application_load_paths ⇒ Object
Default application load paths.
-
#default_controller_path ⇒ Object
Default controller files load path.
-
#default_frameworks ⇒ Object
Default frameworks loaded into anvil applications.
-
#default_model_path ⇒ Object
Default model files load path.
-
#default_view_path ⇒ Object
Default view files load path.
-
#framework_load_paths ⇒ Object
Framework load paths.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
62 63 64 65 66 67 68 |
# File 'lib/initializer.rb', line 62 def initialize self.load_paths = default_application_load_paths self.frameworks = default_frameworks self.controller_path = default_controller_path self.model_path = default_model_path self.view_path = default_view_path end |
Instance Attribute Details
#controller_path ⇒ Object
Returns the value of attribute controller_path.
57 58 59 |
# File 'lib/initializer.rb', line 57 def controller_path @controller_path end |
#framework_root_path ⇒ Object
Default framework root path. This can be changed in configuration.
107 108 109 |
# File 'lib/initializer.rb', line 107 def framework_root_path @framework_root_path end |
#frameworks ⇒ Object
Returns the value of attribute frameworks.
60 61 62 |
# File 'lib/initializer.rb', line 60 def frameworks @frameworks end |
#load_paths ⇒ Object
Returns the value of attribute load_paths.
55 56 57 |
# File 'lib/initializer.rb', line 55 def load_paths @load_paths end |
#model_path ⇒ Object
Returns the value of attribute model_path.
58 59 60 |
# File 'lib/initializer.rb', line 58 def model_path @model_path end |
#root_path ⇒ Object (readonly)
Root path of the application.
112 113 114 |
# File 'lib/initializer.rb', line 112 def root_path @root_path end |
#view_path ⇒ Object
Returns the value of attribute view_path.
59 60 61 |
# File 'lib/initializer.rb', line 59 def view_path @view_path end |
Instance Method Details
#default_application_load_paths ⇒ Object
Default application load paths. This can be added onto in configuration.
84 85 86 87 88 89 |
# File 'lib/initializer.rb', line 84 def default_application_load_paths %w( app config ).map{|dir| "#{root_path}/#{dir}"}.select{|dir| File.directory?(dir)} end |
#default_controller_path ⇒ Object
Default controller files load path. This can be changed in configuration.
92 93 94 |
# File 'lib/initializer.rb', line 92 def default_controller_path @controller_path ||= File.join(root_path, 'app', 'controllers') end |
#default_frameworks ⇒ Object
Default frameworks loaded into anvil applications. Default is widget_wrapper.
71 72 73 |
# File 'lib/initializer.rb', line 71 def default_frameworks [ :widget_wrapper ] end |
#default_model_path ⇒ Object
Default model files load path. This can be changed in configuration.
97 98 99 |
# File 'lib/initializer.rb', line 97 def default_model_path @model_path ||= File.join(root_path, 'app', 'models') end |
#default_view_path ⇒ Object
Default view files load path. This can be changed in configuration.
102 103 104 |
# File 'lib/initializer.rb', line 102 def default_view_path @view_path ||= File.join(root_path, 'app', 'views') end |
#framework_load_paths ⇒ Object
Framework load paths
76 77 78 79 80 81 |
# File 'lib/initializer.rb', line 76 def framework_load_paths %w( anvilties widget_wrapper ).map{|dir| "#{framework_root_path}/#{dir}"}.select{|dir| File.directory?(dir)} end |