Skip to content

Commit

Permalink
Finish 2.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Aug 27, 2017
2 parents d7add8d + 4bfba4b commit 5484aad
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ follows:
* <http://rubydoc.info/github/ruby-rdf/rdf/frames>
* <http://github.com/ruby-rdf/rdf>
* <http://rubygems.org/gems/rdf>
* <http://rubyforge.org/projects/rdf/>
* <http://raa.ruby-lang.org/project/rdf/>
* <http://www.ohloh.net/p/rdf>

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.8
2.2.9
2 changes: 1 addition & 1 deletion etc/doap.nq
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://ar.to/#self> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://bhuga.net/#ben> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#documenter> <http://greggkellogg.net/foaf#me> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubyforge.org/projects/rdf/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubygems.org/gems/rdf/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid1 .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid2 .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#helper> _:genid3 .
Expand Down
2 changes: 1 addition & 1 deletion etc/doap.nt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/rdf11-concepts/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-quads/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-triples/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubyforge.org/projects/rdf/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubygems.org/gems/rdf/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#bug-database> <http://github.com/ruby-rdf/rdf/issues> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://ar.to/> .
<http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://blog.datagraph.org/> .
Expand Down
2 changes: 1 addition & 1 deletion etc/doap.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
doap:implements <http://www.w3.org/TR/rdf11-concepts/>,
<http://www.w3.org/TR/n-quads/>,
<http://www.w3.org/TR/n-triples/> ;
doap:download-page <http://rubyforge.org/projects/rdf/> ;
doap:download-page <http://rubygems.org/gems/rdf/> ;
doap:bug-database <http://github.com/ruby-rdf/rdf/issues> ;
doap:blog <http://ar.to/>, <http://blog.datagraph.org/> ;
doap:vendor <http://datagraph.org/> ;
Expand Down
23 changes: 18 additions & 5 deletions lib/rdf/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ def initialize(symbol: nil, on: nil, datatype: nil, control: nil,
@symbol, @on, @datatype, @control, @description, @use, @callback = symbol.to_sym, Array(on), datatype, control, description, use, block
end

def call(arg, options)
def call(arg, options = {})
if @callback
case @callback.arity
when 0 then @callback.call
when 1 then @callback.call(arg)
when 2 then @callback.call(arg, options)
else arg
end
else
arg
Expand Down Expand Up @@ -305,7 +307,7 @@ def to_hash
on_args = cli_opt.on || []
on_args << cli_opt.description if cli_opt.description
options.on(*on_args) do |opt_arg|
options.options[cli_opt.symbol] = cli_opt.call(opt_arg)
options.options[cli_opt.symbol] = cli_opt.call(opt_arg, options)
end
end if reader
arg.downcase.to_sym
Expand All @@ -327,7 +329,7 @@ def to_hash
on_args = cli_opt.on || []
on_args << cli_opt.description if cli_opt.description
options.on(*on_args) do |opt_arg|
options.options[cli_opt.symbol] = cli_opt.call(opt_arg)
options.options[cli_opt.symbol] = cli_opt.call(opt_arg, options)
end
end if writer
arg.downcase.to_sym
Expand Down Expand Up @@ -358,7 +360,7 @@ def self.basename() File.basename($0) end
# Returns discovered options
def self.options(argv, format: nil)
options = OptionParser.new
cli_opts = OPTIONS.dup
cli_opts = OPTIONS.map(&:dup)
logger = Logger.new($stderr)
logger.level = Logger::WARN
logger.formatter = lambda {|severity, datetime, progname, msg| "#{severity} #{msg}\n"}
Expand Down Expand Up @@ -428,7 +430,7 @@ def self.options(argv, format: nil)

##
# Output usage message
def self.usage(options, cmd_opts = {}, banner: nil)
def self.usage(options, cmd_opts: {}, banner: nil)
options.banner = banner if banner
$stdout.puts options
$stdout.puts "Note: available commands and options may be different depending on selected --input-format and/or --output-format."
Expand Down Expand Up @@ -505,6 +507,17 @@ def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options
COMMANDS[command.to_sym][:lambda].call(args, output: output, **options.merge(messages: messages))
end

# Normalize messages
messages.each do |kind, term_messages|
case term_messages
when Hash
when Array
messages[kind] = {result: term_messages}
else
messages[kind] = {result: [term_messages]}
end
end

if options[:statistics]
options[:statistics][:reader] = @readers.first unless (@readers || []).empty?
options[:statistics][:count] = @repository.count
Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/model/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module RDF
# @see http://en.wikipedia.org/wiki/Uniform_Resource_Identifier
# @see http://www.ietf.org/rfc/rfc3986.txt
# @see http://www.ietf.org/rfc/rfc3987.txt
# @see http://addressable.rubyforge.org/
# @see http://www.rubydoc.info/gems/addressable
class URI
include RDF::Resource

Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/ntriples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module RDF
#
# An example of an RDF statement in N-Triples format:
#
# <http://rubyforge.org/> <http://purl.org/dc/terms/title> "RubyForge" .
# <http://rubygems.org/gems/rdf> <http://purl.org/dc/terms/title> "rdf" .
#
# Installation
# ------------
Expand Down
4 changes: 2 additions & 2 deletions lib/rdf/util/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module RDF; module Util
#
# While this cache is something of an internal implementation detail of
# RDF.rb, some external libraries do currently make use of it as well,
# including [SPARQL](http://ruby-rdf/sparql/) and
# [Spira](http://spira.rubyforge.org/). Do be sure to include any changes
# including [SPARQL](http://github.com/ruby-rdf/sparql/) and
# [Spira](http://github.com/ruby-rdf/spira). Do be sure to include any changes
# here in the RDF.rb changelog.
#
# @see RDF::URI.intern
Expand Down
1 change: 0 additions & 1 deletion rdf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Gem::Specification.new do |gem|
gem.license = 'Unlicense'
gem.summary = 'A Ruby library for working with Resource Description Framework (RDF) data.'
gem.description = 'RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.'
gem.rubyforge_project = 'rdf'

gem.authors = ['Arto Bendiken', 'Ben Lavender', 'Gregg Kellogg']
gem.email = '[email protected]'
Expand Down

0 comments on commit 5484aad

Please sign in to comment.