persist 0.1.1 → 0.1.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.
- checksums.yaml +7 -0
- data/.travis.yml +6 -0
- data/README.md +15 -53
- data/Rakefile +7 -0
- data/lib/persist/version.rb +1 -1
- data/persist.gemspec +3 -5
- data/test/helper.rb +1 -1
- data/test/{test_persist.rb → persist_test.rb} +0 -0
- metadata +31 -51
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cfd5a6e8d039461b96ccc4dcb50ffdceb19e3a26
|
4
|
+
data.tar.gz: 80c53c2651cd2d090102cd822161930c6d73f777
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3a75c9089a8ae144036e3ed0bfc396744f76a910959cf66035bcae76762c01186eb6cc3266a3ddf013038805beeefe541011d2efcc18f4ec78444d57dced0b5e
|
7
|
+
data.tar.gz: d29dfbdb9730f17297867438e979fb00374b54fa0412bdc9c01f28d868f06e6811173d272c11e555ae286bbb93f5bc03d12db93f5c400f08b77f4e018e775fd4
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,74 +1,38 @@
|
|
1
|
-
# Persist
|
1
|
+
# Persist
|
2
|
+
[](https://travis-ci.org/havenwood/persist)
|
2
3
|
|
3
|
-
Persist
|
4
|
+
The Persist gem makes it simple to persist Ruby objects to disk. Persist uses Ruby's PStore class to serialize Ruby objects with Marshal and transactionally save them for retrieval later.
|
4
5
|
|
5
6
|
## Installation
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem 'persist'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself:
|
16
|
-
|
17
|
-
$ gem install persist
|
7
|
+
Install the gem from the command line:
|
8
|
+
`gem install persist`
|
18
9
|
|
19
10
|
## Usage
|
20
|
-
|
21
|
-
Example in Pry (or IRB if you must):
|
22
|
-
|
11
|
+
Example in irb or [Pry](http://pryrepl.org):
|
23
12
|
```ruby
|
24
13
|
require 'persist'
|
25
|
-
#=> true
|
26
|
-
|
27
|
-
Persist.pull
|
28
|
-
# => #<PStore:0x007f8c199c9698
|
29
|
-
@abort=false,
|
30
|
-
@filename=".db.pstore",
|
31
|
-
@lock=#<Mutex:0x007f8c199c9580>,
|
32
|
-
@rdonly=true,
|
33
|
-
@table={},
|
34
|
-
@thread_safe=true,
|
35
|
-
@ultra_safe=true>
|
36
|
-
|
37
14
|
Persist[:pie] = ['Key Lime', 'Strawberry Rhubarb', 'Blackberry Cobbler']
|
38
15
|
# => ["Key Lime", "Strawberry Rhubarb", "Blackberry Cobbler"]
|
39
|
-
|
40
|
-
Persist[:ice_cream] = ['chocolate', 'vanilla']
|
41
|
-
# => ["chocolate", "vanilla"]
|
42
16
|
```
|
43
17
|
|
44
|
-
You can now exit Pry
|
45
|
-
|
18
|
+
You can now exit irb or [Pry](http://pryrepl.org) and your Ruby objects are still there:
|
46
19
|
```ruby
|
47
20
|
require 'persist'
|
48
|
-
#=> true
|
49
|
-
|
50
|
-
Persist.pull
|
51
|
-
#=> #<PStore:0x007f8c199c9698 ... >
|
52
|
-
|
53
21
|
Persist[:pie]
|
54
22
|
#=> ["Key Lime", "Strawberry Rhubarb", "Blackberry Cobbler"]
|
55
23
|
```
|
56
24
|
|
57
25
|
## Transactions
|
58
|
-
|
59
26
|
Transactions succeed or fail together to ensure that data is not left in a transitory state:
|
60
|
-
|
61
27
|
```ruby
|
62
28
|
Persist.transaction do |db|
|
63
|
-
db[:
|
29
|
+
db[:ice_cream] = ['chocolate', 'vanilla']
|
64
30
|
db.delete :pie
|
65
31
|
end
|
66
32
|
```
|
67
33
|
|
68
34
|
## Helper Methods
|
69
|
-
|
70
|
-
Each of Persist.db's tables is stored as a key:
|
71
|
-
|
35
|
+
Tables are treated as Hash keys:
|
72
36
|
```ruby
|
73
37
|
Persist.keys
|
74
38
|
#=> [:pie, :ice_cream]
|
@@ -80,15 +44,13 @@ Persist.key? :cake
|
|
80
44
|
#=> false
|
81
45
|
```
|
82
46
|
|
83
|
-
|
84
|
-
|
47
|
+
Easily delete tables:
|
85
48
|
```ruby
|
86
49
|
Persist.delete :pie
|
87
50
|
#=> nil
|
88
51
|
```
|
89
52
|
|
90
|
-
|
91
|
-
|
53
|
+
Check the location of the persistant file on disk:
|
92
54
|
```ruby
|
93
55
|
Persist.path
|
94
56
|
#=> ".db.pstore"
|
@@ -98,14 +60,14 @@ Persist.path
|
|
98
60
|
|
99
61
|
## Supported Platforms
|
100
62
|
|
101
|
-
Persist
|
63
|
+
Persist takes advantage of PStore's [ultra_safe attribute](http://ruby-doc.org/stdlib-2.0/libdoc/pstore/rdoc/PStore.html#ultra_safe-attribute-method), which requires:
|
102
64
|
|
103
|
-
1. Ruby 1.9 (tested on
|
104
|
-
2. A POSIX platform (such as OS X, GNU/Linux or
|
65
|
+
1. Ruby 1.9+ compatibility (tested on Ruby 2.0.0, 1.9.3, JRuby and Rubinius).
|
66
|
+
2. A POSIX compliant platform (such as OS X, GNU/Linux or a BSD).
|
105
67
|
|
106
68
|
## Contributing
|
107
69
|
|
108
70
|
1. Fork it
|
109
71
|
2. Commit changes (`git commit -am 'did something'`)
|
110
72
|
3. Submit a Pull Request
|
111
|
-
4. :cake:
|
73
|
+
4. :cake:
|
data/Rakefile
ADDED
data/lib/persist/version.rb
CHANGED
data/persist.gemspec
CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/persist/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ['Shannon Skipper']
|
6
6
|
gem.email = ['shannonskipper@gmail.com']
|
7
|
-
gem.description = %q{A
|
8
|
-
gem.summary = %q{Persist
|
7
|
+
gem.description = %q{A wrapper around Ruby's PStore that allows you to persist Ruby objects to a transactional file store.}
|
8
|
+
gem.summary = %q{Persist Ruby objects to a transactional file store using Ruby's Pstore.}
|
9
9
|
gem.homepage = 'https://github.com/Havenwood/persist'
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
@@ -16,7 +16,5 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = Persist::VERSION
|
17
17
|
|
18
18
|
gem.add_development_dependency 'minitest'
|
19
|
-
|
20
|
-
gem.signing_key = '/Users/shannonskipper/.gem/private/gem-private_key.pem'
|
21
|
-
gem.cert_chain = ['/Users/shannonskipper/.gem/private/gem-public_cert.pem']
|
19
|
+
gem.add_development_dependency 'rake'
|
22
20
|
end
|
data/test/helper.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,64 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: persist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shannon Skipper
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
-
|
13
|
-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURpakNDQW5LZ0F3SUJB
|
14
|
-
Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREJGTVJjd0ZRWURWUVFEREE1emFH
|
15
|
-
RnUKYm05dWMydHBjSEJsY2pFVk1CTUdDZ21TSm9tVDhpeGtBUmtXQldkdFlX
|
16
|
-
bHNNUk13RVFZS0NaSW1pWlB5TEdRQgpHUllEWTI5dE1CNFhEVEV6TURJd01q
|
17
|
-
SXlNalExTUZvWERURTBNREl3TWpJeU1qUTFNRm93UlRFWE1CVUdBMVVFCkF3
|
18
|
-
d09jMmhoYm01dmJuTnJhWEJ3WlhJeEZUQVRCZ29Ka2lhSmsvSXNaQUVaRmdW
|
19
|
-
bmJXRnBiREVUTUJFR0NnbVMKSm9tVDhpeGtBUmtXQTJOdmJUQ0NBU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-
R0ZYSExOYmJGYnFyCk03Tkd4N0p4eVBVbFdTQ0VDYUVIeDF3UkFzc3Y2aU9p
|
36
|
-
TzlpZWozU1pGS2VrQWZDVDNWUG1Kb2s1OXR2dGtHL1MKWGRsYkZGekQwclMw
|
37
|
-
MEdaZEEyaHBzSmJ2ck1IcmNlclJsSTNXRnR1dk9RT2VGN01ndDNmMnNJQjVl
|
38
|
-
RkZQR2huZgp6MjJXUXliTStmbGpBek1FcE1qYkdUaFdtdy9nS3FIV09NT1Ey
|
39
|
-
WjlTOWpjR2pFZUVzK3EzTFJhdlJDelJCQnptCnVZSWIwbWtUcGg0M3lxOVp4
|
40
|
-
T3h3VDNmYld0RkorUDAwNEl2ZnFwUmpqelgvRXFTRTVBUi94RjFwYTUyRjd3
|
41
|
-
PT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
|
42
|
-
date: 2013-02-05 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-06-17 00:00:00.000000000 Z
|
43
12
|
dependencies:
|
44
13
|
- !ruby/object:Gem::Dependency
|
45
14
|
name: minitest
|
46
15
|
requirement: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
16
|
requirements:
|
49
|
-
- -
|
17
|
+
- - '>='
|
50
18
|
- !ruby/object:Gem::Version
|
51
19
|
version: '0'
|
52
20
|
type: :development
|
53
21
|
prerelease: false
|
54
22
|
version_requirements: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
23
|
requirements:
|
57
|
-
- -
|
24
|
+
- - '>='
|
58
25
|
- !ruby/object:Gem::Version
|
59
26
|
version: '0'
|
60
|
-
|
61
|
-
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A wrapper around Ruby's PStore that allows you to persist Ruby objects
|
42
|
+
to a transactional file store.
|
62
43
|
email:
|
63
44
|
- shannonskipper@gmail.com
|
64
45
|
executables: []
|
@@ -66,42 +47,41 @@ extensions: []
|
|
66
47
|
extra_rdoc_files: []
|
67
48
|
files:
|
68
49
|
- .gitignore
|
50
|
+
- .travis.yml
|
69
51
|
- Gemfile
|
70
52
|
- LICENSE
|
71
53
|
- README.md
|
54
|
+
- Rakefile
|
72
55
|
- lib/persist.rb
|
73
56
|
- lib/persist/persist.rb
|
74
57
|
- lib/persist/version.rb
|
75
58
|
- persist.gemspec
|
76
59
|
- test/helper.rb
|
77
|
-
- test/
|
60
|
+
- test/persist_test.rb
|
78
61
|
homepage: https://github.com/Havenwood/persist
|
79
62
|
licenses: []
|
63
|
+
metadata: {}
|
80
64
|
post_install_message:
|
81
65
|
rdoc_options: []
|
82
66
|
require_paths:
|
83
67
|
- lib
|
84
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
69
|
requirements:
|
87
|
-
- -
|
70
|
+
- - '>='
|
88
71
|
- !ruby/object:Gem::Version
|
89
72
|
version: '0'
|
90
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
74
|
requirements:
|
93
|
-
- -
|
75
|
+
- - '>='
|
94
76
|
- !ruby/object:Gem::Version
|
95
77
|
version: '0'
|
96
78
|
requirements: []
|
97
79
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
80
|
+
rubygems_version: 2.0.3
|
99
81
|
signing_key:
|
100
|
-
specification_version:
|
101
|
-
summary: Persist
|
102
|
-
facilitate simple file-persistant storage of Ruby objects in a transactional NoSQL
|
103
|
-
database.
|
82
|
+
specification_version: 4
|
83
|
+
summary: Persist Ruby objects to a transactional file store using Ruby's Pstore.
|
104
84
|
test_files:
|
105
85
|
- test/helper.rb
|
106
|
-
- test/
|
86
|
+
- test/persist_test.rb
|
107
87
|
has_rdoc:
|
data.tar.gz.sig
DELETED
metadata.gz.sig
DELETED
Binary file
|