json_refs 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 873527fb07ff698ff5cae1f2954cf403e876c2e6353fb5a395e7eab5517dd08a
4
- data.tar.gz: d9d3c3a6b2493f1150c29a1834b72a474089690e0aab0ad4d6e32670dfa55e74
3
+ metadata.gz: 1189625a84d998e3d9a6f249368c187bf0144393271aec06398830ba0ddc66a1
4
+ data.tar.gz: c079bf4dbf63782819d5d1081396c7f9e8ad9f155e5ef701ca337a6a21f3a176
5
5
  SHA512:
6
- metadata.gz: f1ef5cb22467df59eb10e0a0f4bdc5fbdcae6e6260f7d8f59a26b34447b325a8d2bb4bec2c31715c997c99a2e071c6669692fc3f8620c9495915a740cd191a4e
7
- data.tar.gz: 719c2b6dd54023a0f788d30ddc3caa0526bff1c3f80bfa6c1f395b399cd11f8d77563283c03c2da42802abf49e8ca50eec602709498ee2fd95b9d3da9c718764
6
+ metadata.gz: b18e096f64d639506cc39728e426af5ff276bee765c69331ba9a32d401299439367a851142717ab51214755ef2934eb34793a582e3cda73782fd8f5394eef3ce
7
+ data.tar.gz: afab208bf473c6f575761b0e51a83a99e8abefe625e185f13ebb93caed688e9e882eba9bdec49925a53e646eb22d61f59b6d4d8aec3db219ef2f28e09964c1fa
@@ -1,3 +1,3 @@
1
1
  module JsonRefs
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/json_refs.rb CHANGED
@@ -40,7 +40,14 @@ module JsonRefs
40
40
  target = paths.inject(@doc) do |obj, key|
41
41
  obj[key]
42
42
  end
43
- target[key] = referenced_value(referenced_path)
43
+ value = follow_referenced_value(referenced_path)
44
+ target[key] = value
45
+ end
46
+
47
+ def follow_referenced_value(referenced_path)
48
+ value = referenced_value(referenced_path)
49
+ return referenced_value(value['$ref']) if value.is_a?(Hash) && value.has_key?('$ref')
50
+ value
44
51
  end
45
52
 
46
53
  def referenced_value(referenced_path)
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makoto Tajitsu
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-29 00:00:00.000000000 Z
11
+ date: 2021-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hana
@@ -91,7 +91,7 @@ homepage: https://github.com/tzmfreedom/json_refs
91
91
  licenses:
92
92
  - MIT
93
93
  metadata: {}
94
- post_install_message:
94
+ post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths:
97
97
  - lib
@@ -106,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubygems_version: 3.0.3
110
- signing_key:
109
+ rubygems_version: 3.2.22
110
+ signing_key:
111
111
  specification_version: 4
112
112
  summary: Dereference JSON Pointer
113
113
  test_files: []