Class: Gokdok::Dokker

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/gokdok.rb

Overview

Create a new object in your Rakefile to set up the tasks. See the initialize method for the options that you can pass in.

Gokdok::Dokker.new do |gd|
  gd.pages_home = 'gh-pages'
  gd.doc_home = 'doc'
  ...
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Dokker

Initialize the task. You may set the following properties in the init block:

git_path

Path to the git binary. If unset, a system call will be used to find the binary. This will likely work on Unix-like systems but fail on Windows.

doc_home

Path to the place where the RDoc documentation is created. Defaults to ‘html’

pages_home

Path were the repository with the gh-pages will be checked out to. Defaults to ‘.gh_pages’

remote_path

Path in the remote repository where the RDoc will end up. Defaults to ‘html’

repo_url

URL of the GIT repository that will be used. If unset, the Task will attempt to use the URL of the current “origin” branch.

rdoc_task

The task that will be called to create the documentation. Defaults to :rdoc

Yields:

  • (_self)

Yield Parameters:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gokdok.rb', line 35

def initialize
  yield(self) if(block_given?)
  
  @git_path ||= find_git_binary
  @repo_url ||= find_repo_url
  
  @doc_home ||= 'html'
  @pages_home ||= '.gh_pages'
  @remote_path ||= 'html'
  @rdoc_task ||= :rdoc
  
  @doc_home = File.expand_path(doc_home)
  @pages_home = File.expand_path(pages_home)
  @home_dir = File.expand_path('.')
  
  define
end

Instance Attribute Details

#doc_homeObject

Returns the value of attribute doc_home.



16
17
18
# File 'lib/gokdok.rb', line 16

def doc_home
  @doc_home
end

#git_pathObject

Returns the value of attribute git_path.



16
17
18
# File 'lib/gokdok.rb', line 16

def git_path
  @git_path
end

#pages_homeObject

Returns the value of attribute pages_home.



16
17
18
# File 'lib/gokdok.rb', line 16

def pages_home
  @pages_home
end

#rdoc_taskObject

Returns the value of attribute rdoc_task.



16
17
18
# File 'lib/gokdok.rb', line 16

def rdoc_task
  @rdoc_task
end

#remote_pathObject

Returns the value of attribute remote_path.



16
17
18
# File 'lib/gokdok.rb', line 16

def remote_path
  @remote_path
end

#repo_urlObject

Returns the value of attribute repo_url.



16
17
18
# File 'lib/gokdok.rb', line 16

def repo_url
  @repo_url
end