whitespace ninja

This commit is contained in:
Travis Tilley 2009-05-27 20:32:02 -04:00
parent 15915ad6e7
commit f62693b70c
6 changed files with 16 additions and 14 deletions

View File

@ -22,8 +22,8 @@ end
$package_version = CURRENT_VERSION
PKG_FILES = FileList['[A-Z]*',
'lib/**/*.rb',
'doc/**/*'
'lib/**/*.rb',
'doc/**/*'
]
desc 'Generate documentation for the acts as state machine plugin.'
@ -44,9 +44,10 @@ else
s.name = 'aasm'
s.version = $package_version
s.summary = 'State machine mixin for Ruby objects'
s.description = <<-EOF
AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
EOF
s.description = <<EOF
AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
EOF
s.files = PKG_FILES.to_a
s.require_path = 'lib'
s.has_rdoc = true

View File

@ -4,15 +4,16 @@ Gem::Specification.new do |s|
s.name = 'aasm'
s.version = "2.0.6"
s.summary = 'State machine mixin for Ruby objects'
s.description = <<-EOF
s.description = <<EOF
AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
EOF
s.files = PKG_FILES
s.require_path = 'lib'
s.has_rdoc = true
s.extra_rdoc_files = ['README.rdoc', 'MIT-LICENSE', 'TODO', 'CHANGELOG']
s.rdoc_options = ['--line-numbers', '--inline-source', '--main', 'README.rdoc', '--title', 'AASM']
s.author = 'Scott Barron'
s.email = 'scott@elitists.net'
s.homepage = 'http://github.com/rubyist/aasm'

View File

@ -118,7 +118,7 @@ module AASM
end
@aasm_current_state = state
end
def aasm_determine_state_name(state)
case state
when Symbol, String

View File

@ -44,7 +44,7 @@ module AASM
base.class_eval do
class << self
unless method_defined?(:aasm_state_without_named_scope)
alias_method :aasm_state_without_named_scope, :aasm_state
alias_method :aasm_state_without_named_scope, :aasm_state
alias_method :aasm_state, :aasm_state_with_named_scope
end
end

View File

@ -141,7 +141,7 @@ describe AASM, '- initial states' do
it 'should use the first state defined if no initial state is given' do
@bar.aasm_current_state.should == :read
end
it 'should determine initial state from the Proc results' do
Banker.new(Banker::RICH - 1).aasm_current_state.should == :selling_bad_mortgages
Banker.new(Banker::RICH + 1).aasm_current_state.should == :retired

View File

@ -50,7 +50,7 @@ begin
class Beaver < June
end
class Thief < ActiveRecord::Base
include AASM
aasm_initial_state Proc.new { |thief| thief.skilled ? :rich : :jailed }
@ -227,17 +227,17 @@ begin
end
end
end
describe 'Thieves' do
before(:each) do
connection = mock(Connection, :columns => [])
Thief.stub!(:connection).and_return(connection)
end
it 'should be rich if they\'re skilled' do
Thief.new(:skilled => true).aasm_current_state.should == :rich
end
it 'should be jailed if they\'re unskilled' do
Thief.new(:skilled => false).aasm_current_state.should == :jailed
end