topmodel 0.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/README.md +34 -33
- data/VERSION +1 -1
- data/lib/topmodel/redis.rb +2 -2
- data/topmodel.gemspec +7 -5
- metadata +13 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a952577926b51b8c0053be523be532428e0d221d
|
|
4
|
+
data.tar.gz: 41e3ed2cc74b915b7656491e14a9e7878f5d4b27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef6417293797f7820dccc86d6db24e839455174fe1bcf9c76d5427088240e19f04ff16c6c905300ffc5ac850ccdda609d7fc228792f3e555d4ca1075de83a012
|
|
7
|
+
data.tar.gz: 643e7bffa6f7aa6444756e53e59ff0a4153fdfdf04eb38da776607db701428d0eb439f747927cb92a954f8262b6eca82c12b45cd0665916b9a527d316abbbbef
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#TopModel a Rails 4 compatible
|
|
1
|
+
#TopModel is a Rails 4 compatible In-Memory Object-Relational mapper using ActiveModel
|
|
2
2
|
**This gem is based on topmodel by Alex Maccaw (maccman). It includes some fixes and is updated to be compatible with Rails 4.**
|
|
3
3
|
|
|
4
4
|
|
|
@@ -15,50 +15,51 @@ http://github.com/maccman/bowline**
|
|
|
15
15
|
|
|
16
16
|
##Examples:
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
require "topmodel"
|
|
19
|
+
class Test < TopModel::Base
|
|
20
|
+
end
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
t = Test.new
|
|
23
|
+
t.name = "foo"
|
|
24
|
+
t.save #=> true
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Test.all
|
|
28
|
-
Test.first
|
|
29
|
-
Test.last
|
|
30
|
-
Test.find_by_name('foo)
|
|
26
|
+
Test.all
|
|
27
|
+
Test.first
|
|
28
|
+
Test.last
|
|
29
|
+
Test.find_by_name('foo)
|
|
31
30
|
|
|
32
31
|
You can use a random ID rather than the object ID:
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
class Test < TopModel::Base
|
|
34
|
+
include TopModel::RandomID
|
|
35
|
+
end
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
t = Test.create(:name => "test")
|
|
38
|
+
t.id #=> "7ee935377bb4aecc54ad4f9126"
|
|
40
39
|
|
|
41
40
|
You can marshal objects to disk on startup/shutdown
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
class Test < TopModel::Base
|
|
43
|
+
include TopModel::Marshal::Model
|
|
44
|
+
end
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
TopModel::Marshal.path = "dump.db"
|
|
47
|
+
TopModel::Marshal.load
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
at_exit {
|
|
50
|
+
TopModel::Marshal.dump
|
|
51
|
+
}
|
|
53
52
|
|
|
54
53
|
You can use Redis, you need the Redis gem installed:
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
end
|
|
55
|
+
require "redis"
|
|
56
|
+
class Test < TopModel::Base
|
|
57
|
+
include TopModel::Redis::Model
|
|
58
|
+
attributes :name
|
|
59
|
+
indexes :name
|
|
60
|
+
end
|
|
63
61
|
|
|
64
|
-
|
|
62
|
+
Test.find_or_create_by_name("foo")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
;-)
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2
|
|
1
|
+
0.2.1
|
data/lib/topmodel/redis.rb
CHANGED
data/topmodel.gemspec
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{topmodel}
|
|
8
|
-
s.version = "0.2"
|
|
8
|
+
s.version = "0.2.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
-
s.authors = ["Alex
|
|
11
|
+
s.authors = ["Alex Ebeling-Hoppe", "Alex MacCaw", "Jai-gouk Kim", "Mateusz D", "Denis Tierno"]
|
|
12
12
|
s.date = %q{2014-04-03}
|
|
13
|
-
s.
|
|
14
|
-
s.
|
|
13
|
+
s.licenses = ['MIT']
|
|
14
|
+
s.description = %q{TopModel is a Rails 4 compatible In-Memory Object-Relational mapper using ActiveModel}
|
|
15
|
+
s.homepage = %q{https://github.com/agilastic/topmodel}
|
|
16
|
+
s.email = %q{ebeling-hoppe@agilastic.de}
|
|
15
17
|
s.extra_rdoc_files = [
|
|
16
18
|
"README.md"
|
|
17
19
|
]
|
|
@@ -41,7 +43,7 @@ Gem::Specification.new do |s|
|
|
|
41
43
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
42
44
|
s.require_paths = ["lib"]
|
|
43
45
|
s.rubygems_version = %q{1.3.7}
|
|
44
|
-
s.summary = %q{In
|
|
46
|
+
s.summary = %q{TopModel is a Rails 4 compatible In-Memory Object-Relational mapper using ActiveModel}
|
|
45
47
|
|
|
46
48
|
if s.respond_to? :specification_version then
|
|
47
49
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
metadata
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: topmodel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Alex MacCaw
|
|
8
7
|
- Alex Ebeling-Hoppe
|
|
8
|
+
- Alex MacCaw
|
|
9
|
+
- Jai-gouk Kim
|
|
10
|
+
- Mateusz D
|
|
11
|
+
- Denis Tierno
|
|
9
12
|
autorequire:
|
|
10
13
|
bindir: bin
|
|
11
14
|
cert_chain: []
|
|
@@ -31,8 +34,9 @@ dependencies:
|
|
|
31
34
|
- - "<="
|
|
32
35
|
- !ruby/object:Gem::Version
|
|
33
36
|
version: 4.0.3
|
|
34
|
-
description: In
|
|
35
|
-
|
|
37
|
+
description: TopModel is a Rails 4 compatible In-Memory Object-Relational mapper using
|
|
38
|
+
ActiveModel
|
|
39
|
+
email: ebeling-hoppe@agilastic.de
|
|
36
40
|
executables: []
|
|
37
41
|
extensions: []
|
|
38
42
|
extra_rdoc_files:
|
|
@@ -58,8 +62,9 @@ files:
|
|
|
58
62
|
- lib/topmodel/validations.rb
|
|
59
63
|
- lib/topmodel/validations/uniqueness.rb
|
|
60
64
|
- topmodel.gemspec
|
|
61
|
-
homepage:
|
|
62
|
-
licenses:
|
|
65
|
+
homepage: https://github.com/agilastic/topmodel
|
|
66
|
+
licenses:
|
|
67
|
+
- MIT
|
|
63
68
|
metadata: {}
|
|
64
69
|
post_install_message:
|
|
65
70
|
rdoc_options:
|
|
@@ -81,5 +86,6 @@ rubyforge_project:
|
|
|
81
86
|
rubygems_version: 2.2.2
|
|
82
87
|
signing_key:
|
|
83
88
|
specification_version: 3
|
|
84
|
-
summary: In
|
|
89
|
+
summary: TopModel is a Rails 4 compatible In-Memory Object-Relational mapper using
|
|
90
|
+
ActiveModel
|
|
85
91
|
test_files: []
|