Class: PluginManager::PluginDefinition
- Inherits:
-
Object
- Object
- PluginManager::PluginDefinition
- Defined in:
- lib/plugin_manager/plugin_definition.rb
Instance Attribute Summary collapse
-
#definition_file ⇒ Object
Returns the value of attribute definition_file.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object_string ⇒ Object
Returns the value of attribute object_string.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #dependencies ⇒ Object
- #inspect ⇒ Object
- #inspect1 ⇒ Object
- #load ⇒ Object
- #load_time ⇒ Object
- #object ⇒ Object
- #required_files ⇒ Object
Instance Attribute Details
#definition_file ⇒ Object
Returns the value of attribute definition_file.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def definition_file @definition_file end |
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def name @name end |
#object_string ⇒ Object
Returns the value of attribute object_string.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def object_string @object_string end |
#resources ⇒ Object
Returns the value of attribute resources.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def resources @resources end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/plugin_manager/plugin_definition.rb', line 4 def version @version end |
Instance Method Details
#dependencies ⇒ Object
27 28 29 |
# File 'lib/plugin_manager/plugin_definition.rb', line 27 def dependencies @dependencies ||= [] end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/plugin_manager/plugin_definition.rb', line 15 def inspect inspect1 end |
#inspect1 ⇒ Object
11 12 13 |
# File 'lib/plugin_manager/plugin_definition.rb', line 11 def inspect1 "<Plugin #{name} #{version} depends:#{dependencies.inspect} #{required_files.length} files>" end |
#load ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/plugin_manager/plugin_definition.rb', line 35 def load s = Time.now required_files.each {|file| $".delete(file) } load_file = File.(File.join(File.dirname(definition_file), file)) $:.unshift(File.dirname(load_file)) new_files = log_requires do require load_file end required_files.unshift(*new_files) if object.respond_to?(:loaded) object.loaded end @load_time = Time.now - s end |
#load_time ⇒ Object
31 32 33 |
# File 'lib/plugin_manager/plugin_definition.rb', line 31 def load_time @load_time end |
#object ⇒ Object
50 51 52 |
# File 'lib/plugin_manager/plugin_definition.rb', line 50 def object eval(object_string) end |
#required_files ⇒ Object
23 24 25 |
# File 'lib/plugin_manager/plugin_definition.rb', line 23 def required_files @required_files ||= [] end |