hypostasis-object 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -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
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in hypostasis-object.gemspec
4
+ gemspec
5
+
6
+ gem 'codeclimate-test-reporter', group: :test, require: nil
@@ -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.
@@ -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
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.test_files = FileList['test/**/*_spec.rb'] + FileList['test/**/*_test.rb']
7
+ end
8
+
9
+ task :default => :test
@@ -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
@@ -0,0 +1,5 @@
1
+ module Hypostasis
2
+ module Base
3
+
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ require 'hypostasis/object/version'
2
+ require 'hypostasis/base'
3
+
4
+ module Hypostasis
5
+ module Object
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Hypostasis
2
+ module Object
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'minitest_helper'
2
+
3
+ describe Hypostasis::Base do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'minitest_helper'
2
+
3
+ describe Hypostasis::Object do
4
+
5
+ end
@@ -0,0 +1,10 @@
1
+ if ENV['CI']
2
+ require 'codeclimate-test-reporter'
3
+ CodeClimate::TestReporter.start
4
+ end
5
+
6
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
7
+ require 'hypostasis/object'
8
+
9
+ require 'minitest/autorun'
10
+ require 'minitest/spec'
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