state_machines 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.idea/.name +1 -0
  4. data/.idea/.rakeTasks +7 -0
  5. data/.idea/cssxfire.xml +9 -0
  6. data/.idea/encodings.xml +5 -0
  7. data/.idea/misc.xml +5 -0
  8. data/.idea/modules.xml +12 -0
  9. data/.idea/scopes/scope_settings.xml +5 -0
  10. data/.idea/state_machine2.iml +34 -0
  11. data/.idea/vcs.xml +9 -0
  12. data/.idea/workspace.xml +1156 -0
  13. data/.rspec +3 -0
  14. data/.travis.yml +8 -0
  15. data/Gemfile +4 -0
  16. data/LICENSE.txt +23 -0
  17. data/README.md +29 -0
  18. data/Rakefile +1 -0
  19. data/lib/state_machines/assertions.rb +40 -0
  20. data/lib/state_machines/branch.rb +187 -0
  21. data/lib/state_machines/callback.rb +220 -0
  22. data/lib/state_machines/core.rb +25 -0
  23. data/lib/state_machines/core_ext/class/state_machine.rb +5 -0
  24. data/lib/state_machines/core_ext.rb +2 -0
  25. data/lib/state_machines/error.rb +13 -0
  26. data/lib/state_machines/eval_helpers.rb +87 -0
  27. data/lib/state_machines/event.rb +246 -0
  28. data/lib/state_machines/event_collection.rb +141 -0
  29. data/lib/state_machines/extensions.rb +148 -0
  30. data/lib/state_machines/helper_module.rb +17 -0
  31. data/lib/state_machines/integrations/base.rb +100 -0
  32. data/lib/state_machines/integrations.rb +113 -0
  33. data/lib/state_machines/machine.rb +2234 -0
  34. data/lib/state_machines/machine_collection.rb +84 -0
  35. data/lib/state_machines/macro_methods.rb +520 -0
  36. data/lib/state_machines/matcher.rb +123 -0
  37. data/lib/state_machines/matcher_helpers.rb +54 -0
  38. data/lib/state_machines/node_collection.rb +221 -0
  39. data/lib/state_machines/path.rb +120 -0
  40. data/lib/state_machines/path_collection.rb +90 -0
  41. data/lib/state_machines/state.rb +276 -0
  42. data/lib/state_machines/state_collection.rb +112 -0
  43. data/lib/state_machines/state_context.rb +138 -0
  44. data/lib/state_machines/transition.rb +470 -0
  45. data/lib/state_machines/transition_collection.rb +245 -0
  46. data/lib/state_machines/version.rb +3 -0
  47. data/lib/state_machines/yard.rb +8 -0
  48. data/lib/state_machines.rb +3 -0
  49. data/spec/errors/default_spec.rb +14 -0
  50. data/spec/errors/with_message_spec.rb +39 -0
  51. data/spec/helpers/helper_spec.rb +14 -0
  52. data/spec/internal/app/models/auto_shop.rb +31 -0
  53. data/spec/internal/app/models/car.rb +19 -0
  54. data/spec/internal/app/models/model_base.rb +6 -0
  55. data/spec/internal/app/models/motorcycle.rb +9 -0
  56. data/spec/internal/app/models/traffic_light.rb +47 -0
  57. data/spec/internal/app/models/vehicle.rb +123 -0
  58. data/spec/machine_spec.rb +3167 -0
  59. data/spec/matcher_helpers_spec.rb +39 -0
  60. data/spec/matcher_spec.rb +157 -0
  61. data/spec/models/auto_shop_spec.rb +41 -0
  62. data/spec/models/car_spec.rb +90 -0
  63. data/spec/models/motorcycle_spec.rb +44 -0
  64. data/spec/models/traffic_light_spec.rb +56 -0
  65. data/spec/models/vehicle_spec.rb +580 -0
  66. data/spec/node_collection_spec.rb +371 -0
  67. data/spec/path_collection_spec.rb +271 -0
  68. data/spec/path_spec.rb +488 -0
  69. data/spec/spec_helper.rb +6 -0
  70. data/spec/state_collection_spec.rb +352 -0
  71. data/spec/state_context_spec.rb +442 -0
  72. data/spec/state_machine_spec.rb +29 -0
  73. data/spec/state_spec.rb +970 -0
  74. data/spec/support/migration_helpers.rb +50 -0
  75. data/spec/support/models.rb +6 -0
  76. data/spec/transition_collection_spec.rb +2199 -0
  77. data/spec/transition_spec.rb +1558 -0
  78. data/state_machines.gemspec +23 -0
  79. metadata +194 -0
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'state_machines/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'state_machines'
8
+ spec.version = StateMachines::VERSION
9
+ spec.authors = ['Abdelkader Boudih', 'Aaron Pfeifer']
10
+ spec.email = ['terminale@gmail.com']
11
+ spec.summary = %q(State machines for attributes)
12
+ spec.description = %q(Adds support for creating state machines for attributes on any Ruby class)
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.test_files = spec.files.grep(/^spec\//)
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler'
21
+ spec.add_development_dependency 'rake'
22
+ spec.add_development_dependency 'rspec' , '3.0.0.beta2'
23
+ end
metadata ADDED
@@ -0,0 +1,194 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: state_machines
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Abdelkader Boudih
8
+ - Aaron Pfeifer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-04-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 3.0.0.beta2
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 3.0.0.beta2
56
+ description: Adds support for creating state machines for attributes on any Ruby class
57
+ email:
58
+ - terminale@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".idea/.name"
65
+ - ".idea/.rakeTasks"
66
+ - ".idea/cssxfire.xml"
67
+ - ".idea/encodings.xml"
68
+ - ".idea/misc.xml"
69
+ - ".idea/modules.xml"
70
+ - ".idea/scopes/scope_settings.xml"
71
+ - ".idea/state_machine2.iml"
72
+ - ".idea/vcs.xml"
73
+ - ".idea/workspace.xml"
74
+ - ".rspec"
75
+ - ".travis.yml"
76
+ - Gemfile
77
+ - LICENSE.txt
78
+ - README.md
79
+ - Rakefile
80
+ - lib/state_machines.rb
81
+ - lib/state_machines/assertions.rb
82
+ - lib/state_machines/branch.rb
83
+ - lib/state_machines/callback.rb
84
+ - lib/state_machines/core.rb
85
+ - lib/state_machines/core_ext.rb
86
+ - lib/state_machines/core_ext/class/state_machine.rb
87
+ - lib/state_machines/error.rb
88
+ - lib/state_machines/eval_helpers.rb
89
+ - lib/state_machines/event.rb
90
+ - lib/state_machines/event_collection.rb
91
+ - lib/state_machines/extensions.rb
92
+ - lib/state_machines/helper_module.rb
93
+ - lib/state_machines/integrations.rb
94
+ - lib/state_machines/integrations/base.rb
95
+ - lib/state_machines/machine.rb
96
+ - lib/state_machines/machine_collection.rb
97
+ - lib/state_machines/macro_methods.rb
98
+ - lib/state_machines/matcher.rb
99
+ - lib/state_machines/matcher_helpers.rb
100
+ - lib/state_machines/node_collection.rb
101
+ - lib/state_machines/path.rb
102
+ - lib/state_machines/path_collection.rb
103
+ - lib/state_machines/state.rb
104
+ - lib/state_machines/state_collection.rb
105
+ - lib/state_machines/state_context.rb
106
+ - lib/state_machines/transition.rb
107
+ - lib/state_machines/transition_collection.rb
108
+ - lib/state_machines/version.rb
109
+ - lib/state_machines/yard.rb
110
+ - spec/errors/default_spec.rb
111
+ - spec/errors/with_message_spec.rb
112
+ - spec/helpers/helper_spec.rb
113
+ - spec/internal/app/models/auto_shop.rb
114
+ - spec/internal/app/models/car.rb
115
+ - spec/internal/app/models/model_base.rb
116
+ - spec/internal/app/models/motorcycle.rb
117
+ - spec/internal/app/models/traffic_light.rb
118
+ - spec/internal/app/models/vehicle.rb
119
+ - spec/machine_spec.rb
120
+ - spec/matcher_helpers_spec.rb
121
+ - spec/matcher_spec.rb
122
+ - spec/models/auto_shop_spec.rb
123
+ - spec/models/car_spec.rb
124
+ - spec/models/motorcycle_spec.rb
125
+ - spec/models/traffic_light_spec.rb
126
+ - spec/models/vehicle_spec.rb
127
+ - spec/node_collection_spec.rb
128
+ - spec/path_collection_spec.rb
129
+ - spec/path_spec.rb
130
+ - spec/spec_helper.rb
131
+ - spec/state_collection_spec.rb
132
+ - spec/state_context_spec.rb
133
+ - spec/state_machine_spec.rb
134
+ - spec/state_spec.rb
135
+ - spec/support/migration_helpers.rb
136
+ - spec/support/models.rb
137
+ - spec/transition_collection_spec.rb
138
+ - spec/transition_spec.rb
139
+ - state_machines.gemspec
140
+ homepage: ''
141
+ licenses:
142
+ - MIT
143
+ metadata: {}
144
+ post_install_message:
145
+ rdoc_options: []
146
+ require_paths:
147
+ - lib
148
+ required_ruby_version: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ requirements: []
159
+ rubyforge_project:
160
+ rubygems_version: 2.2.2
161
+ signing_key:
162
+ specification_version: 4
163
+ summary: State machines for attributes
164
+ test_files:
165
+ - spec/errors/default_spec.rb
166
+ - spec/errors/with_message_spec.rb
167
+ - spec/helpers/helper_spec.rb
168
+ - spec/internal/app/models/auto_shop.rb
169
+ - spec/internal/app/models/car.rb
170
+ - spec/internal/app/models/model_base.rb
171
+ - spec/internal/app/models/motorcycle.rb
172
+ - spec/internal/app/models/traffic_light.rb
173
+ - spec/internal/app/models/vehicle.rb
174
+ - spec/machine_spec.rb
175
+ - spec/matcher_helpers_spec.rb
176
+ - spec/matcher_spec.rb
177
+ - spec/models/auto_shop_spec.rb
178
+ - spec/models/car_spec.rb
179
+ - spec/models/motorcycle_spec.rb
180
+ - spec/models/traffic_light_spec.rb
181
+ - spec/models/vehicle_spec.rb
182
+ - spec/node_collection_spec.rb
183
+ - spec/path_collection_spec.rb
184
+ - spec/path_spec.rb
185
+ - spec/spec_helper.rb
186
+ - spec/state_collection_spec.rb
187
+ - spec/state_context_spec.rb
188
+ - spec/state_machine_spec.rb
189
+ - spec/state_spec.rb
190
+ - spec/support/migration_helpers.rb
191
+ - spec/support/models.rb
192
+ - spec/transition_collection_spec.rb
193
+ - spec/transition_spec.rb
194
+ has_rdoc: