class DocSmoosher::Generators::Api

Public Class Methods

source_root() click to toggle source
# File lib/doc_smoosher.rb, line 117
def self.source_root
  File.dirname(__FILE__)
end

Public Instance Methods

create_api() click to toggle source
# 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() click to toggle source

%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

# File lib/doc_smoosher.rb, line 132
      def done_message
        message = <<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 message
      end