state_machines-mongoid 0.1.1 → 0.2.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: 2084ec0e554c23254041e63aa0646f0cc9cf3d21
4
- data.tar.gz: 26cf5deac7ccd94d7e69d5c45d51eb23f03174ec
3
+ metadata.gz: 13a7d299b7d77b49bd83f81b80241a16a22facf9
4
+ data.tar.gz: c777b7391b51e107625bbeb13455bcb8557f9bb1
5
5
  SHA512:
6
- metadata.gz: 02359fa8bb84c95bb677be652e7a7c5978f58ee14ac3dc6d74a60314229ef7c092abdf3c4c568cda5fd985ba7bd51eb52c5ce436ea3754b7ea73b2f1696d89ef
7
- data.tar.gz: 4565221a84bdb4781a5d0f847f2870ae78ce388c03979d91e84da3c86bebc7617e64edd8e614251175a818ef78b7615bedffe53672b63ef003a746b98e1a38a2
6
+ metadata.gz: 66bd8fe88e2f3ea19d4407867337819179bf5c325d3159cabd44c639e905fdfd0752c29d5687cf35ed62197c562c7f751d20c71a9fd5f24bdca82c698770c19b
7
+ data.tar.gz: 0f4337db87ac68a124139ce1018f6a27011b3a8b0d320be66c6e99bebceced4f8446f2dd0688f1b098ffcbe713ec49558fb3a485c1d7aedd83a333da2bfb25ff
@@ -294,7 +294,7 @@ module StateMachines
294
294
  # Classes that include Mongoid::Document will automatically use the
295
295
  # Mongoid integration.
296
296
  def self.matching_ancestors
297
- %w(Mongoid::Document)
297
+ [::Mongoid::Document]
298
298
  end
299
299
 
300
300
  def self.locale_path
@@ -1,7 +1,7 @@
1
1
  module StateMachines
2
2
  module Integrations
3
3
  module Mongoid
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
6
6
  end
7
7
  end
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.required_ruby_version = '>= 1.9.3'
22
- spec.add_dependency 'state_machines-activemodel' , '>= 0'
21
+ spec.required_ruby_version = '>= 2.0.0'
22
+ spec.add_dependency 'state_machines-activemodel', '>= 0.5.0'
23
23
  spec.add_dependency 'mongoid' , '>= 4.0.0'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '>= 1.6'
@@ -0,0 +1,6 @@
1
+ test:
2
+ clients:
3
+ default:
4
+ database: state-machines-mongoid_test
5
+ hosts:
6
+ - localhost:27017
data/test/test_helper.rb CHANGED
@@ -2,28 +2,10 @@ require 'minitest/reporters'
2
2
  Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
3
3
  require 'state_machines-mongoid'
4
4
  require 'minitest/autorun'
5
+ require 'mongoid'
6
+ require 'mongo/client'
5
7
 
6
- # Env variables can be set to test to another database
7
- ENV['MONGO_HOST'] ||= 'localhost'
8
- ENV['MONGO_PORT'] ||= '27017'
9
-
10
- HOST = ENV['MONGO_HOST']
11
- PORT = ENV['MONGO_PORT'].to_i
12
- DB_NAME = 'state-machines-mongoid_test'
13
-
14
- CONFIG = {
15
- sessions: {
16
- default: {
17
- database: DB_NAME,
18
- hosts: [ "#{HOST}:#{PORT}" ]
19
- }
20
- }
21
- }
22
-
23
- # Set the database that the spec suite connects to.
24
- Mongoid.configure do |config|
25
- config.load_configuration(CONFIG)
26
- end
8
+ Mongoid.load!('./test/config/mongoid.yml', :test)
27
9
 
28
10
  # Module for test models
29
11
  module MongoidTest
@@ -36,7 +18,8 @@ class BaseTestCase < Minitest::Test
36
18
 
37
19
  def teardown
38
20
  if @table_names
39
- db = Mongoid::Sessions.default
21
+ client = Mongo::Client.new(['127.0.0.1:27017'])
22
+ db = Mongo::Database.new(client, :test)
40
23
  db.collections.each {|c| c.drop if @table_names.include?(c.name)}
41
24
  end
42
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
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: 2015-02-12 00:00:00.000000000 Z
12
+ date: 2017-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: state_machines-activemodel
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 0.5.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 0.5.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mongoid
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -118,6 +118,7 @@ files:
118
118
  - lib/state_machines/integrations/mongoid/version.rb
119
119
  - lib/state_machines/state_machines-mongoid.rb
120
120
  - state_machines-mongoid.gemspec
121
+ - test/config/mongoid.yml
121
122
  - test/files/en.yml
122
123
  - test/integration_test.rb
123
124
  - test/machine_by_default_test.rb
@@ -179,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
180
  requirements:
180
181
  - - ">="
181
182
  - !ruby/object:Gem::Version
182
- version: 1.9.3
183
+ version: 2.0.0
183
184
  required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  requirements:
185
186
  - - ">="
@@ -187,11 +188,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
188
  version: '0'
188
189
  requirements: []
189
190
  rubyforge_project:
190
- rubygems_version: 2.4.5
191
+ rubygems_version: 2.6.12
191
192
  signing_key:
192
193
  specification_version: 4
193
194
  summary: Mongoid integration for state machines
194
195
  test_files:
196
+ - test/config/mongoid.yml
195
197
  - test/files/en.yml
196
198
  - test/integration_test.rb
197
199
  - test/machine_by_default_test.rb
@@ -241,4 +243,3 @@ test_files:
241
243
  - test/machine_with_validations_test.rb
242
244
  - test/machine_without_field_test.rb
243
245
  - test/test_helper.rb
244
- has_rdoc: