odata 0.6.10 → 0.6.11
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/odata/query/result.rb +18 -4
- data/lib/odata/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a572559e7706b0bef39c622c2e4b3a4b4e5a7b21
|
4
|
+
data.tar.gz: cf9f5a4a0afce81ef6c0eb9cf2f7df1ec47d2cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5afefdbeb87aa038ce5d4bfea737712d8afbcb87ddc4e6a240eda5213d5d2969491b953a86e1827b84bc885739a4d4ba871451971e7fe1892f5f391901337fe9
|
7
|
+
data.tar.gz: 614b2f640935183abb86acc1823c808605e067fc6e217413079a5e0e0256a777338904edea14ab9e24c628c0cf3b8377ae35be698c5645871eafb3f96dc2b176
|
data/CHANGELOG.md
CHANGED
data/lib/odata/query/result.rb
CHANGED
@@ -17,15 +17,19 @@ module OData
|
|
17
17
|
# @param block [block] a block to evaluate
|
18
18
|
# @return [OData::Entity] each entity in turn for the query result
|
19
19
|
def each(&block)
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
until next_page.nil?
|
21
|
+
service.find_entities(result).each do |entity_xml|
|
22
|
+
entity = OData::Entity.from_xml(entity_xml, entity_options)
|
23
|
+
block_given? ? block.call(entity) : yield(entity)
|
24
|
+
end
|
25
|
+
result = service.execute(next_page_url)
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
29
|
private
|
27
30
|
|
28
|
-
attr_reader :query
|
31
|
+
attr_reader :query
|
32
|
+
attr_accessor :result
|
29
33
|
|
30
34
|
def service
|
31
35
|
query.entity_set.service
|
@@ -34,6 +38,16 @@ module OData
|
|
34
38
|
def entity_options
|
35
39
|
query.entity_set.entity_options
|
36
40
|
end
|
41
|
+
|
42
|
+
def next_page
|
43
|
+
doc = ::Nokogiri::XML(result.body)
|
44
|
+
doc.remove_namespaces!
|
45
|
+
doc.xpath("/feed/link[@rel='next']").first
|
46
|
+
end
|
47
|
+
|
48
|
+
def next_page_url
|
49
|
+
next_page.attributes['href'].gsub(service.service_url, '')
|
50
|
+
end
|
37
51
|
end
|
38
52
|
end
|
39
53
|
end
|
data/lib/odata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|