Browse files

moved web pages to git

  • Loading branch information...
slagyr committed Mar 23, 2010
1 parent 8a3c767 commit 20f68586c389caea274472dd4020b4c48adfe782
@@ -0,0 +1,4 @@
File renamed without changes.
@@ -1,7 +1,6 @@
require 'rubygems'
require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
require 'rake/clean'
require 'rake/rdoctask'
require 'spec/rake/spectask'
@@ -24,15 +23,16 @@ do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
+WEB_ROOT = File.expand_path('~/Projects/')
desc 'Generate RDoc'
rd = do |rdoc|
- rdoc.rdoc_dir = 'doc/website/output/rdoc'
- rdoc.options << '--title' << 'Statemachine' << '--line-numbers' << '--inline-source' << '--main' << 'README'
- rdoc.rdoc_files.include('README', 'CHANGES', 'lib/**/*.rb')
+ rdoc.rdoc_dir = "#{WEB_ROOT}/rdoc"
+ rdoc.options << '--title' << 'Statemachine' << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
+ rdoc.rdoc_files.include('README.rdoc', 'CHANGES', 'lib/**/*.rb')
task :rdoc
spec = do |s| = PKG_NAME
s.version = PKG_VERSION
@@ -73,10 +73,6 @@ task :todo do
egrep /(FIXME|TODO|TBD)/
-task :clobber do
- rm_rf 'doc/output'
task :release => [:clobber, :verify_committed, :verify_user, :verify_password, :spec, :publish_packages, :tag, :publish_website, :publish_news]
desc "Verifies that there is no uncommitted code"
@@ -97,46 +93,18 @@ end
desc 'Generate HTML documentation for website'
task :webgen do
- `cd doc/website; webgen`
+ system "rm -rf doc/website/out"
+ system "rm -rf doc/website/webgen.cache"
+ system "cd doc/website; webgen -v render; cp -rf out/* #{WEB_ROOT}"
desc "Build the website, but do not publish it"
-task :website => [:clobber, :webgen, :spec, :rdoc]
-desc "Upload Website to RubyForge"
-task :publish_website => [:verify_user, :website] do
- publisher =
- "/var/www/gforge-projects/#{PKG_NAME}",
- "doc/website/output"
- )
- publisher.upload
+task :website => [:webgen, :rdoc]
task :verify_user do
raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
task :verify_password do
raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
-desc "Publish gem+tgz+zip on RubyForge. You must make sure lib/version.rb is aligned with the CHANGELOG file"
-task :publish_packages => [:verify_user, :verify_password, :package] do
- require 'meta_project'
- require 'rake/contrib/xforge'
- release_files = FileList[
- "pkg/#{PKG_FILE_NAME}.gem",
- "pkg/#{PKG_FILE_NAME}.tgz",
- "pkg/#{PKG_FILE_NAME}.zip"
- ]
- do |xf|
- # Never hardcode user name and password in the Rakefile!
- xf.user_name = ENV['RUBYFORGE_USER']
- xf.password = ENV['RUBYFORGE_PASSWORD']
- xf.files = release_files.to_a
- xf.release_name = "statemachine #{PKG_VERSION}"
- end
@@ -19,11 +19,11 @@
<li><a href="documentation.html">Documentation</a></li>
<li><a href="example.html">Examples</a></li>
<li><a href="rdoc/index.html">RDoc</a></li>
- <li><a href="">Project</a></li>
+ <li><a href="">Project</a></li>
<div id="body">
- {content: }
+ <webgen:block name='content' />
<div id="footer">
<table border="0" cellpadding="0" cellspacing="0" align="center">
@@ -3,11 +3,11 @@ title: Statemachine Documentation
inMenu: true
-h2. What is a statemachine?
+<h2>What is a statemachine?</h2>
A statemachine keeps track of the status(state) of an application or device and responds to different inputs, which alter the state of the machine.
-h2. States, Transitions, and Events
+<h2>States, Transitions, and Events</h2>
* State: This is the status of the device or application the statemachine is being used for. At any given time, the statemachine is in one of its predefined states.
* Transition: Moving from one state to another is called a transition. Transitions are invoked by Events.
@@ -17,7 +17,7 @@ In the Statemachine project, a statemachine is defined by its transitions.
Take a look at <a href="example1.html">Example 1</a> to see States, Transitions, and Events being used.
-h2. Actions
Actions allow statemachines to perform operations at various point during execution. There are two models for incorporating actions into statemachines.
@@ -28,17 +28,17 @@ Mealy and Moore machines each have advantages and disadvantages. But one great a
Take a look at <a href="example2.html">Example 2</a> to see Actions being used.
-h2. Conditional Logic
+<h2>Conditional Logic</h2>
If you’re doing any significant amount of work with statemachines, you will most certainly encounter some conditional logic in your statemachines. You may need the state machine to go to one state if a certain condition is true and a different state if it is false. To accomplish this, you can have a state check for the condition and invoke the appropriate transition in an entry action.
Take a look at <a href="example3.html">Example 3</a> to see Conditional Logic being used.
-h2. Superstates
Oftentimes duplication can arise within a statemachine. One way to solve this problem is through the use of superstates. A <b>superstate</b> is a state that contains other states. One statemachine may have multiple superstates. And every superstate may contain other superstates. ie. Superstates can be nested.
-h3. History State
+<h3>History State</h3>
One problem with superstates is that they may not know which state to return to when coming into that state. To solve this problem, superstates come with the <b>history state</b>. Every superstate will remember which state it is in before the superstate is exited. This memory is stored in a pseudo state called the history state. Transitions that end in the history state will recall the last active state of the superstate and enter it.
@@ -3,7 +3,7 @@ title: Statemachine Examples
inMenu: true
-h2. Examples
Please take a look at the Documentation tab for details explaining the terms used in each of the following examples.
@@ -3,9 +3,9 @@ title: Statemachine Example 1
inMenu: true
-h2. States, Transitions, and Events
+<h2>States, Transitions, and Events</h2>
-h3. This is a simple statemachine showing use of states and transitions.
+<h3>This is a simple statemachine showing use of states and transitions.</h3>
<img style="border: 1px solid black" src="images/examples/vending_machine.png">
<br><b>The Vending Machine Statemachine Diagram</b>
@@ -3,9 +3,9 @@ title: Statemachine Example 2
inMenu: true
-h2. Actions
-h3. This example shows the addition of actions to our statemachine from <a href="example1.html">Example 1</a>.
+<h3>This example shows the addition of actions to our statemachine from <a href="example1.html">Example 1</a>.</h3>
The vending machine statemachine had some problems. Adding some actions will solve many of them. Here’s the same statemachine with actions.
@@ -67,7 +67,7 @@ Here is a simple context for the vending machine statemachine.
-h3. Action Declarations:
+<h3>Action Declarations:</h3>
With the statemachine gem, actions can be declared in any of three forms: Symbol, String, or Block.
@@ -77,7 +77,7 @@ When the action is a <b>Symbol</b>, (on_entry :sales_mode) it is assumes that th
If the action is a <b>Proc</b> (on_entry {puts 'entering sales mode'}), it will be called within the context of the context. Proc actions are also nice for quick and dirty actions. They can accept parameters and are preferred to String actions, unless you want to marshal your statemachine. Using one Proc actions will prevent the entire statemachine from being marhsal-able.
-h3. Execution
For kicks let’s put this statemachine thought a few events.
@@ -3,7 +3,7 @@ title: Statemachine Example 3
inMenu: true
-h2. Conditional Logic
+<h2>Conditional Logic</h2>
Out vending machine is a good example of when we may need conditional logic. When ever a coin is inserted, the invoked event will depend on whether the total amount of money inserted is sufficient to buy something. If enough money has been tendered, the display should suggest that the customer make a selection. If insufficient money has been inserted, the customer should be prompted to insert more.
@@ -16,7 +16,7 @@ Starting in the Accept Money state, when a coin is inserted, the coin event is f
The Coin Inserted state is unique. You wouldn’t expect to find the statemachine in the Coin Inserted state for any reason except to make this decision. Once the decision is made, the state changes. States like this are called <b>Decision States</b>.
-h2. Code
<pre>require 'rubygems'
require 'statemachine'
@@ -3,7 +3,7 @@ title: Statemachine Example 4
inMenu: true
-h2. Superstates
Often in statemachines, duplication can arise. For example, the vending machine in our examples may need periodic repairs. It’s not certain which state the vending machine will be in when the repair man arrives. So all states should have a transition into the Repair Mode state.
@@ -19,13 +19,13 @@ Here we introduce the Operational superstate. Both the Waiting and Paid states a
One statemachine may have multiple superstates. And every superstate may contain other superstates. ie. Superstates can be nested.
-h2. History State
+<h2>History State</h2>
The solution in <i>diagram 2</i> has an advantage over <i>diagram 1</i>. In <i>diagram 1</i>, once the repair man is done he triggers the operate event and the vending machine transitions into the Waiting event. This is unfortunate. Even if the vending machine was in the Paid state before the repair man came along, it will be in the Waiting state after he leaves. Shouldn’t it go back into the Paid state?
This is where use of the history state is useful. You can see the history state being use in <i>diagram 2</i>. In this solution, the history state allows the vending machine to return from a repair session into the same state it was in before, as though nothing happened at all.
-h2. Code
The following code builds the statemachine in <i>diagram 2</i>. Watch out for the _H. This is how the history state is denoted. If you have a superstate named foo, then it’s history state will be named foo_H.
@@ -1,20 +1,20 @@
title: Statemachine Overview
inMenu: true
The Statemachine library is a simple yet full-featured Finite Statemachine framework. Define your statemachine in Ruby code and execute it in your system.
-h2. Download and Installation
+<h2>Download and Installation</h2>
To download the package or source code visit the Statemachine <a href="">project page.</a> For the Statemachine gem:
<pre> > sudo gem install statemachine</pre>
or just
<pre> > gem install statemachine</pre>
-h2. Documentation
* <a href="documentation.html">Full descriptive documentation</a>
-* <a href="">RDoc API</a>
+* <a href="">RDoc API</a>
* <a href="">Helpful tutorial</a> describing what Statemachine are and how to implement them using the statemachine library.

0 comments on commit 20f6858

Please sign in to comment.