Class: DocSmoosher::Generators::Api
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- DocSmoosher::Generators::Api
- Includes:
- Thor::Actions
- Defined in:
- lib/doc_smoosher.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_api ⇒ Object
-
#done_message ⇒ Object
%w( resource parameter request ).each do |thing_name| define_method “#thing_name_folder” do template(File.join(TEMPLATES, “#thing_name.tt”), “#name/#thing_namething_name.pluralize/#thing_name_example.rb”) end end.
Class Method Details
.source_root ⇒ Object
117 118 119 |
# File 'lib/doc_smoosher.rb', line 117 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_api ⇒ Object
121 122 123 124 |
# File 'lib/doc_smoosher.rb', line 121 def create_api template(File.join(TEMPLATES, 'api.tt'), "#{name}/#{name}.rb") copy_file(File.join(TEMPLATES, 'Readme.md'), "#{name}/Readme.md") end |
#done_message ⇒ Object
%w( resource parameter request ).each do |thing_name|
define_method "#{thing_name}_folder" do
template(File.join(TEMPLATES, "#{thing_name}.tt"), "#{name}/#{thing_name.pluralize}/#{thing_name}_example.rb")
end
end
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/doc_smoosher.rb', line 132 def = <<MESSAGE Scaffolding all built and ready! You now need to edit the example files/folders to setup the shape of your API, so you can generate documentation around it magically. Thanks for using doc_smoosher. Now smoosh them APIs gurd. - Joran Kikke - @donkeyscience MESSAGE puts end |