Skip to content

Commit e688e8b

Browse files
committed
Merged 'develop'.
2 parents a9f39d4 + db345f2 commit e688e8b

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

lib/json/ld.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,10 @@ class LoadingDocumentFailed < JsonLdError; @code = "loading document failed"; en
131131
class LoadingRemoteContextFailed < JsonLdError; @code = "loading remote context failed"; end
132132
class MultipleContextLinkHeaders < JsonLdError; @code = "multiple context link headers"; end
133133
class RecursiveContextInclusion < JsonLdError; @code = "recursive context inclusion"; end
134-
end
135-
136-
class InvalidFrame < Exception
137-
class MultipleEmbeds < InvalidFrame; end
138-
class Syntax < InvalidFrame; end
134+
class InvalidFrame < JsonLdError
135+
class MultipleEmbeds < InvalidFrame; end
136+
class Syntax < InvalidFrame; end
137+
end
139138
end
140139
end
141140
end

lib/json/ld/api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def self.flatten(input, context, options = {})
309309
def self.frame(input, frame, options = {})
310310
result = nil
311311
options = {
312-
base: input.is_a?(String) ? input : '',
312+
base: (input if input.is_a?(String)),
313313
compactArrays: true,
314314
embed: '@last',
315315
explicit: false,

lib/json/ld/context.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ def parse(local_context, remote_contexts = [])
396396
end
397397
rescue JsonLdError::LoadingDocumentFailed => e
398398
#log_debug("parse") {"Failed to retrieve @context from remote document at #{context_no_base.context_base.inspect}: #{e.message}"}
399-
raise JsonLdError::LoadingRemoteContextFailed, "#{context_no_base.context_base}", e.backtrace
399+
raise JsonLdError::LoadingRemoteContextFailed, "#{context_no_base.context_base}: #{e.message}", e.backtrace
400400
rescue JsonLdError
401401
raise
402-
rescue Exception => e
402+
rescue StandardError => e
403403
#log_debug("parse") {"Failed to retrieve @context from remote document at #{context_no_base.context_base.inspect}: #{e.message}"}
404-
raise JsonLdError::LoadingRemoteContextFailed, "#{context_no_base.context_base}", e.backtrace
404+
raise JsonLdError::LoadingRemoteContextFailed, "#{context_no_base.context_base}: #{e.message}", e.backtrace
405405
end
406406

407407
# 3.2.6) Set context to the result of recursively calling this algorithm, passing context no base for active context, context for local context, and remote contexts.

lib/json/ld/from_rdf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def from_statements(input, useRdfType: false, useNativeTypes: false)
7878
# If property equals rdf:rest, the value associated to the usages member of node has exactly 1 entry, node has a rdf:first and rdf:rest property, both of which have as value an array consisting of a single element, and node has no other members apart from an optional @type member whose value is an array with a single item equal to rdf:List, node represents a well-formed list node. Continue with the following steps:
7979
#log_debug("list element?") {node.to_json(JSON_STATE) rescue 'malformed json'}
8080
while property == RDF.rest.to_s &&
81-
node_usages_map[node['@id']].uniq.length == 1 &&
81+
Array(node_usages_map[node['@id']]).uniq.length == 1 &&
8282
blank_node?(node) &&
8383
node.keys.none? {|k| !["@id", '@type', :usages, RDF.first.to_s, RDF.rest.to_s].include?(k)} &&
8484
Array(node[:usages]).length == 1 &&

script/tc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def run_tc(man, tc, options)
9494
rescue Interrupt
9595
$stderr.puts "(interrupt)"
9696
exit 1
97-
rescue Exception => e
97+
rescue StandardError => e
9898
result = if tc.positiveTest?
9999
STDERR.puts "#{"exception:" unless options[:quiet]}: #{e}"
100100
if options[:quiet]

0 commit comments

Comments
 (0)