entity_storage 2.1.4 → 2.1.5
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.
- data/README.rdoc +3 -1
- data/lib/entity_storage.rb +3 -3
- metadata +30 -17
- checksums.yaml +0 -7
data/README.rdoc
CHANGED
@@ -40,9 +40,11 @@ All EntityStorage operations sync immediately with the database, so a server shu
|
|
40
40
|
|
41
41
|
If you access a key that doesn't exist, and is specified in default list, will be initialized and returned. If not in default list, will return nil.
|
42
42
|
|
43
|
-
Keys can be up to
|
43
|
+
Keys can be up to 250 characters in length. Values can be practically any size, and consist of any object. Objects are marshalled back and forth between database.
|
44
44
|
|
45
45
|
== REQUIREMENTS:
|
46
|
+
As of 2.1.5, key length reduced to allow indexing on MySQL 5.6
|
47
|
+
|
46
48
|
As of 2.1.4, tested with Ruby 2.1.2.
|
47
49
|
|
48
50
|
As of 2.1.0, the MySQL2 gem and Ruby 1.9.3 are now supported.
|
data/lib/entity_storage.rb
CHANGED
@@ -9,7 +9,7 @@ require 'active_record'
|
|
9
9
|
|
10
10
|
|
11
11
|
module EntityStorage
|
12
|
-
VERSION = '2.1.
|
12
|
+
VERSION = '2.1.5'
|
13
13
|
|
14
14
|
class Storage
|
15
15
|
attr_accessor :defaults
|
@@ -78,7 +78,7 @@ module EntityStorage
|
|
78
78
|
|
79
79
|
def self.create
|
80
80
|
create_table "entity_storage", :force => true do |t|
|
81
|
-
t.string "key", :limit =>
|
81
|
+
t.string "key", :limit => 250, :null => false
|
82
82
|
#t.text "value"
|
83
83
|
t.binary "value"
|
84
84
|
t.datetime "created_at"
|
@@ -113,7 +113,7 @@ module EntityStorage
|
|
113
113
|
def self.set_value(search_key, new_value)
|
114
114
|
e = Entity.find_by_key(search_key.to_s)
|
115
115
|
if new_value.nil?
|
116
|
-
Entity.where(key:
|
116
|
+
Entity.where(key: search_key).delete_all
|
117
117
|
else
|
118
118
|
if e.nil?
|
119
119
|
e = new
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: entity_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Joshua Siler
|
@@ -13,51 +14,62 @@ dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rails
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: 3.0.3
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.0.3
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: activerecord
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: 3.0.3
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: 3.0.3
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: hoe
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: 2.3.3
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: 2.3.3
|
55
|
-
description:
|
56
|
-
|
62
|
+
description: ! 'An easy to use Key/Value store for any Ruby on Rails project. Like
|
63
|
+
Memcache, only persistent. Stores config values & application wide state in
|
64
|
+
the database in order to survive server restarts.
|
57
65
|
|
58
|
-
Designed to allow you to add persistent value storage to any Rails project in about 5 minutes.
|
59
66
|
|
60
|
-
|
67
|
+
Designed to allow you to add persistent value storage to any Rails project in about
|
68
|
+
5 minutes.
|
69
|
+
|
70
|
+
|
71
|
+
Additionally, allows users to set a list of default keys that auto-initializes baseline
|
72
|
+
key/value pairs in the database for easy initialization.'
|
61
73
|
email:
|
62
74
|
- joshua.siler@gmail.com
|
63
75
|
executables: []
|
@@ -70,34 +82,35 @@ files:
|
|
70
82
|
- Manifest.txt
|
71
83
|
- README.rdoc
|
72
84
|
- Rakefile
|
73
|
-
- config/database.yml
|
74
85
|
- lib/entity_storage.rb
|
75
86
|
- script/console
|
76
87
|
- script/destroy
|
77
88
|
- script/generate
|
89
|
+
- config/database.yml
|
78
90
|
- test/test_entity_storage.rb
|
79
91
|
homepage: http://github.com/eatenbyagrue/entity_storage
|
80
92
|
licenses: []
|
81
|
-
metadata: {}
|
82
93
|
post_install_message:
|
83
94
|
rdoc_options:
|
84
|
-
-
|
95
|
+
- --main
|
85
96
|
- README.rdoc
|
86
97
|
require_paths:
|
87
98
|
- lib
|
88
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
89
101
|
requirements:
|
90
|
-
- -
|
102
|
+
- - ! '>='
|
91
103
|
- !ruby/object:Gem::Version
|
92
104
|
version: 1.8.7
|
93
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
94
107
|
requirements:
|
95
|
-
- -
|
108
|
+
- - ! '>='
|
96
109
|
- !ruby/object:Gem::Version
|
97
110
|
version: '0'
|
98
111
|
requirements: []
|
99
112
|
rubyforge_project: entity-storage
|
100
|
-
rubygems_version:
|
113
|
+
rubygems_version: 1.8.25
|
101
114
|
signing_key:
|
102
115
|
specification_version: 3
|
103
116
|
summary: An easy to use Key/Value store for any Ruby on Rails project
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c22d19f1842688ea2ecbe8cce2a532923c99bced
|
4
|
-
data.tar.gz: a5d69524c725cacc5e39330419149db23b6459e9
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: f2f673a60836d93b1a4a9119cb8a948a55b06bc48659e847a41d081ff3d19a5965817b5933da46fdb358307dfc119e07983d74a1aae9001ca5a5a3fcd39d7f2a
|
7
|
-
data.tar.gz: ba58271df0f3acb7e44c27a051e48be02dc4cf4fba2b58f6bad228c30de9532bf902d2dcfa96af53a46a09812e5370799611b94374c534c7ead5f4e38c9fc057
|