state_machines-activemodel 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,16 +3,6 @@ require 'spec_helper'
3
3
  describe StateMachines::Integrations::ActiveModel do
4
4
  it { expect(StateMachines::Integrations::ActiveModel.integration_name).to eq(:active_model) }
5
5
 
6
- it 'should_be_available' do
7
- expect(StateMachines::Integrations::ActiveModel.available?).to be_truthy
8
- end
9
-
10
- if defined?(ActiveModel::Observing)
11
- it 'should_match_if_class_includes_observing_feature' do
12
- expect(StateMachines::Integrations::ActiveModel.matches?(new_model { include ActiveModel::Observing })).to be_truthy
13
- end
14
- end
15
-
16
6
  it 'should_match_if_class_includes_validations_feature' do
17
7
  expect(StateMachines::Integrations::ActiveModel.matches?(new_model { include ActiveModel::Validations })).to be_truthy
18
8
  end
@@ -24,4 +14,13 @@ describe StateMachines::Integrations::ActiveModel do
24
14
  it 'should_have_no_defaults' do
25
15
  expect(StateMachines::Integrations::ActiveModel.defaults).to eq({})
26
16
  end
17
+
18
+ describe '.matching_ancestors' do
19
+ it do
20
+ expect(StateMachines::Integrations::ActiveModel.matching_ancestors).to include('ActiveModel')
21
+ end
22
+ it do
23
+ expect(StateMachines::Integrations::ActiveModel.matching_ancestors).to include('ActiveModel::Validations')
24
+ end
25
+ end
27
26
  end
@@ -45,20 +45,4 @@ def new_model(&block)
45
45
  end
46
46
  model.class_eval(&block) if block_given?
47
47
  model
48
- end
49
-
50
-
51
- # Creates a new ActiveModel observer
52
- def new_observer(model, &block)
53
- observer = Class.new(ActiveModel::Observer) do
54
- attr_accessor :notifications
55
-
56
- def initialize
57
- super
58
- @notifications = []
59
- end
60
- end
61
- observer.observe(model)
62
- observer.class_eval(&block) if block_given?
63
- observer
64
48
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.test_files = spec.files.grep(/^spec\//)
18
18
  spec.require_paths = ['lib']
19
-
19
+ spec.required_ruby_version = '>= 1.9.3'
20
20
  spec.add_dependency 'state_machines' , '>= 0'
21
21
  spec.add_dependency 'activemodel' , '>= 3.2'
22
22
 
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.0.1
4
+ version: 0.0.2
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: 2014-04-29 00:00:00.000000000 Z
12
+ date: 2014-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: state_machines
@@ -103,15 +103,6 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - ".gitignore"
106
- - ".idea/.rakeTasks"
107
- - ".idea/cssxfire.xml"
108
- - ".idea/encodings.xml"
109
- - ".idea/misc.xml"
110
- - ".idea/modules.xml"
111
- - ".idea/scopes/scope_settings.xml"
112
- - ".idea/state_machine2_activemodel.iml"
113
- - ".idea/vcs.xml"
114
- - ".idea/workspace.xml"
115
106
  - ".rspec"
116
107
  - ".travis.yml"
117
108
  - Appraisals
@@ -123,25 +114,16 @@ files:
123
114
  - gemfiles/active_model_3.2.gemfile.lock
124
115
  - gemfiles/active_model_4.0.gemfile
125
116
  - gemfiles/active_model_4.0.gemfile.lock
126
- - gemfiles/active_model_4.0_obs.gemfile
127
- - gemfiles/active_model_4.0_obs.gemfile.lock
128
117
  - gemfiles/active_model_4.1.gemfile
129
118
  - gemfiles/active_model_4.1.gemfile.lock
130
- - gemfiles/active_model_4.1_obs.gemfile
131
- - gemfiles/active_model_4.1_obs.gemfile.lock
132
119
  - gemfiles/active_model_edge.gemfile
133
120
  - gemfiles/active_model_edge.gemfile.lock
134
- - gemfiles/active_model_edge_obs.gemfile
135
- - gemfiles/active_model_edge_obs.gemfile.lock
136
121
  - lib/state_machines-activemodel.rb
137
122
  - lib/state_machines/integrations/active_model.rb
138
123
  - lib/state_machines/integrations/active_model/locale.rb
139
- - lib/state_machines/integrations/active_model/observer.rb
140
- - lib/state_machines/integrations/active_model/observer_update.rb
141
124
  - lib/state_machines/integrations/version.rb
142
125
  - spec/active_model_spec.rb
143
126
  - spec/integration_spec.rb
144
- - spec/observer_spec.rb
145
127
  - spec/spec_helper.rb
146
128
  - spec/support/en.yml
147
129
  - spec/support/helpers.rb
@@ -159,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
141
  requirements:
160
142
  - - ">="
161
143
  - !ruby/object:Gem::Version
162
- version: '0'
144
+ version: 1.9.3
163
145
  required_rubygems_version: !ruby/object:Gem::Requirement
164
146
  requirements:
165
147
  - - ">="
@@ -174,7 +156,6 @@ summary: ActiveModel integration for State Machines
174
156
  test_files:
175
157
  - spec/active_model_spec.rb
176
158
  - spec/integration_spec.rb
177
- - spec/observer_spec.rb
178
159
  - spec/spec_helper.rb
179
160
  - spec/support/en.yml
180
161
  - spec/support/helpers.rb
data/.idea/.rakeTasks DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Settings><!--This file was automatically generated by Ruby plugin.
3
- You are allowed to:
4
- 1. Remove rake task
5
- 2. Add existing rake tasks
6
- To add existing rake tasks automatically delete this file and reload the project.
7
- --><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
data/.idea/cssxfire.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="CssXFireSettings">
4
- <general autoClear="false" autoExpand="false" />
5
- <strategy useRoutes="false" mediaReduce="false" fileReduce="false" currentDocumentsReduce="false" resolveVariables="true" resolveMixins="true" />
6
- <routes />
7
- </component>
8
- </project>
9
-
data/.idea/encodings.xml DELETED
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
- </project>
5
-
data/.idea/misc.xml DELETED
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 1.9.3-p448" project-jdk-type="RUBY_SDK" />
4
- </project>
5
-
data/.idea/modules.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/state_machine2_activemodel.iml" filepath="$PROJECT_DIR$/.idea/state_machine2_activemodel.iml" />
6
- </modules>
7
- </component>
8
- </project>
9
-
@@ -1,5 +0,0 @@
1
- <component name="DependencyValidationManager">
2
- <state>
3
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
- </state>
5
- </component>
@@ -1,32 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="FacetManager">
4
- <facet type="gem" name="Ruby Gem">
5
- <configuration>
6
- <option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$/../state_machine2_activemodel" />
7
- <option name="GEM_APP_TEST_PATH" value="" />
8
- <option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/../state_machine2_activemodel/lib" />
9
- </configuration>
10
- </facet>
11
- </component>
12
- <component name="NewModuleRootManager">
13
- <content url="file://$MODULE_DIR$" />
14
- <orderEntry type="inheritedJdk" />
15
- <orderEntry type="sourceFolder" forTests="false" />
16
- <orderEntry type="module-library">
17
- <library name="state_machines-activemodel (v[path], /home/abdelkader/RubymineProjects/gems/state_machines-activemodel) [path][gem]">
18
- <CLASSES>
19
- <root url="file://$MODULE_DIR$/lib" />
20
- <root url="file://$MODULE_DIR$/.idea" />
21
- <root url="file://$MODULE_DIR$/gemfiles" />
22
- </CLASSES>
23
- <SOURCES>
24
- <root url="file://$MODULE_DIR$/lib" />
25
- <root url="file://$MODULE_DIR$/.idea" />
26
- <root url="file://$MODULE_DIR$/gemfiles" />
27
- </SOURCES>
28
- </library>
29
- </orderEntry>
30
- </component>
31
- </module>
32
-
data/.idea/vcs.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="" />
5
- </component>
6
- </project>
7
-
data/.idea/workspace.xml DELETED
@@ -1,50 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ChangeListManager">
4
- <option name="TRACKING_ENABLED" value="true" />
5
- <option name="SHOW_DIALOG" value="false" />
6
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
7
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
8
- <option name="LAST_RESOLUTION" value="IGNORE" />
9
- </component>
10
- <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
11
- <component name="CreatePatchCommitExecutor">
12
- <option name="PATCH_PATH" value="" />
13
- </component>
14
- <component name="DaemonCodeAnalyzer">
15
- <disable_hints />
16
- </component>
17
- <component name="ProjectLevelVcsManager" settingsEditedManually="false">
18
- <OptionsSetting value="true" id="Add" />
19
- <OptionsSetting value="true" id="Remove" />
20
- <OptionsSetting value="true" id="Checkout" />
21
- <OptionsSetting value="true" id="Update" />
22
- <OptionsSetting value="true" id="Status" />
23
- <OptionsSetting value="true" id="Edit" />
24
- <ConfirmationsSetting value="0" id="Add" />
25
- <ConfirmationsSetting value="0" id="Remove" />
26
- </component>
27
- <component name="ProjectReloadState">
28
- <option name="STATE" value="0" />
29
- </component>
30
- <component name="RunManager">
31
- <list size="0" />
32
- </component>
33
- <component name="ShelveChangesManager" show_recycled="false" />
34
- <component name="TaskManager">
35
- <task active="true" id="Default" summary="Default task" />
36
- <servers />
37
- </component>
38
- <component name="VcsContentAnnotationSettings">
39
- <option name="myLimit" value="2678400000" />
40
- </component>
41
- <component name="VcsManagerConfiguration">
42
- <option name="myTodoPanelSettings">
43
- <TodoPanelSettings />
44
- </option>
45
- </component>
46
- <component name="XDebuggerManager">
47
- <breakpoint-manager />
48
- </component>
49
- </project>
50
-
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activemodel", "~> 4.0.0"
6
- gem "rails-observers"
7
-
8
- gemspec :path => "../"
@@ -1,59 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- state_machines-activemodel (0.0.1)
5
- activemodel (>= 3.2)
6
- state_machines
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activemodel (4.0.4)
12
- activesupport (= 4.0.4)
13
- builder (~> 3.1.0)
14
- activesupport (4.0.4)
15
- i18n (~> 0.6, >= 0.6.9)
16
- minitest (~> 4.2)
17
- multi_json (~> 1.3)
18
- thread_safe (~> 0.1)
19
- tzinfo (~> 0.3.37)
20
- appraisal (1.0.0)
21
- bundler
22
- rake
23
- thor (>= 0.14.0)
24
- builder (3.1.4)
25
- diff-lcs (1.2.5)
26
- i18n (0.6.9)
27
- minitest (4.7.5)
28
- multi_json (1.9.3)
29
- rails-observers (0.1.2)
30
- activemodel (~> 4.0)
31
- rake (10.3.1)
32
- rspec (3.0.0.beta2)
33
- rspec-core (= 3.0.0.beta2)
34
- rspec-expectations (= 3.0.0.beta2)
35
- rspec-mocks (= 3.0.0.beta2)
36
- rspec-core (3.0.0.beta2)
37
- rspec-support (= 3.0.0.beta2)
38
- rspec-expectations (3.0.0.beta2)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (= 3.0.0.beta2)
41
- rspec-mocks (3.0.0.beta2)
42
- rspec-support (= 3.0.0.beta2)
43
- rspec-support (3.0.0.beta2)
44
- state_machines (0.0.1)
45
- thor (0.19.1)
46
- thread_safe (0.3.3)
47
- tzinfo (0.3.39)
48
-
49
- PLATFORMS
50
- ruby
51
-
52
- DEPENDENCIES
53
- activemodel (~> 4.0.0)
54
- appraisal (>= 1)
55
- bundler (>= 1.6)
56
- rails-observers
57
- rake (>= 10)
58
- rspec (= 3.0.0.beta2)
59
- state_machines-activemodel!
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activemodel", "~> 4.1.0"
6
- gem "rails-observers"
7
-
8
- gemspec :path => "../"
@@ -1,60 +0,0 @@
1
- PATH
2
- remote: ../
3
- specs:
4
- state_machines-activemodel (0.0.1)
5
- activemodel (>= 3.2)
6
- state_machines
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activemodel (4.1.0)
12
- activesupport (= 4.1.0)
13
- builder (~> 3.1)
14
- activesupport (4.1.0)
15
- i18n (~> 0.6, >= 0.6.9)
16
- json (~> 1.7, >= 1.7.7)
17
- minitest (~> 5.1)
18
- thread_safe (~> 0.1)
19
- tzinfo (~> 1.1)
20
- appraisal (1.0.0)
21
- bundler
22
- rake
23
- thor (>= 0.14.0)
24
- builder (3.2.2)
25
- diff-lcs (1.2.5)
26
- i18n (0.6.9)
27
- json (1.8.1)
28
- minitest (5.3.3)
29
- rails-observers (0.1.2)
30
- activemodel (~> 4.0)
31
- rake (10.3.1)
32
- rspec (3.0.0.beta2)
33
- rspec-core (= 3.0.0.beta2)
34
- rspec-expectations (= 3.0.0.beta2)
35
- rspec-mocks (= 3.0.0.beta2)
36
- rspec-core (3.0.0.beta2)
37
- rspec-support (= 3.0.0.beta2)
38
- rspec-expectations (3.0.0.beta2)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (= 3.0.0.beta2)
41
- rspec-mocks (3.0.0.beta2)
42
- rspec-support (= 3.0.0.beta2)
43
- rspec-support (3.0.0.beta2)
44
- state_machines (0.0.1)
45
- thor (0.19.1)
46
- thread_safe (0.3.3)
47
- tzinfo (1.1.0)
48
- thread_safe (~> 0.1)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- activemodel (~> 4.1.0)
55
- appraisal (>= 1)
56
- bundler (>= 1.6)
57
- rails-observers
58
- rake (>= 10)
59
- rspec (= 3.0.0.beta2)
60
- state_machines-activemodel!
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activemodel", :github => "rails/rails"
6
- gem "rails-observers"
7
-
8
- gemspec :path => "../"
@@ -1,65 +0,0 @@
1
- GIT
2
- remote: git://github.com/rails/rails.git
3
- revision: 89893a000188f977163dddc04ff37846169a35dc
4
- specs:
5
- activemodel (4.2.0.alpha)
6
- activesupport (= 4.2.0.alpha)
7
- builder (~> 3.1)
8
- activesupport (4.2.0.alpha)
9
- i18n (~> 0.6, >= 0.6.9)
10
- json (~> 1.7, >= 1.7.7)
11
- minitest (~> 5.1)
12
- thread_safe (~> 0.1)
13
- tzinfo (~> 1.1)
14
-
15
- PATH
16
- remote: ../
17
- specs:
18
- state_machines-activemodel (0.0.1)
19
- activemodel (>= 3.2)
20
- state_machines
21
-
22
- GEM
23
- remote: https://rubygems.org/
24
- specs:
25
- appraisal (1.0.0)
26
- bundler
27
- rake
28
- thor (>= 0.14.0)
29
- builder (3.2.2)
30
- diff-lcs (1.2.5)
31
- i18n (0.6.9)
32
- json (1.8.1)
33
- minitest (5.3.3)
34
- rails-observers (0.1.2)
35
- activemodel (~> 4.0)
36
- rake (10.3.1)
37
- rspec (3.0.0.beta2)
38
- rspec-core (= 3.0.0.beta2)
39
- rspec-expectations (= 3.0.0.beta2)
40
- rspec-mocks (= 3.0.0.beta2)
41
- rspec-core (3.0.0.beta2)
42
- rspec-support (= 3.0.0.beta2)
43
- rspec-expectations (3.0.0.beta2)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (= 3.0.0.beta2)
46
- rspec-mocks (3.0.0.beta2)
47
- rspec-support (= 3.0.0.beta2)
48
- rspec-support (3.0.0.beta2)
49
- state_machines (0.0.1)
50
- thor (0.19.1)
51
- thread_safe (0.3.3)
52
- tzinfo (1.1.0)
53
- thread_safe (~> 0.1)
54
-
55
- PLATFORMS
56
- ruby
57
-
58
- DEPENDENCIES
59
- activemodel!
60
- appraisal (>= 1)
61
- bundler (>= 1.6)
62
- rails-observers
63
- rake (>= 10)
64
- rspec (= 3.0.0.beta2)
65
- state_machines-activemodel!