Sha256: 5422ab459dbbfb7d15c9dd8961fa01626437022dd93250fb86b19596d6c3d4ab

Contents?: true

Size: 500 Bytes

Versions: 4

Compression:

Stored size: 500 Bytes

Contents

namespace :ga do
  desc 'Produce documentation'
  task docs: :environment do
    api = ENV['API'] || ARGV[1]
    raise 'You must provide the name of an API to document' if api.nil?
    begin
      api_class = Object.const_get(api)
      api_docs = GrapeApiary::Blueprint.new(api_class).generate
      output_file = 'docs/grape-apiary.md'
      File.open(output_file, 'w') { |file| file.write(api_docs) }
    rescue NameError
      raise "#{api} has not been defined as a Grape API"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grape-apiary-1.0.0 lib/grape-apiary/tasks/grape-apiary.rake
grape-apiary-0.2.0 lib/grape-apiary/tasks/grape-apiary.rake
grape-apiary-0.1.2 lib/grape-apiary/tasks/grape-apiary.rake
grape-apiary-0.1.1 lib/grape-apiary/tasks/grape-apiary.rake