Class: Yard::GHPages::Tasks

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/yard-ghpages.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.install_tasks(opts = {}) ⇒ Object



12
13
14
# File 'lib/yard-ghpages.rb', line 12

def install_tasks(opts = {})
  new.install(opts)
end

Instance Method Details

#install(opts) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/yard-ghpages.rb', line 17

def install(opts)
  namespace :yard do
    desc 'Build yard documentation'
    task :build do |t|
      YARD::CLI::Yardoc.run(*opts)
    end

    desc 'Publish documentation to gh-pages'
    task :publish do |t|
      Yard::GHPages::BranchMerger.new do |g|
        g.source = { branch: 'master', directory: 'doc' }
        g.destination = { branch: 'gh-pages'}
        g.message = 'Updated website' # defaults to 'Updated files.'
      end.merge.push
    end
  end
end