]> Inochi 0.2.0






Contents

Tips

  1. Merging files with kdiff3



Chapter 1
Introduction

Inochi is an infrastructure for RubyGems-based software projects that encourages good documentation, reduces programming effort, and automates common tasks.

Inochi is exciting because:

  • It encourages good documentation:

    • Provides a comprehensive user manual that integrates release notes, setup and usage instructions, and more.
    • Automates the display of help, version, and usage information for your project’s main executable.
  • It reduces programming effort:

    • Provides a single point of entry to your project’s libraries.
    • Keeps your project’s configuration in one place.
    • Parses command-line options using the Trollop library.
  • It automates common tasks:

    • Generates project scaffolds while merging changes from previous ones.
    • Provides Rake tasks for packaging, publishing, and announcing your project.

These features distinguish Inochi from the competition:

Etymology

In the past, software development was thought to be like mathematical modeling or building construction: the assembly of inanimate objects. Nowadays, it is thought to be more like gardening: the cultivation of life!

In this manner, I consider this project not as a generator of skeletons or as a builder of scaffolds, but as a giver of life. That is why I named this project “inochi”, the Japanese word for life.

Happy gardening!

1.1  Logistics

To get help or provide feedback, simply contact the author(s).

Version numbers

Inochi releases are numbered in major.minor.patch form according to the RubyGems rational versioning policy, which can be summarized thus:

What increased in the version number? The increase indicates that the release:
Is backward compatible? Has new features? Has bug fixes?
major No Yes Yes
minor Yes Yes Yes
patch Yes No Yes

1.2  License

Copyright 2008 Suraj N. Kurapati sunaku@gmail.com

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

1.3  Credits

project logo

The “inochi.png” image and its “inochi.svg” source utilize the “3 flowers” graphic, which was created and released into the public domain by Peileppe Production on June 25, 2008.

Chapter 2
Setup

2.1  Requirements

Your system needs the following software to run Inochi.

SoftwareDescriptionNotes
RubyRuby language interpreterVersion 1.8.6 or 1.8.7 is required.
RubyGemsRuby packaging systemVersion 1.x.x is required.
ERBookExtensible document processor based on eRubyVersion 6.x.x is required.
LynxText-mode web browserVersion 2.8.6 or newer is required to convert HTML into plain text.

2.2  Installation

You can install Inochi by running this command:

gem install erbook inochi

To check whether the installation was sucessful, run this command:

inochi --version

If the installation was successful, you will see output like this:

project: Inochi
version: 0.2.0
release: 2009-01-25
website: http://snk.tuxfamily.org/lib/inochi
install: /home/sun/src/inochi

If you do not see such output, you may ask the author(s) for help.

2.3  Manifest

You will see the following items inside Inochi’s installation directory, whose path you can determine by running this command:

inochi --version
  • bin/

    • inochi — the main Inochi executable.
  • lib/

    • inochi.rb — the main Inochi library.
  • doc/

    • api/ — API reference documentation.

    • index.erb — source of this user manual.

  • LICENSE — copyright notice and legal conditions.

Part 3
Usage

3.1  Command-line interface

When you run this command:

inochi --help

You will see this output:

Inochi - Gives life to RubyGems-based software

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
            merging tool (see the "--merger" option) will be launched to
            transfer content from the old file (*.old) and the new file
            (*.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 [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
                      old file or the new file.
      --manual, -a:   Show the user manual
     --version, -v:   Print version and exit
        --help, -h:   Show this message

Tip 1.  Merging files with kdiff3

tip

Instead of merging files by hand, you can transfer wanted changes between files semi-automatically using kdiff3. Simply follow these instructions:

  1. Create a file named merge2 with the following content:

    #!/bin/sh
    
    old_file=$1
    shift
    
    new_file=$1
    shift
    
    output_file=$1
    shift
    
    kdiff3 --merge "$old_file" "$new_file" --output "$output_file"
  2. Make the file executable:

    chmod +x merge2
  3. Place the file in a directory that is listed in your PATH environment variable.

  4. Run Inochi like this:

    inochi -m merge2

    Now kdiff3 will be invoked to help you transfer your changes. When you are finished transferring changes, save the file and quit kdiff3. If you do not want to transfer any changes, simply quit kdiff3 without saving the file.

3.2  Ruby library interface

The Inochi module has several class methods which provide a common configuration for various aspects of your project. These aspects, and their interactions with the Inochi module, are as follows:

3.3  Tutorial

This tutorial shows how Inochi is used to manage a hypothetical WordCount project throughout the various stages of its life.

3.3.1  Have a brilliant idea

It is 4am on Sunday morning. Unwilling to sleep, you have spent the past few hours programming obsessively.. Though your eyes grow heavy and your stomach churns from hunger, your mind charges forth with haste.

Push on! Keep on!

Until at last, pushed far beyond its limit, your body overpowers your will and drags you into black unconsciousness.

BEEP BEEP B

Half-asleep and violent from the sudden disturbance, you silence the bleeting alarm clock with vengeance. It is 2pm on Sunday afternoon.

Red beams of sunlight slip through the gaps in your curtains. It is a beautiful day, outside. Outside— you think,

What am I doing to myself?

I’ve got to get outside.

I’ve got to get away

Away from this computer… this… mental prison in which I toil night after night, like a souless machine.

Venturing into the courtyard outside your quarters, you find peace. A warm breeze graces you, sweeping your hair gently as a mother would. The bright sunlight penetrates your mind’s eye as your thoughts fade…

Thoughts of tests to write, units to refactor, bugs to fix, options to document. They melt and mix and flow into nothingness.

All is clear. No thoughts. No more.

No!

You collapse heavily onto the grassy earth beneath you. Breathing deeply, you sink into yourself and whisper

It’s okay.

Just, let go.

and fall asleep.

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 WordCount module.

However, you must go to work the next morning, so there isn’t much time. What can you do? Let’s see how Inochi can help us meet this challenge.

3.3.2  Generate your project

Give life to your new project:

# 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
  create  word_count/doc/history.erb

Enter the word_count directory:

# cd word_count

View Rake tasks

# 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
rake clean          # Remove any temporary products.
rake clobber        # Remove any generated file.
rake doc            # Build all documentation.
rake doc:api        # Build API reference.
rake doc:man        # Build the user manual.
rake pak            # Build a release.
rake pub            # Publish a release.
rake pub:ann        # Publish all announcements.
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.
rake test           # Run all unit tests.

Run unit tests

# rake test
(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)
Loaded suite word_count
Started
.
Finished in 0.001064 seconds.

1 tests, 23 assertions, 0 failures, 0 errors, 0 skips

Run project executable

# ruby bin/word_count
Command-line options:   {:manual=>false, :version=>false, :help=>false}
Command-line arguments: []

See usage information:

# 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 [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

See project & version information:

# ruby bin/word_count --version
project: WordCount
version: 0.0.0
release: 2009-01-25
website: http://word_count.rubyforge.org
install: /tmp/Inochi20090125-24483-1xmgxqy-0/word_count

Show user manual

Build the user manual (please disregard any “unclosed span” warnings):

# rake doc:man

Launch the user manual:

# ruby bin/word_count --manual

The manual will now appear in your default web browser.

3.3.3  Configure your project

Section 3.2. Ruby library interface lists and documents the interactions between your project and Inochi. These points of interaction are illustrated in the following sections.

3.3.3.1  Project information

Open the LICENSE file, which contains the open source ISC license by default, and add a copyright notice with your name and (optional) email address:

Copyright 2009 Your Name <your@email.here>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Open the main project library file lib/word_count.rb and fill in the blanks:

require 'rubygems'
gem 'inochi', '~> 0'
require 'inochi'

Inochi.init :WordCount,
  :project => 'WordCount',
  :version => '0.0.0',
  :release => '2009-01-25',
  :website => 'http://word_count.rubyforge.org',
  :tagline => 'TODO: put a single line description of your project here.',
  :require => {
    # TODO: list gems required by your project here.
    # NOTE: this is completely optional!
    #
    # example: if your project needs version 9.9.9 of the 'foo' gem:
    # 'foo' => '9.9.9',
    #
    # example: if any version of a gem is acceptable then:
    # 'foo' => nil,
  }

3.3.3.2  Project executable

Open the bin/word_count file and fill in the blanks:

#!/usr/bin/ruby -w
#
# TODO: Explain the command-line usage of this program here.
#
#
# Usage:
#
#   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:
#

require 'rubygems'
gem 'inochi', '~> 0'
require 'inochi'

options = Inochi.main :WordCount do
  # TODO: define command-line options here.
  #       see http://trollop.rubyforge.org/
  #
  # NOTE: this is completely optional!
end

# TODO: add the body of your program here

puts "Command-line options:   #{options.inspect}"
puts "Command-line arguments: #{ARGV.inspect}"

3.3.3.3  Rake tasks

Open the Rakefile and fill in the blanks:

require 'rubygems'
gem 'inochi', '~> 0'
require 'inochi'

Inochi.rake :WordCount do |gem|
  # TODO: additional gem configuration.
  # NOTE: this is completely optional!
  #
  # gem.extensions = ['foo.so']
  # gem.files += ['other', 'files']
end

3.3.3.4  User manual

The user manual’s source file doc/index.erb subdivides its content into several smaller files, according to topic, for easier editing and maintenance. These files are processed by the ERBook program’s XHTML format to produce the doc/index.xhtml file.

Open these source files and fill in the blanks:

doc/index.erb

<% Inochi.book :WordCount, self %>

<%# include intro.erb #%>
<%# include setup.erb #%>
<%# include theory.erb #%>
<%# include usage.erb #%>
<%# include history.erb #%>

doc/intro.erb

<% chapter "Introduction" do %>
  <% project_summary do %>
    > TODO: explain the purpose of your project

    **<%= $project %>** is a __________ that __________.
  <% end %>

  > TODO: explain why your project is important

  **<%= $project %>** is exciting because:
  * It lets you __________.
  * Its core contains less than __________ lines of code.
  * It __________.

  > TODO: explain why your project is better than its competitors

  These features distinguish **<%= $project %>** from the competition:
  * [competitor 1](http://)
  * [competitor 2](http://)
  * [competitor 3](http://)

  <% paragraph "Etymology" do %>
    > TODO: explain the meaning of the name of your project
  <% end %>

  <% section "Logistics" do %>
    * <%= xref "History", "Release notes" %> --- history of project releases.
    * [Source code](http://github.com/sun/<%= $program %>) --- obtain via [Git](http://git.or.cz) or browse online.
    * [API reference](api/index.html) --- documentation for source code.

    To get help or provide feedback, simply
    <%= xref "License", "contact the author(s)" %>.

    <% paragraph "Version numbers" do %>
      **<%= $project %>** releases are numbered in *major.minor.patch*
      form according to the [RubyGems rational versioning
      policy](http://www.rubygems.org/read/chapter/7), which
      can be summarized thus:

      <table markdown="1">
        <thead>
          <tr>
            <td rowspan="2">What increased in the version number?</td>
            <td colspan="3">The increase indicates that the release:</td>
          </tr>
          <tr>
            <th>Is backward compatible?</th>
            <th>Has new features?</th>
            <th>Has bug fixes?</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th>major</th>
            <td style="background-color: #FFE4E1;">No</td>
            <td>Yes</td>
            <td>Yes</td>
          </tr>
          <tr>
            <th>minor</th>
            <td>Yes</td>
            <td>Yes</td>
            <td>Yes</td>
          </tr>
          <tr>
            <th>patch</th>
            <td>Yes</td>
            <td style="background-color: #FFE4E1;">No</td>
            <td>Yes</td>
          </tr>
        </tbody>
      </table>
    <% end %>
  <% end %>

  <% section "License" do %>
    <%# include ../LICENSE #%>
  <% end %>

  <% section "Credits" do %>
    > TODO: give attribution to your predecessors and contributors
  <% end %>
<% end %>

doc/setup.erb

<% chapter "Setup" do %>
  <% section "Requirements" do %>
    Your system needs the following software to run **<%= $project %>**.

    | 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. |
  <% end %>

  <% section "Installation" do %>
    You can install **<%= $project %>** by running this command:

        gem install <%= $program %>

    To check whether the installation was sucessful, run this command:

        <%= $program %> --version

    If the installation was successful, you will see output like this:

    <pre><%= verbatim `ruby bin/#{$program} --version` %></pre>

    If you do not see such output, you may
    <%= xref "License", "ask the author(s)" %> for help.
  <% end %>

  <% section "Manifest" do %>
    You will see the following items inside **<%= $project %>**'s installation
    directory, whose path you can determine by running this command:

        <%= $program %> --version

    > TODO: list important files your project provides here

    * <tt>bin/</tt>

      * <tt><%= $program %></tt> --- the main **<%= $project %>** executable.

    * <tt>lib/</tt>

      * <tt><%= $program %>.rb</tt> --- the main **<%= $project %>** library.

      * <tt><%= $program %>/</tt>

        > TODO: list sub-libraries your project provides here

    * <tt>doc/</tt>

      * <tt>api/</tt> --- API reference documentation.

      * <tt>index.erb</tt> --- source of this user manual.

    * <tt>LICENSE</tt> --- copyright notice and legal conditions.
  <% end %>
<% end %>

doc/theory.erb

<% chapter "Theory of operation" do %>
  > TODO: explain how your project does what it does
<% end %>

doc/usage.erb

<% chapter "Usage" do %>
  <% section "Command-line interface" do %>
    When you run this command:

        <%= $program %> --help

    You will see this output:

    <pre><%= verbatim `ruby bin/#{$program_name} --help` %></pre>

    > TODO: explain the command-line arguments
  <% end %>

  <% section "Ruby library interface" do %>
    > TODO: explain how to use your project's Ruby library
    >       from inside another Ruby program or library
  <% end %>

  <% section "Tutorial" do %>
    This tutorial shows how **<%= $project %>** is used to __________.

    > TODO: give examples for doing common tasks
  <% end %>

  > TODO: explain how to do more (advanced) things
<% end %>

doc/history.erb

<% chapter "History" do %>
  > TODO: put a brief history about your project here

  <% project_history do %>
    > TODO: put release notes for your project
    >       here -- newest first, oldest last.

    <% section "Version 0.0.0 (2009-01-25)" do %>
      > TODO: write a short summary of the changes in this release

      This release changes __________, adds __________, and fixes __________.

      <% paragraph "Contributor kudos" do %>
        > TODO: list everyone who contributed to this
        >       release and what their contribution was

        * __________ contributed __________ which __________.

        * __________ fixed __________ which __________.

        * __________ added __________ which __________.
      <% end %>

      <% paragraph "Incompatible changes" do %>
        > TODO: list all backward-incompatible changes in this release

        * __________ has been __________ to __________.

        * __________.

        * __________.
      <% end %>

      <% paragraph "New features" do %>
        > TODO: list new features added in this release

        * __________.

        * __________.

        * __________.
      <% end %>

      <% paragraph "Bug fixes" do %>
        > TODO: describe all bugs that are fixed in this release

        * __________ was __________.

        * __________ were __________.

        * __________ did __________.
      <% end %>

      <% paragraph "Housekeeping" do %>
        > TODO: list the refactorings, clean ups, and other
        >       improvements that were done for this release

        * __________.

        * __________.

        * __________.
      <% end %>
    <% end %>
  <% end %>
<% end %>

3.3.4  Implement your project

Add the following code to the bottom of lib/word_count.rb, the main project library:

module WordCount
  # Returns the number of words in the given input.
  def WordCount.count input
    input.to_s.split(/\W+/).length
  end
end

Add the following code to the bottom of bin/word_count, the main project executable:

input = ARGF.read
total = WordCount.count(input)
puts "There are #{total} words in the input."

Add the following code to the bottom of test/word_count.rb, a unit test for the main project library:

describe WordCount do
  it 'handles empty input' do
    WordCount.count(nil).must_equal(0)
    WordCount.count('').must_equal(0)
    WordCount.count(' ').must_equal(0)
  end

  it 'handles single words' do
    WordCount.count('a').must_equal(1)
    WordCount.count('foo').must_equal(1)
    WordCount.count('bar').must_equal(1)
  end

  it 'handles multiple words' do
    WordCount.count('a b').must_equal(2)
    WordCount.count('a-b').must_equal(2)
    WordCount.count('a/b').must_equal(2)
  end

  it 'ignores punctuation and space' do
    WordCount.count('!').must_equal(0)
    WordCount.count('! @ # % #!@#').must_equal(0)
    WordCount.count(' !').must_equal(0)
    WordCount.count('! ').must_equal(0)
    WordCount.count(' ! ').must_equal(0)
    WordCount.count('   !   ').must_equal(0)
  end
end

Goodbye $LOAD_PATH, hello require()

Notice that, in the Ruby files that you modified so far, there were no $LOAD_PATH manipulations and no explicit require() statements to pull in the various parts of your project. That is because Inochi does this for you automatically.

Furthermore, you can always require() a sub-library anywhere in your project using its canonical path because Inochi puts your main project libraries on the Ruby load path.

For example, if your project has a sub-library, say, lib/word_count/odf/text.rb that counts the number of words in an OpenDocument Text document, then it would be loaded into the main project executable like this:

require 'word_count/odf/text'

Regardless of whether a sub-library is used within your project itself or from within an external application, we always require() the sub-library using the same canonical path.

3.3.5  Test your project

To reduce the amount of code you have to write, Inochi defines the following convention for unit tests.

Units and tests

Every Ruby source file in your project’s lib/ directory is considered to be a unit. Likewise, every Ruby source file in your project’s test/ is considered to be a test.

As a result, your project’s test/ directory structure mirrors the structure of your project’s lib/ directory. For example, if your project has a lib/foo/bar.rb unit, then test/foo/bar.rb would be its the corresponding test.

Test execution

rake test

The above command begins the testing process, during which:

  • Tests which lack corresponding units are skipped and not executed. A message specifying which test file was skipped is printed to the standard error stream whenever this occurs.

  • Before a test is executed, its corresponding unit is automatically loaded into the Ruby environment using require().

As for the details of test execution:

  • Tests are executed by the minitest 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.

  • Within each test, test cases are executed in random order. This is the default behavior of the minitest library.

Helper libraries

Your project’s main directory is added to Ruby’s load path. So if your tests have helper libraries stored in your project’s test/ directory, you can load them into your tests by adding a “test/” prefix.

For example, if your test/foo/bar.rb test has a test/foo/qux.rb helper library, then you would write the following code inside the test to load the helper library:

require 'test/foo/qux'

3.3.6  Publish your project

This command performs all of the automated steps described in the following sections:

# rake pub

3.3.6.1  Build a RubyGem

Build a RubyGem by running:

# rake pak
(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

See the RubyGem contents:

# gem spec pkg/*.gem
--- !ruby/object:Gem::Specification 
name: word_count
version: !ruby/object:Gem::Version 
  version: 0.0.0
platform: ruby
authors: 
- Your Name
autorequire: 
bindir: bin
cert_chain: []

date: 2009-01-25 00:00:00 -08:00
default_executable: 
dependencies: 
- !ruby/object:Gem::Dependency 
  name: inochi
  type: :runtime
  version_requirement: 
  version_requirements: !ruby/object:Gem::Requirement 
    requirements: 
    - - ~>
      - !ruby/object:Gem::Version 
        version: "0"
    version: 
description: "TODO: put a single line description of your project here."
email: your@email.here
executables: 
- word_count
extensions: []

extra_rdoc_files: []

files: 
- lib
- lib/word_count.rb
- test
- test/word_count.rb
- bin
- bin/word_count
- Rakefile
- LICENSE
- doc
- doc/usage.erb
- doc/index.erb
- doc/history.erb
- doc/intro.erb
- doc/index.xhtml
- doc/setup.erb
- doc/api
- doc/api/index.html
- doc/api/all-methods.html
- doc/api/app.js
- doc/api/syntax_highlight.css
- doc/api/readme.html
- doc/api/style.css
- doc/api/jquery.js
- doc/api/all-namespaces.html
- doc/theory.erb
has_rdoc: true
homepage: http://word_count.rubyforge.org
post_install_message: 
rdoc_options: []

require_paths: 
- lib
required_ruby_version: !ruby/object:Gem::Requirement 
  requirements: 
  - - ">="
    - !ruby/object:Gem::Version 
      version: "0"
  version: 
required_rubygems_version: !ruby/object:Gem::Requirement 
  requirements: 
  - - ">="
    - !ruby/object:Gem::Version 
      version: "0"
  version: 
requirements: []

rubyforge_project: word_count
rubygems_version: 1.3.1
signing_key: 
specification_version: 2
summary: "TODO: put a single line description of your project here."
test_files: []

3.3.6.2  Publish a RubyGem

You must first register your project on RubyForge before you can publish a RubyGem. If your RubyForge project name is different from your actual project name, then you should pass the :rubyforge_project and :rubyforge_section options to the Inochi.rake() method).

Publish a RubyGem by running:

# rake pub:pak

3.3.6.3  Announce a release

You must first provide your Paragraph. Login information to Inochi. If you do not want to do this, then see Section 3.3.6.3.1. Manual release announcement.

Announce a release by running:

# rake pub:ann

Login information

In order to automate the announcement of releases, Inochi needs to know your login information for the RAA (Ruby Application Archive) and RubyForum, which serves as a gateway to the ruby-talk mailing list.

This information is expected to be stored in a ~/.config/inochi/logins.yaml file (this location can be overridden by passing the :logins_file option to the Inochi.rake() method), where ~ denotes the path to your home directory. This file is a YAML document containing the following parameters:

www.ruby-forum.com:
  user: YOUR_USERNAME_HERE
  pass: YOUR_PASSWORD_HERE

raa.ruby-lang.org:
  pass: YOUR_PASSWORD_HERE

For better security, you should ensure that this file is only readable and writable by you and is not accessible by anyone else. In a UNIX environment, this can be accomplished by running the following command:

# chmod 0600 ~/.config/inochi/logins.yaml
3.3.6.3.1  Manual release announcement

Build release announcements by running:

# rake ann
(in /tmp/Inochi20090125-24483-1xmgxqy-0/word_count)

This produces the following files in your project directory:

  • ANN.eml
  • ANN.html
  • ANN.txt

Now you can manually announce your release using these files.

3.3.6.4  Publish the documentation

Publish the user manual and API documentation by running:

# rake pub:doc

If your documentation website (see the :docsite option for the Inochi.init() method) is hosted on RubyForge, then the above command will automatically upload your project’s documentation to the correct place.

Chapter 4
History

4.1  Version 0.2.0 (2009-01-25)

This release adds support for unit testing, improves the portability of Inochi and configurability of your projects, adds new content to the user manual, and fixes some bugs.

Contributor kudos

Florian Gilcher patched Inochi to:

  • Run on both JRuby and normal Ruby in multiple versions and with different executable names on Windows.

  • 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.

New features

  • Added support for unit testing via the minitest library. See Section 3.3.5. Test your project for documentation.

    Also, in related news, the scaffold generator now emits a default unit test for the main project library.

  • Added optional ProgramName parameter to the scaffold generator. This allows you to specify reasonable program names when your project module has a strange capitalization:

    > inochi ERBook
      create  er_book/LICENSE
    
    > inochi ERBook erbook
      create  erbook/LICENSE
    
    > inochi ERBook foobar
      create  foobar/LICENSE
  • Allow project authors to be specified via

    Inochi.init :YourProject, :authors => ...

Bug fixes

  • Use Gem::RubyGemsVersion instead of a shell command to determine rubygems version for generation of setup.erb. (Florian Gilcher)

  • Add blank lines between all list items, not just multi-line ones, in the plain-text version of the relase announcement for improved readability.

  • 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.

Housekeeping

  • Added unit tests for utility methods provided by the Inochi module: project name calculation and CamelCase to snake_case conversion.

4.1  Version 0.1.0 (2009-01-13)

This release reattempts to fix the circular dependency problem that occurred when installing either Inochi or ERBook.

New features

  • **Inochi**.init() now adds #major(), #series(), and #requirement() instance methods to a project’s VERSION constant.

Bug fixes

  • 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 gem install command for Inochi.

    Section 2.2. Installation has been updated accordingly.

  • Add forgotten Rake dependency for Inochi gem.

4.1  Version 0.0.1 (2009-01-13)

This release fixes some show-stopper bugs.

Contributor kudos

  • Florian Gilcher tried the first release of Inochi and reported bugs.

Bug fixes

  • Florian Gilcher reported that the name of the project library was being determined incorrectly.

  • Florian Gilcher reported that there was a circular dependency problem when installing the Inochi gem.

    The solution is to specify the --force option when installing the gem. Section 2.2. Installation has been updated accordingly.

  • Generated project scaffolds now check against the major version of the Inochi gem, to avoid runtime version conflicts.

Housekeeping

  • Only add project libraries to $LOAD_PATH if not already there.

4.1  Version 0.0.0 (2009-01-13)

This is the first release of Inochi.

Happy birthday!