enum_state_machine 0.7.0 → 0.8.0

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
  SHA256:
3
- metadata.gz: b789f253ef713a0650807bc1d06439252411fca86b15c7c9947dfa466edb104b
4
- data.tar.gz: dd54f68b6bd0ff062c98ab75bcfd4444e4879820a831a5def374845fcfec8380
3
+ metadata.gz: 81e22e2e5a8d0d447fb75fe6b2b5474c1d444a4f595b5684fcee5ff35e0ed5e5
4
+ data.tar.gz: 0bd801c9aec9124f4710101bf7d61b6e854552c7b23af65755b1acd22963d38d
5
5
  SHA512:
6
- metadata.gz: 3d35efc93d0045b153105ddb01499a4b09db5d70acf740ab3ac1ac9b106d5f917042491604c2702b40137acdd317e0b0d4bc4c8c1670146010c6c5915ea9f3ad
7
- data.tar.gz: 73389b3df7fe1d451e81321e4eee3e0c4714fcf89270ac1afd10094aca807df6543d8785f79884869f3f6b807d16b61edf0cd3763e1e897c83bb040cf7ea8117
6
+ metadata.gz: 14e91f1e027f08509cc346882786d7f70d48bc552834954f7775d1252ee280a18b72d7f44d3c4167ed90816b33688c2fb51831dd4b59ad131ebd786a9103dffd
7
+ data.tar.gz: c58ef00910ab7f8cff3be1d52ebc77276754d45f1f1c4f79a3ff869894dfe84f3d902afd39c8d8a56632f83a3ebd70ace03ba9377b6ef172b7a2e77cfb90623c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.6
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.extra_rdoc_files = %w(README.md CHANGELOG.md LICENSE)
18
18
  s.license = 'MIT'
19
19
 
20
- s.add_dependency "rails", "> 4.0", "< 7.0"
20
+ s.add_dependency "rails", ">= 6.0", "< 7.0"
21
21
  s.add_dependency "activerecord-deprecated_finders", ">= 1.0.3"
22
22
  #s.add_dependency "rails-observers", ">= 0.1.2"
23
23
  s.add_dependency "power_enum", "> 2.8", "< 4.0"
@@ -382,7 +382,7 @@ module EnumStateMachine
382
382
  end
383
383
 
384
384
  default_options = default_error_message_options(object, attribute, message)
385
- object.errors.add(attribute, message, options.merge(default_options))
385
+ object.errors.add(attribute, message, **options.merge(default_options))
386
386
  end
387
387
  end
388
388
 
@@ -486,11 +486,11 @@ module EnumStateMachine
486
486
  def define_action_hook
487
487
  if action_hook == :save
488
488
  define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
489
- def save(*)
489
+ def save(**)
490
490
  self.class.state_machine(#{name.inspect}).send(:around_save, self) { super }
491
491
  end
492
492
 
493
- def save!(*)
493
+ def save!(**)
494
494
  self.class.state_machine(#{name.inspect}).send(:around_save, self) { super } || raise(ActiveRecord::RecordInvalid.new(self))
495
495
  end
496
496
 
@@ -78,7 +78,7 @@ module EnumStateMachine
78
78
  # support i18n.
79
79
  def locale_path
80
80
  path = "#{File.dirname(__FILE__)}/#{integration_name}/locale.rb"
81
- path if File.exists?(path)
81
+ path if File.exist?(path)
82
82
  end
83
83
 
84
84
  # Extends the given object with any version overrides that are currently
@@ -1,3 +1,3 @@
1
1
  module EnumStateMachine
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -110,8 +110,6 @@ class EvalHelpersSymbolTaintedMethodTest < EvalHelpersBaseTest
110
110
  def callback
111
111
  true
112
112
  end
113
-
114
- taint
115
113
  end
116
114
  end
117
115
 
@@ -3227,26 +3227,26 @@ begin
3227
3227
 
3228
3228
  def test_should_save_file_with_class_name_by_default
3229
3229
  @machine.draw
3230
- assert File.exists?("./#{@klass.name}_state.png")
3230
+ assert File.exist?("./#{@klass.name}_state.png")
3231
3231
  end
3232
3232
 
3233
3233
  def test_should_allow_base_name_to_be_customized
3234
3234
  name = "machine_#{rand(1000000)}"
3235
3235
  @machine.draw(:name => name)
3236
3236
  @path = "./#{name}.png"
3237
- assert File.exists?(@path)
3237
+ assert File.exist?(@path)
3238
3238
  end
3239
3239
 
3240
3240
  def test_should_allow_format_to_be_customized
3241
3241
  @machine.draw(:format => 'jpg')
3242
3242
  @path = "./#{@klass.name}_state.jpg"
3243
- assert File.exists?(@path)
3243
+ assert File.exist?(@path)
3244
3244
  end
3245
3245
 
3246
3246
  def test_should_allow_path_to_be_customized
3247
3247
  @machine.draw(:path => "#{File.dirname(__FILE__)}/")
3248
3248
  @path = "#{File.dirname(__FILE__)}/#{@klass.name}_state.png"
3249
- assert File.exists?(@path)
3249
+ assert File.exist?(@path)
3250
3250
  end
3251
3251
 
3252
3252
  def test_should_allow_orientation_to_be_landscape
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_state_machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The HornsAndHooves Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-04 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '6.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '7.0'
@@ -24,9 +24,9 @@ dependencies:
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">"
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.0'
29
+ version: '6.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '7.0'
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
283
  requirements: []
284
- rubygems_version: 3.0.9
284
+ rubygems_version: 3.1.6
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: Enum State machines for attributes