aasm 3.0.25 → 3.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d749826eeac0c51c3ee50f09e7acee8f67db5bf
4
- data.tar.gz: 7c96c771d9470db46c96c0ca1af339afd037feb1
3
+ metadata.gz: affc5be8f824b6ad897f4d8edca0a1809691e4b0
4
+ data.tar.gz: 6c777aba81646cf8d0ac801a9ecfe5d21c43929e
5
5
  SHA512:
6
- metadata.gz: ff4157e4b1824c00a0201d249bd2e3d97f899c172c2209765ce786d0974836291c532a5d8c6ff54d92e999d322a545db3156331b9f69d9ab7ec60b2b94a35eec
7
- data.tar.gz: e96dffe3354bbe7b9d9a38e0b5f7f1c447effd552e6a98b84bfbcea0ad4fe13299b99f8cffd99bdec42d87b56f3e8940b80744d889d1bb1d84862b133fc633de
6
+ metadata.gz: 56acaaef0033789a207dbabffa8e0aa088b26f0f7c9796a692992dfea502356a1fbb45131c61bce93c850f0b8b85859a6fa8870394a268e3115c4c88305291a7
7
+ data.tar.gz: acb7811990e9d2bc678395f1520c553f359432327f18b745a5a4d1e11fe702f87d1166ae18da9f375aac2aca2ac1e0083f283a97d7693f388bacebd74fcbcf9b
data/.gitignore CHANGED
@@ -6,8 +6,11 @@ coverage
6
6
  pkg
7
7
  rdoc
8
8
  Gemfile.lock
9
+ gemfiles/*.lock
9
10
  spec/debug.log
10
11
  spec/*.db
11
12
  TODO
12
13
  .rvmrc
14
+ .ruby-version
15
+ .ruby-gemset
13
16
  alto
@@ -5,6 +5,7 @@ rvm:
5
5
  - 1.9.2
6
6
  - 1.9.3
7
7
  - 2.0.0
8
+ - 2.1.0
8
9
  # - jruby-18mode # JRuby in 1.8 mode
9
10
  - jruby-19mode # JRuby in 1.9 mode
10
11
  - rbx-2.2.1
@@ -14,6 +15,7 @@ services: mongodb
14
15
  gemfile:
15
16
  - gemfiles/rails_3.2.gemfile
16
17
  - gemfiles/rails_4.0.gemfile
18
+ - gemfiles/rails_4.1.gemfile
17
19
 
18
20
  matrix:
19
21
  allow_failures:
@@ -21,9 +23,8 @@ matrix:
21
23
  - rvm: jruby-19mode
22
24
  exclude:
23
25
  - { rvm: 1.8.7, gemfile: gemfiles/rails_4.0.gemfile }
26
+ - { rvm: 1.8.7, gemfile: gemfiles/rails_4.1.gemfile }
24
27
  - { rvm: 1.9.2, gemfile: gemfiles/rails_4.0.gemfile }
25
- - { rvm: 1.9.3, gemfile: gemfiles/rails_4.0.gemfile }
26
- - { rvm: jruby-19mode, gemfile: gemfiles/rails_3.2.gemfile }
27
- - { rvm: jruby-19mode, gemfile: gemfiles/rails_4.0.gemfile }
28
- - { rvm: rbx-2.2.1, gemfile: gemfiles/rails_3.2.gemfile }
29
- - { rvm: rbx-2.2.1, gemfile: gemfiles/rails_4.0.gemfile }
28
+ - { rvm: 1.9.2, gemfile: gemfiles/rails_4.1.gemfile }
29
+ - { rvm: 1.9.3, gemfile: gemfiles/rails_4.1.gemfile }
30
+ - { rvm: jruby-19mode, gemfile: gemfiles/rails_4.1.gemfile }
@@ -1,12 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 3.1.0 (not yet released)
3
+ ## 3.9.0 (not yet released)
4
4
 
5
5
  * deprecated old aasm_* class methods (old-style DSL), in preparation for AASM v4.0.0
6
6
 
7
+ ## 3.0.26
8
+
9
+ * support state.human_name (aliased to state.localized_name) (see [issue #105](https://github.com/aasm/aasm/issues/105)
10
+
7
11
  ## 3.0.25
8
12
 
9
- * initialize the state even if validation is skipped (for ActiveRecord and Mongoid persistence) (see issue #103, thanks to [@vfonic](https://github.com/vfonic) and [@aaronklaassen](https://github.com/aaronklaassen))
13
+ * initialize the state even if validation is skipped (for ActiveRecord and Mongoid persistence) (see [issue #103](https://github.com/aasm/aasm/issues/103), thanks to [@vfonic](https://github.com/vfonic) and [@aaronklaassen](https://github.com/aaronklaassen))
10
14
 
11
15
  ## 3.0.24
12
16
 
@@ -1,11 +1,12 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gem "sqlite3", :platforms => :ruby
4
- gem "coveralls", :platforms => :ruby
4
+ gem "coveralls"
5
5
  gem 'rubysl', :platforms => :rbx
6
+ gem 'rubinius-developer_tools', :platforms => :rbx
6
7
  gem "jruby-openssl", :platforms => :jruby
7
8
  gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
8
- gem "rails", "3.2.15"
9
+ gem "rails", "3.2.16"
9
10
  gem 'mongoid' if Gem::Version.create(RUBY_VERSION.dup) >= Gem::Version.create('1.9.3')
10
11
 
11
12
  gemspec :path => "../"
@@ -1,10 +1,11 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gem "sqlite3", :platforms => :ruby
4
- gem "coveralls", :platforms => :ruby
4
+ gem "coveralls"
5
5
  gem 'rubysl', :platforms => :rbx
6
+ gem 'rubinius-developer_tools', :platforms => :rbx
6
7
  gem "jruby-openssl", :platforms => :jruby
7
8
  gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
8
- gem "rails", "4.0.1"
9
+ gem "rails", "4.0.2"
9
10
 
10
11
  gemspec :path => "../"
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sqlite3", :platforms => :ruby
4
+ gem "coveralls"
5
+ gem 'rubysl', :platforms => :rbx
6
+ gem 'rubinius-developer_tools', :platforms => :rbx
7
+ gem "jruby-openssl", :platforms => :jruby
8
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
9
+ gem "rails", "4.1.0.beta1"
10
+
11
+ gemspec :path => "../"
@@ -50,6 +50,7 @@ module AASM
50
50
  def localized_name
51
51
  AASM::Localizer.new.human_state_name(@clazz, self)
52
52
  end
53
+ alias human_name localized_name
53
54
 
54
55
  def for_select
55
56
  [display_name, name.to_s]
@@ -1,3 +1,3 @@
1
1
  module AASM
2
- VERSION = "3.0.25"
2
+ VERSION = "3.0.26"
3
3
  end
@@ -0,0 +1,33 @@
1
+ ActiveRecord::Migration.suppress_messages do
2
+ %w{gates readers writers transients simples simple_new_dsls no_scopes thieves localizer_test_models persisted_states provided_and_persisted_states}.each do |table_name|
3
+ ActiveRecord::Migration.create_table table_name, :force => true do |t|
4
+ t.string "aasm_state"
5
+ end
6
+ end
7
+
8
+ ActiveRecord::Migration.create_table "validators", :force => true do |t|
9
+ t.string "name"
10
+ t.string "status"
11
+ end
12
+
13
+ ActiveRecord::Migration.create_table "transactors", :force => true do |t|
14
+ t.string "name"
15
+ t.string "status"
16
+ t.integer "worker_id"
17
+ end
18
+
19
+ ActiveRecord::Migration.create_table "workers", :force => true do |t|
20
+ t.string "name"
21
+ t.string "status"
22
+ end
23
+
24
+ ActiveRecord::Migration.create_table "invalid_persistors", :force => true do |t|
25
+ t.string "name"
26
+ t.string "status"
27
+ end
28
+
29
+ ActiveRecord::Migration.create_table "fathers", :force => true do |t|
30
+ t.string "aasm_state"
31
+ t.string "type"
32
+ end
33
+ end
@@ -16,7 +16,7 @@ def load_schema
16
16
  config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
17
17
  ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
18
18
  ActiveRecord::Base.establish_connection(config['sqlite3'])
19
- load(File.dirname(__FILE__) + "/schema.rb")
19
+ require File.dirname(__FILE__) + "/database.rb"
20
20
  end
21
21
 
22
22
  # custom spec helpers
@@ -30,11 +30,15 @@ describe 'localized state names' do
30
30
  end
31
31
 
32
32
  it 'should localize' do
33
- LocalizerTestModel.aasm.states.detect {|s| s == :opened}.localized_name.should == "It's open now!"
33
+ state = LocalizerTestModel.aasm.states.detect {|s| s == :opened}
34
+ state.localized_name.should == "It's open now!"
35
+ state.human_name.should == "It's open now!"
34
36
  end
35
37
 
36
38
  it 'should use fallback' do
37
- LocalizerTestModel.aasm.states.detect {|s| s == :closed}.localized_name.should == 'Closed'
39
+ state = LocalizerTestModel.aasm.states.detect {|s| s == :closed}
40
+ state.localized_name.should == 'Closed'
41
+ state.human_name.should == 'Closed'
38
42
  end
39
43
  end
40
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.25
4
+ version: 3.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Barron
@@ -11,90 +11,90 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-12-16 00:00:00.000000000 Z
14
+ date: 2014-01-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: sdoc
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: rspec
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ~>
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '2.14'
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ~>
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '2.14'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rr
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - '>='
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: minitest
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '>='
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: mime-types
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ~>
90
+ - - "~>"
91
91
  - !ruby/object:Gem::Version
92
92
  version: '1.25'
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ~>
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '1.25'
100
100
  description: AASM is a continuation of the acts as state machine rails plugin, built
@@ -104,9 +104,9 @@ executables: []
104
104
  extensions: []
105
105
  extra_rdoc_files: []
106
106
  files:
107
- - .document
108
- - .gitignore
109
- - .travis.yml
107
+ - ".document"
108
+ - ".gitignore"
109
+ - ".travis.yml"
110
110
  - API
111
111
  - CHANGELOG.md
112
112
  - Gemfile
@@ -117,6 +117,7 @@ files:
117
117
  - aasm.gemspec
118
118
  - gemfiles/rails_3.2.gemfile
119
119
  - gemfiles/rails_4.0.gemfile
120
+ - gemfiles/rails_4.1.gemfile
120
121
  - lib/aasm.rb
121
122
  - lib/aasm/aasm.rb
122
123
  - lib/aasm/base.rb
@@ -132,6 +133,7 @@ files:
132
133
  - lib/aasm/state_machine.rb
133
134
  - lib/aasm/transition.rb
134
135
  - lib/aasm/version.rb
136
+ - spec/database.rb
135
137
  - spec/database.yml
136
138
  - spec/en.yml
137
139
  - spec/en_deprecated_style.yml
@@ -158,7 +160,6 @@ files:
158
160
  - spec/models/transactor.rb
159
161
  - spec/models/validator.rb
160
162
  - spec/models/worker.rb
161
- - spec/schema.rb
162
163
  - spec/spec_helper.rb
163
164
  - spec/unit/api_spec.rb
164
165
  - spec/unit/callbacks_spec.rb
@@ -185,12 +186,12 @@ require_paths:
185
186
  - lib
186
187
  required_ruby_version: !ruby/object:Gem::Requirement
187
188
  requirements:
188
- - - '>='
189
+ - - ">="
189
190
  - !ruby/object:Gem::Version
190
191
  version: '0'
191
192
  required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  requirements:
193
- - - '>='
194
+ - - ">="
194
195
  - !ruby/object:Gem::Version
195
196
  version: '0'
196
197
  requirements: []
@@ -200,6 +201,7 @@ signing_key:
200
201
  specification_version: 4
201
202
  summary: State machine mixin for Ruby objects
202
203
  test_files:
204
+ - spec/database.rb
203
205
  - spec/database.yml
204
206
  - spec/en.yml
205
207
  - spec/en_deprecated_style.yml
@@ -226,7 +228,6 @@ test_files:
226
228
  - spec/models/transactor.rb
227
229
  - spec/models/validator.rb
228
230
  - spec/models/worker.rb
229
- - spec/schema.rb
230
231
  - spec/spec_helper.rb
231
232
  - spec/unit/api_spec.rb
232
233
  - spec/unit/callbacks_spec.rb
@@ -1,35 +0,0 @@
1
- ActiveRecord::Schema.define(:version => 0) do
2
-
3
- %w{gates readers writers transients simples simple_new_dsls no_scopes thieves localizer_test_models persisted_states provided_and_persisted_states}.each do |table_name|
4
- create_table table_name, :force => true do |t|
5
- t.string "aasm_state"
6
- end
7
- end
8
-
9
- create_table "validators", :force => true do |t|
10
- t.string "name"
11
- t.string "status"
12
- end
13
-
14
- create_table "transactors", :force => true do |t|
15
- t.string "name"
16
- t.string "status"
17
- t.integer "worker_id"
18
- end
19
-
20
- create_table "workers", :force => true do |t|
21
- t.string "name"
22
- t.string "status"
23
- end
24
-
25
- create_table "invalid_persistors", :force => true do |t|
26
- t.string "name"
27
- t.string "status"
28
- end
29
-
30
- create_table "fathers", :force => true do |t|
31
- t.string "aasm_state"
32
- t.string "type"
33
- end
34
-
35
- end