rdf 2.2.8 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a77462d7aa84383474aec0d885fcff326293c41
4
- data.tar.gz: fc3ff787ef744bb281ce34a3a9d415232fd4081a
3
+ metadata.gz: 4c1a5dbdabcabf42a336dcd47777e3bca134a2fa
4
+ data.tar.gz: 0dd66ec264c9dd2b475a12d615fe88bb6ef73a91
5
5
  SHA512:
6
- metadata.gz: 0e257e359a05481b608dad6d3fd783e723485aaa7dd7cee828fdc3e9202b2625541fb3bc324dc4fe6703ec487c62667bbbef1f2febcddb357bee3b3abf74eea2
7
- data.tar.gz: fe307ff319e3c78a1aec5d014b6a57dce05b4cdac64c88dad09fdab9d7d6f238f31ff64e5cf33a1ac8110530de3477755e5e5b860683517adf11cd0a819ed626
6
+ metadata.gz: 56a8bcbe0ce7eb75dfb7854efe9dfabdb17ad2f05895ac0c3f5d6084a004a97fd51b1b5a58084823e18f844f41676cdafe9be8e3fd0ebf808b0c0572e44cc9fc
7
+ data.tar.gz: c069aa63600fb1d0b50179c1aa0f2314bed3463eb087c7589661cc5b804dafab1155ae181cc867d85917c18b8e51576294b25e66830bd9ed55a4850a16128c96
data/README.md CHANGED
@@ -360,7 +360,6 @@ follows:
360
360
  * <http://rubydoc.info/github/ruby-rdf/rdf/frames>
361
361
  * <http://github.com/ruby-rdf/rdf>
362
362
  * <http://rubygems.org/gems/rdf>
363
- * <http://rubyforge.org/projects/rdf/>
364
363
  * <http://raa.ruby-lang.org/project/rdf/>
365
364
  * <http://www.ohloh.net/p/rdf>
366
365
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.8
1
+ 2.2.9
@@ -11,7 +11,7 @@
11
11
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/rdf11-concepts/> .
12
12
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-quads/> .
13
13
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/TR/n-triples/> .
14
- <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubyforge.org/projects/rdf/> .
14
+ <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#download-page> <http://rubygems.org/gems/rdf/> .
15
15
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#bug-database> <http://github.com/ruby-rdf/rdf/issues> .
16
16
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://ar.to/> .
17
17
  <http://rubygems.org/gems/rdf> <http://usefulinc.com/ns/doap#blog> <http://blog.datagraph.org/> .
@@ -124,11 +124,13 @@ module RDF
124
124
  @symbol, @on, @datatype, @control, @description, @use, @callback = symbol.to_sym, Array(on), datatype, control, description, use, block
125
125
  end
126
126
 
127
- def call(arg, options)
127
+ def call(arg, options = {})
128
128
  if @callback
129
129
  case @callback.arity
130
+ when 0 then @callback.call
130
131
  when 1 then @callback.call(arg)
131
132
  when 2 then @callback.call(arg, options)
133
+ else arg
132
134
  end
133
135
  else
134
136
  arg
@@ -305,7 +307,7 @@ module RDF
305
307
  on_args = cli_opt.on || []
306
308
  on_args << cli_opt.description if cli_opt.description
307
309
  options.on(*on_args) do |opt_arg|
308
- options.options[cli_opt.symbol] = cli_opt.call(opt_arg)
310
+ options.options[cli_opt.symbol] = cli_opt.call(opt_arg, options)
309
311
  end
310
312
  end if reader
311
313
  arg.downcase.to_sym
@@ -327,7 +329,7 @@ module RDF
327
329
  on_args = cli_opt.on || []
328
330
  on_args << cli_opt.description if cli_opt.description
329
331
  options.on(*on_args) do |opt_arg|
330
- options.options[cli_opt.symbol] = cli_opt.call(opt_arg)
332
+ options.options[cli_opt.symbol] = cli_opt.call(opt_arg, options)
331
333
  end
332
334
  end if writer
333
335
  arg.downcase.to_sym
@@ -358,7 +360,7 @@ module RDF
358
360
  # Returns discovered options
359
361
  def self.options(argv, format: nil)
360
362
  options = OptionParser.new
361
- cli_opts = OPTIONS.dup
363
+ cli_opts = OPTIONS.map(&:dup)
362
364
  logger = Logger.new($stderr)
363
365
  logger.level = Logger::WARN
364
366
  logger.formatter = lambda {|severity, datetime, progname, msg| "#{severity} #{msg}\n"}
@@ -428,7 +430,7 @@ module RDF
428
430
 
429
431
  ##
430
432
  # Output usage message
431
- def self.usage(options, cmd_opts = {}, banner: nil)
433
+ def self.usage(options, cmd_opts: {}, banner: nil)
432
434
  options.banner = banner if banner
433
435
  $stdout.puts options
434
436
  $stdout.puts "Note: available commands and options may be different depending on selected --input-format and/or --output-format."
@@ -505,6 +507,17 @@ module RDF
505
507
  COMMANDS[command.to_sym][:lambda].call(args, output: output, **options.merge(messages: messages))
506
508
  end
507
509
 
510
+ # Normalize messages
511
+ messages.each do |kind, term_messages|
512
+ case term_messages
513
+ when Hash
514
+ when Array
515
+ messages[kind] = {result: term_messages}
516
+ else
517
+ messages[kind] = {result: [term_messages]}
518
+ end
519
+ end
520
+
508
521
  if options[:statistics]
509
522
  options[:statistics][:reader] = @readers.first unless (@readers || []).empty?
510
523
  options[:statistics][:count] = @repository.count
@@ -23,7 +23,7 @@ module RDF
23
23
  # @see http://en.wikipedia.org/wiki/Uniform_Resource_Identifier
24
24
  # @see http://www.ietf.org/rfc/rfc3986.txt
25
25
  # @see http://www.ietf.org/rfc/rfc3987.txt
26
- # @see http://addressable.rubyforge.org/
26
+ # @see http://www.rubydoc.info/gems/addressable
27
27
  class URI
28
28
  include RDF::Resource
29
29
 
@@ -13,7 +13,7 @@ module RDF
13
13
  #
14
14
  # An example of an RDF statement in N-Triples format:
15
15
  #
16
- # <http://rubyforge.org/> <http://purl.org/dc/terms/title> "RubyForge" .
16
+ # <http://rubygems.org/gems/rdf> <http://purl.org/dc/terms/title> "rdf" .
17
17
  #
18
18
  # Installation
19
19
  # ------------
@@ -9,8 +9,8 @@ module RDF; module Util
9
9
  #
10
10
  # While this cache is something of an internal implementation detail of
11
11
  # RDF.rb, some external libraries do currently make use of it as well,
12
- # including [SPARQL](http://ruby-rdf/sparql/) and
13
- # [Spira](http://spira.rubyforge.org/). Do be sure to include any changes
12
+ # including [SPARQL](http://github.com/ruby-rdf/sparql/) and
13
+ # [Spira](http://github.com/ruby-rdf/spira). Do be sure to include any changes
14
14
  # here in the RDF.rb changelog.
15
15
  #
16
16
  # @see RDF::URI.intern
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-08-17 00:00:00.000000000 Z
13
+ date: 2017-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  requirements: []
300
- rubyforge_project: rdf
300
+ rubyforge_project:
301
301
  rubygems_version: 2.6.12
302
302
  signing_key:
303
303
  specification_version: 4