Skip to content

Commit e3c20c8

Browse files
committed
Finish 3.1.9
2 parents e6800d0 + 673a8cf commit e3c20c8

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ group :debug do
2525
gem "redcarpet", platforms: :ruby
2626
gem "byebug", platforms: :mri
2727
gem 'guard-rspec'
28-
gem 'awesome_print', github: 'akshaymohite/awesome_print'
2928
end
3029

3130
group :test do

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.8
1+
3.1.9

lib/rdf/cli.rb

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,26 @@
88
require 'linkeddata'
99
rescue LoadError
1010
# Silently load without linkeddata, but try some others
11-
%w(microdata n3 rdfa rdfxml reasoner tabular trig trix turtle vocab xsd json/ld ld/patch).each do |ser|
11+
%w(
12+
json/ld
13+
ld/patch
14+
rdf/microdata
15+
rdf/n3
16+
rdf/ordered_repo
17+
rdf/rdfa
18+
rdf/rdfxml
19+
rdf/reasoner
20+
rdf/tabular
21+
rdf/trig
22+
rdf/trix
23+
rdf/turtle
24+
rdf/vocab
25+
rdf/xsd
26+
shacl
27+
shex
28+
).each do |ser|
1229
begin
13-
require ser.include?('/') ? ser : "rdf/#{ser}"
30+
require ser
1431
rescue LoadError
1532
end
1633
end
@@ -457,7 +474,7 @@ def self.usage(options, cmd_opts: {}, banner: nil)
457474
# @param [Array<String>] args
458475
# @param [IO] output
459476
# @param [OptionParser] option_parser
460-
# @param [Hash{Symbol => Hash{Symbol => Array[String]}}] messages used for confeying non primary-output which is structured.
477+
# @param [Hash{Symbol => Hash{Symbol => Array[String]}}] messages used for conveying non primary-output which is structured.
461478
# @param [Hash{Symbol => Object}] options
462479
# @return [Boolean]
463480
def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options)
@@ -506,10 +523,12 @@ def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options
506523
options[:output_format] = options[:output_format].to_sym if options[:output_format]
507524

508525
# Allow repository to be set via option.
509-
@repository = options[:repository] ||
510-
(options[:ordered] ?
511-
[].extend(RDF::Enumerable, RDF::Queryable) :
512-
RDF::Repository.new)
526+
# If RDF::OrderedRepo is present, use it if the `ordered` option is specified, otherwise extend an Array.
527+
@repository = options[:repository] || case
528+
when RDF.const_defined?(:OrderedRepo) then RDF::OrderedRepo.new
529+
when options[:ordered] then [].extend(RDF::Enumerable, RDF::Queryable)
530+
else RDF::Repository.new
531+
end
513532

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

0 commit comments

Comments
 (0)