rdf 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acbca4aa3fe95f404b1cf25f7f9e38673c67eb37
4
- data.tar.gz: 0a9df75c39e24ec6f601c479add676f35ebe9048
3
+ metadata.gz: a0c4f107a087cbcd8828a9db8826cf54e7746ac3
4
+ data.tar.gz: 8d98e00d3290c1483a19a46c5596fe1e74411f30
5
5
  SHA512:
6
- metadata.gz: d9760659cea0b003bdb2a4086b08ef4429619f31610f23c4dc276c863f35cc9f8693ac606233c9badd1633d33edb8b6ac5c6dcf7595e849254714cd54aa5969c
7
- data.tar.gz: 105dfca92ad52999b997a53931a34f70f44a403a0699fea4af0e16c31b852ef29bb1a21535acdec5970cdae9d54f303cddfccd2c08c5befdefbac6863395aaba
6
+ metadata.gz: 9cc293fc0d360d0f936452cf97e759dd86485ba26de3c84087936248d7d2a490a89a53e7c9a6aef1380c340faeb7335124b6d25ffb54426887c549138b59a931
7
+ data.tar.gz: eba1d1738c875b2d862dfff870eb5ceb714004cc2be9899104641250006e5c86a6bceaf6a91562db6f298addfe8f3c6a8d305e1be5ce1ded16a4d805a51e2b8f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.3
@@ -765,7 +765,10 @@ module RDF
765
765
  def method_missing(meth, *args)
766
766
  case meth
767
767
  when :to_hash
768
- warn "[DEPRECATION] Enumerable#to_hash is deprecated, use Enumerable#to_h instead. Called from #{Gem.location_of_caller.join(':')}"
768
+ warn "[DEPRECATION] RDF::Enumerable#to_hash is deprecated, use RDF::Enumerable#to_h instead.\n" +
769
+ "This is due to the introduction of keyword arugments that attempt to turn the last argument into a hash using #to_hash.\n" +
770
+ "This can be avoided by explicitly passing an options hash as the last argument.\n" +
771
+ "Called from #{Gem.location_of_caller.join(':')}"
769
772
  return self.to_h
770
773
  end
771
774
  writer = RDF::Writer.for(meth.to_s[3..-1].to_sym) if meth.to_s[0,3] == "to_"
@@ -426,7 +426,10 @@ module RDF
426
426
  def method_missing(meth, *args)
427
427
  case meth
428
428
  when :to_hash
429
- warn "[DEPRECATION] Statement#to_hash is deprecated, use Statement#to_h instead. Called from #{Gem.location_of_caller.join(':')}"
429
+ warn "[DEPRECATION] RDF::Statement#to_hash is deprecated, use RDF::Statement#to_h instead.\n" +
430
+ "This is due to the introduction of keyword arugments that attempt to turn the last argument into a hash using #to_hash.\n" +
431
+ "This can be avoided by explicitly passing an options hash as the last argument.\n" +
432
+ "Called from #{Gem.location_of_caller.join(':')}"
430
433
  self.to_h
431
434
  else
432
435
  super
data/lib/rdf/model/uri.rb CHANGED
@@ -1299,7 +1299,10 @@ module RDF
1299
1299
  def method_missing(meth, *args)
1300
1300
  case meth
1301
1301
  when :to_hash
1302
- warn "[DEPRECATION] URI#to_hash is deprecated, use URI#to_h instead. Called from #{Gem.location_of_caller.join(':')}"
1302
+ warn "[DEPRECATION] RDF::URI#to_hash is deprecated, use RDF::URI#to_h instead.\n" +
1303
+ "This is due to the introduction of keyword arugments that attempt to turn the last argument into a hash using #to_hash.\n" +
1304
+ "This can be avoided by explicitly passing an options hash as the last argument.\n" +
1305
+ "Called from #{Gem.location_of_caller.join(':')}"
1303
1306
  self.to_h
1304
1307
  else
1305
1308
  super
@@ -277,7 +277,10 @@ class RDF::Query
277
277
  # @return [RDF::Term]
278
278
  def method_missing(name, *args, &block)
279
279
  if name == :to_hash
280
- warn "[DEPRECATION] Solution#to_hash is deprecated, use Solution#to_h instead. Called from #{Gem.location_of_caller.join(':')}"
280
+ warn "[DEPRECATION] RDF::Query::Solution#to_hash is deprecated, use RDF::Query::Solution#to_h instead.\n" +
281
+ "This is due to the introduction of keyword arugments that attempt to turn the last argument into a hash using #to_hash.\n" +
282
+ "This can be avoided by explicitly passing an options hash as the last argument.\n" +
283
+ "Called from #{Gem.location_of_caller.join(':')}"
281
284
  self.to_h
282
285
  elsif args.empty? && @bindings.has_key?(name.to_sym)
283
286
  @bindings[name.to_sym]
@@ -229,7 +229,10 @@ class RDF::Query
229
229
  # @deprecated Use {#to_h} instead.
230
230
  def method_missing(name, *args, &block)
231
231
  if name == :to_hash
232
- warn "[DEPRECATION] Variable#to_hash is deprecated, use Variable#to_h instead. Called from #{Gem.location_of_caller.join(':')}"
232
+ warn "[DEPRECATION] RDF::Query::Variable#to_hash is deprecated, use RDF::Query::Variable#to_h instead.\n" +
233
+ "This is due to the introduction of keyword arugments that attempt to turn the last argument into a hash using #to_hash.\n" +
234
+ "This can be avoided by explicitly passing an options hash as the last argument.\n" +
235
+ "Called from #{Gem.location_of_caller.join(':')}"
233
236
  self.to_h
234
237
  elsif args.empty? && @bindings.has_key?(name.to_sym)
235
238
  @bindings[name.to_sym]
data/lib/rdf/reader.rb CHANGED
@@ -50,7 +50,7 @@ module RDF
50
50
  # @yieldparam [Class] klass
51
51
  # @return [Enumerator]
52
52
  def self.each(&block)
53
- @@subclasses.each(&block)
53
+ RDF::Format.map(&:reader).reject(&:nil?).each(&block)
54
54
  end
55
55
 
56
56
  ##
@@ -195,7 +195,7 @@ module RDF
195
195
  if reader
196
196
  reader.new(file, options, &block)
197
197
  else
198
- raise FormatError, "unknown RDF format: #{format_options.inspect}\nThis may be resolved with a require of the 'linkeddata' gem."
198
+ raise FormatError, "unknown RDF format: #{format_options.inspect}#{"\nThis may be resolved with a require of the 'linkeddata' gem." unless Object.const_defined?(:LinkedData)}"
199
199
  end
200
200
  end
201
201
  end
@@ -43,8 +43,8 @@ module RDF
43
43
  # Repositories support transactions with a variety of ACID semantics:
44
44
  #
45
45
  # Atomicity is indicated by `#supports?(:atomic_write)`. When atomicity is
46
- # supported, writes through `#transaction`, `#apply_changeset` and
47
- # `#delete_insert` are applied atomically.
46
+ # supported, writes through {#transaction}, {#apply_changeset} and
47
+ # {#delete_insert} are applied atomically.
48
48
  #
49
49
  # Consistency should be guaranteed, in general. Repositories that don't
50
50
  # support consistency, or that have specialized definitions of consistency
@@ -52,7 +52,7 @@ module RDF
52
52
  # their documentation.
53
53
  #
54
54
  # Isolation may be supported at various levels, indicated by
55
- # `#isolation_level`:
55
+ # {#isolation_level}:
56
56
  # - `:read_uncommitted`: Inserts & deletes in an uncommitted transaction
57
57
  # scope may be visible to other transactions (or via `#each`, etc...)
58
58
  # - `:read_committed`: Inserts & deletes may be visible to other
@@ -64,8 +64,8 @@ module RDF
64
64
  # When two or more transactions attempt conflicting writes, only one of
65
65
  # them may succeed.
66
66
  #
67
- # Durability is noted via `RDF::Durable` support and `#durable?`
68
- # /`#nondurable?`.
67
+ # Durability is noted via {RDF::Durable} support and {#durable?}
68
+ # /{#nondurable?}.
69
69
  #
70
70
  # @example Transational read from a repository
71
71
  # repository.transaction do |tx|
@@ -39,21 +39,21 @@ module RDF
39
39
  # end
40
40
  #
41
41
  # The base class provides an atomic write implementation depending on
42
- # `RDF::Changeset` and using `Changeset#apply`. Custom `Repositories`
42
+ # {RDF::Changeset} and using {Changeset#apply}. Custom {Repository} classes
43
43
  # can implement a minimial write-atomic transactions by overriding
44
- # `#apply_changeset`.
44
+ # {#apply_changeset}.
45
45
  #
46
46
  # Reads within a transaction run against the live repository by default
47
- # (`#isolation_level' is `:read_committed`). Repositories may provide support
48
- # for snapshots by implementing `Repository#snapshot` and responding `true` to
47
+ # ({#isolation_level} is `:read_committed`). Repositories may provide support
48
+ # for snapshots by implementing {Repository#snapshot} and responding `true` to
49
49
  # `#supports?(:snapshots)`. In this case, the transaction will use the
50
- # `RDF::Dataset` returned by `#snapshot` for reads (`:repeatable_read`).
50
+ # {RDF::Dataset} returned by {#snapshot} for reads (`:repeatable_read`).
51
51
  #
52
52
  # For datastores that support transactions natively, implementation of a
53
- # custom `Transaction` subclass is recommended. The `Repository` is
53
+ # custom {Transaction} subclass is recommended. The {Repository} is
54
54
  # responsible for specifying snapshot support and isolation level as
55
55
  # appropriate. Note that repositories may provide the snapshot isolation level
56
- # without implementing `#snapshot`.
56
+ # without implementing {#snapshot}.
57
57
  #
58
58
  # @example A repository with a custom transaction class
59
59
  # class MyRepository < RDF::Repository
data/lib/rdf/writer.rb CHANGED
@@ -61,7 +61,7 @@ module RDF
61
61
  # @yieldreturn [void] ignored
62
62
  # @return [Enumerator]
63
63
  def self.each(&block)
64
- @@subclasses.each(&block)
64
+ RDF::Format.map(&:writer).reject(&:nil?).each(&block)
65
65
  end
66
66
 
67
67
  ##
data/lib/rdf.rb CHANGED
@@ -89,18 +89,12 @@ module RDF
89
89
  end
90
90
 
91
91
  ##
92
- # Alias for `RDF::URI.new`.
92
+ # Cast to a URI. If already a URI, return the passed argument.
93
93
  #
94
94
  # @param (see RDF::URI#initialize)
95
95
  # @return [RDF::URI]
96
96
  def self.URI(*args, &block)
97
- case uri = args.first
98
- when RDF::URI then uri
99
- else case
100
- when uri.respond_to?(:to_uri) then uri.to_uri
101
- else URI.new(*args, &block)
102
- end
103
- end
97
+ (uri = args.first).respond_to?(:to_uri) ? uri.to_uri : URI.new(*args, &block)
104
98
  end
105
99
 
106
100
  ##
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.1
4
+ version: 2.2.3
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-01-08 00:00:00.000000000 Z
13
+ date: 2017-01-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header