doc/index.xhtml in inochi-0.1.0 vs doc/index.xhtml in inochi-0.2.0
- old
+ new
@@ -12,15 +12,15 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="generator" content="ERBook 6.0.1"/>
- <title>Inochi 0.1.0</title>
+ <title>Inochi 0.2.0</title>
<meta name="author" content="Suraj N. Kurapati"/>
- <meta name="date" content="19 January 2009"/>
+ <meta name="date" content="25 January 2009"/>
<link rel="alternate" type="application/rss+xml" href="http://snk.tuxfamily.org/lib/inochi/ann.xml"/>
<style type="text/css" media="all">
<![CDATA[/* general */
@@ -640,17 +640,17 @@
<div id="header">
<div class="logo"><img src='inochi.png' alt='project logo' /></div>
- <h1 class="title">Inochi 0.1.0</h1>
+ <h1 class="title">Inochi 0.2.0</h1>
<h2 class="subtitle">Gives life to RubyGems-based software</h2>
<h3 class="authors"><a href="mailto:sunaku@gmail.com">Suraj N. Kurapati</a></h3>
- <h3 class="date">19 January 2009</h3>
+ <h3 class="date">25 January 2009</h3>
</div>
@@ -661,11 +661,11 @@
<div id="toc">
<a name="Contents"/><div class="nav" id="Contents"><a title="Reverse jump to listing" href="#rev:Contents">≡</a>△▽<a title="Jump to this segment" href="#Contents">◎</a></div>
<h1 class="title">Contents</h1>
<ul>
- <li>1 <a id="rev:Introduction" href="#Introduction">Introduction</a><ul><li><a id="rev:Etymology" href="#Etymology">Etymology</a></li><li>1.1 <a id="rev:Logistics" href="#Logistics">Logistics</a><ul><li><a id="rev:Version-numbers" href="#Version-numbers">Version numbers</a></li></ul></li><li>1.2 <a id="rev:License" href="#License">License</a></li><li>1.3 <a id="rev:Credits" href="#Credits">Credits</a></li></ul></li><li>2 <a id="rev:Setup" href="#Setup">Setup</a><ul><li>2.1 <a id="rev:Requirements" href="#Requirements">Requirements</a></li><li>2.2 <a id="rev:Installation" href="#Installation">Installation</a></li><li>2.3 <a id="rev:Manifest" href="#Manifest">Manifest</a></li></ul></li><li>3 <a id="rev:Usage" href="#Usage">Usage</a><ul><li>3.1 <a id="rev:Command-line-interface" href="#Command-line-interface">Command-line interface</a></li><li>3.2 <a id="rev:Ruby-library-interface" href="#Ruby-library-interface">Ruby library interface</a></li><li>3.3 <a id="rev:Tutorial" href="#Tutorial">Tutorial</a><ul><li>3.3.1 <a id="rev:Have-a-brilliant-idea" href="#Have-a-brilliant-idea">Have a brilliant idea</a></li><li>3.3.2 <a id="rev:Generate-your-project" href="#Generate-your-project">Generate your project</a></li><li>3.3.3 <a id="rev:Configure-your-project" href="#Configure-your-project">Configure your project</a><ul><li>3.3.3.1 <a id="rev:Project-information" href="#Project-information">Project information</a></li><li>3.3.3.2 <a id="rev:Project-executable" href="#Project-executable">Project executable</a></li><li>3.3.3.3 <a id="rev:Rake-tasks" href="#Rake-tasks">Rake tasks</a></li><li>3.3.3.4 <a id="rev:User-manual" href="#User-manual">User manual</a><ul><li><a id="rev:doc-index.erb" href="#doc-index.erb"><tt>doc/index.erb</tt></a></li><li><a id="rev:doc-intro.erb" href="#doc-intro.erb"><tt>doc/intro.erb</tt></a></li><li><a id="rev:doc-setup.erb" href="#doc-setup.erb"><tt>doc/setup.erb</tt></a></li><li><a id="rev:doc-theory.erb" href="#doc-theory.erb"><tt>doc/theory.erb</tt></a></li><li><a id="rev:doc-usage.erb" href="#doc-usage.erb"><tt>doc/usage.erb</tt></a></li><li><a id="rev:doc-history.erb" href="#doc-history.erb"><tt>doc/history.erb</tt></a></li></ul></li></ul></li><li>3.3.4 <a id="rev:Implement-your-project" href="#Implement-your-project">Implement your project</a><ul><li><a id="rev:Goodbye-LOAD_PATH-hello-require" href="#Goodbye-LOAD_PATH-hello-require">Goodbye <code class="code"><span style="color:#d70;font-weight:bold">$LOAD_PATH</span></code>, hello <code class="code">require()</code></a></li></ul></li><li>3.3.5 <a id="rev:Test-your-project" href="#Test-your-project">Test your project</a></li><li>3.3.6 <a id="rev:Publish-your-project" href="#Publish-your-project">Publish your project</a><ul><li>3.3.6.1 <a id="rev:Build-a-RubyGem" href="#Build-a-RubyGem">Build a RubyGem</a></li><li>3.3.6.2 <a id="rev:Publish-a-RubyGem" href="#Publish-a-RubyGem">Publish a RubyGem</a></li><li>3.3.6.3 <a id="rev:Announce-a-release" href="#Announce-a-release">Announce a release</a><ul><li><a id="rev:Login-information" href="#Login-information">Login information</a></li><li>3.3.6.3.1 <a id="rev:Manual-release-announcement" href="#Manual-release-announcement">Manual release announcement</a></li></ul></li><li>3.3.6.4 <a id="rev:Publish-the-documentation" href="#Publish-the-documentation">Publish the documentation</a></li></ul></li></ul></li></ul></li><li>4 <a id="rev:history" href="#history">History</a><ul><li>4.1 <a id="rev:Version-0.1.0-2009-01-13" href="#Version-0.1.0-2009-01-13">Version 0.1.0 (2009-01-13)</a><ul><li><a id="rev:New-features" href="#New-features">New features</a></li><li><a id="rev:Bug-fixes" href="#Bug-fixes">Bug fixes</a></li></ul></li><li>4.1 <a id="rev:Version-0.0.1-2009-01-13" href="#Version-0.0.1-2009-01-13">Version 0.0.1 (2009-01-13)</a><ul><li><a id="rev:Contributor-kudos" href="#Contributor-kudos">Contributor kudos</a></li><li><a id="rev:Bug-fixes-608680498" href="#Bug-fixes-608680498">Bug fixes</a></li><li><a id="rev:Housekeeping" href="#Housekeeping">Housekeeping</a></li></ul></li><li>4.1 <a id="rev:Version-0.0.0-2009-01-13" href="#Version-0.0.0-2009-01-13">Version 0.0.0 (2009-01-13)</a></li></ul></li>
+ <li>1 <a id="rev:Introduction" href="#Introduction">Introduction</a><ul><li><a id="rev:Etymology" href="#Etymology">Etymology</a></li><li>1.1 <a id="rev:Logistics" href="#Logistics">Logistics</a><ul><li><a id="rev:Version-numbers" href="#Version-numbers">Version numbers</a></li></ul></li><li>1.2 <a id="rev:License" href="#License">License</a></li><li>1.3 <a id="rev:Credits" href="#Credits">Credits</a></li></ul></li><li>2 <a id="rev:Setup" href="#Setup">Setup</a><ul><li>2.1 <a id="rev:Requirements" href="#Requirements">Requirements</a></li><li>2.2 <a id="rev:Installation" href="#Installation">Installation</a></li><li>2.3 <a id="rev:Manifest" href="#Manifest">Manifest</a></li></ul></li><li>3 <a id="rev:Usage" href="#Usage">Usage</a><ul><li>3.1 <a id="rev:Command-line-interface" href="#Command-line-interface">Command-line interface</a></li><li>3.2 <a id="rev:Ruby-library-interface" href="#Ruby-library-interface">Ruby library interface</a></li><li>3.3 <a id="rev:Tutorial" href="#Tutorial">Tutorial</a><ul><li>3.3.1 <a id="rev:Have-a-brilliant-idea" href="#Have-a-brilliant-idea">Have a brilliant idea</a></li><li>3.3.2 <a id="rev:Generate-your-project" href="#Generate-your-project">Generate your project</a><ul><li><a id="rev:View-Rake-tasks" href="#View-Rake-tasks">View Rake tasks</a></li><li><a id="rev:Run-unit-tests" href="#Run-unit-tests">Run unit tests</a></li><li><a id="rev:Run-project-executable" href="#Run-project-executable">Run project executable</a></li><li><a id="rev:Show-user-manual" href="#Show-user-manual">Show user manual</a></li></ul></li><li>3.3.3 <a id="rev:Configure-your-project" href="#Configure-your-project">Configure your project</a><ul><li>3.3.3.1 <a id="rev:Project-information" href="#Project-information">Project information</a></li><li>3.3.3.2 <a id="rev:Project-executable" href="#Project-executable">Project executable</a></li><li>3.3.3.3 <a id="rev:Rake-tasks" href="#Rake-tasks">Rake tasks</a></li><li>3.3.3.4 <a id="rev:User-manual" href="#User-manual">User manual</a><ul><li><a id="rev:doc-index.erb" href="#doc-index.erb"><tt>doc/index.erb</tt></a></li><li><a id="rev:doc-intro.erb" href="#doc-intro.erb"><tt>doc/intro.erb</tt></a></li><li><a id="rev:doc-setup.erb" href="#doc-setup.erb"><tt>doc/setup.erb</tt></a></li><li><a id="rev:doc-theory.erb" href="#doc-theory.erb"><tt>doc/theory.erb</tt></a></li><li><a id="rev:doc-usage.erb" href="#doc-usage.erb"><tt>doc/usage.erb</tt></a></li><li><a id="rev:doc-history.erb" href="#doc-history.erb"><tt>doc/history.erb</tt></a></li></ul></li></ul></li><li>3.3.4 <a id="rev:Implement-your-project" href="#Implement-your-project">Implement your project</a><ul><li><a id="rev:Goodbye-LOAD_PATH-hello-require" href="#Goodbye-LOAD_PATH-hello-require">Goodbye <code class="code"><span style="color:#d70;font-weight:bold">$LOAD_PATH</span></code>, hello <code class="code">require()</code></a></li></ul></li><li>3.3.5 <a id="rev:Test-your-project" href="#Test-your-project">Test your project</a><ul><li><a id="rev:Units-and-tests" href="#Units-and-tests">Units and tests</a></li><li><a id="rev:Test-execution" href="#Test-execution">Test execution</a></li><li><a id="rev:Helper-libraries" href="#Helper-libraries">Helper libraries</a></li></ul></li><li>3.3.6 <a id="rev:Publish-your-project" href="#Publish-your-project">Publish your project</a><ul><li>3.3.6.1 <a id="rev:Build-a-RubyGem" href="#Build-a-RubyGem">Build a RubyGem</a></li><li>3.3.6.2 <a id="rev:Publish-a-RubyGem" href="#Publish-a-RubyGem">Publish a RubyGem</a></li><li>3.3.6.3 <a id="rev:Announce-a-release" href="#Announce-a-release">Announce a release</a><ul><li><a id="rev:Login-information" href="#Login-information">Login information</a></li><li>3.3.6.3.1 <a id="rev:Manual-release-announcement" href="#Manual-release-announcement">Manual release announcement</a></li></ul></li><li>3.3.6.4 <a id="rev:Publish-the-documentation" href="#Publish-the-documentation">Publish the documentation</a></li></ul></li></ul></li></ul></li><li>4 <a id="rev:history" href="#history">History</a><ul><li>4.1 <a id="rev:Version-0.2.0-2009-01-25" href="#Version-0.2.0-2009-01-25">Version 0.2.0 (2009-01-25)</a><ul><li><a id="rev:Contributor-kudos" href="#Contributor-kudos">Contributor kudos</a></li><li><a id="rev:New-features" href="#New-features">New features</a></li><li><a id="rev:Bug-fixes" href="#Bug-fixes">Bug fixes</a></li><li><a id="rev:Housekeeping" href="#Housekeeping">Housekeeping</a></li></ul></li><li>4.1 <a id="rev:Version-0.1.0-2009-01-13" href="#Version-0.1.0-2009-01-13">Version 0.1.0 (2009-01-13)</a><ul><li><a id="rev:New-features-608879868" href="#New-features-608879868">New features</a></li><li><a id="rev:Bug-fixes-608886358" href="#Bug-fixes-608886358">Bug fixes</a></li></ul></li><li>4.1 <a id="rev:Version-0.0.1-2009-01-13" href="#Version-0.0.1-2009-01-13">Version 0.0.1 (2009-01-13)</a><ul><li><a id="rev:Contributor-kudos-608900438" href="#Contributor-kudos-608900438">Contributor kudos</a></li><li><a id="rev:Bug-fixes-608905168" href="#Bug-fixes-608905168">Bug fixes</a></li><li><a id="rev:Housekeeping-608918928" href="#Housekeeping-608918928">Housekeeping</a></li></ul></li><li>4.1 <a id="rev:Version-0.0.0-2009-01-13" href="#Version-0.0.0-2009-01-13">Version 0.0.0 (2009-01-13)</a></li></ul></li>
</ul>
</div>
<div id="lof"><a name="Tips"/><div class="nav" id="Tips"><a title="Reverse jump to listing" href="#rev:Tips">≡</a>△▽<a title="Jump to this segment" href="#Tips">◎</a></div><h2 class="title">Tips</h2> <ol><li><a id="rev:Merging-files-with-kdiff3" href="#Merging-files-with-kdiff3">Merging files with <strong>kdiff3</strong></a></li></ol></div>
@@ -816,12 +816,10 @@
</h2>
<div class="content"><img src='inochi.png' alt='project logo' />
<p>The “inochi.png” image and its “inochi.svg” source utilize the <a href='http://openclipart.org/media/files/Peileppe/8978'>“3 flowers”</a> graphic, which was created and released into the public domain by <a href='http://openclipart.org/media/people/Peileppe'>Peileppe Production</a> on June 25, 2008.</p></div>
</div></p></div>
</div>
-
-
<div class="chapter">
<a name="Setup"/><div class="nav" id="Setup"><a title="Reverse jump to listing" href="#rev:Setup">≡</a><a title="Jump to previous segment" href="#Credits">△</a><a title="Jump to next segment" href="#Requirements">▽</a><a title="Jump to this segment" href="#Setup">◎</a></div>
<h1 class="title">
Chapter 2
<br/>
@@ -852,12 +850,12 @@
<pre>inochi --version</pre>
<p>If the installation was successful, you will see output like this:</p>
<p><pre>project: Inochi
-version: 0.1.0
-release: 2009-01-19
+version: 0.2.0
+release: 2009-01-25
website: http://snk.tuxfamily.org/lib/inochi
install: /home/sun/src/inochi</pre></p>
<p>If you do not see such output, you may <a class="xref" href="#License" title="Section 1.2. License">ask the author(s)</a> for help.</p></div>
</div> <div class="section">
@@ -923,12 +921,18 @@
<p>You will see this output:</p>
<p><pre>Inochi - Gives life to RubyGems-based software
-Progress indicators:
+Generates a project scaffold using the given information.
+Existing files are backed up and NOT overwritten. It is your
+responsibility to merge changes between the existing files and
+the newly generated files. See the --merge option for details.
+
+This tool announces its progress as it runs, using these indicators:
+
create: A file is being created because it does not exist.
skip: A file is being skipped because it is already up to date.
update: A file will be updated because it is out of date. A text
@@ -937,12 +941,24 @@
(*.new) to the out of date file. If a text merging tool is
not specified, then you will have to do the merging by hand.
Usage:
- inochi [Option...] ModuleName
+ inochi [Options] ProjectName [ProgramName]
+
+ ProjectName: Name of your project, which will be normalized
+ into the naame of a Ruby module that will serve
+ as a namespace for all code in your project.
+
+ ProgramName: (Optional) Name of the main project executable,
+ which also serves as the name of the generated
+ project directory and the main project library.
+
+
+Options:
+
--merger, -m <s>: A command that invokes a text merging tool with three
arguments: (1) old file, (2) new file, (3) output file.
The command should write the result of merging the old
file and the new file to the output file. The command
may only modify the output file; it must NOT modify the
@@ -953,11 +969,11 @@
<p><div class="tip">
<a name="Merging-files-with-kdiff3"/><div class="nav" id="Merging-files-with-kdiff3"><a title="Reverse jump to listing" href="#rev:Merging-files-with-kdiff3">≡</a><a title="Jump to previous segment" href="#Command-line-interface">△</a><a title="Jump to next segment" href="#Ruby-library-interface">▽</a><a title="Jump to this segment" href="#Merging-files-with-kdiff3">◎</a></div>
<p class="title">Tip 1. Merging files with <strong>kdiff3</strong></p>
<div class="content">
- <img class="icon" src="&icon_tip;" alt="tip"/>
+ <img class="icon" alt="tip" src="&icon_tip;"/>
<p>Instead of merging files by hand, you can transfer wanted changes between files semi-automatically using <a href='http://kdiff3.sourceforge.net'>kdiff3</a>. Simply follow these instructions:</p>
<ol>
<li>
<p>Create a file named <tt>merge2</tt> with the following content:</p>
@@ -971,11 +987,11 @@
shift
output_file=$1
shift
-kdiff3 --auto "$old_file" "$new_file" --output "$output_file"</pre>
+kdiff3 --merge "$old_file" "$new_file" --output "$output_file"</pre>
</li>
<li>
<p>Make the file executable:</p>
@@ -1070,21 +1086,22 @@
<p>You awaken that evening relaxed and refreshed. A brilliant idea for a new project enters your mind: the project will be a tool that counts the number of words in text file. And, the project can be accessed from Ruby via the <code class="code"><span style="color:#036;font-weight:bold">WordCount</span></code> module.</p>
<p><em>However</em>, you must go to work the next morning, so there isn’t much time. What can you do? Let’s see how <strong>Inochi</strong> can help us meet this challenge.</p></div>
</div> <div class="section">
- <a name="Generate-your-project"/><div class="nav" id="Generate-your-project"><a title="Reverse jump to listing" href="#rev:Generate-your-project">≡</a><a title="Jump to previous segment" href="#Have-a-brilliant-idea">△</a><a title="Jump to next segment" href="#Configure-your-project">▽</a><a title="Jump to this segment" href="#Generate-your-project">◎</a></div>
+ <a name="Generate-your-project"/><div class="nav" id="Generate-your-project"><a title="Reverse jump to listing" href="#rev:Generate-your-project">≡</a><a title="Jump to previous segment" href="#Have-a-brilliant-idea">△</a><a title="Jump to next segment" href="#View-Rake-tasks">▽</a><a title="Jump to this segment" href="#Generate-your-project">◎</a></div>
<h3 class="title">
3.3.2 Generate your project
</h3>
<div class="content"><p>Give life to your new project:</p>
<p><pre># inochi WordCount
create word_count/LICENSE
create word_count/Rakefile
create word_count/bin/word_count
create word_count/lib/word_count.rb
+ create word_count/test/word_count.rb
create word_count/doc/index.erb
create word_count/doc/intro.erb
create word_count/doc/setup.erb
create word_count/doc/theory.erb
create word_count/doc/usage.erb
@@ -1093,14 +1110,15 @@
<p>Enter the <tt>word_count</tt> directory:</p>
<p><pre># cd word_count</pre></p>
-<p>View the available Rake tasks:</p>
-
-<p><pre># rake -T
-(in /tmp/Inochi20090119-28736-efadjc-0/word_count)
+<p><div class="paragraph">
+ <a name="View-Rake-tasks"/><div class="nav" id="View-Rake-tasks"><a title="Reverse jump to listing" href="#rev:View-Rake-tasks">≡</a><a title="Jump to previous segment" href="#Generate-your-project">△</a><a title="Jump to next segment" href="#Run-unit-tests">▽</a><a title="Jump to this segment" href="#View-Rake-tasks">◎</a></div>
+ <p class="title">View Rake tasks</p>
+ <div class="content"><p><pre># rake -T
+(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
rake ann # Build all release announcements.
rake ann:feed # Build RSS announcement: doc/ann.xml
rake ann:html # Build HTML announcement: ANN.html
rake ann:mail # Build e-mail announcement: ANN.eml
rake ann:text # Build plain text announcement: ANN.txt
@@ -1115,54 +1133,83 @@
rake pub:ann:forge # Announce to RubyForge news.
rake pub:ann:raa # Announce to RAA (Ruby Application Archive).
rake pub:ann:talk # Announce to ruby-talk mailing list.
rake pub:doc # Publish documentation to project website.
rake pub:pak # Publish release packages to RubyForge.
-</pre></p>
+rake test # Run all unit tests.
+</pre></p></div>
+</div> <div class="paragraph">
+ <a name="Run-unit-tests"/><div class="nav" id="Run-unit-tests"><a title="Reverse jump to listing" href="#rev:Run-unit-tests">≡</a><a title="Jump to previous segment" href="#View-Rake-tasks">△</a><a title="Jump to next segment" href="#Run-project-executable">▽</a><a title="Jump to this segment" href="#Run-unit-tests">◎</a></div>
+ <p class="title">Run unit tests</p>
+ <div class="content"><p><pre># rake test
+(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
+Loaded suite word_count
+Started
+.
+Finished in 0.001064 seconds.
-<p>Try the main project executable:</p>
-
-<p><pre># ruby bin/word_count
-Command-line options: {:help=>false, :manual=>false, :version=>false}
+1 tests, 23 assertions, 0 failures, 0 errors, 0 skips
+</pre></p></div>
+</div> <div class="paragraph">
+ <a name="Run-project-executable"/><div class="nav" id="Run-project-executable"><a title="Reverse jump to listing" href="#rev:Run-project-executable">≡</a><a title="Jump to previous segment" href="#Run-unit-tests">△</a><a title="Jump to next segment" href="#Show-user-manual">▽</a><a title="Jump to this segment" href="#Run-project-executable">◎</a></div>
+ <p class="title">Run project executable</p>
+ <div class="content"><p><pre># ruby bin/word_count
+Command-line options: {:manual=>false, :version=>false, :help=>false}
Command-line arguments: []
</pre></p>
<p>See usage information:</p>
<p><pre># ruby bin/word_count --help
WordCount - TODO: put a single line description of your project here.
TODO: Explain the command-line usage of this program here.
+
Usage:
- word_count [Option...] Arg1 Arg2 Arg3...
+ word_count [Options] Param1 Param2 Param3...
+
+ Param1: Description for the first parameter.
+
+ Param2: Description for the second parameter.
+
+ Param3: Description for the third parameter.
+
+
+Options:
+
--manual, -m: Show the user manual
--version, -v: Print version and exit
--help, -h: Show this message
</pre></p>
<p>See project & version information:</p>
<p><pre># ruby bin/word_count --version
project: WordCount
version: 0.0.0
-release: 2009-01-19
+release: 2009-01-25
website: http://word_count.rubyforge.org
-install: /tmp/Inochi20090119-28736-efadjc-0/word_count
-</pre></p>
+install: /tmp/Inochi20090125-24483-1xmgxqy-0/word_count
+</pre></p></div>
+</div> <div class="paragraph">
+ <a name="Show-user-manual"/><div class="nav" id="Show-user-manual"><a title="Reverse jump to listing" href="#rev:Show-user-manual">≡</a><a title="Jump to previous segment" href="#Run-project-executable">△</a><a title="Jump to next segment" href="#Configure-your-project">▽</a><a title="Jump to this segment" href="#Show-user-manual">◎</a></div>
+ <p class="title">Show user manual</p>
+ <div class="content"><p>Build the user manual (please disregard any “unclosed span” warnings):</p>
-<p>See the user manual:</p>
+<p><pre># rake doc:man</pre></p>
-<p><pre># rake doc:man 2>/dev/null
+<p>Launch the user manual:</p>
-# ruby bin/word_count --manual</pre></p>
+<p><pre># ruby bin/word_count --manual</pre></p>
<p>The manual will now appear in your default web browser.</p></div>
+</div></p></div>
</div> <div class="section">
- <a name="Configure-your-project"/><div class="nav" id="Configure-your-project"><a title="Reverse jump to listing" href="#rev:Configure-your-project">≡</a><a title="Jump to previous segment" href="#Generate-your-project">△</a><a title="Jump to next segment" href="#Project-information">▽</a><a title="Jump to this segment" href="#Configure-your-project">◎</a></div>
+ <a name="Configure-your-project"/><div class="nav" id="Configure-your-project"><a title="Reverse jump to listing" href="#rev:Configure-your-project">≡</a><a title="Jump to previous segment" href="#Show-user-manual">△</a><a title="Jump to next segment" href="#Project-information">▽</a><a title="Jump to this segment" href="#Configure-your-project">◎</a></div>
<h3 class="title">
3.3.3 Configure your project
</h3>
<div class="content"><p><a class="xref" href="#Ruby-library-interface">Section 3.2. Ruby library interface</a> lists and documents the interactions between your project and <strong>Inochi</strong>. These points of interaction are illustrated in the following sections.</p>
@@ -1195,11 +1242,11 @@
require <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">inochi</span><span style="color:#710">'</span></span>
<span style="color:#036;font-weight:bold">Inochi</span>.init <span style="color:#A60">:WordCount</span>,
<span style="color:#A60">:project</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">WordCount</span><span style="color:#710">'</span></span>,
<span style="color:#A60">:version</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">0.0.0</span><span style="color:#710">'</span></span>,
- <span style="color:#A60">:release</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">2009-01-19</span><span style="color:#710">'</span></span>,
+ <span style="color:#A60">:release</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">2009-01-25</span><span style="color:#710">'</span></span>,
<span style="color:#A60">:website</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">http://word_count.rubyforge.org</span><span style="color:#710">'</span></span>,
<span style="color:#A60">:tagline</span> => <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">TODO: put a single line description of your project here.</span><span style="color:#710">'</span></span>,
<span style="color:#A60">:require</span> => {
<span style="color:#666"># TODO: list gems required by your project here.</span>
<span style="color:#666"># NOTE: this is completely optional!</span>
@@ -1221,14 +1268,25 @@
<p><pre class="code"><span style="color:#666">#!/usr/bin/ruby -w</span>
<span style="color:#666">#</span>
<span style="color:#666"># TODO: Explain the command-line usage of this program here.</span>
<span style="color:#666">#</span>
+<span style="color:#666">#</span>
<span style="color:#666"># Usage:</span>
<span style="color:#666">#</span>
-<span style="color:#666"># word_count [Option...] Arg1 Arg2 Arg3...</span>
+<span style="color:#666"># word_count [Options] Param1 Param2 Param3...</span>
<span style="color:#666">#</span>
+<span style="color:#666">#</span>
+<span style="color:#666"># Param1: Description for the first parameter.</span>
+<span style="color:#666">#</span>
+<span style="color:#666"># Param2: Description for the second parameter.</span>
+<span style="color:#666">#</span>
+<span style="color:#666"># Param3: Description for the third parameter.</span>
+<span style="color:#666">#</span>
+<span style="color:#666">#</span>
+<span style="color:#666"># Options:</span>
+<span style="color:#666">#</span>
require <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">rubygems</span><span style="color:#710">'</span></span>
gem <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">inochi</span><span style="color:#710">'</span></span>, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">~> 0</span><span style="color:#710">'</span></span>
require <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">inochi</span><span style="color:#710">'</span></span>
@@ -1290,11 +1348,11 @@
<p class="title"><tt>doc/intro.erb</tt></p>
<div class="content"><p><pre class="code" lang="rhtml"><span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> chapter <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Introduction</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> project_summary <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="color:#F00;background-color:#FAA">></span> TODO: explain the purpose of your project
- ****<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$project</span> <span style="font-weight:bold;color:#888">%></span></span>**** is a __________ that __________.
+ **<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$project</span> <span style="font-weight:bold;color:#888">%></span></span>** is a __________ that __________.
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="color:#F00;background-color:#FAA">></span> TODO: explain why your project is important
**<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$project</span> <span style="font-weight:bold;color:#888">%></span></span>** is exciting because:
@@ -1377,13 +1435,13 @@
<p class="title"><tt>doc/setup.erb</tt></p>
<div class="content"><p><pre class="code" lang="rhtml"><span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> chapter <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Setup</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> section <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Requirements</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
Your system needs the following software to run **<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$project</span> <span style="font-weight:bold;color:#888">%></span></span>**.
- | Software | Description | Notes |
- | -------- | ----------- | ----- |
- | [Ruby](http://ruby-lang.org) | Ruby language interpreter | Version 1.8.7 is required. |
+ | Software | Description | Notes |
+ | -------- | ----------- | ----- |
+ | [Ruby](http://ruby-lang.org) | Ruby language interpreter | Version 1.8.7 is required. |
| [RubyGems](http://rubygems.org) | Ruby packaging system | Version 1.3.1 is required. |
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> section <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Installation</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
You can install **<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$project</span> <span style="font-weight:bold;color:#888">%></span></span>** by running this command:
@@ -1448,11 +1506,11 @@
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> <span style="color:#d70;font-weight:bold">$program</span> <span style="font-weight:bold;color:#888">%></span></span> --help
You will see this output:
- <span style="color:#070"><pre></span><span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> verbatim <span style="background-color:#f0fff0;color:#2B2"><span style="color:#161">`</span><span style="">ruby bin/</span><span style="background:#eee"><span style="font-weight:bold;color:#888">#{</span><span style="color:#d70;font-weight:bold">$program</span><span style="font-weight:bold;color:#888">}</span></span><span style=""> --help</span><span style="color:#161">`</span></span> <span style="font-weight:bold;color:#888">%></span></span><span style="color:#070"></pre></span>
+ <span style="color:#070"><pre></span><span style="background:#eee"><span style="font-weight:bold;color:#888"><%=</span> verbatim <span style="background-color:#f0fff0;color:#2B2"><span style="color:#161">`</span><span style="">ruby bin/</span><span style="background:#eee"><span style="font-weight:bold;color:#888">#{</span><span style="color:#d70;font-weight:bold">$program_name</span><span style="font-weight:bold;color:#888">}</span></span><span style=""> --help</span><span style="color:#161">`</span></span> <span style="font-weight:bold;color:#888">%></span></span><span style="color:#070"></pre></span>
<span style="color:#F00;background-color:#FAA">></span> TODO: explain the command-line arguments
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> section <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Ruby library interface</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
@@ -1477,11 +1535,11 @@
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> project_history <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="color:#F00;background-color:#FAA">></span> TODO: put release notes for your project
<span style="color:#F00;background-color:#FAA">></span> here -- newest first, oldest last.
- <span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> section <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Version 0.0.0 (2009-01-19)</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
+ <span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> section <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Version 0.0.0 (2009-01-25)</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
<span style="color:#F00;background-color:#FAA">></span> TODO: write a short summary of the changes in this release
This release changes __________, adds __________, and fixes __________.
<span style="background:#eee"><span style="font-weight:bold;color:#888"><%</span> paragraph <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">Contributor kudos</span><span style="color:#710">"</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%></span></span>
@@ -1544,27 +1602,59 @@
</div> <div class="section">
<a name="Implement-your-project"/><div class="nav" id="Implement-your-project"><a title="Reverse jump to listing" href="#rev:Implement-your-project">≡</a><a title="Jump to previous segment" href="#doc-history.erb">△</a><a title="Jump to next segment" href="#Goodbye-LOAD_PATH-hello-require">▽</a><a title="Jump to this segment" href="#Implement-your-project">◎</a></div>
<h3 class="title">
3.3.4 Implement your project
</h3>
- <div class="content"><p>Add the following code to the bottom of the main project library:</p>
+ <div class="content"><p>Add the following code to the bottom of <tt>lib/word_count.rb</tt>, the main project library:</p>
<p><pre class="code"><span style="color:#080;font-weight:bold">module</span> <span style="color:#B06;font-weight:bold">WordCount</span>
<span style="color:#666"># Returns the number of words in the given input.</span>
<span style="color:#080;font-weight:bold">def</span> <span style="color:#036;font-weight:bold">WordCount</span>.count input
input.to_s.split(<span style="background-color:#fff0ff"><span style="color:#404">/</span><span style="color:#04D">\W</span><span style="color:#808">+</span><span style="color:#404">/</span></span>).length
<span style="color:#080;font-weight:bold">end</span>
<span style="color:#080;font-weight:bold">end</span>
</pre></p>
-<p>Add the following code to the bottom of the main project executable:</p>
+<p>Add the following code to the bottom of <tt>bin/word_count</tt>, the main project executable:</p>
<p><pre class="code">input = <span style="color:#038;font-weight:bold">ARGF</span>.read
total = <span style="color:#036;font-weight:bold">WordCount</span>.count(input)
puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">"</span><span style="">There are </span><span style="background:#eee"><span style="font-weight:bold;color:#888">#{</span>total<span style="font-weight:bold;color:#888">}</span></span><span style=""> words in the input.</span><span style="color:#710">"</span></span>
</pre></p>
+<p>Add the following code to the bottom of <tt>test/word_count.rb</tt>, a unit test for the main project library:</p>
+
+<p><pre class="code">describe <span style="color:#036;font-weight:bold">WordCount</span> <span style="color:#080;font-weight:bold">do</span>
+ it <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">handles empty input</span><span style="color:#710">'</span></span> <span style="color:#080;font-weight:bold">do</span>
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="color:#038;font-weight:bold">nil</span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style=""> </span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#080;font-weight:bold">end</span>
+
+ it <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">handles single words</span><span style="color:#710">'</span></span> <span style="color:#080;font-weight:bold">do</span>
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">a</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">1</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">foo</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">1</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">bar</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">1</span>)
+ <span style="color:#080;font-weight:bold">end</span>
+
+ it <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">handles multiple words</span><span style="color:#710">'</span></span> <span style="color:#080;font-weight:bold">do</span>
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">a b</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">2</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">a-b</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">2</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">a/b</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">2</span>)
+ <span style="color:#080;font-weight:bold">end</span>
+
+ it <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">ignores punctuation and space</span><span style="color:#710">'</span></span> <span style="color:#080;font-weight:bold">do</span>
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">!</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">! @ # % #!@#</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style=""> !</span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">! </span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style=""> ! </span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#036;font-weight:bold">WordCount</span>.count(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style=""> ! </span><span style="color:#710">'</span></span>).must_equal(<span style="color:#00D;font-weight:bold">0</span>)
+ <span style="color:#080;font-weight:bold">end</span>
+<span style="color:#080;font-weight:bold">end</span>
+</pre></p>
+
<p><div class="paragraph">
<a name="Goodbye-LOAD_PATH-hello-require"/><div class="nav" id="Goodbye-LOAD_PATH-hello-require"><a title="Reverse jump to listing" href="#rev:Goodbye-LOAD_PATH-hello-require">≡</a><a title="Jump to previous segment" href="#Implement-your-project">△</a><a title="Jump to next segment" href="#Test-your-project">▽</a><a title="Jump to this segment" href="#Goodbye-LOAD_PATH-hello-require">◎</a></div>
<p class="title">Goodbye <code class="code"><span style="color:#d70;font-weight:bold">$LOAD_PATH</span></code>, hello <code class="code">require()</code></p>
<div class="content"><p>Notice that, in the Ruby files that you modified so far, there were no <code class="code"><span style="color:#d70;font-weight:bold">$LOAD_PATH</span></code> manipulations and no explicit <code class="code">require()</code> statements to pull in the various parts of your project. That is because <strong>Inochi</strong> does this for you automatically.</p>
@@ -1576,23 +1666,62 @@
</pre></p>
<p>Regardless of whether a sub-library is used within your project itself or from within an external application, we always <code class="code">require()</code> the sub-library using the same canonical path.</p></div>
</div></p></div>
</div> <div class="section">
- <a name="Test-your-project"/><div class="nav" id="Test-your-project"><a title="Reverse jump to listing" href="#rev:Test-your-project">≡</a><a title="Jump to previous segment" href="#Goodbye-LOAD_PATH-hello-require">△</a><a title="Jump to next segment" href="#Publish-your-project">▽</a><a title="Jump to this segment" href="#Test-your-project">◎</a></div>
+ <a name="Test-your-project"/><div class="nav" id="Test-your-project"><a title="Reverse jump to listing" href="#rev:Test-your-project">≡</a><a title="Jump to previous segment" href="#Goodbye-LOAD_PATH-hello-require">△</a><a title="Jump to next segment" href="#Units-and-tests">▽</a><a title="Jump to this segment" href="#Test-your-project">◎</a></div>
<h3 class="title">
3.3.5 Test your project
</h3>
- <div class="content"><blockquote>
-<p>TODO: show how to write a unit test for the code</p>
-</blockquote>
+ <div class="content"><p>To reduce the amount of code you have to write, <strong>Inochi</strong> defines the following convention for unit tests.</p>
-<blockquote>
-<p>TODO: integrate minitest tasks into Inochi.rake()</p>
-</blockquote></div>
+<p><div class="paragraph">
+ <a name="Units-and-tests"/><div class="nav" id="Units-and-tests"><a title="Reverse jump to listing" href="#rev:Units-and-tests">≡</a><a title="Jump to previous segment" href="#Test-your-project">△</a><a title="Jump to next segment" href="#Test-execution">▽</a><a title="Jump to this segment" href="#Units-and-tests">◎</a></div>
+ <p class="title">Units and tests</p>
+ <div class="content"><p>Every Ruby source file in your project’s <tt>lib/</tt> directory is considered to be a <strong>unit</strong>. Likewise, every Ruby source file in your project’s <tt>test/</tt> is considered to be a <strong>test</strong>.</p>
+
+<p>As a result, your project’s <tt>test/</tt> directory structure <em>mirrors</em> the structure of your project’s <tt>lib/</tt> directory. For example, if your project has a <tt>lib/foo/bar.rb</tt> unit, then <tt>test/foo/bar.rb</tt> would be its the corresponding test.</p></div>
+</div> <div class="paragraph">
+ <a name="Test-execution"/><div class="nav" id="Test-execution"><a title="Reverse jump to listing" href="#rev:Test-execution">≡</a><a title="Jump to previous segment" href="#Units-and-tests">△</a><a title="Jump to next segment" href="#Helper-libraries">▽</a><a title="Jump to this segment" href="#Test-execution">◎</a></div>
+ <p class="title">Test execution</p>
+ <div class="content"><p><pre>rake test</pre></p>
+
+<p>The above command begins the testing process, during which:</p>
+
+<ul>
+<li>
+<p>Tests which lack corresponding units are <em>skipped</em> and not executed. A message specifying which test file was skipped is printed to the standard error stream whenever this occurs.</p>
+</li>
+
+<li>
+<p>Before a test is executed, its corresponding unit is automatically loaded into the Ruby environment using <code class="code">require()</code>.</p>
+</li>
+</ul>
+
+<p>As for the details of test execution:</p>
+
+<ul>
+<li>
+<p>Tests are executed by the <a href='http://rubyforge.org/projects/bfts/'>minitest</a> library, which allows you to write unit tests in a combination of styles: traditional TDD, modern BDD, alternative rSpec BDD, and mock-based validation styles.</p>
+</li>
+
+<li>
+<p>Within each test, test cases are executed in random order. This is the default behavior of the <a href='http://rubyforge.org/projects/bfts/'>minitest</a> library.</p>
+</li>
+</ul></div>
+</div> <div class="paragraph">
+ <a name="Helper-libraries"/><div class="nav" id="Helper-libraries"><a title="Reverse jump to listing" href="#rev:Helper-libraries">≡</a><a title="Jump to previous segment" href="#Test-execution">△</a><a title="Jump to next segment" href="#Publish-your-project">▽</a><a title="Jump to this segment" href="#Helper-libraries">◎</a></div>
+ <p class="title">Helper libraries</p>
+ <div class="content"><p>Your project’s main directory is added to Ruby’s load path. So if your tests have helper libraries stored in your project’s <tt>test/</tt> directory, you can load them into your tests by adding a “test/” prefix.</p>
+
+<p>For example, if your <tt>test/foo/bar.rb</tt> test has a <tt>test/foo/qux.rb</tt> helper library, then you would write the following code inside the test to load the helper library:</p>
+
+<p><pre class="code">require <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">test/foo/qux</span><span style="color:#710">'</span></span>
+</pre></p></div>
+</div></p></div>
</div> <div class="section">
- <a name="Publish-your-project"/><div class="nav" id="Publish-your-project"><a title="Reverse jump to listing" href="#rev:Publish-your-project">≡</a><a title="Jump to previous segment" href="#Test-your-project">△</a><a title="Jump to next segment" href="#Build-a-RubyGem">▽</a><a title="Jump to this segment" href="#Publish-your-project">◎</a></div>
+ <a name="Publish-your-project"/><div class="nav" id="Publish-your-project"><a title="Reverse jump to listing" href="#rev:Publish-your-project">≡</a><a title="Jump to previous segment" href="#Helper-libraries">△</a><a title="Jump to next segment" href="#Build-a-RubyGem">▽</a><a title="Jump to this segment" href="#Publish-your-project">◎</a></div>
<h3 class="title">
3.3.6 Publish your project
</h3>
<div class="content"><p>This command performs all of the automated steps described in the following sections:</p>
@@ -1604,12 +1733,18 @@
3.3.6.1 Build a RubyGem
</h4>
<div class="content"><p>Build a RubyGem by running:</p>
<p><pre># rake pak
-(in /tmp/Inochi20090119-28736-efadjc-0/word_count)
-(in /tmp/Inochi20090119-28736-efadjc-0/word_count)
+(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
+(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
+Loaded suite word_count
+Started
+.
+Finished in 0.001073 seconds.
+
+1 tests, 23 assertions, 0 failures, 0 errors, 0 skips
Successfully built RubyGem
Name: word_count
Version: 0.0.0
File: word_count-0.0.0.gem
</pre></p>
@@ -1626,11 +1761,11 @@
- <span style="background-color:#fff0f0;color:#D20">Your Name</span>
<span style="color:#808">autorequire</span>:
<span style="color:#808">bindir</span>: <span style="background-color:#fff0f0;color:#D20">bin</span>
<span style="color:#808">cert_chain</span>: <span style="background-color:#fff0f0;color:#D20">[]</span>
-<span style="color:#808">date</span>: <span style="background-color:#fff0f0;color:#D20">2009-01-19 00:00:00 -08:00</span>
+<span style="color:#808">date</span>: <span style="background-color:#fff0f0;color:#D20">2009-01-25 00:00:00 -08:00</span>
<span style="color:#808">default_executable</span>:
<span style="color:#808">dependencies</span>:
- <span style="color:#339;font-weight:bold">!ruby/object</span>:<span style="color:#B06;font-weight:bold">Gem::Dependency</span>
<span style="color:#808">name</span>: <span style="background-color:#fff0f0;color:#D20">inochi</span>
<span style="color:#808">type</span>: <span style="background-color:#fff0f0;color:#D20">:runtime</span>
@@ -1650,10 +1785,12 @@
<span style="color:#808">extra_rdoc_files</span>: <span style="background-color:#fff0f0;color:#D20">[]</span>
<span style="color:#808">files</span>:
- <span style="background-color:#fff0f0;color:#D20">lib</span>
- <span style="background-color:#fff0f0;color:#D20">lib/word_count.rb</span>
+- <span style="background-color:#fff0f0;color:#D20">test</span>
+- <span style="background-color:#fff0f0;color:#D20">test/word_count.rb</span>
- <span style="background-color:#fff0f0;color:#D20">bin</span>
- <span style="background-color:#fff0f0;color:#D20">bin/word_count</span>
- <span style="background-color:#fff0f0;color:#D20">Rakefile</span>
- <span style="background-color:#fff0f0;color:#D20">LICENSE</span>
- <span style="background-color:#fff0f0;color:#D20">doc</span>
@@ -1745,11 +1882,11 @@
3.3.6.3.1 Manual release announcement
</h5>
<div class="content"><p>Build release announcements by running:</p>
<p><pre># rake ann
-(in /tmp/Inochi20090119-28736-efadjc-0/word_count)
+(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
</pre></p>
<p>This produces the following files in your project directory:</p>
<ul>
@@ -1774,59 +1911,132 @@
<p>If your documentation website (see the <code class="code"><span style="color:#A60">:docsite</span></code> option for the <a href='api/Inochi.html#init-class_method'><code class="code"><span style="color:#036;font-weight:bold">Inochi</span>.init()</code> method</a>) is hosted on RubyForge, then the above command will automatically upload your project’s documentation to the correct place.</p></div>
</div></p></div>
</div></p></div>
</div></p></div>
</div><div class="chapter">
- <a name="history"/><div class="nav" id="history"><a title="Reverse jump to listing" href="#rev:history">≡</a><a title="Jump to previous segment" href="#Publish-the-documentation">△</a><a title="Jump to next segment" href="#Version-0.1.0-2009-01-13">▽</a><a title="Jump to this segment" href="#history">◎</a></div>
+ <a name="history"/><div class="nav" id="history"><a title="Reverse jump to listing" href="#rev:history">≡</a><a title="Jump to previous segment" href="#Publish-the-documentation">△</a><a title="Jump to next segment" href="#Version-0.2.0-2009-01-25">▽</a><a title="Jump to this segment" href="#history">◎</a></div>
<h1 class="title">
Chapter 4
<br/>
<big>History</big>
</h1>
<div class="content"><p><p><div class="section">
- <a name="Version-0.1.0-2009-01-13"/><div class="nav" id="Version-0.1.0-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.1.0-2009-01-13">≡</a><a title="Jump to previous segment" href="#history">△</a><a title="Jump to next segment" href="#New-features">▽</a><a title="Jump to this segment" href="#Version-0.1.0-2009-01-13">◎</a></div>
+ <a name="Version-0.2.0-2009-01-25"/><div class="nav" id="Version-0.2.0-2009-01-25"><a title="Reverse jump to listing" href="#rev:Version-0.2.0-2009-01-25">≡</a><a title="Jump to previous segment" href="#history">△</a><a title="Jump to next segment" href="#Contributor-kudos">▽</a><a title="Jump to this segment" href="#Version-0.2.0-2009-01-25">◎</a></div>
<h2 class="title">
+ 4.1 Version 0.2.0 (2009-01-25)
+ </h2>
+ <div class="content"><p>This release adds support for unit testing, improves the portability of <strong>Inochi</strong> and configurability of your projects, adds new content to the user manual, and fixes some bugs.</p>
+
+<p><div class="paragraph">
+ <a name="Contributor-kudos"/><div class="nav" id="Contributor-kudos"><a title="Reverse jump to listing" href="#rev:Contributor-kudos">≡</a><a title="Jump to previous segment" href="#Version-0.2.0-2009-01-25">△</a><a title="Jump to next segment" href="#New-features">▽</a><a title="Jump to this segment" href="#Contributor-kudos">◎</a></div>
+ <p class="title">Contributor kudos</p>
+ <div class="content"><p>Florian Gilcher patched <strong>Inochi</strong> to:</p>
+
+<ul>
+<li>
+<p>Run on both JRuby and normal Ruby in multiple versions and with different executable names on Windows.</p>
+</li>
+
+<li>
+<p>Allow project authors to be specified by hand instead of always relying on the license file to be in expected form, because his license template doesn’t follow that form.</p>
+</li>
+</ul></div>
+</div> <div class="paragraph">
+ <a name="New-features"/><div class="nav" id="New-features"><a title="Reverse jump to listing" href="#rev:New-features">≡</a><a title="Jump to previous segment" href="#Contributor-kudos">△</a><a title="Jump to next segment" href="#Bug-fixes">▽</a><a title="Jump to this segment" href="#New-features">◎</a></div>
+ <p class="title">New features</p>
+ <div class="content"><ul>
+<li>
+<p>Added support for unit testing via the <a href='http://rubyforge.org/projects/bfts/'>minitest</a> library. See <a class="xref" href="#Test-your-project">Section 3.3.5. Test your project</a> for documentation.</p>
+
+<p>Also, in related news, the scaffold generator now emits a default unit test for the main project library.</p>
+</li>
+
+<li>
+<p>Added optional ProgramName parameter to the scaffold generator. This allows you to specify reasonable program names when your project module has a strange capitalization:</p>
+
+<pre>> inochi ERBook
+ create er_book/LICENSE
+
+> inochi ERBook erbook
+ create erbook/LICENSE
+
+> inochi ERBook foobar
+ create foobar/LICENSE</pre>
+</li>
+
+<li>
+<p>Allow project authors to be specified via</p>
+
+<p><code class="code"><span style="color:#036;font-weight:bold">Inochi</span>.init <span style="color:#A60">:YourProject</span>, <span style="color:#A60">:authors</span> => ...</code></p>
+</li>
+</ul></div>
+</div> <div class="paragraph">
+ <a name="Bug-fixes"/><div class="nav" id="Bug-fixes"><a title="Reverse jump to listing" href="#rev:Bug-fixes">≡</a><a title="Jump to previous segment" href="#New-features">△</a><a title="Jump to next segment" href="#Housekeeping">▽</a><a title="Jump to this segment" href="#Bug-fixes">◎</a></div>
+ <p class="title">Bug fixes</p>
+ <div class="content"><ul>
+<li>
+<p>Use <code class="code"><span style="color:#036;font-weight:bold">Gem</span>::<span style="color:#036;font-weight:bold">RubyGemsVersion</span></code> instead of a shell command to determine rubygems version for generation of <tt>setup.erb</tt>. (Florian Gilcher)</p>
+</li>
+
+<li>
+<p>Add blank lines between all list items, not just multi-line ones, in the plain-text version of the relase announcement for improved readability.</p>
+</li>
+
+<li>
+<p>Omit LaTeX-style heading numbers from release announcements. They caused confusion, especially in plain-text announcements, when trying to determine which version of a project was released.</p>
+</li>
+</ul></div>
+</div> <div class="paragraph">
+ <a name="Housekeeping"/><div class="nav" id="Housekeeping"><a title="Reverse jump to listing" href="#rev:Housekeeping">≡</a><a title="Jump to previous segment" href="#Bug-fixes">△</a><a title="Jump to next segment" href="#Version-0.1.0-2009-01-13">▽</a><a title="Jump to this segment" href="#Housekeeping">◎</a></div>
+ <p class="title">Housekeeping</p>
+ <div class="content"><ul>
+<li>Added unit tests for utility methods provided by the <strong>Inochi</strong> module: project name calculation and CamelCase to snake_case conversion.</li>
+</ul></div>
+</div></p></div>
+</div> <div class="section">
+ <a name="Version-0.1.0-2009-01-13"/><div class="nav" id="Version-0.1.0-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.1.0-2009-01-13">≡</a><a title="Jump to previous segment" href="#Housekeeping">△</a><a title="Jump to next segment" href="#New-features-608879868">▽</a><a title="Jump to this segment" href="#Version-0.1.0-2009-01-13">◎</a></div>
+ <h2 class="title">
4.1 Version 0.1.0 (2009-01-13)
</h2>
<div class="content"><p>This release reattempts to fix the <a href='http://www.ruby-forum.com/topic/176173#771281'>circular dependency problem</a> that occurred when installing either <strong>Inochi</strong> or <strong>ERBook</strong>.</p>
<p><div class="paragraph">
- <a name="New-features"/><div class="nav" id="New-features"><a title="Reverse jump to listing" href="#rev:New-features">≡</a><a title="Jump to previous segment" href="#Version-0.1.0-2009-01-13">△</a><a title="Jump to next segment" href="#Bug-fixes">▽</a><a title="Jump to this segment" href="#New-features">◎</a></div>
+ <a name="New-features-608879868"/><div class="nav" id="New-features-608879868"><a title="Reverse jump to listing" href="#rev:New-features-608879868">≡</a><a title="Jump to previous segment" href="#Version-0.1.0-2009-01-13">△</a><a title="Jump to next segment" href="#Bug-fixes-608886358">▽</a><a title="Jump to this segment" href="#New-features-608879868">◎</a></div>
<p class="title">New features</p>
<div class="content"><ul>
-<li><code class="code"><span style="color:#036;font-weight:bold">Inochi</span>.init()</code> now adds <code class="code"><span style="color:#666">#major()</span></code>, <code class="code"><span style="color:#666">#series()</span></code>, and <code class="code"><span style="color:#666">#requirement()</span></code> instance methods to a project’s <code class="code"><span style="color:#036;font-weight:bold">VERSION</span></code> constant.</li>
+<li><code class="code">**<span style="color:#036;font-weight:bold">Inochi</span>**.init()</code> now adds <code class="code"><span style="color:#666">#major()</span></code>, <code class="code"><span style="color:#666">#series()</span></code>, and <code class="code"><span style="color:#666">#requirement()</span></code> instance methods to a project’s <code class="code"><span style="color:#036;font-weight:bold">VERSION</span></code> constant.</li>
</ul></div>
</div> <div class="paragraph">
- <a name="Bug-fixes"/><div class="nav" id="Bug-fixes"><a title="Reverse jump to listing" href="#rev:Bug-fixes">≡</a><a title="Jump to previous segment" href="#New-features">△</a><a title="Jump to next segment" href="#Version-0.0.1-2009-01-13">▽</a><a title="Jump to this segment" href="#Bug-fixes">◎</a></div>
+ <a name="Bug-fixes-608886358"/><div class="nav" id="Bug-fixes-608886358"><a title="Reverse jump to listing" href="#rev:Bug-fixes-608886358">≡</a><a title="Jump to previous segment" href="#New-features-608879868">△</a><a title="Jump to next segment" href="#Version-0.0.1-2009-01-13">▽</a><a title="Jump to this segment" href="#Bug-fixes-608886358">◎</a></div>
<p class="title">Bug fixes</p>
<div class="content"><ul>
<li>
-<p>Solved circular dependency problem by making inochi gem not dependent on erbook gem. However, <strong>ERBook</strong> is still required during runtime and is supplied on the <code class="code">gem install</code> command for <strong>Inochi</strong>.</p>
+<p>Solved circular dependency problem by making inochi gem not dependent on erbook gem. However, ERBook is still required during runtime and is supplied on the <code class="code">gem install</code> command for <strong>Inochi</strong>.</p>
<p><a class="xref" href="#Installation">Section 2.2. Installation</a> has been updated accordingly.</p>
</li>
<li>
<p>Add forgotten Rake dependency for <strong>Inochi</strong> gem.</p>
</li>
</ul></div>
</div></p></div>
</div> <div class="section">
- <a name="Version-0.0.1-2009-01-13"/><div class="nav" id="Version-0.0.1-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.0.1-2009-01-13">≡</a><a title="Jump to previous segment" href="#Bug-fixes">△</a><a title="Jump to next segment" href="#Contributor-kudos">▽</a><a title="Jump to this segment" href="#Version-0.0.1-2009-01-13">◎</a></div>
+ <a name="Version-0.0.1-2009-01-13"/><div class="nav" id="Version-0.0.1-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.0.1-2009-01-13">≡</a><a title="Jump to previous segment" href="#Bug-fixes-608886358">△</a><a title="Jump to next segment" href="#Contributor-kudos-608900438">▽</a><a title="Jump to this segment" href="#Version-0.0.1-2009-01-13">◎</a></div>
<h2 class="title">
4.1 Version 0.0.1 (2009-01-13)
</h2>
<div class="content"><p>This release fixes some show-stopper bugs.</p>
<p><div class="paragraph">
- <a name="Contributor-kudos"/><div class="nav" id="Contributor-kudos"><a title="Reverse jump to listing" href="#rev:Contributor-kudos">≡</a><a title="Jump to previous segment" href="#Version-0.0.1-2009-01-13">△</a><a title="Jump to next segment" href="#Bug-fixes-608680498">▽</a><a title="Jump to this segment" href="#Contributor-kudos">◎</a></div>
+ <a name="Contributor-kudos-608900438"/><div class="nav" id="Contributor-kudos-608900438"><a title="Reverse jump to listing" href="#rev:Contributor-kudos-608900438">≡</a><a title="Jump to previous segment" href="#Version-0.0.1-2009-01-13">△</a><a title="Jump to next segment" href="#Bug-fixes-608905168">▽</a><a title="Jump to this segment" href="#Contributor-kudos-608900438">◎</a></div>
<p class="title">Contributor kudos</p>
<div class="content"><ul>
<li>Florian Gilcher tried the first release of <strong>Inochi</strong> and reported bugs.</li>
</ul></div>
</div> <div class="paragraph">
- <a name="Bug-fixes-608680498"/><div class="nav" id="Bug-fixes-608680498"><a title="Reverse jump to listing" href="#rev:Bug-fixes-608680498">≡</a><a title="Jump to previous segment" href="#Contributor-kudos">△</a><a title="Jump to next segment" href="#Housekeeping">▽</a><a title="Jump to this segment" href="#Bug-fixes-608680498">◎</a></div>
+ <a name="Bug-fixes-608905168"/><div class="nav" id="Bug-fixes-608905168"><a title="Reverse jump to listing" href="#rev:Bug-fixes-608905168">≡</a><a title="Jump to previous segment" href="#Contributor-kudos-608900438">△</a><a title="Jump to next segment" href="#Housekeeping-608918928">▽</a><a title="Jump to this segment" href="#Bug-fixes-608905168">◎</a></div>
<p class="title">Bug fixes</p>
<div class="content"><ul>
<li>
<p>Florian Gilcher reported that the name of the project library was <a href='http://www.ruby-forum.com/topic/176173#771351'>being determined incorrectly</a>.</p>
</li>
@@ -1840,18 +2050,18 @@
<li>
<p>Generated project scaffolds now check against the major version of the <strong>Inochi</strong> gem, to avoid runtime version conflicts.</p>
</li>
</ul></div>
</div> <div class="paragraph">
- <a name="Housekeeping"/><div class="nav" id="Housekeeping"><a title="Reverse jump to listing" href="#rev:Housekeeping">≡</a><a title="Jump to previous segment" href="#Bug-fixes-608680498">△</a><a title="Jump to next segment" href="#Version-0.0.0-2009-01-13">▽</a><a title="Jump to this segment" href="#Housekeeping">◎</a></div>
+ <a name="Housekeeping-608918928"/><div class="nav" id="Housekeeping-608918928"><a title="Reverse jump to listing" href="#rev:Housekeeping-608918928">≡</a><a title="Jump to previous segment" href="#Bug-fixes-608905168">△</a><a title="Jump to next segment" href="#Version-0.0.0-2009-01-13">▽</a><a title="Jump to this segment" href="#Housekeeping-608918928">◎</a></div>
<p class="title">Housekeeping</p>
<div class="content"><ul>
<li>Only add project libraries to <code class="code"><span style="color:#d70;font-weight:bold">$LOAD_PATH</span></code> if not already there.</li>
</ul></div>
</div></p></div>
</div> <div class="section">
- <a name="Version-0.0.0-2009-01-13"/><div class="nav" id="Version-0.0.0-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.0.0-2009-01-13">≡</a><a title="Jump to previous segment" href="#Housekeeping">△</a>▽<a title="Jump to this segment" href="#Version-0.0.0-2009-01-13">◎</a></div>
+ <a name="Version-0.0.0-2009-01-13"/><div class="nav" id="Version-0.0.0-2009-01-13"><a title="Reverse jump to listing" href="#rev:Version-0.0.0-2009-01-13">≡</a><a title="Jump to previous segment" href="#Housekeeping-608918928">△</a>▽<a title="Jump to this segment" href="#Version-0.0.0-2009-01-13">◎</a></div>
<h2 class="title">
4.1 Version 0.0.0 (2009-01-13)
</h2>
<div class="content"><p>This is the first release of <strong>Inochi</strong>.</p>
@@ -1865,27 +2075,27 @@
<br style="display: none"/>
<div id="footer">
- Generated by <a href="http://snk.tuxfamily.org/lib/erbook/">ERBook 6.0.1</a> on Mon Jan 19 12:55:48 -0800 2009.
+ Generated by <a href="http://snk.tuxfamily.org/lib/erbook/">ERBook 6.0.1</a> on Sun Jan 25 10:26:44 -0800 2009.
<div id="footer-credits">
<p>
- <img class="icon" src="&icon_caution;" alt="caution"/>
- <img class="icon" src="&icon_tip;" alt="tip"/>
- <img class="icon" src="&icon_important;" alt="important"/>
- <img class="icon" src="&icon_note;" alt="note"/>
- <img class="icon" src="&icon_warning;" alt="warning"/>
- <img class="icon" src="&icon_quote;" alt="quote"/>
+ <img class="icon" alt="caution" src="&icon_caution;"/>
+ <img class="icon" alt="tip" src="&icon_tip;"/>
+ <img class="icon" alt="important" src="&icon_important;"/>
+ <img class="icon" alt="note" src="&icon_note;"/>
+ <img class="icon" alt="warning" src="&icon_warning;"/>
+ <img class="icon" alt="quote" src="&icon_quote;"/>
<br/>
The icons shown above are © 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>. They are part of the <a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a> set, which is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>.
</p>
<p>
- <img class="icon" src="&icon_link;" alt="link"/>
+ <img class="icon" alt="link" src="&icon_link;"/>
<br/>
The icons shown above are © 2007 <a href="https://www.ohloh.net/projects/mediawiki/contributors">MediaWiki contributors</a>. They are part of the <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> software, which is distributed under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2</a>.
</p>