transitions 1.0.1 → 1.1.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
  SHA1:
3
- metadata.gz: 0e0eecbbaa7a8c858df9799e370497da5c55691a
4
- data.tar.gz: 2aeaec6cb95f64080a9a2a03a19ac1d9885db568
3
+ metadata.gz: f104d4ab40d3eed0fa80ea8f7478ceda3392e2c0
4
+ data.tar.gz: 4da942a300e3bfada33284dcc7e2c53c1f3e7dc6
5
5
  SHA512:
6
- metadata.gz: 14bdc0e63e4cad7f5cf626022738509b61878964b1fd5c86eb8c87b6550ad45e8381af5d15333ca021a5c043edf521e8b4a2360d4d3f82d6587bc2537e756818
7
- data.tar.gz: 8e5142a6a0448e8cb29b2b4bdd08cb8ac5bd8776ff9c2f16ae7bf900775cb4768fe70e7bbdf5d82f72ed0a006a95288350c3ba9910c4436d5702b585dbfe4c0e
6
+ metadata.gz: 944438392a350653aa572612852e475da7d4284cdc2d1a2f28babb2e762ba692da9d6a22c08afaa65df09bf79ac00c254245a813c0906d80fcc780a5bfe4bf3f
7
+ data.tar.gz: 6fb231329c1fc52f1e8572496ed0fbb1cbb5009ca93ebc66092175edaa5ade0195d5f3130f08a8ba678a6bd5561205a8e2f32dffa93c8183511c07730c6236a6
data/.codeclimate.yml ADDED
@@ -0,0 +1,10 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ reek:
5
+ enabled: true
6
+ ratings:
7
+ paths:
8
+ - lib/**/*
9
+ exclude_paths:
10
+ - test/**/*
data/.rubocop.yml CHANGED
@@ -19,3 +19,5 @@ Style/ConditionalAssignment:
19
19
  Exclude:
20
20
  - 'lib/transitions/event.rb'
21
21
  - 'lib/transitions/state.rb'
22
+ Style/FrozenStringLiteralComment:
23
+ Enabled: false
data/.todo.reek ADDED
@@ -0,0 +1,85 @@
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
data/.travis.yml CHANGED
@@ -7,11 +7,13 @@ script:
7
7
  rvm:
8
8
  - 2.1
9
9
  - 2.2
10
+ - 2.3.0
10
11
  - rbx-2
11
12
  - jruby
12
13
  matrix:
13
14
  allow_failures:
14
15
  - rvm: rbx-2
16
+ - rvm: jruby
15
17
  fast_finish: true
16
18
  notifications:
17
19
  email:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.1.0
2
+
3
+ * (itkin) `available_states` and `available_events` should list states or events in the order they are defined
4
+
1
5
  # 1.0.1
2
6
 
3
7
  * (avyy) Fix @state_machine lookup for Presenter's methods
data/Rakefile CHANGED
@@ -3,6 +3,7 @@ require 'bundler/gem_tasks'
3
3
  require 'appraisal'
4
4
  require 'rake/testtask'
5
5
  require 'rubocop/rake_task'
6
+ require 'reek/rake/task'
6
7
 
7
8
  Rake::TestTask.new(:test) do |test|
8
9
  test.libs = %w(lib test)
@@ -15,5 +16,6 @@ RuboCop::RakeTask.new do |task|
15
16
  task.patterns = ['lib/**/*.rb']
16
17
  end
17
18
 
18
- task default: :test
19
- task default: :rubocop
19
+ Reek::Rake::Task.new
20
+
21
+ task default: [:test, :reek, :rubocop]
@@ -3,6 +3,7 @@ module Transitions
3
3
  class Event
4
4
  attr_reader :name, :success, :timestamp
5
5
 
6
+ # :reek:TooManyStatements: { max_statements: 13 }
6
7
  def initialize(machine, name, options = {}, &block)
7
8
  @machine = machine
8
9
  @name = name
@@ -1,11 +1,11 @@
1
1
  module Transitions
2
2
  module Presenter
3
3
  def available_states
4
- get_state_machine.states.map(&:name).sort_by(&:to_s)
4
+ get_state_machine.states.map(&:name)
5
5
  end
6
6
 
7
7
  def available_events
8
- get_state_machine.events.keys.sort
8
+ get_state_machine.events.keys
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Transitions
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
data/transitions.gemspec CHANGED
@@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'random_data'
25
25
  spec.add_development_dependency 'appraisal'
26
26
  spec.add_development_dependency 'activerecord', ['>= 3.0', '<= 4.0']
27
- spec.add_development_dependency 'rubocop', '~> 0.36'
27
+ spec.add_development_dependency 'rubocop', '~> 0.36.0'
28
+ spec.add_development_dependency 'reek'
28
29
  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.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Rößner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-05 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,14 +120,28 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.36'
123
+ version: 0.36.0
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '0.36'
130
+ version: 0.36.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: reek
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
131
145
  description: Lightweight state machine extracted from ActiveModel
132
146
  email:
133
147
  - timo.roessner@googlemail.com
@@ -135,9 +149,11 @@ executables: []
135
149
  extensions: []
136
150
  extra_rdoc_files: []
137
151
  files:
152
+ - ".codeclimate.yml"
138
153
  - ".gitignore"
139
154
  - ".rubocop.yml"
140
155
  - ".ruby-version"
156
+ - ".todo.reek"
141
157
  - ".travis.yml"
142
158
  - Appraisals
143
159
  - CHANGELOG.md