Sha256: a0875f902f299cab435a9663311d8617b60c2916e6359f13112e32bdf2854371

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

include RapiDoc::RAPIDoc

namespace :rapi_doc do

  desc "Generate the config files"
  task :setup do
    create_structure!
    #puts "Now specify controllers in config/rapi_doc/config.yml for which api documentation is to be generated and then run rapi_doc::generate"
  end

  desc "Generate the api documentation"
  task :generate do
    resources = get_resources! do |controller, controller_url, controller_location|
      print "Generate documentation for resource \"#{controller}\" mapped at \"#{controller_url}\" (\"#{File.basename(controller_location)}\")? (Y/n):"
      response = STDIN.gets.chomp
      ['y', 'Y'].include? response
    end
    if resources.empty?
      puts "Nothing to generate"
      #puts "Please specify controllers in config/rapi_doc/config.yml for which api documentation is to be generated and then run rapi_doc::generate again"
    else
      # generate the apidoc
      puts "Generating API documentation..."
      generate_templates!(resources)
      move_structure!
      puts "Finished."
    end
  end

  desc "Clean up generated documentation"
  task :clean do
    remove_structure!
  end

  desc "Clean up everything - generated documentation and all the config"
  task :distclean do
    remove_all!
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rapi_doc-0.4.0 lib/rapi_doc/tasks/rapi_doc_tasks.rake