Skip to content

Commit

Permalink
Update some calling sequences.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 12, 2019
1 parent 91e7213 commit 9736d1a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lib/rdf/trig/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def blankNodePropertyList?(resource, position)
end

def resource_in_single_graph?(resource)
graph_names = @repo.query(subject: resource).map(&:graph_name)
graph_names += @repo.query(object: resource).map(&:graph_name)
graph_names = @repo.query({subject: resource}).map(&:graph_name)
graph_names += @repo.query({object: resource}).map(&:graph_name)
graph_names.uniq.length <= 1
end

Expand All @@ -207,7 +207,7 @@ def order_graphs
graph_names = @repo.graph_names.to_a.sort

# include default graph, if necessary
graph_names.unshift(nil) unless @repo.query(graph_name: false).to_a.empty?
graph_names.unshift(nil) unless @repo.query({graph_name: false}).to_a.empty?

graph_names
end
Expand Down
6 changes: 3 additions & 3 deletions script/parse
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def run(input, **options)
end
end
elsif options[:output_format] == :inspect
reader_class.new(input, options[:parser_options]).each do |statement|
reader_class.new(input, **options[:parser_options]).each do |statement|
num += 1
options[:output].puts statement.inspect
end
else
r = reader_class.new(input, options[:parser_options])
r = reader_class.new(input, **options[:parser_options])
g = RDF::Repository.new << r
num = g.count
options[:output].puts g.dump(options[:output_format], {:prefixes => r.prefixes}.merge(options[:writer_options]))
options[:output].puts g.dump(options[:output_format], prefixes: r.prefixes, **options[:writer_options])
end
if options[:profile]
Profiler__::stop_profile
Expand Down
10 changes: 5 additions & 5 deletions script/tc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require 'getoptlong'
ASSERTOR = "http://greggkellogg.net/foaf#me"
RUN_TIME = Time.now

def earl_preamble(options)
def earl_preamble(**options)
options[:output].write File.read(File.expand_path("../../etc/doap#{'-nquads' if options[:nquads]}.ttl", __FILE__))
options[:output].puts %(
<> foaf:primaryTopic <http://rubygems.org/gems/rdf#{'-trig' unless options[:nquads]}> ;
Expand Down Expand Up @@ -142,7 +142,7 @@ opts = GetoptLong.new(
["--verbose", "-v", GetoptLong::NO_ARGUMENT]
)

def help(options)
def help(**options)
puts "Usage: #{$0} [options] [test-number ...]"
puts "Options:"
puts " --debug: Display detailed debug output"
Expand All @@ -159,7 +159,7 @@ end

opts.each do |opt, arg|
case opt
when '--help' then help(options)
when '--help' then help(**options)
when '--dbg' then logger.level = Logger::DEBUG
when '--earl'
options[:quiet] = options[:earl] = true
Expand All @@ -177,15 +177,15 @@ end

manifests = (options[:nquads] ? [Fixtures::SuiteTest::NQBASE] : [Fixtures::SuiteTest::BASE]).map {|b| b + "manifest.ttl"}

earl_preamble(options) if options[:earl]
earl_preamble(**options) if options[:earl]

result_count = {}

manifests.each do |manifest|
Fixtures::SuiteTest::Manifest.open(manifest) do |m|
m.entries.each do |tc|
next unless ARGV.empty? || ARGV.any? {|n| tc.name.match(/#{n}/)}
run_tc(tc, options.merge(result_count: result_count))
run_tc(tc, result_count: result_count, **options)
end
end
end
Expand Down

0 comments on commit 9736d1a

Please sign in to comment.