hypostasis-repository 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +34 -0
- data/Gemfile +3 -0
- data/ext/mkrf_conf.rb +23 -0
- data/hypostasis-repository.gemspec +2 -2
- data/lib/hypostasis/repository.rb +4 -2
- data/lib/hypostasis/repository/version.rb +1 -1
- data/spec/hypostasis/simple_repository_spec.rb +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf39be3829346b7de29e2a3a46a0e714e8cbd98
|
4
|
+
data.tar.gz: 780805f2447594aeb21bbbd2495b112594f4c1ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b08a6b00ff5bb2e08edc1446d2868d481ba69e567d736dc380dfc9345b6349be92f2e5b1f2ba33647e6b0de4361b62b33d0824802b12b7f479ec3a557637142c
|
7
|
+
data.tar.gz: ae339d7118e2ab5ecad627c9a5e87661ec7ab0fd8a41c9740712acb6a35fe42de91d6ee26ce1fee0e814d1ec4b59ed3244c8536c497edb501355a891bf8f50cb
|
data/.travis.yml
CHANGED
@@ -4,11 +4,45 @@ rvm:
|
|
4
4
|
- 2.0.0
|
5
5
|
- 2.1.0
|
6
6
|
- 2.1.1
|
7
|
+
- jruby
|
8
|
+
jdk:
|
9
|
+
- openjdk6
|
10
|
+
- openjdk7
|
11
|
+
- oraclejdk7
|
12
|
+
- oraclejdk8
|
7
13
|
branches:
|
8
14
|
only:
|
9
15
|
- master
|
10
16
|
- /^feature\/.*/
|
11
17
|
- /-stable$/
|
18
|
+
matrix:
|
19
|
+
exclude:
|
20
|
+
- rvm: 1.9.3
|
21
|
+
jdk: openjdk6
|
22
|
+
- rvm: 1.9.3
|
23
|
+
jdk: oraclejdk7
|
24
|
+
- rvm: 1.9.3
|
25
|
+
jdk: oraclejdk8
|
26
|
+
- rvm: 2.0.0
|
27
|
+
jdk: openjdk6
|
28
|
+
- rvm: 2.0.0
|
29
|
+
jdk: oraclejdk7
|
30
|
+
- rvm: 2.0.0
|
31
|
+
jdk: oraclejdk8
|
32
|
+
- rvm: 2.1.0
|
33
|
+
jdk: openjdk6
|
34
|
+
- rvm: 2.1.0
|
35
|
+
jdk: oraclejdk7
|
36
|
+
- rvm: 2.1.0
|
37
|
+
jdk: oraclejdk8
|
38
|
+
- rvm: 2.1.1
|
39
|
+
jdk: openjdk6
|
40
|
+
- rvm: 2.1.1
|
41
|
+
jdk: oraclejdk7
|
42
|
+
- rvm: 2.1.1
|
43
|
+
jdk: oraclejdk8
|
44
|
+
allow_failures:
|
45
|
+
- rvm: jruby
|
12
46
|
before_install:
|
13
47
|
- wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/2.0.5/foundationdb-clients_2.0.5-1_amd64.deb
|
14
48
|
- wget https://foundationdb.com/downloads/I_accept_the_FoundationDB_Community_License_Agreement/2.0.5/foundationdb-server_2.0.5-1_amd64.deb
|
data/Gemfile
CHANGED
@@ -3,5 +3,8 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in hypostasis-repository.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
gem "msgpack-jruby", "~> 1.4.0", platform: :jruby, require: nil
|
7
|
+
gem "msgpack", "~> 0.5.8", platform: :mri, require: nil
|
8
|
+
|
6
9
|
gem 'codeclimate-test-reporter', group: :test, require: nil
|
7
10
|
gem 'simplecov', '~> 0.7.1', group: :test, require: nil
|
data/ext/mkrf_conf.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubygems/command.rb'
|
3
|
+
require 'rubygems/dependency_installer.rb'
|
4
|
+
|
5
|
+
begin
|
6
|
+
Gem::Command.build_args = ARGV
|
7
|
+
rescue NoMethodError
|
8
|
+
end
|
9
|
+
|
10
|
+
inst = Gem::DependencyInstaller.new
|
11
|
+
begin
|
12
|
+
if RUBY_PLATFORM =~ /java/
|
13
|
+
inst.install "msgpack-jruby", "~> 1.4.0"
|
14
|
+
else
|
15
|
+
inst.install "msgpack", "~> 0.5.8"
|
16
|
+
end
|
17
|
+
rescue
|
18
|
+
exit(1)
|
19
|
+
end
|
20
|
+
|
21
|
+
#f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
|
22
|
+
#f.write("task :default\n")
|
23
|
+
#f.close
|
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rspec"
|
24
24
|
|
25
|
-
spec.
|
26
|
-
spec.
|
25
|
+
spec.add_runtime_dependency "fdb", "~> 2.0.0"
|
26
|
+
spec.add_runtime_dependency "activesupport", "~> 4.0"
|
27
27
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "active_support/concern"
|
2
2
|
require "fdb"
|
3
3
|
require "securerandom"
|
4
|
+
require "msgpack"
|
4
5
|
|
5
6
|
require "hypostasis/repository/version"
|
6
7
|
|
@@ -26,7 +27,8 @@ module Hypostasis
|
|
26
27
|
tr.clear_range_start_with(object_space)
|
27
28
|
object.instance_variables.each do |ivar|
|
28
29
|
next if ivar == :@hypostasis_repository_id
|
29
|
-
|
30
|
+
value = object.instance_variable_get(ivar).to_msgpack
|
31
|
+
tr.set(object_space[ivar.to_s], value)
|
30
32
|
end
|
31
33
|
end
|
32
34
|
object
|
@@ -71,7 +73,7 @@ module Hypostasis
|
|
71
73
|
object.instance_variable_set(:@hypostasis_repository_id, object_id)
|
72
74
|
results.each do |key|
|
73
75
|
ivar = object_space.unpack(key.key)[0].to_sym
|
74
|
-
object.instance_variable_set(ivar, key.value)
|
76
|
+
object.instance_variable_set(ivar, MessagePack.unpack(key.value))
|
75
77
|
end
|
76
78
|
|
77
79
|
object
|
@@ -32,9 +32,9 @@ describe SimpleRepository do
|
|
32
32
|
@id = object.instance_variable_get(:@hypostasis_repository_id).encode(Encoding::US_ASCII)
|
33
33
|
end
|
34
34
|
|
35
|
-
it { database.get(directory[object.class.to_s][@id][:@name.to_s]).value.should eq 'John' }
|
36
|
-
it { database.get(directory[object.class.to_s][@id][:@dob.to_s]).value.should eq '1982-05-19' }
|
37
|
-
it { database.get(directory[object.class.to_s][@id][:@notes.to_s]).value.should eq 'An example' }
|
35
|
+
it { database.get(directory[object.class.to_s][@id][:@name.to_s]).value.should eq 'John'.to_msgpack }
|
36
|
+
it { database.get(directory[object.class.to_s][@id][:@dob.to_s]).value.should eq '1982-05-19'.to_msgpack }
|
37
|
+
it { database.get(directory[object.class.to_s][@id][:@notes.to_s]).value.should eq 'An example'.to_msgpack }
|
38
38
|
it { database.get(directory[object.class.to_s][@id][:@hypostasis_repository_id.to_s]).should be_nil }
|
39
39
|
it { result.should eq object }
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hypostasis-repository
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- README.md
|
96
96
|
- Rakefile
|
97
97
|
- Vagrantfile
|
98
|
+
- ext/mkrf_conf.rb
|
98
99
|
- hypostasis-repository.gemspec
|
99
100
|
- lib/hypostasis/repository.rb
|
100
101
|
- lib/hypostasis/repository/version.rb
|