Class: RakeTasks::Doc

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_tasks/doc.rb

Overview

This class will handle documentation utilities.

Instance Method Summary collapse

Constructor Details

#initialize(gem_info = RakeTasks::Gem) ⇒ Doc

Constructor.



38
39
40
41
42
43
# File 'lib/rake_tasks/doc.rb', line 38

def initialize(gem_info = RakeTasks::Gem)
  @gem_spec = gem_info.gem_spec
  @gem_title = gem_info.gem_title(@gem_spec)
  @license_path = 'license'
  @contents = nil
end

Instance Method Details

#readme_contentsObject

The default contents for a readme file.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/rake_tasks/doc.rb', line 46

def readme_contents
  gem_title = @gem_title
  gem_spec = @gem_spec

  @contents ||= %Q{
#{header :h1, "Welcome to #{gem_title}"}

#{gem_spec.description}

#{header :h2, 'Getting Started'}

Install #{gem_title} at the command prompt if you haven't yet:

$ gem install #{gem_spec.name}

Require the gem in your Gemfile:

gem '#{gem_spec.name}', '~> #{gem_spec.version}'

Require the gem wherever you need to use it:

require '#{gem_spec.name}'

#{header :h2, 'Usage'}

TODO

#{header :h2, 'Additional Notes'}

TODO

#{header :h2, 'Additional Documentation'}

$ rake rdoc:app
#{license_details}}.strip

  return @contents.split("\n")
end