state_machines-activemodel 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +28 -25
- data/gemfiles/active_model_6.0.gemfile +7 -0
- data/lib/state_machines-activemodel.rb +5 -0
- data/lib/state_machines/integrations/active_model.rb +0 -18
- data/lib/state_machines/integrations/active_model/version.rb +1 -1
- data/test/machine_with_internationalization_test.rb +1 -21
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c0c2ff3f596aa6cef5995e482bcebf703eae4a12b69ab74eab03808bd11c6d6
|
4
|
+
data.tar.gz: f52f715a48845c350ddb25d84ea7a9e17ec9d95ea333cd57c329175cb9dcf01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8585ea04188c0f058c5ac7673ff9df179222c0419a51b9f82d76bf38bd42a25409def954d0bfc2dbf54c2fb24830f02d13ae0307f2879b56c7c36e7aca27c3dd
|
7
|
+
data.tar.gz: 06e2b22e4c65b8a0f10052d73891b1f54016cb00952829320e65a4ce9ea1fc8fbb0427bff6fbdfb58cd3095e65f4f9a63a775916957d2fb8ca7b89eabc60608c
|
data/.travis.yml
CHANGED
@@ -5,9 +5,10 @@ cache: bundler
|
|
5
5
|
rvm:
|
6
6
|
- 2.1
|
7
7
|
- 2.2.9
|
8
|
-
- 2.3.
|
9
|
-
- 2.4.
|
10
|
-
- 2.5.
|
8
|
+
- 2.3.8
|
9
|
+
- 2.4.6
|
10
|
+
- 2.5.5
|
11
|
+
- 2.6.2
|
11
12
|
- jruby
|
12
13
|
- rbx-2
|
13
14
|
|
@@ -21,47 +22,49 @@ matrix:
|
|
21
22
|
- gemfile: gemfiles/active_model_4.1.gemfile
|
22
23
|
rvm: 2.2.9
|
23
24
|
- gemfile: gemfiles/active_model_4.1.gemfile
|
24
|
-
rvm: 2.3.
|
25
|
+
rvm: 2.3.8
|
25
26
|
- gemfile: gemfiles/active_model_5.0.gemfile
|
26
27
|
rvm: 2.2.9
|
27
28
|
- gemfile: gemfiles/active_model_5.0.gemfile
|
28
|
-
rvm: 2.3.
|
29
|
+
rvm: 2.3.8
|
29
30
|
- gemfile: gemfiles/active_model_5.0.gemfile
|
30
|
-
rvm: 2.4.
|
31
|
+
rvm: 2.4.6
|
31
32
|
- gemfile: gemfiles/active_model_5.0.gemfile
|
32
|
-
rvm: 2.5.
|
33
|
+
rvm: 2.5.5
|
34
|
+
- gemfile: gemfiles/active_model_5.0.gemfile
|
35
|
+
rvm: 2.6.2
|
33
36
|
- gemfile: gemfiles/active_model_5.1.gemfile
|
34
37
|
rvm: 2.2.9
|
35
38
|
- gemfile: gemfiles/active_model_5.1.gemfile
|
36
|
-
rvm: 2.3.
|
39
|
+
rvm: 2.3.8
|
40
|
+
- gemfile: gemfiles/active_model_5.1.gemfile
|
41
|
+
rvm: 2.4.6
|
37
42
|
- gemfile: gemfiles/active_model_5.1.gemfile
|
38
|
-
rvm: 2.
|
43
|
+
rvm: 2.5.5
|
39
44
|
- gemfile: gemfiles/active_model_5.1.gemfile
|
40
|
-
rvm: 2.
|
45
|
+
rvm: 2.6.2
|
41
46
|
- gemfile: gemfiles/active_model_5.2.gemfile
|
42
47
|
rvm: 2.2.9
|
43
48
|
- gemfile: gemfiles/active_model_5.2.gemfile
|
44
|
-
rvm: 2.3.
|
49
|
+
rvm: 2.3.8
|
45
50
|
- gemfile: gemfiles/active_model_5.2.gemfile
|
46
|
-
rvm: 2.4.
|
51
|
+
rvm: 2.4.6
|
47
52
|
- gemfile: gemfiles/active_model_5.2.gemfile
|
48
|
-
rvm: 2.5.
|
49
|
-
- gemfile: gemfiles/
|
50
|
-
rvm: 2.2
|
51
|
-
- gemfile: gemfiles/
|
52
|
-
rvm: 2.
|
53
|
+
rvm: 2.5.5
|
54
|
+
- gemfile: gemfiles/active_model_5.2.gemfile
|
55
|
+
rvm: 2.6.2
|
56
|
+
- gemfile: gemfiles/active_model_6.0.gemfile
|
57
|
+
rvm: 2.5.5
|
58
|
+
- gemfile: gemfiles/active_model_6.0.gemfile
|
59
|
+
rvm: 2.6.2
|
53
60
|
- gemfile: gemfiles/active_model_edge.gemfile
|
54
|
-
rvm: 2.
|
61
|
+
rvm: 2.6.2
|
55
62
|
- gemfile: gemfiles/active_model_edge.gemfile
|
56
|
-
rvm: 2.5.
|
63
|
+
rvm: 2.5.5
|
57
64
|
allow_failures:
|
58
65
|
- rvm: jruby
|
59
66
|
- rvm: rbx-2
|
60
67
|
- gemfile: gemfiles/active_model_edge.gemfile
|
61
|
-
rvm: 2.
|
62
|
-
- gemfile: gemfiles/active_model_edge.gemfile
|
63
|
-
rvm: 2.3.6
|
64
|
-
- gemfile: gemfiles/active_model_edge.gemfile
|
65
|
-
rvm: 2.4.3
|
68
|
+
rvm: 2.5.5
|
66
69
|
- gemfile: gemfiles/active_model_edge.gemfile
|
67
|
-
rvm: 2.
|
70
|
+
rvm: 2.6.2
|
@@ -465,24 +465,6 @@ module StateMachines
|
|
465
465
|
klass.lookup_ancestors
|
466
466
|
end
|
467
467
|
|
468
|
-
# Initializes class-level extensions and defaults for this machine
|
469
|
-
def after_initialize
|
470
|
-
super()
|
471
|
-
load_locale
|
472
|
-
end
|
473
|
-
|
474
|
-
# Loads any locale files needed for translating validation errors
|
475
|
-
def load_locale
|
476
|
-
unless I18n.load_path.include?(locale_path)
|
477
|
-
I18n.load_path.unshift(locale_path)
|
478
|
-
I18n.reload!
|
479
|
-
end
|
480
|
-
end
|
481
|
-
|
482
|
-
def locale_path
|
483
|
-
"#{File.dirname(__FILE__)}/active_model/locale.rb"
|
484
|
-
end
|
485
|
-
|
486
468
|
# Skips defining reader/writer methods since this is done automatically
|
487
469
|
def define_state_accessor
|
488
470
|
name = self.name
|
@@ -144,28 +144,8 @@ class MachineWithInternationalizationTest < BaseTestCase
|
|
144
144
|
assert_equal 'stop', machine.event(:park).human_name
|
145
145
|
end
|
146
146
|
|
147
|
-
def
|
147
|
+
def test_should_have_locale_once_in_load_path
|
148
148
|
assert_equal 1, I18n.load_path.select { |path| path =~ %r{active_model/locale\.rb$} }.length
|
149
|
-
|
150
|
-
# Create another ActiveModel model that will triger the i18n feature
|
151
|
-
new_model
|
152
|
-
|
153
|
-
assert_equal 1, I18n.load_path.select { |path| path =~ %r{active_model/locale\.rb$} }.length
|
154
|
-
end
|
155
|
-
|
156
|
-
def test_should_add_locale_to_beginning_of_load_path
|
157
|
-
@original_load_path = I18n.load_path
|
158
|
-
I18n.backend = I18n::Backend::Simple.new
|
159
|
-
|
160
|
-
app_locale = File.dirname(__FILE__) + '/files/en.yml'
|
161
|
-
default_locale = File.dirname(__FILE__) + '/../lib/state_machines/integrations/active_model/locale.rb'
|
162
|
-
I18n.load_path = [app_locale]
|
163
|
-
|
164
|
-
StateMachines::Machine.new(@model)
|
165
|
-
|
166
|
-
assert_equal [default_locale, app_locale].map { |path| File.expand_path(path) }, I18n.load_path.map { |path| File.expand_path(path) }
|
167
|
-
ensure
|
168
|
-
I18n.load_path = @original_load_path
|
169
149
|
end
|
170
150
|
|
171
151
|
def test_should_prefer_other_locales_first
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines-activemodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: state_machines
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- gemfiles/active_model_5.0.gemfile
|
136
136
|
- gemfiles/active_model_5.1.gemfile
|
137
137
|
- gemfiles/active_model_5.2.gemfile
|
138
|
+
- gemfiles/active_model_6.0.gemfile
|
138
139
|
- gemfiles/active_model_edge.gemfile
|
139
140
|
- lib/state_machines-activemodel.rb
|
140
141
|
- lib/state_machines/integrations/active_model.rb
|
@@ -185,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
- !ruby/object:Gem::Version
|
186
187
|
version: '0'
|
187
188
|
requirements: []
|
188
|
-
|
189
|
-
rubygems_version: 2.7.3
|
189
|
+
rubygems_version: 3.0.1
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: ActiveModel integration for State Machines
|