hold 1.0.0 → 1.0.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/hold.rb +2 -4
  4. data/lib/hold/version.rb +1 -1
  5. metadata +26 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 078fa2a47c6a66287d3d81ebcd88bb63697b4f66
4
- data.tar.gz: 69302275430a5fbecbfe33b50e3ca701d9d5459c
3
+ metadata.gz: 6eb66a9b993a58327effef42e2503297ab0fdad6
4
+ data.tar.gz: 205a84af71021efa70c74995dc8ae0c3bd904e25
5
5
  SHA512:
6
- metadata.gz: 04f96a47dba63737c94e4979b3e954a5e3b0479f78d9030eea4754ffbe113391d6fa888093bd30a5d2986d061a4fd3d6d44fbea3cc621f3e9dcaa09be090b0d7
7
- data.tar.gz: a17ca7adeef0bde56d0d6ef81410cb8299eeb92ebc3f54ccc9778bae94986ad3cf8eb8a32faba39d2edeb73bc55b67466eb4ee2c2577e031db37c2611b2b7aaa
6
+ metadata.gz: 61fb6def62557bfb2ecfd68c0531f9f70a3b4f2ccacb4a0581862c8edf7c1e2cee1279a2a747760b5bda18e3668ff28996debfcd99a3e5ecbb65577b167ffdf7
7
+ data.tar.gz: c7571b92d84ff5ae33744636e7326e639674b52e550dcebc6e87337d7e704d43c3bf53d794fa64d8cf9ee19fbcff2dddc27ec7b44ecdf96cfbe8620d4aed2242
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ ![Build Status](https://travis-ci.org/mediasp/hold.svg?branch=master)
1
2
  # Hold
2
3
 
3
4
  A ruby library geared towards separating persistence concerns from data model classes.
data/lib/hold.rb CHANGED
@@ -3,12 +3,10 @@ require_relative 'hold/file/hash_repository'
3
3
  require_relative 'hold/sequel'
4
4
 
5
5
  module Hold; end
6
- Persistence = Hold
7
6
 
8
- module Kernel
7
+ module Persistence
9
8
  def self.const_missing(const_name)
10
- super unless const_name == :Persistence
11
9
  warn "'Persistence' has been deprecated, please use 'Hold' instead"
12
- Hold
10
+ Hold.const_get(const_name)
13
11
  end
14
12
  end
data/lib/hold/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hold
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hold
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Willson
8
+ - Nick Griffiths
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
12
+ date: 2014-05-16 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
@@ -136,9 +137,27 @@ dependencies:
136
137
  - - "~>"
137
138
  - !ruby/object:Gem::Version
138
139
  version: 0.1.4
139
- description:
140
+ description: |2
141
+ A persistence library based more closely on the repository model.
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
140
157
  email:
141
- - matthew@playlouder.com
158
+ - mark@mediasp.com
159
+ - tom@mediasp.com
160
+ - devs@mediasp.com
142
161
  executables: []
143
162
  extensions: []
144
163
  extra_rdoc_files: []
@@ -172,8 +191,9 @@ files:
172
191
  - lib/hold/serialized.rb
173
192
  - lib/hold/serialized/json_serializer.rb
174
193
  - lib/hold/version.rb
175
- homepage:
176
- licenses: []
194
+ homepage: https://github.com/mediasp/hold
195
+ licenses:
196
+ - MIT
177
197
  metadata: {}
178
198
  post_install_message:
179
199
  rdoc_options: []