Skip to content

Commit

Permalink
Finish 3.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jan 4, 2021
2 parents e6800d0 + 673a8cf commit e3c20c8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ group :debug do
gem "redcarpet", platforms: :ruby
gem "byebug", platforms: :mri
gem 'guard-rspec'
gem 'awesome_print', github: 'akshaymohite/awesome_print'
end

group :test do
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.8
3.1.9
33 changes: 26 additions & 7 deletions lib/rdf/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,26 @@
require 'linkeddata'
rescue LoadError
# Silently load without linkeddata, but try some others
%w(microdata n3 rdfa rdfxml reasoner tabular trig trix turtle vocab xsd json/ld ld/patch).each do |ser|
%w(
json/ld
ld/patch
rdf/microdata
rdf/n3
rdf/ordered_repo
rdf/rdfa
rdf/rdfxml
rdf/reasoner
rdf/tabular
rdf/trig
rdf/trix
rdf/turtle
rdf/vocab
rdf/xsd
shacl
shex
).each do |ser|
begin
require ser.include?('/') ? ser : "rdf/#{ser}"
require ser
rescue LoadError
end
end
Expand Down Expand Up @@ -457,7 +474,7 @@ def self.usage(options, cmd_opts: {}, banner: nil)
# @param [Array<String>] args
# @param [IO] output
# @param [OptionParser] option_parser
# @param [Hash{Symbol => Hash{Symbol => Array[String]}}] messages used for confeying non primary-output which is structured.
# @param [Hash{Symbol => Hash{Symbol => Array[String]}}] messages used for conveying non primary-output which is structured.
# @param [Hash{Symbol => Object}] options
# @return [Boolean]
def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options)
Expand Down Expand Up @@ -506,10 +523,12 @@ def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options
options[:output_format] = options[:output_format].to_sym if options[:output_format]

# Allow repository to be set via option.
@repository = options[:repository] ||
(options[:ordered] ?
[].extend(RDF::Enumerable, RDF::Queryable) :
RDF::Repository.new)
# If RDF::OrderedRepo is present, use it if the `ordered` option is specified, otherwise extend an Array.
@repository = options[:repository] || case
when RDF.const_defined?(:OrderedRepo) then RDF::OrderedRepo.new
when options[:ordered] then [].extend(RDF::Enumerable, RDF::Queryable)
else RDF::Repository.new
end

# Parse input files if any command requires it
if cmds.any? {|c| COMMANDS[c.to_sym][:parse]}
Expand Down

0 comments on commit e3c20c8

Please sign in to comment.