georeferencer 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f9f94318c12d86161d527a1d18146596f641eaf2003a013cfe0f4eb88fa2113
4
- data.tar.gz: 28206df2f5aa4ecb8c66b390565378191fe38eeb4274321010196939b9d2a24c
3
+ metadata.gz: fc2db58207e72675ddef6ce61da5b7f43a55ab42f5bea3af68bf682b9a9362b3
4
+ data.tar.gz: ea44a9e62a8418244ef63a5174d9233bf3f154f1c600a3d62edcb94edc7f6782
5
5
  SHA512:
6
- metadata.gz: daf926e877d7e27486c03a6cf96d22bd6867959c2ec92cdb2b080fc3a18d388d574a6fe2341db585e84340daa6df58730b9342388aa93665852d713337a12ff3
7
- data.tar.gz: bd9c85a3a19948a66f10e402c50267360a53260188769081dede6e74cfdd31fbfadc15bcd329be5175985cf3505375a07231cfeccf8c3e4e76c148f6388b0cd8
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 !(@params.keys.include?(:start) || @params.keys.include?("start")) && @_collection.metadata[:start].present?
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
@@ -19,7 +19,7 @@ module Georeferencer
19
19
  end
20
20
 
21
21
  def url(width=200,height=nil)
22
- [image[:url],'full',"#{width},#{height}",0,'default.jpg'].join("/")
22
+ [thumbnail[:url],'full',"#{width},#{height}",0,'default.jpg'].join("/")
23
23
  end
24
24
 
25
25
  end
@@ -4,7 +4,6 @@ module Georeferencer
4
4
 
5
5
  collection_path "progress"
6
6
  resource_path "progress?collection=:id"
7
- self.perform_object_caching = false
8
7
 
9
8
 
10
9
  def self.all
@@ -1,3 +1,3 @@
1
1
  module Georeferencer
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  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.5
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-20 00:00:00.000000000 Z
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
- rubyforge_project:
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