Class: Ocs::Document::Generator
- Inherits:
-
Object
- Object
- Ocs::Document::Generator
- Defined in:
- lib/ocs/document/generator.rb
Class Method Summary collapse
- .documents_path ⇒ Object
- .library_path ⇒ Object
- .ocs_path ⇒ Object
- .patches_path ⇒ Object
- .resource_paths ⇒ Object
- .resources_path ⇒ Object
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
37 38 39 |
# File 'lib/ocs/document/generator.rb', line 37 def initialize end |
Class Method Details
.documents_path ⇒ Object
12 13 14 |
# File 'lib/ocs/document/generator.rb', line 12 def documents_path File.("../../../../docs", __FILE__) end |
.library_path ⇒ Object
16 17 18 |
# File 'lib/ocs/document/generator.rb', line 16 def library_path File.("../../../", __FILE__) end |
.ocs_path ⇒ Object
20 21 22 |
# File 'lib/ocs/document/generator.rb', line 20 def ocs_path File.join(library_path, "ocs") end |
.patches_path ⇒ Object
24 25 26 |
# File 'lib/ocs/document/generator.rb', line 24 def patches_path File.join(ocs_path, "document/patches") end |
.resource_paths ⇒ Object
32 33 34 |
# File 'lib/ocs/document/generator.rb', line 32 def resource_paths Dir[File.join(resources_path, "*.rb")] end |
.resources_path ⇒ Object
28 29 30 |
# File 'lib/ocs/document/generator.rb', line 28 def resources_path File.join(ocs_path, "resources") end |
Instance Method Details
#generate ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ocs/document/generator.rb', line 41 def generate require "ocs/errors" Patches.patch("ocs/resources/base") self.class.resource_paths.each do |resource| name = resource.sub(/^.+\//, "").sub(/\.rb$/, "").camelize self.class.resources[name] = {} require resource end output end |