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 +8 -8
- data/CHANGELOG.md +7 -0
- data/Manifest.txt +0 -1
- data/lib/mem_model.rb +1 -1
- data/lib/mem_model/base.rb +20 -4
- data/lib/mem_model/version.rb +1 -1
- data/mem_model.gemspec +3 -3
- data/test/mem_model/test_rooted_base.rb +1 -1
- metadata +2 -3
- data/lib/mem_model/rooted_base.rb +0 -30
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWUyZGEyNjVkNDU2YTEzODQxYTRiZmZhNDk5YTVkMTNjN2UzZDY1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTlmNjU4MTBlNzQwNzQ4YzUxMDlmMGU5YmVjODg1MjliNTNiMTk4Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWFiZjNiODE0YmM3MzZhNTFhZDBmMjA0NTA0NzkyODVkOGY0ZmM5YWJlODZm
|
10
|
+
NDcyMWM0MGViY2Y1YWY4ZjdiNDJkNTM5MThkMjRiYjEzYjE4YWJkNDdiNGM0
|
11
|
+
NDExNjcxMGU2Zjg4NzdjNTViNTE3ZGE1MTczMDU2YzUwOTRmMWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODEyZTFhNzQzNDA5ZTVlNjllMjkxMjI0M2JhOGNmZTgwNjFjYTA2NTZiYjFl
|
14
|
+
NmNhZTkyNzA5YTVlYjRkMjdlOGMwMmU1YjZiYTZlN2ZiZDg0MDg5ZDQ0MmQ1
|
15
|
+
OGEzZTg3NTAzNTZiOTAyNzk5MWQ2YmJlYjMzMjA0MDQ4MWIwM2M=
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
data/lib/mem_model.rb
CHANGED
@@ -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
|
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
|
data/lib/mem_model/base.rb
CHANGED
@@ -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
|
data/lib/mem_model/version.rb
CHANGED
data/mem_model.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: mem_model 0.
|
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.
|
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-
|
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"]
|
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.
|
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-
|
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
|