rdf 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
data/lib/rdf.rb CHANGED
@@ -1,7 +1,11 @@
1
+ require 'enumerator' # @since Ruby 1.8.1
1
2
  require 'open-uri'
2
3
  require 'rdf/version'
3
4
 
4
5
  module RDF
6
+ # For compatibility with both Ruby 1.8.x and Ruby 1.9.x:
7
+ Enumerator = defined?(::Enumerator) ? ::Enumerator : ::Enumerable::Enumerator
8
+
5
9
  # RDF mixins
6
10
  autoload :Durable, 'rdf/mixin/durable'
7
11
  autoload :Enumerable, 'rdf/mixin/enumerable'
@@ -132,8 +132,7 @@ module RDF
132
132
  # @return [Enumerator]
133
133
  # @see #each_statement
134
134
  def enum_statement
135
- require_enumerator!
136
- ::Enumerable::Enumerator.new(self, :each_statement)
135
+ Enumerator.new(self, :each_statement)
137
136
  end
138
137
 
139
138
  alias_method :enum_statements, :enum_statement
@@ -191,8 +190,7 @@ module RDF
191
190
  # @return [Enumerator]
192
191
  # @see #each_triple
193
192
  def enum_triple
194
- require_enumerator!
195
- ::Enumerable::Enumerator.new(self, :each_triple)
193
+ Enumerator.new(self, :each_triple)
196
194
  end
197
195
 
198
196
  alias_method :enum_triples, :enum_triple
@@ -251,8 +249,7 @@ module RDF
251
249
  # @return [Enumerator]
252
250
  # @see #each_quad
253
251
  def enum_quad
254
- require_enumerator!
255
- ::Enumerable::Enumerator.new(self, :each_quad)
252
+ Enumerator.new(self, :each_quad)
256
253
  end
257
254
 
258
255
  alias_method :enum_quads, :enum_quad
@@ -318,8 +315,7 @@ module RDF
318
315
  # @return [Enumerator]
319
316
  # @see #each_subject
320
317
  def enum_subject
321
- require_enumerator!
322
- ::Enumerable::Enumerator.new(self, :each_subject)
318
+ Enumerator.new(self, :each_subject)
323
319
  end
324
320
 
325
321
  alias_method :enum_subjects, :enum_subject
@@ -385,8 +381,7 @@ module RDF
385
381
  # @return [Enumerator]
386
382
  # @see #each_predicate
387
383
  def enum_predicate
388
- require_enumerator!
389
- ::Enumerable::Enumerator.new(self, :each_predicate)
384
+ Enumerator.new(self, :each_predicate)
390
385
  end
391
386
 
392
387
  alias_method :enum_predicates, :enum_predicate
@@ -452,8 +447,7 @@ module RDF
452
447
  # @return [Enumerator]
453
448
  # @see #each_object
454
449
  def enum_object
455
- require_enumerator!
456
- ::Enumerable::Enumerator.new(self, :each_object)
450
+ Enumerator.new(self, :each_object)
457
451
  end
458
452
 
459
453
  alias_method :enum_objects, :enum_object
@@ -519,8 +513,7 @@ module RDF
519
513
  # @return [Enumerator]
520
514
  # @see #each_context
521
515
  def enum_context
522
- require_enumerator!
523
- ::Enumerable::Enumerator.new(self, :each_context)
516
+ Enumerator.new(self, :each_context)
524
517
  end
525
518
 
526
519
  alias_method :enum_contexts, :enum_context
@@ -543,12 +536,5 @@ module RDF
543
536
  end
544
537
  result
545
538
  end
546
-
547
- private
548
-
549
- def require_enumerator! # @private
550
- require 'enumerator' unless defined?(::Enumerable::Enumerator)
551
- end
552
-
553
539
  end
554
540
  end
data/lib/rdf/query.rb CHANGED
@@ -77,12 +77,11 @@ module RDF
77
77
  # Enumerates over each query solution.
78
78
  #
79
79
  # @yield [solution]
80
- # @yieldparam [Solution]
80
+ # @yieldparam [Solution] solution
81
81
  # @return [Enumerator]
82
82
  def each_solution(&block)
83
83
  unless block_given?
84
- require 'enumerator' unless defined?(::Enumerable::Enumerator)
85
- ::Enumerable::Enumerator.new(self, :each_solution)
84
+ Enumerator.new(self, :each_solution)
86
85
  else
87
86
  solutions.each do |solution|
88
87
  block.call(solution.is_a?(Solution) ? solution : Solution.new(solution))
data/lib/rdf/version.rb CHANGED
@@ -2,7 +2,7 @@ module RDF
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 7
5
+ TINY = 8
6
6
  EXTRA = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 7
9
- version: 0.1.7
8
+ - 8
9
+ version: 0.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Arto Bendiken
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-16 00:00:00 +02:00
18
+ date: 2010-04-18 00:00:00 +02:00
19
19
  default_executable: rdf
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -28,8 +28,8 @@ dependencies:
28
28
  segments:
29
29
  - 0
30
30
  - 1
31
- - 6
32
- version: 0.1.6
31
+ - 8
32
+ version: 0.1.8
33
33
  type: :development
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency