Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[all] Changed README to .rdoc format

[#970 state:resolved]
  • Loading branch information...
commit fc8b882af6f4a15cacd7261462b80732bc21c133 1 parent 450a151
@snusnu snusnu authored
View
0  History.txt → History.rdoc
File renamed without changes
View
5 Manifest.txt
@@ -1,8 +1,7 @@
-History.txt
+History.rdoc
LICENSE
Manifest.txt
-README.markdown
-README.txt
+README.rdoc
Rakefile
TODO
lib/dm-is-state_machine.rb
View
54 README.markdown → README.rdoc
@@ -1,8 +1,8 @@
-# dm-is-state_machine #
+= dm-is-state_machine
DataMapper plugin that adds state machine functionality to your models.
-## Why is this plugin useful? ##
+== Why is this plugin useful?
Your DataMapper resource might benefit from a state machine if it:
@@ -14,46 +14,46 @@ And you want a clean, high-level way of describing these modes / behaviors
and how the resource moves between them. This plugin allows you to
declaratively describe the states and transitions involved.
-## Installation ##
+== Installation
1. Download dm-more.
2. Install dm-is-state_machine using the supplied rake files.
-## Setting up with Merb ##
+== Setting up with Merb ##
Add this line to your init.rb:
- dependency "dm-is-state_machine"
+ dependency "dm-is-state_machine"
## Example DataMapper resource (i.e. model) ##
- # /app/models/traffic_light.rb
- class TrafficLight
- include DataMapper::Resource
+ # /app/models/traffic_light.rb
+ class TrafficLight
+ include DataMapper::Resource
- property :id, Serial
+ property :id, Serial
- is :state_machine, :initial => :green, :column => :color do
- state :green
- state :yellow
- state :red, :enter => :red_hook
- state :broken
+ is :state_machine, :initial => :green, :column => :color do
+ state :green
+ state :yellow
+ state :red, :enter => :red_hook
+ state :broken
- event :forward do
- transition :from => :green, :to => :yellow
- transition :from => :yellow, :to => :red
- transition :from => :red, :to => :green
- end
+ event :forward do
+ transition :from => :green, :to => :yellow
+ transition :from => :yellow, :to => :red
+ transition :from => :red, :to => :green
end
+ end
- def red_hook
- # Do something
- end
+ def red_hook
+ # Do something
end
+ end
-## What this gives you ##
+== What this gives you
-### Explained in words ###
+=== Explained in words
The above DSL (domain specific language) does these things "behind the scenes":
@@ -67,7 +67,7 @@ The above DSL (domain specific language) does these things "behind the scenes":
it with an invalid state (such as :broken, see above). After the method
runs successfully, the state machine will be left in the :to state.
-### Explained with some code examples ###
+=== Explained with some code examples
# Somewhere in your controller, perhaps
light = TrafficLight.new
@@ -85,11 +85,11 @@ The above DSL (domain specific language) does these things "behind the scenes":
# do something red-related
end
-## Specific examples ##
+== Specific examples
We would also like to hear how *you* are using state machines in your code.
-## See also ##
+== See also
Here are some other projects you might want to look at. Most of them
are probably intended for ActiveRecord. They take different approaches,
View
5 README.txt
@@ -1,5 +0,0 @@
-= dm-is-state_machine
-
-== DESCRIPTION:
-
-See README.markdown
View
2  Rakefile
@@ -14,7 +14,7 @@ GEM_NAME = 'dm-is-state_machine'
GEM_VERSION = DataMapper::Is::StateMachine::VERSION
GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
GEM_CLEAN = %w[ log pkg coverage ]
-GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt README.markdown LICENSE TODO History.txt] }
+GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc] }
PROJECT_NAME = 'datamapper'
PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
Please sign in to comment.
Something went wrong with that request. Please try again.