georeferencer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/georeferencer/middleware/parser.rb +4 -0
- data/lib/georeferencer/mixins/collection_cache.rb +1 -1
- data/lib/georeferencer/mixins/collection_iterator.rb +12 -5
- data/lib/georeferencer/models/image.rb +1 -1
- data/lib/georeferencer/models/progress.rb +0 -1
- data/lib/georeferencer/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc2db58207e72675ddef6ce61da5b7f43a55ab42f5bea3af68bf682b9a9362b3
|
4
|
+
data.tar.gz: ea44a9e62a8418244ef63a5174d9233bf3f154f1c600a3d62edcb94edc7f6782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 487785dd3a8401fab75435a0ff216b8c61f56eb481c77b8acd1b9ff7e62d610c20b6938631f41c5f0677d8562fcd8919f199a5734536a6d8524ee9ca965a5b02
|
7
|
+
data.tar.gz: 88b248fa495291a8f6f91e36e39bc99dfaf831f39c930bb224357a936e3cb5e264fb1d63a46f45e44b5c2e03c422bfd23c8021fbcd55e34db41c132d3975001c
|
@@ -17,6 +17,10 @@ module Georeferencer
|
|
17
17
|
body.merge!({metadata: {start: start}})
|
18
18
|
env[:body] = body
|
19
19
|
else
|
20
|
+
# Progress doesn't have an id; set the id to the collection
|
21
|
+
if env.url.path =~ /progress/
|
22
|
+
json.merge!({id: Faraday::Utils.parse_query(env.url.query)["collection"]})
|
23
|
+
end
|
20
24
|
env[:body] = {
|
21
25
|
data: json.with_indifferent_access
|
22
26
|
}
|
@@ -2,7 +2,7 @@ module Georeferencer
|
|
2
2
|
module CollectionCache
|
3
3
|
def fetch
|
4
4
|
raise ArgumentError, "You need to configure Georeferencer before you make requests" unless Georeferencer.configuration.present?
|
5
|
-
if Georeferencer.configuration.perform_caching
|
5
|
+
if Georeferencer.configuration.perform_caching && @parent.ancestors.include?(Georeferencer::Base)
|
6
6
|
# Sort the arguments - reduces the number of different argument hashes.
|
7
7
|
# Note that 2 different arg hashes might actually be the same, with child arrays
|
8
8
|
# in a different order. But we won't mess with the order of the child arrays
|
@@ -11,12 +11,13 @@ module Georeferencer
|
|
11
11
|
|
12
12
|
# check the params don't specifically include a :start argument (in which case we don't need to loop),
|
13
13
|
# and that the response metadata includes a :start key
|
14
|
-
if !
|
14
|
+
if !start_included? && @_collection.metadata[:start].present? && (!limited_included? || (limited_included? && @_collection.count < params[:limit]))
|
15
15
|
@params.merge!(start: @_collection.metadata[:start])
|
16
16
|
loop do
|
17
17
|
clear_fetch_cache!
|
18
18
|
new_collection = super
|
19
19
|
@_collection += new_collection
|
20
|
+
break if limited_included? && @_collection.count >= @params[:limit]
|
20
21
|
if new_collection.metadata[:start].present? && new_collection.metadata[:start] != @params[:start]
|
21
22
|
@params.merge!(start: new_collection.metadata[:start])
|
22
23
|
else
|
@@ -25,17 +26,23 @@ module Georeferencer
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
|
-
if @parent.preload_resources == true
|
29
|
-
Her::Collection.new(@_collection.collect(&:reload), metadata)
|
30
|
-
else
|
31
29
|
Her::Collection.new(@_collection, metadata)
|
32
|
-
end
|
33
30
|
|
34
31
|
|
35
32
|
else
|
36
33
|
super
|
37
34
|
end
|
38
35
|
end
|
36
|
+
|
37
|
+
def limited_included?
|
38
|
+
(@params.keys.include?(:limit) || @params.keys.include?("limit"))
|
39
|
+
end
|
40
|
+
|
41
|
+
def start_included?
|
42
|
+
(@params.keys.include?(:start) || @params.keys.include?("start"))
|
43
|
+
end
|
44
|
+
|
45
|
+
|
39
46
|
end
|
40
47
|
|
41
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: georeferencer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Jones
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-03-
|
12
|
+
date: 2019-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -159,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
|
163
|
-
rubygems_version: 2.7.8
|
162
|
+
rubygems_version: 3.0.3
|
164
163
|
signing_key:
|
165
164
|
specification_version: 4
|
166
165
|
summary: A Ruby client for Georeferencer
|