Sha256: 94315026ccafb7425c4edbbf5793b80887c4be58600f241f87ba8b3a74baa57d

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

include RapiDoc::RapiConfig

desc "Generate the API Documentation"
task :rapi_doc do
  begin
    yml = YAML::load(File.open(config_file(:target)))
  rescue
    FileUtils.mkdir(config_dir) if (!File.directory?(config_dir))
    [config_file(:template), layout_file(:template)].each do |_file|
      FileUtils.cp _file, config_dir
      puts "Generated config/rapi_doc/#{File.basename(_file)}" # TODO Add instructions for users to update the config file
    end
  end

  # Generating documentations
  if yml
    resources = []
    yml.keys.each do |key|
      resources << RapiDoc::ResourceDoc.new(key, yml[key]["location"], yml[key]["controller_name"])
    end

    # generate the apidoc
    RapiDoc::RAPIDoc.new(resources)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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