lib/shex/format.rb in shex-0.5.2 vs lib/shex/format.rb in shex-0.6.0
- old
+ new
@@ -23,11 +23,11 @@
{
shex: {
description: "Validate repository given shape",
help: "shex [--shape Resource] [--focus Resource] [--schema-input STRING] [--schema STRING] file",
parse: true,
- lambda: -> (argv, options) do
+ lambda: -> (argv, **options) do
options[:schema_input] ||= case options[:schema]
when IO, StringIO then options[:schema]
else RDF::Util::File.open_file(options[:schema]) {|f| f.read}
end
raise ArgumentError, "Shape matching requires a schema or reference to schema resource" unless options[:schema_input]
@@ -42,10 +42,10 @@
else
focus = options.delete(:focus)
shape = options.delete(:shape)
map = shape ? {focus => shape} : {}
begin
- res = shex.execute(RDF::CLI.repository, map, options.merge(focus: focus))
+ res = shex.execute(RDF::CLI.repository, map, focus: focus, **options)
options[:messages][:shex] = {
result: ["Satisfied shape."],
detail: [SXP::Generator.string(res.to_sxp_bin)]
}
rescue ShEx::NotSatisfied => e