eatenbyagrue-entity_storage 1.0.1 → 1.0.2
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/History.txt +3 -0
- data/README.rdoc +14 -2
- data/Rakefile +0 -1
- data/config/database.yml +1 -1
- data/lib/entity_storage.rb +3 -5
- metadata +2 -2
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -12,7 +12,8 @@ Additionally, allows users to set a list of default keys that auto-initiliazes b
|
|
12
12
|
|
13
13
|
You can use the entity store like so:
|
14
14
|
|
15
|
-
# Get key value. If it doesn't exist and is specified in default list, will be initialized and returned.
|
15
|
+
# Get key value. If it doesn't exist and is specified in default list, will be initialized and returned.
|
16
|
+
# If not in default list, will return nil.
|
16
17
|
e = EntityStore["testkey"]
|
17
18
|
e = EntityStore.testkey
|
18
19
|
e = EntityStore[:testkey]
|
@@ -40,8 +41,19 @@ Keys can be up to 512 characters in length. Values can be practically any size,
|
|
40
41
|
Requires ActiveRecord 2.2.3 or above (probably works with earlier versions, but has not been tested.)
|
41
42
|
|
42
43
|
== INSTALL:
|
44
|
+
To install from github:
|
43
45
|
|
44
|
-
|
46
|
+
Run the following if you haven't already:
|
47
|
+
|
48
|
+
gem sources -a http://gems.github.com
|
49
|
+
|
50
|
+
Install the gem(s):
|
51
|
+
|
52
|
+
sudo gem install eatenbyagrue-entity_storage
|
53
|
+
|
54
|
+
Or download the souce above and run, customized for version and environment:
|
55
|
+
|
56
|
+
sudo gem install PATH/entity_storage.#.#.#.gem
|
45
57
|
|
46
58
|
Put the following at the bottom of your environment.rb file, or in an initializer.
|
47
59
|
|
data/Rakefile
CHANGED
@@ -15,7 +15,6 @@ $hoe = Hoe.spec 'entity_storage' do
|
|
15
15
|
# self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
16
|
self.rubyforge_name = self.name # TODO this is default value
|
17
17
|
self.extra_deps = [['activerecord','>= 2.2.2']]
|
18
|
-
|
19
18
|
end
|
20
19
|
|
21
20
|
require 'newgem/tasks'
|
data/config/database.yml
CHANGED
data/lib/entity_storage.rb
CHANGED
@@ -5,17 +5,15 @@ require 'rubygems'
|
|
5
5
|
require 'activerecord'
|
6
6
|
|
7
7
|
module EntityStorage
|
8
|
-
VERSION = '1.0.
|
8
|
+
VERSION = '1.0.2'
|
9
9
|
|
10
10
|
class Storage
|
11
11
|
attr_accessor :defaults
|
12
12
|
|
13
13
|
# Checks for the existence of the necessary Entities table... if not here, creates it.
|
14
14
|
def initialize(defaults={})
|
15
|
-
table_exists
|
16
|
-
|
17
|
-
unless table_exists
|
18
|
-
AddEntitiesTable.up
|
15
|
+
unless ActiveRecord::Base.connection.table_exists?('entity_storage')
|
16
|
+
AddEntitiesTable.up
|
19
17
|
end
|
20
18
|
|
21
19
|
self.defaults = defaults
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eatenbyagrue-entity_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Siler
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-21 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|