rom-json 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -5
- data/lib/rom/json/gateway.rb +1 -1
- data/lib/rom/json/relation.rb +2 -0
- data/lib/rom/json/version.rb +1 -1
- data/rom-json.gemspec +1 -1
- data/spec/integration/adapter_spec.rb +8 -11
- data/spec/spec_helper.rb +5 -2
- metadata +5 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d072ff27a6eb39fc80ee056799c53b985bb80b5f
|
4
|
+
data.tar.gz: f661116ab1ee5513d864cd8c8ea30031c1d4047a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd28836d537422b511a221965492cd5e00f28c870a5042855db0fd47398a412253074b2342a8d4eb55ff6d35c1ce63226fbbf0b8ab18f48ad5eed4607da01ca
|
7
|
+
data.tar.gz: 4eb2e3bd7525cf4bb65c3ef3b88268d8bfa5e5cb55713d6ec9c9ec3292f651297f99ab3661bfa1aab7048e46c646ee14ea15627b8ac49172766f850fd97ac2b3
|
data/.travis.yml
CHANGED
@@ -4,15 +4,17 @@ env:
|
|
4
4
|
- CODECLIMATE_REPO_TOKEN=ef69eb6a9e19987527e5010a02bbf71cd4ddc8a5137ba308f299817f56d06e7f
|
5
5
|
script: "bundle exec rake spec"
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
-
|
11
|
-
-
|
7
|
+
- 2.1.9
|
8
|
+
- 2.2.5
|
9
|
+
- 2.3.1
|
10
|
+
- ruby-2.4.0-preview2
|
11
|
+
- rbx
|
12
|
+
- jruby-9.1.5.0
|
12
13
|
- ruby-head
|
13
14
|
matrix:
|
14
15
|
allow_failures:
|
15
16
|
- rvm: ruby-head
|
17
|
+
- rvm: rbx
|
16
18
|
notifications:
|
17
19
|
webhooks:
|
18
20
|
urls:
|
data/lib/rom/json/gateway.rb
CHANGED
data/lib/rom/json/relation.rb
CHANGED
data/lib/rom/json/version.rb
CHANGED
data/rom-json.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_runtime_dependency
|
21
|
+
spec.add_runtime_dependency "rom", "~> 2.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler'
|
24
24
|
spec.add_development_dependency 'rake'
|
@@ -3,15 +3,13 @@ require 'spec_helper'
|
|
3
3
|
require 'rom/lint/spec'
|
4
4
|
|
5
5
|
describe 'JSON adapter' do
|
6
|
-
subject(:rom) { setup.finalize }
|
7
6
|
|
8
7
|
let(:root) { Pathname(__FILE__).dirname.join('..') }
|
9
|
-
|
10
8
|
let(:path) { "#{root}/fixtures/test_db.json" }
|
11
|
-
let(:setup) { ROM.setup(:json, path) }
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
subject(:rom) do
|
11
|
+
ROM.container(:json, path) do |setup|
|
12
|
+
setup.relation(:users) do
|
15
13
|
def by_name(name)
|
16
14
|
restrict(name: name)
|
17
15
|
end
|
@@ -31,6 +29,7 @@ describe 'JSON adapter' do
|
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
32
|
+
end
|
34
33
|
end
|
35
34
|
|
36
35
|
describe 'env#relation' do
|
@@ -48,12 +47,10 @@ describe 'JSON adapter' do
|
|
48
47
|
|
49
48
|
describe 'multi-file setup' do
|
50
49
|
it 'uses one-file-per-relation' do
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
rom = setup.finalize
|
50
|
+
rom = ROM.container(:json, "#{root}/fixtures/db") do |setup|
|
51
|
+
setup.relation(:users)
|
52
|
+
setup.relation(:tasks)
|
53
|
+
end
|
57
54
|
|
58
55
|
expect(rom.relation(:users)).to match_array([
|
59
56
|
{ name: 'Jane', email: 'jane@doe.org' }
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require 'bundler'
|
4
|
+
Bundler.setup
|
5
|
+
|
6
|
+
require 'rom-json'
|
7
|
+
|
3
8
|
if RUBY_ENGINE == 'rbx'
|
4
9
|
require "codeclimate-test-reporter"
|
5
10
|
CodeClimate::TestReporter.start
|
6
11
|
end
|
7
12
|
|
8
|
-
require 'rom-json'
|
9
|
-
|
10
13
|
begin
|
11
14
|
require 'byebug'
|
12
15
|
rescue LoadError
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rom
|
@@ -17,20 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '0
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.8.0
|
20
|
+
version: '2.0'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
25
|
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: '0
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.0
|
27
|
+
version: '2.0'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: bundler
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
119
|
version: '0'
|
126
120
|
requirements: []
|
127
121
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.6
|
129
123
|
signing_key:
|
130
124
|
specification_version: 4
|
131
125
|
summary: JSON support for Ruby Object Mapper
|