redlander 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,7 +57,7 @@ module Redlander
57
57
  # Scope can be:
58
58
  # :all
59
59
  # :first
60
- def find(scope, options = {})
60
+ def find(scope, options = {}, &block)
61
61
  statement = Statement.new(options)
62
62
  rdf_stream = Redland.librdf_model_find_statements(@model.rdf_model, statement.rdf_statement)
63
63
  proxy = self.class.new(@model, rdf_stream)
@@ -67,7 +67,7 @@ module Redlander
67
67
  proxy.first
68
68
  when :all
69
69
  if block_given?
70
- proxy.each
70
+ proxy.each(&block)
71
71
  else
72
72
  proxy
73
73
  end
@@ -77,7 +77,11 @@ module Redlander
77
77
  end
78
78
 
79
79
  def all(options = {})
80
- find(:all, options)
80
+ [].tap do |st|
81
+ find(:all, options) do |fs|
82
+ st << fs
83
+ end
84
+ end
81
85
  end
82
86
 
83
87
  end
@@ -1,3 +1,3 @@
1
1
  module Redlander
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -52,7 +52,6 @@ describe Model do
52
52
  statement = @model.statements.create(statement_attributes)
53
53
  @model.statements.find(:first).should eql(statement)
54
54
  @model.statements.first.should eql(statement)
55
- @model.statements.find(:all).should eql([statement])
56
55
  @model.statements.all.should eql([statement])
57
56
  end
58
57
 
@@ -74,7 +74,7 @@ describe Node do
74
74
 
75
75
  it "should have a blank identifier for a blank node" do
76
76
  node = Node.new
77
- node.value.should match(/^\(\w+\)$/)
77
+ node.value.should match(/^_:\w+$/)
78
78
  end
79
79
 
80
80
  it "should have an instance of URI for a resource node" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redlander
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Slava Kravchenko