state_machines-activemodel 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a65ab5931d785bfe167675a0232d773e7512535bfa35f9425836927d112216f
4
- data.tar.gz: 52d09ca9cac1fb9d5536817fcff391e26da9b08c8e1ec6d22d2c60c6d9f143b8
3
+ metadata.gz: 6c0c2ff3f596aa6cef5995e482bcebf703eae4a12b69ab74eab03808bd11c6d6
4
+ data.tar.gz: f52f715a48845c350ddb25d84ea7a9e17ec9d95ea333cd57c329175cb9dcf01f
5
5
  SHA512:
6
- metadata.gz: 0b30f78d8a2bb57b60f0d4e9efcce549b4aadcb4727014aa39f727497f6413a159d877d8d6cbb21c9a7d30f80c94cc7fb3cd4f0448b13c4cdde92ac50ccb5205
7
- data.tar.gz: b8ed3d456e734a6ab8e10afd1743c290a761d6c1149c7fb8bcc3812991683a43ce2a3748b0bab0dfc4a3c332a0eaa7bb2e2a5ecc712c10efcc1b246a6dd5b3f7
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.6
9
- - 2.4.3
10
- - 2.5.0
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.6
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.6
29
+ rvm: 2.3.8
29
30
  - gemfile: gemfiles/active_model_5.0.gemfile
30
- rvm: 2.4.3
31
+ rvm: 2.4.6
31
32
  - gemfile: gemfiles/active_model_5.0.gemfile
32
- rvm: 2.5.0
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.6
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.4.3
43
+ rvm: 2.5.5
39
44
  - gemfile: gemfiles/active_model_5.1.gemfile
40
- rvm: 2.5.0
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.6
49
+ rvm: 2.3.8
45
50
  - gemfile: gemfiles/active_model_5.2.gemfile
46
- rvm: 2.4.3
51
+ rvm: 2.4.6
47
52
  - gemfile: gemfiles/active_model_5.2.gemfile
48
- rvm: 2.5.0
49
- - gemfile: gemfiles/active_model_edge.gemfile
50
- rvm: 2.2.9
51
- - gemfile: gemfiles/active_model_edge.gemfile
52
- rvm: 2.3.6
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.4.3
61
+ rvm: 2.6.2
55
62
  - gemfile: gemfiles/active_model_edge.gemfile
56
- rvm: 2.5.0
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.2.9
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.5.0
70
+ rvm: 2.6.2
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activemodel", github: "rails/rails", branch: "master"
6
+
7
+ gemspec path: "../"
@@ -1 +1,6 @@
1
+ require 'active_support'
1
2
  require 'state_machines/integrations/active_model'
3
+
4
+ ActiveSupport.on_load(:i18n) do
5
+ I18n.load_path << File.expand_path('state_machines/integrations/active_model/locale.rb', __dir__)
6
+ end
@@ -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
@@ -1,7 +1,7 @@
1
1
  module StateMachines
2
2
  module Integrations
3
3
  module ActiveModel
4
- VERSION = '0.5.1'
4
+ VERSION = '0.6.0'
5
5
  end
6
6
  end
7
7
  end
@@ -144,28 +144,8 @@ class MachineWithInternationalizationTest < BaseTestCase
144
144
  assert_equal 'stop', machine.event(:park).human_name
145
145
  end
146
146
 
147
- def test_should_only_add_locale_once_in_load_path
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.5.1
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: 2018-03-19 00:00:00.000000000 Z
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
- rubyforge_project:
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