json_schemer 0.2.17 → 0.2.18
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
- data/.github/workflows/ci.yml +16 -6
- data/Gemfile.lock +4 -4
- data/lib/json_schemer.rb +6 -2
- data/lib/json_schemer/format.rb +0 -1
- data/lib/json_schemer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 426a95173deee91594b5ad1df05dac15ea3c90bac6e17b3136a7170744555c50
|
4
|
+
data.tar.gz: 25268e7f5cb108245aad3d112624eee96774fe8820eda5e24a4f91d97d91e676
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5534a623dfece170bd27bbb2cbc34978e9e81c075ddad60213d8ce4538d50a6ee119b7efcb2b750068cee0cf565ee582a35eac990c14c2ca647d9d8cc314d4f5
|
7
|
+
data.tar.gz: b813c1b1acd0b1cf0680bf0ecae7eef33b6eb576ff5735d76f072e82fc5cfb36e80ec5b0a3fde6829ec3de856e903b42164a917b833019c33a11d79d6db6080b
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,16 +1,26 @@
|
|
1
1
|
name: ci
|
2
2
|
on: [push, pull_request]
|
3
3
|
jobs:
|
4
|
-
|
4
|
+
test:
|
5
5
|
strategy:
|
6
|
+
fail-fast: false
|
6
7
|
matrix:
|
7
|
-
|
8
|
-
|
8
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
9
|
+
ruby: [2.4, 2.5, 2.6, 2.7, 3.0, head, jruby, jruby-head, truffleruby, truffleruby-head]
|
10
|
+
exclude:
|
11
|
+
- os: windows-latest
|
12
|
+
ruby: jruby
|
13
|
+
- os: windows-latest
|
14
|
+
ruby: jruby-head
|
15
|
+
- os: windows-latest
|
16
|
+
ruby: truffleruby
|
17
|
+
- os: windows-latest
|
18
|
+
ruby: truffleruby-head
|
19
|
+
runs-on: ${{ matrix.os }}
|
9
20
|
steps:
|
10
21
|
- uses: actions/checkout@v2
|
11
22
|
- uses: ruby/setup-ruby@v1
|
12
23
|
with:
|
13
24
|
ruby-version: ${{ matrix.ruby }}
|
14
|
-
|
15
|
-
|
16
|
-
bundle exec rake test
|
25
|
+
bundler-cache: true
|
26
|
+
- run: bundle exec rake test
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
json_schemer (0.2.
|
4
|
+
json_schemer (0.2.18)
|
5
5
|
ecma-re-validator (~> 0.3)
|
6
6
|
hana (~> 1.3)
|
7
7
|
regexp_parser (~> 2.0)
|
@@ -13,9 +13,9 @@ GEM
|
|
13
13
|
ecma-re-validator (0.3.0)
|
14
14
|
regexp_parser (~> 2.0)
|
15
15
|
hana (1.3.7)
|
16
|
-
minitest (5.14.
|
16
|
+
minitest (5.14.3)
|
17
17
|
rake (13.0.1)
|
18
|
-
regexp_parser (2.
|
18
|
+
regexp_parser (2.1.1)
|
19
19
|
uri_template (0.7.0)
|
20
20
|
|
21
21
|
PLATFORMS
|
@@ -28,4 +28,4 @@ DEPENDENCIES
|
|
28
28
|
rake (~> 13.0)
|
29
29
|
|
30
30
|
BUNDLED WITH
|
31
|
-
2.
|
31
|
+
2.2.11
|
data/lib/json_schemer.rb
CHANGED
@@ -37,10 +37,14 @@ module JSONSchemer
|
|
37
37
|
|
38
38
|
DEFAULT_META_SCHEMA = 'http://json-schema.org/draft-07/schema#'
|
39
39
|
|
40
|
+
WINDOWS_URI_PATH_REGEX = /\A\/[a-z]:/i
|
41
|
+
|
40
42
|
FILE_URI_REF_RESOLVER = proc do |uri|
|
41
43
|
raise InvalidFileURI, 'must use `file` scheme' unless uri.scheme == 'file'
|
42
44
|
raise InvalidFileURI, 'cannot have a host (use `file:///`)' if uri.host && !uri.host.empty?
|
43
|
-
|
45
|
+
path = uri.path
|
46
|
+
path = path[1..-1] if path.match?(WINDOWS_URI_PATH_REGEX)
|
47
|
+
JSON.parse(File.read(path))
|
44
48
|
end
|
45
49
|
|
46
50
|
class << self
|
@@ -49,7 +53,7 @@ module JSONSchemer
|
|
49
53
|
when String
|
50
54
|
schema = JSON.parse(schema)
|
51
55
|
when Pathname
|
52
|
-
uri = URI.parse(
|
56
|
+
uri = URI.parse(File.join('file:', schema.realpath))
|
53
57
|
if options.key?(:ref_resolver)
|
54
58
|
schema = FILE_URI_REF_RESOLVER.call(uri)
|
55
59
|
else
|
data/lib/json_schemer/format.rb
CHANGED
data/lib/json_schemer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_schemer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Harsha
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
rubygems_version: 3.1.
|
156
|
+
rubygems_version: 3.1.4
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: JSON Schema validator. Supports drafts 4, 6, and 7.
|