Sha256: 8b3eab652763d850edede3f29ee3ca2173ea7f15e36b094d67ac12109715ecda
Contents?: true
Size: 1.25 KB
Versions: 13
Compression:
Stored size: 1.25 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
13 entries across 13 versions & 1 rubygems