Class: Redmine::PluginPath
- Inherits:
-
Object
- Object
- Redmine::PluginPath
- Defined in:
- lib/redmine/plugin_loader.rb
Instance Attribute Summary collapse
-
#assets_dir ⇒ Object
readonly
Returns the value of attribute assets_dir.
-
#initializer ⇒ Object
readonly
Returns the value of attribute initializer.
Instance Method Summary collapse
- #has_assets_dir? ⇒ Boolean
- #has_initializer? ⇒ Boolean
-
#initialize(dir) ⇒ PluginPath
constructor
A new instance of PluginPath.
- #run_initializer ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(dir) ⇒ PluginPath
Returns a new instance of PluginPath.
24 25 26 27 28 |
# File 'lib/redmine/plugin_loader.rb', line 24 def initialize(dir) @dir = dir @assets_dir = File.join dir, 'assets' @initializer = File.join dir, 'init.rb' end |
Instance Attribute Details
#assets_dir ⇒ Object (readonly)
Returns the value of attribute assets_dir.
22 23 24 |
# File 'lib/redmine/plugin_loader.rb', line 22 def assets_dir @assets_dir end |
#initializer ⇒ Object (readonly)
Returns the value of attribute initializer.
22 23 24 |
# File 'lib/redmine/plugin_loader.rb', line 22 def initializer @initializer end |
Instance Method Details
#has_assets_dir? ⇒ Boolean
38 39 40 |
# File 'lib/redmine/plugin_loader.rb', line 38 def has_assets_dir? File.directory?(@assets_dir) end |
#has_initializer? ⇒ Boolean
42 43 44 |
# File 'lib/redmine/plugin_loader.rb', line 42 def has_initializer? File.file?(@initializer) end |
#run_initializer ⇒ Object
30 31 32 |
# File 'lib/redmine/plugin_loader.rb', line 30 def run_initializer load initializer if has_initializer? end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/redmine/plugin_loader.rb', line 34 def to_s @dir end |