Class: Ruber::PluginSpecification
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Ruber::PluginSpecification
- Defined in:
- lib/ruber/plugin_specification.rb
Defined Under Namespace
Classes: PSFError
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
Class Method Summary collapse
Instance Method Summary collapse
- #complete_processing ⇒ Object
- #has_config_options? ⇒ Boolean
- #has_config_widgets? ⇒ Boolean
- #has_extensions? ⇒ Boolean
- #has_project_options? ⇒ Boolean
- #has_project_widgets? ⇒ Boolean
- #has_tool_widgets? ⇒ Boolean
-
#initialize(arg, dir = nil) ⇒ PluginSpecification
constructor
A new instance of PluginSpecification.
- #intro_only? ⇒ Boolean
Constructor Details
#initialize(arg, dir = nil) ⇒ PluginSpecification
Returns a new instance of PluginSpecification.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ruber/plugin_specification.rb', line 47 def initialize arg, dir = nil super() @directory = if dir then dir elsif arg.is_a? String then File.dirname arg else File. Dir.pwd end @intro_only = true @reader = PluginSpecificationReader.new self @data = arg.is_a?(Hash) ? arg : YAML.load( File.read(arg) ) @reader.process_pdf_intro @data end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
46 47 48 |
# File 'lib/ruber/plugin_specification.rb', line 46 def directory @directory end |
Class Method Details
.full(file, dir = nil) ⇒ Object
40 41 42 43 44 |
# File 'lib/ruber/plugin_specification.rb', line 40 def self.full file, dir = nil res = self.new file, dir res.complete_processing res end |
Instance Method Details
#complete_processing ⇒ Object
99 100 101 102 |
# File 'lib/ruber/plugin_specification.rb', line 99 def complete_processing @reader.process_pdf @data @intro_only = false end |
#has_config_options? ⇒ Boolean
63 64 65 66 67 |
# File 'lib/ruber/plugin_specification.rb', line 63 def raise "Ruber::PluginSpecification#has_config_options? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !.empty? end |
#has_config_widgets? ⇒ Boolean
75 76 77 78 79 |
# File 'lib/ruber/plugin_specification.rb', line 75 def raise "Ruber::PluginSpecification#has_config_widgets? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !.empty? end |
#has_extensions? ⇒ Boolean
93 94 95 96 97 |
# File 'lib/ruber/plugin_specification.rb', line 93 def has_extensions? raise "Ruber::PluginSpecification#has_extensions? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !extensions.empty? end |
#has_project_options? ⇒ Boolean
81 82 83 84 85 |
# File 'lib/ruber/plugin_specification.rb', line 81 def raise "Ruber::PluginSpecification#has_project_options? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !.empty? end |
#has_project_widgets? ⇒ Boolean
87 88 89 90 91 |
# File 'lib/ruber/plugin_specification.rb', line 87 def raise "Ruber::PluginSpecification#has_project_widgets? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !.empty? end |
#has_tool_widgets? ⇒ Boolean
69 70 71 72 73 |
# File 'lib/ruber/plugin_specification.rb', line 69 def raise "Ruber::PluginSpecification#has_tool_widgets? can only be called on a full "\ "Ruber::PluginSpecification" if @intro_only !.empty? end |
#intro_only? ⇒ Boolean
59 60 61 |
# File 'lib/ruber/plugin_specification.rb', line 59 def intro_only? @intro_only end |