mem_model 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjdiMTBhMWRhMGZmMWRkMDlkOGEwODJmNDUzYmJmOWFkODU0ZWJkZA==
4
+ OWUyZGEyNjVkNDU2YTEzODQxYTRiZmZhNDk5YTVkMTNjN2UzZDY1ZQ==
5
5
  data.tar.gz: !binary |-
6
- ZjM2OTc3OWQ1ODlmOTJjZGQ4NDY3MDliNDlkMWQ3MTdlOTc5ZDlhNQ==
6
+ YTlmNjU4MTBlNzQwNzQ4YzUxMDlmMGU5YmVjODg1MjliNTNiMTk4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTUzOTMwN2ViZjM1Y2Q4N2VhZDU4OWRkZDAyYjJkZjZiNjhlNGFjY2U2Y2Y2
10
- YzY4YmEyYjY2MGYyZmJmNTM2MGVhN2NkZGU0MTFkNTUyNmI0NjBlNTM3MjMx
11
- OWU5YTg2ZTgxMDI4MmUyOTk4MjM1YjJkNzVjZjk0ZDBmNzUxZGY=
9
+ ZWFiZjNiODE0YmM3MzZhNTFhZDBmMjA0NTA0NzkyODVkOGY0ZmM5YWJlODZm
10
+ NDcyMWM0MGViY2Y1YWY4ZjdiNDJkNTM5MThkMjRiYjEzYjE4YWJkNDdiNGM0
11
+ NDExNjcxMGU2Zjg4NzdjNTViNTE3ZGE1MTczMDU2YzUwOTRmMWI=
12
12
  data.tar.gz: !binary |-
13
- ZWYyMjgzODkwNTQxZGU5ZTc4ZWQ4MzFlZmRiZGEwN2MxYjYwNWEzNmEyNjgx
14
- MDk1NzllNmMyZGMzZmRkMjY2ZjMzOGM3Njk5OTYwMTAxZDYxYTkzMGM4ZmQz
15
- ZGY2ZTEzZjA1NDE5YjFkMmM3NTlhMzdkY2E3NWI2NzBlZGQxYTY=
13
+ ODEyZTFhNzQzNDA5ZTVlNjllMjkxMjI0M2JhOGNmZTgwNjFjYTA2NTZiYjFl
14
+ NmNhZTkyNzA5YTVlYjRkMjdlOGMwMmU1YjZiYTZlN2ZiZDg0MDg5ZDQ0MmQ1
15
+ OGEzZTg3NTAzNTZiOTAyNzk5MWQ2YmJlYjMzMjA0MDQ4MWIwM2M=
@@ -1,3 +1,10 @@
1
+ ### 0.8.0 / 2014-01-03
2
+
3
+ * 1 enhancement:
4
+
5
+ * Merge RootedBase into Base
6
+
7
+
1
8
  ### 0.7.0 / 2014-01-03
2
9
 
3
10
  * 2 enhancements:
@@ -14,7 +14,6 @@ lib/mem_model/concern.rb
14
14
  lib/mem_model/errors.rb
15
15
  lib/mem_model/guid.rb
16
16
  lib/mem_model/model_name.rb
17
- lib/mem_model/rooted_base.rb
18
17
  lib/mem_model/validations.rb
19
18
  lib/mem_model/version.rb
20
19
  mem_model.gemspec
@@ -28,6 +28,6 @@ module MemModel
28
28
  module_function :maglev?, :commit, :abort, :persistent
29
29
  end
30
30
 
31
- %w[ concern base errors guid model_name rooted_base validations version ].each do |file|
31
+ %w[ concern base errors guid model_name validations version ].each do |file|
32
32
  load File.expand_path("../mem_model/#{file}.rb", __FILE__)
33
33
  end
@@ -1,4 +1,6 @@
1
1
  module MemModel
2
+ PERSISTENT_ROOT = {} if !MemModel.maglev?
3
+
2
4
  module Base
3
5
  extend MemModel::Concern
4
6
 
@@ -11,6 +13,24 @@ module MemModel
11
13
  module ClassMethods
12
14
  include Enumerable
13
15
 
16
+ def root_container
17
+ MemModel.maglev? ? Maglev : MemModel
18
+ end
19
+
20
+ def container_key
21
+ name.to_sym
22
+ end
23
+
24
+ def store
25
+ root[:MemModel] ||= {}
26
+ root[:MemModel][container_key] ||= store_class.new
27
+ end
28
+
29
+ def root
30
+ @root ||= root_container::PERSISTENT_ROOT
31
+ end
32
+
33
+
14
34
  def each(&block)
15
35
  store.each(&block)
16
36
  end
@@ -23,10 +43,6 @@ module MemModel
23
43
  maglev? ? IdentitySet : Set
24
44
  end
25
45
 
26
- def store
27
- @store ||= store_class.new
28
- end
29
-
30
46
  def size
31
47
  store.size
32
48
  end
@@ -1,3 +1,3 @@
1
1
  module MemModel
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: mem_model 0.7.0.20140103165733 ruby lib
2
+ # stub: mem_model 0.8.0.20140103190534 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mem_model"
6
- s.version = "0.7.0.20140103165733"
6
+ s.version = "0.8.0.20140103190534"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["JohnnyT"]
10
- s.date = "2014-01-03"
10
+ s.date = "2014-01-04"
11
11
  s.description = "MemModel persists Ruby objects using MagLev as a data storage engine. It's an ActiveModel implementation so it works stand-alone or in Rails 3 as a drop-in replacement for ActiveRecord or DataMapper. If MemModel is used in non-MagLev platforms, objects will be persisted to in-memory sets."
12
12
  s.email = ["ubergeek3141@gmail.com"]
13
13
  s.extra_rdoc_files = ["CHANGELOG.md", "CONTRIBUTING.md", "LICENSE.md", "Manifest.txt", "README.md"]
@@ -2,7 +2,7 @@ require File.expand_path('../../helper', __FILE__)
2
2
 
3
3
  class TestRootedBase < Minitest::Test
4
4
  class Account
5
- include MemModel::RootedBase
5
+ include MemModel::Base
6
6
  end
7
7
 
8
8
  def setup
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mem_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JohnnyT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-03 00:00:00.000000000 Z
11
+ date: 2014-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -97,7 +97,6 @@ files:
97
97
  - lib/mem_model/errors.rb
98
98
  - lib/mem_model/guid.rb
99
99
  - lib/mem_model/model_name.rb
100
- - lib/mem_model/rooted_base.rb
101
100
  - lib/mem_model/validations.rb
102
101
  - lib/mem_model/version.rb
103
102
  - mem_model.gemspec
@@ -1,30 +0,0 @@
1
- module MemModel
2
- PERSISTENT_ROOT = {} if !MemModel.maglev?
3
-
4
- module RootedBase
5
- extend MemModel::Concern
6
-
7
- included do
8
- include MemModel::Base
9
- end
10
-
11
- module ClassMethods
12
- def root_container
13
- MemModel.maglev? ? Maglev : MemModel
14
- end
15
-
16
- def container_key
17
- name.to_sym
18
- end
19
-
20
- def store
21
- root[:MemModel] ||= {}
22
- root[:MemModel][container_key] ||= store_class.new
23
- end
24
-
25
- def root
26
- @root ||= root_container::PERSISTENT_ROOT
27
- end
28
- end
29
- end
30
- end