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)
-
- (Object) directory
readonly
Returns the value of attribute directory.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) complete_processing
- - (Boolean) has_config_options?
- - (Boolean) has_config_widgets?
- - (Boolean) has_extensions?
- - (Boolean) has_project_options?
- - (Boolean) has_project_widgets?
- - (Boolean) has_tool_widgets?
-
- (PluginSpecification) initialize(arg, dir = nil)
constructor
A new instance of PluginSpecification.
- - (Boolean) intro_only?
Constructor Details
- (PluginSpecification) initialize(arg, dir = nil)
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
- (Object) directory (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
+ (Object) full(file, dir = nil)
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
- (Object) complete_processing
99 100 101 102 |
# File 'lib/ruber/plugin_specification.rb', line 99 def complete_processing @reader.process_pdf @data @intro_only = false end |
- (Boolean) has_config_options?
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 |
- (Boolean) has_config_widgets?
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 |
- (Boolean) has_extensions?
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 |
- (Boolean) has_project_options?
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 |
- (Boolean) has_project_widgets?
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 |
- (Boolean) has_tool_widgets?
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 |
- (Boolean) intro_only?
59 60 61 |
# File 'lib/ruber/plugin_specification.rb', line 59 def intro_only? @intro_only end |