lurker 0.6.5 → 0.6.6
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/lurker/engine.rb +1 -0
- data/lib/lurker/json/schema/tuple.rb +2 -1
- data/lib/lurker/version.rb +1 -1
- data/lurker.gemspec +1 -1
- data/spec/lurker/json/tuple_spec.rb +108 -0
- metadata +9 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30ebc30725edae00ce62d00c7d882e742407068
|
4
|
+
data.tar.gz: 0a56c57f2fc7fc7e8c3ed64cd23fb2da7346c544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df1fff6dfc3b43dba4776b04b539d6c483c8880d3f3807ac3868a62a74f2406cc1843791eb5d67e94d0c038a2be2d49c7eab7c0c5904fe73c62b1fba6e5b3dd
|
7
|
+
data.tar.gz: 72cda4e77eb4ca281fd9328e51101cbf40fcdefc8974d6ae8a0875bc2926f4134a7b1fb7a0bad9f9a7b3f377c0e982725eac5e336cb5fad1ddbc56ad2d628acb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/lurker/engine.rb
CHANGED
data/lib/lurker/version.rb
CHANGED
data/lurker.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency("json-schema", "~> 2.2")
|
25
25
|
spec.add_dependency("thor", "~> 0.19")
|
26
26
|
spec.add_dependency("sinatra", "~> 1.4")
|
27
|
-
spec.add_dependency("hashie", "
|
27
|
+
spec.add_dependency("hashie", ">= 3.0")
|
28
28
|
spec.add_dependency("activesupport", ">= 3.2", "< 4.2")
|
29
29
|
|
30
30
|
# testing
|
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Lurker::Json::Tuple do
|
4
|
+
let(:klass) { Lurker::Json::Tuple::AnyOf }
|
5
|
+
|
6
|
+
describe '#parse_schema' do
|
7
|
+
context 'when schema is empty hash' do
|
8
|
+
let(:tuple) { klass.new({}) }
|
9
|
+
let(:expected) do
|
10
|
+
{
|
11
|
+
'anyOf' => [],
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
it { expect(tuple.to_hash).to eq expected }
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'when schema is array' do
|
19
|
+
let(:tuple) do
|
20
|
+
klass.new(['razum2um', 42])
|
21
|
+
end
|
22
|
+
|
23
|
+
let(:expected) do
|
24
|
+
{
|
25
|
+
'anyOf' => [
|
26
|
+
{
|
27
|
+
'type' => 'string',
|
28
|
+
'description' => '',
|
29
|
+
'example' => 'razum2um'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
'type' => 'integer',
|
33
|
+
'description' => '',
|
34
|
+
'example' => 42
|
35
|
+
}
|
36
|
+
],
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
it { expect(tuple.to_hash).to eq expected }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '#merge!' do
|
45
|
+
context 'when merge with empty tuple' do
|
46
|
+
let(:tuple) { klass.new({}) }
|
47
|
+
let(:expected) do
|
48
|
+
{
|
49
|
+
'anyOf' => [
|
50
|
+
{
|
51
|
+
'type' => 'string',
|
52
|
+
'description' => '',
|
53
|
+
'example' => 'razum2um'
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
before { tuple.merge!('razum2um') }
|
60
|
+
|
61
|
+
it { expect(tuple.to_hash).to eq expected }
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'when merge new scheme in filled tuple' do
|
65
|
+
let(:tuple) { klass.new(['razum2um']) }
|
66
|
+
let(:expected) do
|
67
|
+
{
|
68
|
+
'anyOf' => [
|
69
|
+
{
|
70
|
+
'type' => 'string',
|
71
|
+
'description' => '',
|
72
|
+
'example' => 'razum2um'
|
73
|
+
},
|
74
|
+
{
|
75
|
+
'type' => 'integer',
|
76
|
+
'description' => '',
|
77
|
+
'example' => 42
|
78
|
+
}
|
79
|
+
]
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
before { tuple.merge!(42) }
|
84
|
+
|
85
|
+
it { expect(tuple.to_hash).to eq expected }
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when merge existing scheme in filled tuple' do
|
89
|
+
let(:tuple) { klass.new(['razum2um']) }
|
90
|
+
let(:expected) do
|
91
|
+
{
|
92
|
+
'anyOf' => [
|
93
|
+
{
|
94
|
+
'type' => 'string',
|
95
|
+
'description' => '',
|
96
|
+
'example' => 'razum2um'
|
97
|
+
}
|
98
|
+
]
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
before { tuple.merge!('oni.strech') }
|
103
|
+
|
104
|
+
it { expect(tuple.to_hash).to eq expected }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lurker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Bokov
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
vzKbYclpJ7gENr/xiTjGqA/Md3zJMzmsFrzUXt4RVmo5SaCyZjC6gFfhSr+PODc7
|
31
31
|
ZaSbckvH/+m4boAsg0JkGGFcS3j5fgNmdwgA1A==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-
|
33
|
+
date: 2014-11-06 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: json
|
@@ -92,16 +92,16 @@ dependencies:
|
|
92
92
|
name: hashie
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - "
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '3.0'
|
98
98
|
type: :runtime
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
104
|
+
version: '3.0'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: activesupport
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -579,6 +579,7 @@ files:
|
|
579
579
|
- spec/lurker/json/list_spec.rb
|
580
580
|
- spec/lurker/json/object_spec.rb
|
581
581
|
- spec/lurker/json/schema_spec.rb
|
582
|
+
- spec/lurker/json/tuple_spec.rb
|
582
583
|
- spec/lurker/yaml_spec.rb
|
583
584
|
- spec/spec_helper.rb
|
584
585
|
- spec/support/matchers/json_attribute.rb
|
@@ -637,7 +638,9 @@ test_files:
|
|
637
638
|
- spec/lurker/json/list_spec.rb
|
638
639
|
- spec/lurker/json/object_spec.rb
|
639
640
|
- spec/lurker/json/schema_spec.rb
|
641
|
+
- spec/lurker/json/tuple_spec.rb
|
640
642
|
- spec/lurker/yaml_spec.rb
|
641
643
|
- spec/spec_helper.rb
|
642
644
|
- spec/support/matchers/json_attribute.rb
|
643
645
|
- spec/support/matchers/json_object.rb
|
646
|
+
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|