hypostasis-object 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +21 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +57 -0
- data/Rakefile +9 -0
- data/hypostasis-object.gemspec +27 -0
- data/lib/hypostasis/base.rb +5 -0
- data/lib/hypostasis/object.rb +8 -0
- data/lib/hypostasis/object/version.rb +5 -0
- data/test/hypostasis/base_spec.rb +5 -0
- data/test/hypostasis/object_spec.rb +5 -0
- data/test/minitest_helper.rb +10 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e0f315fc156ce1c4345f81c676e5646693272de8
|
4
|
+
data.tar.gz: 7d6210d4dd6e6c390071bb8a40ded8c288567c7d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b98ee4e8bb89175b3ddbfe4c31019dd8693eeaa510244df8a480e010c97f31cbde9dabcae9afec77df0cd53c7a1732e90cf4dd3c933c9da24f8e7a50e6aa07a1
|
7
|
+
data.tar.gz: 7b4b52205ca916eda865a574aa1c8b55d1acdc8729cca5226a6c0b683f6cfa584403d1f744b7dfd0a81b849dec76af43c985b44f5c673e49c7e739b5a2293ebf
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
- 2.1.0
|
6
|
+
- 2.1.1
|
7
|
+
branches:
|
8
|
+
only:
|
9
|
+
- master
|
10
|
+
- /^feature\/.*/
|
11
|
+
- /-stable$/
|
12
|
+
env:
|
13
|
+
- FDBVERSION=2.0.4
|
14
|
+
before_install:
|
15
|
+
- wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/$FDBVERSION/foundationdb-clients_$FDBVERSION-1_amd64.deb
|
16
|
+
- wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/$FDBVERSION/foundationdb-server_$FDBVERSION-1_amd64.deb
|
17
|
+
- sudo dpkg -i foundationdb-clients_$FDBVERSION-1_amd64.deb
|
18
|
+
- sudo dpkg -i foundationdb-server_$FDBVERSION-1_amd64.deb
|
19
|
+
addons:
|
20
|
+
code_climate:
|
21
|
+
repo_token: 730542b4bc8da7456aa1cb8d5d47ebf8620b074e0256927c0ddc8e95bac14e94
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 James Thompson
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Hypostasis::Object
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/hypostasis/object.svg)](https://travis-ci.org/hypostasis/object)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/hypostasis/object.png)](https://codeclimate.com/github/hypostasis/object)
|
5
|
+
[![Code Coverage](https://codeclimate.com/github/hypostasis/object/coverage.png)](https://codeclimate.com/github/hypostasis/object/code)
|
6
|
+
|
7
|
+
Hypostasis::Object is an OODB-style layer for FoundationDB and is part of the
|
8
|
+
broader Hypostasis project. The Hypostasis project aims to provide a collection
|
9
|
+
of data models for Ruby, built on top of FoundationDB.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'hypostasis-object'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install hypostasis-object
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
require 'hypostasis/object'
|
28
|
+
|
29
|
+
class Employee
|
30
|
+
include Hypostasis::Object
|
31
|
+
|
32
|
+
attr_accessor :name, :title, :salary
|
33
|
+
end
|
34
|
+
|
35
|
+
john = Employee.new
|
36
|
+
john.name = 'John Doe'
|
37
|
+
john.title = 'Patent Clerk'
|
38
|
+
john.salary = 42000
|
39
|
+
|
40
|
+
john.persist
|
41
|
+
|
42
|
+
The above example is a simple demonstration of working with Hypostasis::Object.
|
43
|
+
Hypostasis::Object adds two public methods for handling persistence: `persist`
|
44
|
+
and `persist!`. The latter raises an error when certain kinds of things go
|
45
|
+
wrong. Behind the scenes Hypostasis::Object gathers the state of the object and
|
46
|
+
atomically commits it to FoundationDB. In the process, it will also generate a
|
47
|
+
unique id for the object, accessible via the `id` attribute. This is the most
|
48
|
+
basic example of working with Hypostasis::Object. Please refer to the Wiki for
|
49
|
+
more detailed examples and other feature details.
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
1. Fork it ( http://github.com/<my-github-username>/hypostasis-object/fork )
|
54
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
55
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
56
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
57
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hypostasis/object/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'hypostasis-object'
|
8
|
+
spec.version = Hypostasis::Object::VERSION
|
9
|
+
spec.authors = ['James Thompson']
|
10
|
+
spec.email = %w{james@plainprograms.com}
|
11
|
+
spec.summary = %q{Hypostasis::Object is an OODB layer for FoundationDB}
|
12
|
+
spec.description = %q{}
|
13
|
+
spec.homepage = 'https://github.com/hypostasis/object'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = %w{lib}
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'minitest'
|
24
|
+
|
25
|
+
spec.add_dependency 'fdb', '~> 2.0.0'
|
26
|
+
spec.add_dependency 'msgpack', '~> 0.5.8'
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hypostasis-object
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Thompson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: fdb
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.0.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.0.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: msgpack
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.5.8
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.5.8
|
83
|
+
description: ''
|
84
|
+
email:
|
85
|
+
- james@plainprograms.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
|
+
- Gemfile
|
93
|
+
- LICENSE.txt
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- hypostasis-object.gemspec
|
97
|
+
- lib/hypostasis/base.rb
|
98
|
+
- lib/hypostasis/object.rb
|
99
|
+
- lib/hypostasis/object/version.rb
|
100
|
+
- test/hypostasis/base_spec.rb
|
101
|
+
- test/hypostasis/object_spec.rb
|
102
|
+
- test/minitest_helper.rb
|
103
|
+
homepage: https://github.com/hypostasis/object
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata: {}
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 2.2.2
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Hypostasis::Object is an OODB layer for FoundationDB
|
127
|
+
test_files:
|
128
|
+
- test/hypostasis/base_spec.rb
|
129
|
+
- test/hypostasis/object_spec.rb
|
130
|
+
- test/minitest_helper.rb
|