json_refs 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_refs.rb +12 -6
- data/lib/json_refs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873527fb07ff698ff5cae1f2954cf403e876c2e6353fb5a395e7eab5517dd08a
|
4
|
+
data.tar.gz: d9d3c3a6b2493f1150c29a1834b72a474089690e0aab0ad4d6e32670dfa55e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ef5cb22467df59eb10e0a0f4bdc5fbdcae6e6260f7d8f59a26b34447b325a8d2bb4bec2c31715c997c99a2e071c6669692fc3f8620c9495915a740cd191a4e
|
7
|
+
data.tar.gz: 719c2b6dd54023a0f788d30ddc3caa0526bff1c3f80bfa6c1f395b399cd11f8d77563283c03c2da42802abf49e8ca50eec602709498ee2fd95b9d3da9c718764
|
data/lib/json_refs.rb
CHANGED
@@ -48,11 +48,17 @@ module JsonRefs
|
|
48
48
|
puts "De-referencing #{referenced_path}"
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
filepath, pointer = referenced_path.split('#')
|
52
|
+
pointer.prepend('#') if pointer
|
53
|
+
return dereference_local(pointer) if filepath.empty?
|
54
|
+
|
55
|
+
dereferenced_file = dereference_file(filepath)
|
56
|
+
return dereferenced_file if pointer.nil?
|
57
|
+
|
58
|
+
JsonRefs::DereferenceHandler::Local.new(
|
59
|
+
doc: dereferenced_file,
|
60
|
+
path: pointer
|
61
|
+
).call
|
56
62
|
end
|
57
63
|
|
58
64
|
def dereference_local(referenced_path)
|
@@ -84,7 +90,7 @@ module JsonRefs
|
|
84
90
|
def recursive_dereference(referenced_path, klass)
|
85
91
|
directory = File.dirname(referenced_path)
|
86
92
|
filename = File.basename(referenced_path)
|
87
|
-
|
93
|
+
|
88
94
|
dereferenced_doc = {}
|
89
95
|
Dir.chdir(directory) do
|
90
96
|
referenced_doc = klass.new(path: filename, doc: @doc).call
|
data/lib/json_refs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_refs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makoto Tajitsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hana
|