redlander 0.2.1 → 0.2.2
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.
- data/lib/redlander/model_proxy.rb +7 -3
- data/lib/redlander/version.rb +1 -1
- data/spec/redlander/model_spec.rb +0 -1
- data/spec/redlander/node_spec.rb +1 -1
- metadata +3 -3
@@ -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
|
-
|
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
|
data/lib/redlander/version.rb
CHANGED
@@ -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
|
|
data/spec/redlander/node_spec.rb
CHANGED
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Slava Kravchenko
|