goshippo/shippo-ruby-client

View on GitHub
lib/shippo/tasks/shippo.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'yard'
require 'yard/rake/yardoc_task'
require 'rake/application'
require 'fileutils'
# Main namespace for Shippo specific Rake tasks

module Shippo
  DOC_FOLDER = 'doc'
end

YARD::Rake::YardocTask.new do |t|
  t.files = %w(lib/**/*.rb - README.md CHANGELOG.md)
end

namespace :doc do
  desc 'Generate API documentation and preview in browser'
  task :read do
    FileUtils.rm_rf([::Shippo::DOC_FOLDER])
    Rake.application.invoke_task('yard')
    Kernel.system("open #{::Shippo::DOC_FOLDER}/index.html")
  end
end