Skip to content

Commit 62d00ea

Browse files
committed
Finish 1.0.4
2 parents 2e52917 + d194620 commit 62d00ea

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
2525
gem.test_files = Dir.glob('spec/**/*.rb') + Dir.glob('spec/test-files/*')
2626
gem.has_rdoc = false
2727

28-
gem.required_ruby_version = '>= 1.9.3'
28+
gem.required_ruby_version = '>= 1.9.2'
2929
gem.requirements = []
3030
gem.add_runtime_dependency 'rdf', '>= 1.0.7'
3131
gem.add_runtime_dependency 'json', '>= 1.7.5'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.0.4

lib/json/ld/context.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def initialize(options = {})
159159
# @param [String] value must be an absolute IRI
160160
def base=(value)
161161
if value
162-
raise InvalidContext::InvalidBaseIRI, "@base must be a string: #{value.inspect}" unless value.is_a?(String)
162+
raise InvalidContext::InvalidBaseIRI, "@base must be a string: #{value.inspect}" unless value.is_a?(String) || value.is_a?(RDF::URI)
163163
@base = RDF::URI(value)
164164
@base.canonicalize!
165165
@base.fragment = nil
@@ -266,8 +266,8 @@ def parse(local_context, remote_contexts = [])
266266
result = context
267267
debug("parse") {"=> provided_context: #{context.inspect}"}
268268
rescue Exception => e
269-
debug("parse") {"Failed to retrieve @context from remote document at #{context.inspect}: #{e.message}"}
270-
raise InvalidContext::InvalidRemoteContext, "#{context}", e.backtrace if @options[:validate]
269+
debug("parse") {"Failed to retrieve @context from remote document at #{context_no_base.context_base.inspect}: #{e.message}"}
270+
raise InvalidContext::InvalidRemoteContext, "#{context_no_base.context_base}", e.backtrace if @options[:validate]
271271
end
272272
when Hash
273273
# If context has a @vocab member: if its value is not a valid absolute IRI or null trigger an INVALID_VOCAB_MAPPING error; otherwise set the active context's vocabulary mapping to its value and remove the @vocab member from context.

0 commit comments

Comments
 (0)