Class: Nanoc3::Package

Included Modules

Singleton

Nanoc3::Package is a singleton that contains metadata about the nanoc project, which is used for packaging releases.

Public Visibility

Public Instance Method Summary

#extra_rdoc_files

The files that are not documented by RDoc by default, but should still be included in the documentation.

#files

The files to include in the package.

#files_documented_by_default

The files that are included in the documentation by default.

#files_in_documentation

The files that should be included in the documentation.

#files_not_in_documentation

The files that should not be included in the documentation.

#gem_spec

The Gem::Specification used for packaging.

#main_documentation_file

The name of the file that should be used as entry point for the documentation.

#name

The name of the application.

Public Instance Method Details

extra_rdoc_files

public extra_rdoc_files

The files that are not documented by RDoc by default, but should still be included in the documentation.

[View source]


46
47
48
# File 'lib/nanoc3/package.rb', line 46

def extra_rdoc_files
  files_in_documentation - files_documented_by_default
end

files

public files

The files to include in the package. This is also the list of files that will be included in the documentation (with the exception of the files in undocumented_files).

[View source]


21
22
23
24
25
26
# File 'lib/nanoc3/package.rb', line 21

def files
  @files ||= (%w( ChangeLog LICENSE NEWS.rdoc Rakefile README.rdoc ) +
    Dir['bin/**/*'] +
    Dir['lib/**/*'] +
    Dir['vendor/**/*']).reject { |f| File.directory?(f) }
end

files_documented_by_default

public files_documented_by_default

The files that are included in the documentation by default.

[View source]


29
30
31
# File 'lib/nanoc3/package.rb', line 29

def files_documented_by_default
  Dir['lib/**/*'].reject { |f| File.directory?(f) }
end

files_in_documentation

public files_in_documentation

The files that should be included in the documentation.

[View source]


40
41
42
# File 'lib/nanoc3/package.rb', line 40

def files_in_documentation
  files - files_not_in_documentation
end

files_not_in_documentation

public files_not_in_documentation

The files that should not be included in the documentation.

[View source]


34
35
36
37
# File 'lib/nanoc3/package.rb', line 34

def files_not_in_documentation
  Dir['lib/**/*.rake'] +
  Dir['vendor/**/*'].reject { |f| File.directory?(f) }
end

gem_spec

public gem_spec

The Gem::Specification used for packaging.

[View source]


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
84
85
86
87
88
89
90
# File 'lib/nanoc3/package.rb', line 57

def gem_spec
  @gem_spec ||= Gem::Specification.new do |s|
    s.name                  = self.name
    s.version               = Nanoc3::VERSION
    s.platform              = Gem::Platform::RUBY
    s.summary               = 'a tool that runs on your local computer ' +
                              'and compiles Markdown, Textile, Haml, ' +
                              '... documents into static web pages'
    s.description           = s.summary
    s.homepage              = 'http://nanoc.stoneship.org/'
    s.rubyforge_project     = 'nanoc3'

    s.author                = 'Denis Defreyne'
    s.                 = 'denis.defreyne@stoneship.org'

    s.post_install_message  = "------------------------------------------------------------------------------\nThanks for installing nanoc 3.0! Here are some resources to help you get started:\n\n* The tutorial at <http://nanoc.stoneship.org/help/tutorial/>\n* The manual at <http://nanoc.stoneship.org/help/manual/>\n* The discussion group at <http://groups.google.com/group/nanoc>\n\nBecause nanoc 3.0 has a lot of new features, be sure to check out the nanoc blog at <http://nanoc.stoneship.org/blog/> for details about this release.\n\nEnjoy!\n------------------------------------------------------------------------------\n"

    s.required_ruby_version = '>= 1.8.5'

    s.has_rdoc              = true
    s.extra_rdoc_files      = self.extra_rdoc_files
    s.rdoc_options          = []
    s.rdoc_options          += [ '--title', self.name                    ]
    s.rdoc_options          += [ '--main',  self.main_documentation_file ]
    self.files_not_in_documentation.each do |file|
      s.rdoc_options        += [ '--exclude', file ]
    end

    s.files                 = self.files
    s.executables           = [ 'nanoc3' ]
    s.require_path          = 'lib'
    s.bindir                = 'bin'
  end
end

main_documentation_file

public main_documentation_file

The name of the file that should be used as entry point for the documentation.

[View source]


52
53
54
# File 'lib/nanoc3/package.rb', line 52

def main_documentation_file
  'README.rdoc'
end

name

public name

The name of the application.

[View source]


14
15
16
# File 'lib/nanoc3/package.rb', line 14

def name
  'nanoc3'
end
Generated on Sunday, August 09 2009 at 01:43:11 PM by YARD 0.2.3.2 (ruby-1.8.7).