georeferencer 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15bc8aa157ec51687a9c5d2d25028a670b17053e6749592d15b46a2dd943c89a
4
- data.tar.gz: ea5e919ad649d0978d6e0c1739ebc06871754a0b00f8595edabdb125fe7e7a3e
3
+ metadata.gz: 7c36acb7c922b9cdde371dcd61b912997564086240eedcb9d1424760ce6411ab
4
+ data.tar.gz: c936576f11136ba034ee89c579927616ec3a39f9302220d1254c46d8832edac8
5
5
  SHA512:
6
- metadata.gz: 8a947a421f1f15fe27c5e7dfd84d0c3bfe9ad54cff20925a6e17acad5a54831ce9938ee2833e9376f25ce83b21adc4a1d0d43dabc508c47bda545e01a28b57fa
7
- data.tar.gz: dc01a5ba3ae66569b10bfdb383e26708783fdb6ebfa1f4a188a7596c21a75e86d35a17995922bfecb6f40d894e7b710d7f7e0c6477ea68919c69b6bc00e142f3
6
+ metadata.gz: 2bde55a400962aa06bf64b1c0e1a2177ceeb540f04f8b6883a22c16a2c87ce257a7a635b0c1c8e633275844bd3942b1245057c041eb15344f5c4283961f97a03
7
+ data.tar.gz: f55550f2005005905e6ca2249291c22520daad23fb33e6491d6ffb479517b59edcf891657929f73ec2f3320f37fa34c7fe9183e9a500d68e28d3f3be9a8bf66e
@@ -4,9 +4,11 @@ module Georeferencer
4
4
  # Add custom UA String
5
5
  env[:request_headers]["User-Agent"] = Georeferencer.configuration.user_agent
6
6
 
7
+ query = Faraday::Utils.parse_query(env.url.query) || {}
8
+ query["format"] = 'json'
7
9
 
8
10
  # Fix url-encoded percent signs
9
- env.url.query = env.url.query.gsub(/%25/,'%')
11
+ env.url.query = Faraday::Utils.build_query(query).gsub(/%25/,'%')
10
12
 
11
13
  @app.call(env)
12
14
  end
@@ -4,8 +4,5 @@ module Georeferencer
4
4
 
5
5
  collection_path "contributors"
6
6
 
7
- default_scope -> {
8
- where(format: 'json')
9
- }
10
7
  end
11
8
  end
@@ -6,10 +6,6 @@ module Georeferencer
6
6
  collection_path "display"
7
7
  resource_path "maps/:id"
8
8
 
9
- default_scope -> {
10
- where(format: 'json')
11
- }
12
-
13
9
  scope :unreferenced, -> {
14
10
  where(state: 'waiting')
15
11
  }
@@ -17,17 +13,14 @@ module Georeferencer
17
13
  def centroid
18
14
  # Data from the collection endpoint doesn't include the bounding box, so we need to check we have the full data,
19
15
  # or reload (which hits the resource endpoint) if not
20
- if respond_to?(:bbox)
21
- (wlng, slat, elng, nlat) = bbox
22
- else
23
- (wlng, slat, elng, nlat) = reload.bbox
24
- end
16
+ (wlng, slat, elng, nlat) = respond_to?(:bbox) ? bbox : reload.bbox
17
+
25
18
  {lat: (slat+nlat)/2, lng: (wlng+elng)/2}
26
19
  end
27
20
 
28
21
  def url(width=200,height=nil)
29
22
  [image[:url],'full',"#{width},#{height}",0,'default.jpg'].join("/")
30
-
31
23
  end
24
+
32
25
  end
33
26
  end
@@ -5,9 +5,6 @@ module Georeferencer
5
5
  collection_path "progress"
6
6
  resource_path "progress?collection=:id"
7
7
 
8
- default_scope -> {
9
- where(format: 'json')
10
- }
11
8
 
12
9
  def self.all
13
10
  raise NoMethodError, "Use #find(project_name)"
@@ -1,3 +1,3 @@
1
1
  module Georeferencer
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
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-17 00:00:00.000000000 Z
12
+ date: 2019-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler