hold 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6eb66a9b993a58327effef42e2503297ab0fdad6
4
- data.tar.gz: 205a84af71021efa70c74995dc8ae0c3bd904e25
3
+ metadata.gz: ccf3c450bd0581651f077eba61da713f1d1d2c55
4
+ data.tar.gz: 9c91f6779ba78610c0cbf5140f1c401994b04f6a
5
5
  SHA512:
6
- metadata.gz: 61fb6def62557bfb2ecfd68c0531f9f70a3b4f2ccacb4a0581862c8edf7c1e2cee1279a2a747760b5bda18e3668ff28996debfcd99a3e5ecbb65577b167ffdf7
7
- data.tar.gz: c7571b92d84ff5ae33744636e7326e639674b52e550dcebc6e87337d7e704d43c3bf53d794fa64d8cf9ee19fbcff2dddc27ec7b44ecdf96cfbe8620d4aed2242
6
+ metadata.gz: a9264703012fd325bf2dacd390aa732830dbb6874c2da1cf05a774a15a8424ff300f46c268a6351f983cd9af29a79ccf8851407c8e358dab3b27f4eb74322dc3
7
+ data.tar.gz: fbf1e4cb8abfd62aad061b5e5675f251e30e2a6d357c8da5e31c021a56d9624c6eeecdf2bf47976512d815fba8f458a1fe67684eefd1c1ea4fa2303a1acad52d
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- ![Build Status](https://travis-ci.org/mediasp/hold.svg?branch=master)
1
+ [![Build Status](https://travis-ci.org/mediasp/hold.svg?branch=master)](https://travis-ci.org/mediasp/hold)
2
+ [![Gem Version](https://badge.fury.io/rb/hold.svg)](http://badge.fury.io/rb/hold)
2
3
  # Hold
3
4
 
4
5
  A ruby library geared towards separating persistence concerns from data model classes.
@@ -86,10 +86,13 @@ module Hold
86
86
 
87
87
  def get_by_id(id)
88
88
  json = @cache.get_with_key(cache_key(id))
89
- string_hash = @serializer.deserialize(json)
90
- string_hash = string_hash.inject({}){|memo,(k,v)|
91
- memo[k.to_sym] = v; memo
92
- }
89
+ if json
90
+ string_hash = @serializer.deserialize(json)
91
+ string_hash.inject({}) do |memo, (k,v)|
92
+ memo[k.to_sym] = v
93
+ memo
94
+ end
95
+ end
93
96
  end
94
97
 
95
98
  def delete_id(id)
@@ -99,6 +102,5 @@ module Hold
99
102
  def contains_id?(id)
100
103
  @cache.has_key?(cache_key(id))
101
104
  end
102
-
103
105
  end
104
106
  end
data/lib/hold/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hold
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hold
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Willson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-16 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -140,20 +140,6 @@ dependencies:
140
140
  description: |2
141
141
  A persistence library based more closely on the repository model.
142
142
  Used in production for several years.
143
-
144
- To summarize, the idea is that
145
-
146
- * You have Repositories which are responsible for persisting objects in a data store
147
- * Your data objects know nothing about persistence. They are just 'plain old' in-memory ruby objects can be created and manipulated independently of any particular repository.
148
-
149
- This is a substantially different approach to the widely used ActiveRecord pattern.
150
-
151
- Of course there are various trade-offs involved when choosing between these two approaches. ActiveRecord is a more lightweight approach which is often preferred for small-to-mid-sized database-backed web applications where the data model is tightly coupled to a database schema; whereas Repositories start to show benefits when it comes to, e.g.:
152
-
153
- * Separation of concerns in a larger system; avoiding bloated model classes with too many responsibilities
154
- * Ease of switching between alternative back-end data stores, e.g. database-backed vs persisted-in-a-config-file vs persisted in-memory. In particular, this can help avoid database dependencies when testing
155
- * Systems which persist objects in multiple data stores -- e.g. in a relational database, serialized in a key-value cache, serialized in config files, ...
156
- * Decoupling the structure of your data model from the schema of the data store used to persist it
157
143
  email:
158
144
  - mark@mediasp.com
159
145
  - tom@mediasp.com