jsi 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12a262c5b9ec6c22d16c8e4f5cb983c92266d165964a120ffcd72f7e0bd877d1
4
- data.tar.gz: 3e4671dda156d3d8073e9f7af42e3335af8f3482719a0495d4f57a2dfaaf12c9
3
+ metadata.gz: 898a2aae157baa1fc01f6e3e28286f4b6fc9be61b7e47689529acdfdbc8c9c17
4
+ data.tar.gz: 9328c06ac1cc07993f27644b3c94b87b1667be06b6404af2ce5753fb7dc3da1a
5
5
  SHA512:
6
- metadata.gz: 7f9c9816756bb70c16498d2ba503c7b0148533b37ae065d8426e654a0644066db6108a6a7d79789bb039f4911432b4273ca85d6a08a47783d0e992af06e248c2
7
- data.tar.gz: c9859fffe7cffbdde822530c828db5344cefa12e2b94eef5d3732d88dca741db5e93414c2800d681fba4555b6694d5bf873cdee08ccbfbce293f3e159ac2749e
6
+ metadata.gz: 874021cfce6aa05353a897d8519cf319ce0de3fc1a2176cefcc7505eddd8960a2525bbb484a0a3fcaa81ac030768a0d64337f1a3f86e6fbb13403ffbdb13eadc
7
+ data.tar.gz: e67feab1a13a2a23ed51ad75d7622ab9f7093b3dbf0cb79d896f1bd56e6f1f0deb322151b8b7529226a111124de01dceeb4f9981759b358ab78d50b337e2cbef
@@ -1,3 +1,7 @@
1
+ # v0.0.4
2
+
3
+ - minor bugfixes / improvements
4
+
1
5
  # v0.0.3
2
6
 
3
7
  - JSI::Base returns an instance of the default value for the schema if applicable
@@ -55,7 +55,7 @@ module JSI
55
55
 
56
56
  # @return [String] a constant name of this class
57
57
  def name
58
- unless super
58
+ unless super || SchemaClasses.const_defined?(schema_classes_const_name)
59
59
  SchemaClasses.const_set(schema_classes_const_name, self)
60
60
  end
61
61
  super
@@ -83,7 +83,7 @@ module JSON
83
83
  # takes a root json document and evaluates this pointer through the document, returning the value
84
84
  # pointed to by this pointer.
85
85
  def evaluate(document)
86
- reference_tokens.inject(document) do |value, token|
86
+ res = reference_tokens.inject(document) do |value, token|
87
87
  if value.respond_to?(:to_ary)
88
88
  if token.is_a?(String) && token =~ /\A\d|[1-9]\d+\z/
89
89
  token = token.to_i
@@ -104,6 +104,7 @@ module JSON
104
104
  raise(ReferenceError, "Invalid resolution for #{to_s}: #{token.inspect} cannot be resolved in #{value.inspect}")
105
105
  end
106
106
  end
107
+ res
107
108
  end
108
109
 
109
110
  # the pointer string representation of this Pointer
@@ -64,7 +64,8 @@ module JSI
64
64
 
65
65
  # the raw content of this Node from the underlying document at this Node's path.
66
66
  def content
67
- pointer.evaluate(document)
67
+ content = pointer.evaluate(document)
68
+ content
68
69
  end
69
70
 
70
71
  # returns content at the given subscript - call this the subcontent.
@@ -1,3 +1,3 @@
1
1
  module JSI
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2019-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-schema
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.7.7
142
+ rubygems_version: 2.7.8
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: 'JSI: JSON-Schema instantiation'