Sha256: cf67cf28bc0cd76b272485699f52428a39658fd3dc0475f6cf54ef580223e00d
Contents?: true
Size: 1.24 KB
Versions: 17
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true ############################################################################## # Documentation ############################################################################## namespace :documentation do namespace :api do desc 'Generate API documentation markdown' task :blueprint do require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:api_docs) do |t| t.pattern = 'spec/controllers/**/v1/**/*_spec.rb' t.rspec_opts = '--format="Dox::Formatter" --out="./docs/api/index.apib" --order="defined" --tag="dox"' end Rake::Task['api_docs'].invoke end task :json => :blueprint do `apib2swagger --input='./docs/api/index.apib' --output='./docs/api/index.json'` end task :yaml => :blueprint do `apib2swagger --yaml --input='./docs/api/index.apib' --output='./docs/api/index.yaml'` end task :html => :json do `redoc-cli bundle --output='./docs/api/index.html' './docs/api/index.json'` end task :preview => :html do `open './docs/api/index.html'` end task :publish => :blueprint do `apiary publish --path='./docs/api/apispec.apib' --api-name='#{Rails.application.name}'` end end end
Version data entries
17 entries across 17 versions & 1 rubygems