transitions 1.1.1 → 1.3.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
- SHA1:
3
- metadata.gz: 34d3864fac5bd100f261d06295299b1d9b08acd3
4
- data.tar.gz: 41982c65bdea9c3b3aa1160c9ea6bcb2f2232a1d
2
+ SHA256:
3
+ metadata.gz: 499d85851d31ed292773802c44a68d0b1845280b4aaadbb569fc598b3c975028
4
+ data.tar.gz: 28f4dfd13383376ee30fc360aed8d948ce6d546c2de29673f5a4e4160df7afaf
5
5
  SHA512:
6
- metadata.gz: e842c89b94f099b134ffd915b72142cea017338ba209cb4446ad8ebeaea12c7d1a4e3c50feaf1ac16d5fd6ace5073b252a8c09579aca9850db4551311949e6e3
7
- data.tar.gz: 7d383004c82e4ea0fad5ea92ac79d28050699774816737c315442532db8ee89437488b074e9b434a4c17bdb23ce4a23c4ec14eb5dac2003555e2d21c37ffddfe
6
+ metadata.gz: f1932cbdbcbea2a3b75abe4805536c1f2426b0139e83c73be9d0bf4ae28fe141285b9351df3a218b2da1c4ca4a2fa3b3e354973670671cda8ff4d3b1900f51ff
7
+ data.tar.gz: 75feff301bfb543636512c377ea1743e2970c07bd25fed3af4c42d4c19c6f3b8722841be9f85cf33d44c2e0bb20b2bdc20e62bd7cf97c9aaaabc10533aa53874
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ pkg
5
5
  Gemfile.lock
6
6
  gemfiles/*.lock
7
7
  *.swp
8
+ vendor/bundle
data/.reek.yml ADDED
@@ -0,0 +1,100 @@
1
+ # Auto generated by Reeks --todo flag
2
+ ---
3
+ detectors:
4
+ Attribute:
5
+ exclude:
6
+ - Transitions::Machine#events
7
+ - Transitions::Machine#initial_state
8
+ - Transitions::Machine#state_index
9
+ - Transitions::Machine#states
10
+ BooleanParameter:
11
+ exclude:
12
+ - Transitions#update_current_state
13
+ ControlParameter:
14
+ exclude:
15
+ - Transitions#update_current_state
16
+ DataClump:
17
+ exclude:
18
+ - Transitions::Machine
19
+ DuplicateMethodCall:
20
+ exclude:
21
+ - ActiveModel::Transitions#read_state
22
+ - ActiveModel::Transitions#reload
23
+ - ActiveModel::Transitions#set_initial_state
24
+ - Transitions::Event#fire
25
+ - Transitions::Event#initialize
26
+ - Transitions::Event#update
27
+ - Transitions::Machine#handle_event_success_callback
28
+ - Transitions::Machine#initial_state
29
+ - Transitions::State#define_state_query_method
30
+ FeatureEnvy:
31
+ exclude:
32
+ - Transitions::Event#can_execute_transition_from_state?
33
+ - Transitions::Event#default_timestamp_name
34
+ - Transitions::Event#error_message_for_invalid_transitions
35
+ InstanceVariableAssumption:
36
+ exclude:
37
+ - Transitions::Machine
38
+ - Transitions::State
39
+ IrresponsibleModule:
40
+ exclude:
41
+ - ActiveModel::Transitions
42
+ - Transitions::Machine
43
+ - Transitions::Presenter
44
+ - Transitions::State
45
+ - Transitions::StateTransition
46
+ - Transitions
47
+ - Transitions::ClassMethods
48
+ - Transitions::InvalidMethodOverride
49
+ - Transitions::InvalidTransition
50
+ LongParameterList:
51
+ exclude:
52
+ - Transitions::Event#can_execute_transition_from_state?
53
+ - Transitions::Event#fire
54
+ - Transitions::Machine#fire_event
55
+ - Transitions::Machine#transition_to_new_state
56
+ - Transitions::StateTransition#perform_guard
57
+ ManualDispatch:
58
+ exclude:
59
+ - Transitions::Event#default_timestamp_name
60
+ - Transitions::Event#error_message_for_invalid_transitions
61
+ - Transitions::Machine#fire_event
62
+ - Transitions::Machine#handle_event_failed_callback
63
+ - Transitions::Machine#handle_event_fired_callback
64
+ - Transitions::Machine#include_scopes
65
+ - Transitions::StateTransition#perform_guard
66
+ NestedIterators:
67
+ exclude:
68
+ - Transitions::Event#build_success_callback
69
+ NilCheck:
70
+ exclude:
71
+ - ActiveModel::Transitions#state_not_set?
72
+ - Transitions::Event#timestamp_defined?
73
+ - Transitions::StateTransition#execute
74
+ - Transitions#current_state
75
+ TooManyInstanceVariables:
76
+ exclude:
77
+ - Transitions::Event
78
+ - Transitions::Machine
79
+ - Transitions::StateTransition
80
+ TooManyStatements:
81
+ exclude:
82
+ - initialize
83
+ - Transitions::Event#build_success_callback
84
+ - Transitions::Event#fire
85
+ - Transitions::Machine#fire_event
86
+ - Transitions#current_state
87
+ UncommunicativeVariableName:
88
+ exclude:
89
+ - ActiveModel::Transitions#state_included?
90
+ - Transitions::Event#can_execute_transition_from_state?
91
+ - Transitions::Event#fire
92
+ - Transitions::Event#transitions
93
+ - Transitions::Event#transitions_from_state?
94
+ - Transitions::Machine#fire_event
95
+ - Transitions::StateTransition#executable?
96
+ UtilityFunction:
97
+ exclude:
98
+ - Transitions::Machine#handle_event_failed_callback
99
+ - Transitions::Machine#handle_event_fired_callback
100
+ - Transitions::StateTransition#perform_guard
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.7.5
data/.travis.yml CHANGED
@@ -8,6 +8,7 @@ rvm:
8
8
  - 2.1
9
9
  - 2.2
10
10
  - 2.3.0
11
+ - 3.0.2
11
12
  - rbx-2
12
13
  - jruby
13
14
  matrix:
@@ -23,3 +24,14 @@ gemfile:
23
24
  - gemfiles/rails_3_1.gemfile
24
25
  - gemfiles/rails_3_2.gemfile
25
26
  - gemfiles/rails_4_0.gemfile
27
+ - gemfiles/rails_6_1.gemfile
28
+ jobs:
29
+ exclude:
30
+ - rvm: 3.0.2
31
+ gemfile: gemfiles/rails_3_0.gemfile
32
+ - rvm: 3.0.2
33
+ gemfile: gemfiles/rails_3_1.gemfile
34
+ - rvm: 3.0.2
35
+ gemfile: gemfiles/rails_3_2.gemfile
36
+ - rvm: 3.0.2
37
+ gemfile: gemfiles/rails_4_0.gemfile
data/Appraisals CHANGED
@@ -21,3 +21,9 @@ appraise "rails_4_0" do
21
21
  gem "activerecord-jdbcsqlite3-adapter", '1.3.0.rc1', :platforms=>:jruby
22
22
  gem 'sqlite3', :platforms => :ruby
23
23
  end
24
+
25
+ appraise "rails_6_1" do
26
+ gem "activerecord", "~>6.1.0"
27
+ gem "activerecord-jdbcsqlite3-adapter", '61.1', :platforms=>:jruby
28
+ gem 'sqlite3', :platforms => :ruby
29
+ end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 1.3.0
2
+
3
+ * Ruby 3.0 support (fishisfast)
4
+
5
+ # 1.2.1 (2016-11-07)
6
+
7
+ * (jdguzman) remove explicit ActiveRecord dependency
8
+ * (jdguzman) fix module lookup to get it to work with mongoid
9
+
10
+ # 1.2.0
11
+
12
+ * (atomaka) Allow timestamp to accept an array of timestamps
13
+
1
14
  # 1.1.1
2
15
 
3
16
  * (beornborn) use instance_exec for defining scope because @klass sometimes is resolved as nil
data/README.md CHANGED
@@ -300,7 +300,8 @@ corresponding discussion).
300
300
  If you'd like to note the time of a state change, Transitions comes with
301
301
  timestamps free! To activate them, simply pass the `timestamp` option to the
302
302
  event definition with a value of either true or the name of the timestamp
303
- column. *NOTE - This should be either true, a String or a Symbol*
303
+ column. *NOTE - This should be either true, a String, a Symbol, or an Array of
304
+ these*
304
305
  ```ruby
305
306
  # This will look for an attribute called exploded_at or exploded_on (in that order)
306
307
  # If present, it will be updated
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 3.0.10"
6
- gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
7
- gem "sqlite3", :platforms=>:ruby
6
+ gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
7
+ gem "sqlite3", platforms: :ruby
8
8
 
9
9
  gemspec :path=>"../"
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~>3.1.12"
6
- gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
7
- gem "sqlite3", :platforms=>:ruby
6
+ gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
7
+ gem "sqlite3", platforms: :ruby
8
8
 
9
9
  gemspec :path=>"../"
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~>3.2.14"
6
- gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
7
- gem "sqlite3", :platforms=>:ruby
6
+ gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
7
+ gem "sqlite3", platforms: :ruby
8
8
 
9
9
  gemspec :path=>"../"
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~>4.0.0"
6
- gem "activerecord-jdbcsqlite3-adapter", "1.3.0.rc1", :platforms=>:jruby
7
- gem "sqlite3", :platforms=>:ruby
6
+ gem "activerecord-jdbcsqlite3-adapter", "1.3.0.rc1", platforms: :jruby
7
+ gem "sqlite3", platforms: :ruby
8
8
 
9
9
  gemspec :path=>"../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~>6.1.0"
6
+ gem "activerecord-jdbcsqlite3-adapter", "61.1", platforms: :jruby
7
+ gem "sqlite3", platforms: :ruby
8
+
9
+ gemspec path: "../"
@@ -9,9 +9,9 @@ module ActiveModel
9
9
  alias_method :old_transitions_initialize, :initialize
10
10
  alias_method :old_transitions_update, :update
11
11
 
12
- def new_transitions_initialize(*args, &block)
12
+ def new_transitions_initialize(*args, **kwargs, &block)
13
13
  @attribute_name = :state
14
- old_transitions_initialize(*args, &block)
14
+ old_transitions_initialize(*args, **kwargs, &block)
15
15
  end
16
16
 
17
17
  def new_transitions_update(options = {}, &block)
@@ -3,45 +3,46 @@ module Transitions
3
3
  class Event
4
4
  attr_reader :name, :success, :timestamp
5
5
 
6
- # :reek:TooManyStatements: { max_statements: 13 }
6
+ # :reek:TooManyStatements { max_statements: 13 }
7
7
  def initialize(machine, name, options = {}, &block)
8
8
  @machine = machine
9
9
  @name = name
10
10
  @transitions = []
11
+ @timestamps = []
11
12
  if machine
12
- machine.klass.send(:define_method, "#{name}!") do |*args|
13
- machine.fire_event(name, self, true, *args)
13
+ machine.klass.send(:define_method, "#{name}!") do |*args, **kwargs|
14
+ machine.fire_event(name, self, true, *args, **kwargs)
14
15
  end
15
16
 
16
- machine.klass.send(:define_method, name.to_s) do |*args|
17
- machine.fire_event(name, self, false, *args)
17
+ machine.klass.send(:define_method, name.to_s) do |*args, **kwargs|
18
+ machine.fire_event(name, self, false, *args, **kwargs)
18
19
  end
19
20
 
20
21
  machine.klass.send(:define_method, "can_#{name}?") do |*_args|
21
22
  machine.events_for(current_state).include?(name.to_sym)
22
23
  end
23
24
 
24
- machine.klass.send(:define_method, "can_execute_#{name}?") do |*args|
25
+ machine.klass.send(:define_method, "can_execute_#{name}?") do |*args, **kwargs|
25
26
  event = name.to_sym
26
27
 
27
- send("can_#{name}?", *args) &&
28
- machine.events[event].can_execute_transition_from_state?(current_state, self, *args)
28
+ send("can_#{name}?", *args, **kwargs) &&
29
+ machine.events[event].can_execute_transition_from_state?(current_state, self, *args, **kwargs)
29
30
  end
30
31
  end
31
32
  update(options, &block)
32
33
  end
33
34
 
34
- def fire(obj, to_state = nil, *args)
35
+ def fire(obj, to_state = nil, *args, **kwargs)
35
36
  transitions = @transitions.select { |t| t.from == obj.current_state }
36
37
  fail InvalidTransition, error_message_for_invalid_transitions(obj) if transitions.size == 0
37
38
 
38
39
  next_state = nil
39
40
  transitions.each do |transition|
40
41
  next if to_state && !Array(transition.to).include?(to_state)
41
- next unless transition.executable?(obj, *args)
42
+ next unless transition.executable?(obj, *args, **kwargs)
42
43
 
43
44
  next_state = to_state || Array(transition.to).first
44
- transition.execute(obj, *args)
45
+ transition.execute(obj, *args, **kwargs)
45
46
  update_event_timestamp(obj, next_state) if timestamp_defined?
46
47
  break
47
48
  end
@@ -53,8 +54,8 @@ module Transitions
53
54
  @transitions.any? { |t| t.from? state }
54
55
  end
55
56
 
56
- def can_execute_transition_from_state?(state, obj, *args)
57
- @transitions.select { |t| t.from? state }.any? { |t| t.executable?(obj, *args) }
57
+ def can_execute_transition_from_state?(state, obj, *args, **kwargs)
58
+ @transitions.select { |t| t.from? state }.any? { |t| t.executable?(obj, *args, **kwargs) }
58
59
  end
59
60
 
60
61
  def ==(other)
@@ -67,29 +68,33 @@ module Transitions
67
68
 
68
69
  # Has the timestamp option been specified for this event?
69
70
  def timestamp_defined?
70
- !@timestamp.nil?
71
+ !@timestamps.nil?
71
72
  end
72
73
 
73
74
  def update(options = {}, &block)
74
75
  @success = build_success_callback(options[:success]) if options.key?(:success)
75
- self.timestamp = options[:timestamp] if options[:timestamp]
76
+ self.timestamp = Array(options[:timestamp]) if options[:timestamp]
76
77
  instance_eval(&block) if block
77
78
  self
78
79
  end
79
80
 
80
81
  # update the timestamp attribute on obj
81
82
  def update_event_timestamp(obj, next_state)
82
- obj.send "#{timestamp_attribute_name(obj, next_state)}=", Time.now
83
+ @timestamps.each do |timestamp|
84
+ obj.public_send "#{timestamp_attribute_name(obj, next_state, timestamp)}=", Time.now
85
+ end
83
86
  end
84
87
 
85
88
  # Set the timestamp attribute.
86
89
  # @raise [ArgumentError] timestamp should be either a String, Symbol or true
87
- def timestamp=(value)
88
- case value
89
- when String, Symbol, TrueClass
90
- @timestamp = value
91
- else
92
- fail ArgumentError, 'timestamp must be either: true, a String or a Symbol'
90
+ def timestamp=(values)
91
+ values.each do |value|
92
+ case value
93
+ when String, Symbol, TrueClass
94
+ @timestamps << value
95
+ else
96
+ fail ArgumentError, 'timestamp must be either: true, a String or a Symbol'
97
+ end
93
98
  end
94
99
  end
95
100
 
@@ -98,8 +103,8 @@ module Transitions
98
103
  # Returns the name of the timestamp attribute for this event
99
104
  # If the timestamp was simply true it returns the default_timestamp_name
100
105
  # otherwise, returns the user-specified timestamp name
101
- def timestamp_attribute_name(obj, next_state)
102
- timestamp == true ? default_timestamp_name(obj, next_state) : @timestamp
106
+ def timestamp_attribute_name(obj, next_state, user_timestamp)
107
+ user_timestamp == true ? default_timestamp_name(obj, next_state) : user_timestamp
103
108
  end
104
109
 
105
110
  # If @timestamp is true, try a default timestamp name
@@ -138,7 +143,7 @@ module Transitions
138
143
 
139
144
  def error_message_for_invalid_transitions(obj)
140
145
  "Can't fire event `#{name}` in current state `#{obj.current_state}` for `#{obj.class.name}`"\
141
- " #{obj.class < ActiveRecord::Base && obj.persisted? ? "with ID #{obj.id} " : nil}"
146
+ " #{obj.respond_to?(:id) ? "with ID #{obj.id} " : nil}"
142
147
  end
143
148
  end
144
149
  end
@@ -27,9 +27,9 @@ module Transitions
27
27
  #
28
28
  # rubocop:disable Metrics/MethodLength
29
29
  #
30
- def fire_event(event, record, persist, *args)
30
+ def fire_event(event, record, persist, *args, **kwargs)
31
31
  handle_state_exit_callback record
32
- if new_state = transition_to_new_state(record, event, *args)
32
+ if new_state = transition_to_new_state(record, event, *args, **kwargs)
33
33
  handle_state_enter_callback record, new_state
34
34
  handle_event_fired_callback record, new_state, event
35
35
  record.update_current_state(new_state, persist)
@@ -61,8 +61,8 @@ module Transitions
61
61
  state_index[record.current_state].call_action(:exit, record)
62
62
  end
63
63
 
64
- def transition_to_new_state(record, event, *args)
65
- @events[event].fire(record, nil, *args)
64
+ def transition_to_new_state(record, event, *args, **kwargs)
65
+ @events[event].fire(record, nil, *args, **kwargs)
66
66
  end
67
67
 
68
68
  def handle_state_enter_callback(record, new_state)
@@ -95,7 +95,7 @@ module Transitions
95
95
  (@events[name] ||= Event.new(self, name)).update(options, &block)
96
96
  end
97
97
 
98
- # :reek:TooManyStatements: { max_statements: 7 }
98
+ # :reek:TooManyStatements { max_statements: 7 }
99
99
  def include_scopes
100
100
  @states.each do |state|
101
101
  state_name = state.name.to_s
@@ -23,8 +23,8 @@ module Transitions
23
23
  #
24
24
  # @return [Bool]
25
25
  #
26
- def executable?(obj, *args)
27
- [@guard].flatten.all? { |g| perform_guard(obj, g, *args) }
26
+ def executable?(obj, *args, **kwargs)
27
+ [@guard].flatten.all? { |g| perform_guard(obj, g, *args, **kwargs) }
28
28
  end
29
29
 
30
30
  #
@@ -40,17 +40,17 @@ module Transitions
40
40
  #
41
41
  # rubocop:disable Metrics/MethodLength
42
42
  #
43
- def execute(obj, *args)
43
+ def execute(obj, *args, **kwargs)
44
44
  case @on_transition
45
45
  when Symbol, String
46
- obj.send(@on_transition, *args)
46
+ obj.send(@on_transition, *args, **kwargs)
47
47
  when Proc
48
- @on_transition.call(obj, *args)
48
+ @on_transition.call(obj, *args, **kwargs)
49
49
  when Array
50
50
  @on_transition.each do |callback|
51
51
  # Yes, we're passing always the same parameters for each callback in here.
52
52
  # We should probably drop args altogether in case we get an array.
53
- obj.send(callback, *args)
53
+ obj.send(callback, *args, **kwargs)
54
54
  end
55
55
  else
56
56
  # TODO: We probably should check for this in the constructor and not that late.
@@ -70,11 +70,11 @@ module Transitions
70
70
 
71
71
  private
72
72
 
73
- def perform_guard(obj, guard, *args)
73
+ def perform_guard(obj, guard, *args, **kwargs)
74
74
  if guard.respond_to?(:call)
75
- guard.call(obj, *args)
75
+ guard.call(obj, *args, **kwargs)
76
76
  elsif guard.is_a?(Symbol) || guard.is_a?(String)
77
- obj.send(guard, *args)
77
+ obj.send(guard, *args, **kwargs)
78
78
  else
79
79
  true
80
80
  end
@@ -1,3 +1,3 @@
1
1
  module Transitions
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
data/lib/transitions.rb CHANGED
@@ -84,6 +84,6 @@ module Transitions
84
84
 
85
85
  def self.active_model_descendant?(klazz)
86
86
  # Checking directly for "ActiveModel" wouldn't work so we use some arbitrary module close to it.
87
- defined?(ActiveModel) && klazz.included_modules.include?(ActiveModel::Dirty)
87
+ defined?(ActiveModel) && klazz.included_modules.include?(ActiveModel::Validations)
88
88
  end
89
89
  end
data/transitions.gemspec CHANGED
@@ -17,13 +17,14 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_development_dependency 'bundler', '~> 1.0'
21
- spec.add_development_dependency 'rake'
22
- spec.add_development_dependency 'test-unit', '~> 2.5'
20
+ spec.add_development_dependency 'bundler', '~> 2.0'
21
+ spec.add_development_dependency 'rake', '< 11.0'
22
+ spec.add_development_dependency 'test-unit', '~> 3.5'
23
23
  spec.add_development_dependency 'mocha', '~> 0.11.0' # With mocha 0.12 we get: undefined method `run' for #<StateMachineMachineTest:0x94918b8> (NoMethodError)
24
24
  spec.add_development_dependency 'random_data'
25
25
  spec.add_development_dependency 'appraisal'
26
- spec.add_development_dependency 'activerecord', ['>= 3.0', '<= 4.0']
26
+ spec.add_development_dependency 'activerecord', ['~> 6.1']
27
27
  spec.add_development_dependency 'rubocop', '~> 0.36.0'
28
+ spec.add_development_dependency 'rexml'
28
29
  spec.add_development_dependency 'reek'
29
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transitions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Rößner
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2022-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '11.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "<"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '11.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.5'
47
+ version: '3.5'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.5'
54
+ version: '3.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -98,22 +98,16 @@ dependencies:
98
98
  name: activerecord
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '3.0'
104
- - - "<="
101
+ - - "~>"
105
102
  - !ruby/object:Gem::Version
106
- version: '4.0'
103
+ version: '6.1'
107
104
  type: :development
108
105
  prerelease: false
109
106
  version_requirements: !ruby/object:Gem::Requirement
110
107
  requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- version: '3.0'
114
- - - "<="
108
+ - - "~>"
115
109
  - !ruby/object:Gem::Version
116
- version: '4.0'
110
+ version: '6.1'
117
111
  - !ruby/object:Gem::Dependency
118
112
  name: rubocop
119
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +122,20 @@ dependencies:
128
122
  - - "~>"
129
123
  - !ruby/object:Gem::Version
130
124
  version: 0.36.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rexml
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
131
139
  - !ruby/object:Gem::Dependency
132
140
  name: reek
133
141
  requirement: !ruby/object:Gem::Requirement
@@ -151,9 +159,9 @@ extra_rdoc_files: []
151
159
  files:
152
160
  - ".codeclimate.yml"
153
161
  - ".gitignore"
162
+ - ".reek.yml"
154
163
  - ".rubocop.yml"
155
164
  - ".ruby-version"
156
- - ".todo.reek"
157
165
  - ".travis.yml"
158
166
  - Appraisals
159
167
  - CHANGELOG.md
@@ -166,6 +174,7 @@ files:
166
174
  - gemfiles/rails_3_1.gemfile
167
175
  - gemfiles/rails_3_2.gemfile
168
176
  - gemfiles/rails_4_0.gemfile
177
+ - gemfiles/rails_6_1.gemfile
169
178
  - lib/active_model/transitions.rb
170
179
  - lib/active_record/transitions.rb
171
180
  - lib/transitions.rb
@@ -180,7 +189,7 @@ homepage: http://github.com/troessner/transitions
180
189
  licenses:
181
190
  - MIT
182
191
  metadata: {}
183
- post_install_message:
192
+ post_install_message:
184
193
  rdoc_options: []
185
194
  require_paths:
186
195
  - lib
@@ -195,10 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
204
  - !ruby/object:Gem::Version
196
205
  version: '0'
197
206
  requirements: []
198
- rubyforge_project:
199
- rubygems_version: 2.4.5.1
200
- signing_key:
207
+ rubygems_version: 3.1.6
208
+ signing_key:
201
209
  specification_version: 4
202
210
  summary: State machine extracted from ActiveModel
203
211
  test_files: []
204
- has_rdoc:
data/.todo.reek DELETED
@@ -1,85 +0,0 @@
1
- ---
2
- DuplicateMethodCall:
3
- exclude:
4
- - ActiveModel::Transitions#read_state
5
- - ActiveModel::Transitions#reload
6
- - ActiveModel::Transitions#set_initial_state
7
- - ActiveModel::Transitions#set_initial_state
8
- - Transitions::Event#error_message_for_invalid_transitions
9
- - Transitions::Event#fire
10
- - Transitions::Event#fire
11
- - Transitions::Event#initialize
12
- - Transitions::Event#initialize
13
- - Transitions::Event#update
14
- - Transitions::Machine#handle_event_success_callback
15
- - Transitions::Machine#handle_event_success_callback
16
- - Transitions::Machine#initial_state
17
- - Transitions::State#define_state_query_method
18
- IrresponsibleModule:
19
- exclude:
20
- - ActiveModel::Transitions
21
- - Transitions::Machine
22
- - Transitions::Presenter
23
- - Transitions::State
24
- - Transitions::StateTransition
25
- - Transitions
26
- - Transitions::ClassMethods
27
- - Transitions::InvalidMethodOverride
28
- - Transitions::InvalidTransition
29
- NilCheck:
30
- exclude:
31
- - ActiveModel::Transitions#state_not_set?
32
- - Transitions::Event#timestamp_defined?
33
- - Transitions::StateTransition#execute
34
- - Transitions#current_state
35
- UncommunicativeVariableName:
36
- exclude:
37
- - ActiveModel::Transitions#state_included?
38
- - Transitions::Event#can_execute_transition_from_state?
39
- - Transitions::Event#fire
40
- - Transitions::Event#transitions
41
- - Transitions::Event#transitions_from_state?
42
- - Transitions::Machine#fire_event
43
- - Transitions::StateTransition#executable?
44
- FeatureEnvy:
45
- exclude:
46
- - Transitions::Event#can_execute_transition_from_state?
47
- - Transitions::Event#default_timestamp_name
48
- - Transitions::Event#error_message_for_invalid_transitions
49
- NestedIterators:
50
- exclude:
51
- - Transitions::Event#build_success_callback
52
- TooManyInstanceVariables:
53
- exclude:
54
- - Transitions::Event
55
- - Transitions::Machine
56
- - Transitions::StateTransition
57
- TooManyStatements:
58
- exclude:
59
- - Transitions::Event#build_success_callback
60
- - Transitions::Event#fire
61
- - Transitions::Machine#fire_event
62
- - Transitions#current_state
63
- Attribute:
64
- exclude:
65
- - Transitions::Machine#events
66
- - Transitions::Machine#initial_state
67
- - Transitions::Machine#state_index
68
- - Transitions::Machine#states
69
- DataClump:
70
- exclude:
71
- - Transitions::Machine
72
- LongParameterList:
73
- exclude:
74
- - Transitions::Machine#fire_event
75
- UtilityFunction:
76
- exclude:
77
- - Transitions::Machine#handle_event_failed_callback
78
- - Transitions::Machine#handle_event_fired_callback
79
- - Transitions::StateTransition#perform_guard
80
- BooleanParameter:
81
- exclude:
82
- - Transitions#update_current_state
83
- ControlParameter:
84
- exclude:
85
- - Transitions#update_current_state