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
The files that are not documented by RDoc by default, but should still be included in the documentation.
46 47 48 |
# File 'lib/nanoc3/package.rb', line 46 def extra_rdoc_files files_in_documentation - files_documented_by_default end |
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).
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
The files that are included in the documentation by default.
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
The files that should be included in the documentation.
40 41 42 |
# File 'lib/nanoc3/package.rb', line 40 def files_in_documentation files - files_not_in_documentation end |
files_not_in_documentation
The files that should not be included in the documentation.
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
The Gem::Specification used for packaging.
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. = 'Denis Defreyne' s.email = 'denis.defreyne@stoneship.org' s. = "------------------------------------------------------------------------------\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. = [] s. += [ '--title', self.name ] s. += [ '--main', self.main_documentation_file ] self.files_not_in_documentation.each do |file| s. += [ '--exclude', file ] end s.files = self.files s.executables = [ 'nanoc3' ] s.require_path = 'lib' s.bindir = 'bin' end end |
main_documentation_file
The name of the file that should be used as entry point for the documentation.
52 53 54 |
# File 'lib/nanoc3/package.rb', line 52 def main_documentation_file 'README.rdoc' end |
name
The name of the application.
14 15 16 |
# File 'lib/nanoc3/package.rb', line 14 def name 'nanoc3' end |