Class: ApiSketch::Generators::Base
- Inherits:
-
Object
- Object
- ApiSketch::Generators::Base
- Defined in:
- lib/api_sketch/generators/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#definitions_dir ⇒ Object
Returns the value of attribute definitions_dir.
-
#documentation_dir ⇒ Object
Returns the value of attribute documentation_dir.
-
#templates_folder ⇒ Object
readonly
Returns the value of attribute templates_folder.
Instance Method Summary collapse
- #generate! ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
TODO: Add here some validations for folders existance, etc.
Constructor Details
#initialize(options = {}) ⇒ Base
TODO: Add here some validations for folders existance, etc
9 10 11 12 13 |
# File 'lib/api_sketch/generators/base.rb', line 9 def initialize( = {}) self.definitions_dir = [:definitions_dir] self.documentation_dir = [:documentation_dir] @templates_folder = File.("../templates/#{self.class.name.split("::").last.downcase}", File.dirname(__FILE__)) end |
Instance Attribute Details
#definitions_dir ⇒ Object
Returns the value of attribute definitions_dir.
4 5 6 |
# File 'lib/api_sketch/generators/base.rb', line 4 def definitions_dir @definitions_dir end |
#documentation_dir ⇒ Object
Returns the value of attribute documentation_dir.
4 5 6 |
# File 'lib/api_sketch/generators/base.rb', line 4 def documentation_dir @documentation_dir end |
#templates_folder ⇒ Object (readonly)
Returns the value of attribute templates_folder.
6 7 8 |
# File 'lib/api_sketch/generators/base.rb', line 6 def templates_folder @templates_folder end |
Instance Method Details
#generate! ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/api_sketch/generators/base.rb', line 15 def generate! puts_info("Load definitions") load_definitions puts_info("Create documentation directory") puts_info("\t path: #{self.documentation_dir}") create_documentation_directory puts_info("Create documentation files") create_documentation_files end |