simple-mappr 0.0.9 → 0.1.0

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
  SHA1:
3
- metadata.gz: 36ccf1b904a35cc72b6b0190ae962a11fc4936b6
4
- data.tar.gz: 28243c6169bebd56095010fd3d1fb2e3275335d2
3
+ metadata.gz: 7afe8e3105e63d7770c7e387c799173bd9a34f1e
4
+ data.tar.gz: f7bfa3556a8cea5ea58ccd006ee51edbc1f055a7
5
5
  SHA512:
6
- metadata.gz: ab6267f898879417c34744fab26808eff6497a8229e320379ea8b0d1b9e41eec5214181ef3c250bdd88a37e5984b061c9bcea16240de987cb2090f1346573627
7
- data.tar.gz: a8fc617371e3608e8ef729b7ee813165a172f28ad792ba68fee4043d5a1dd64cfc10765f1c6a1fffe5882d18ec07daef5de1caf8ec21671a6f99186c7447e987
6
+ metadata.gz: 86eb7a79b57720af6ff6a20bfaa124cd41d34dc9a616739437d6844c3de693c399fb6b37d994173b18076cba1d68bada1c5aec6db2c79d265bf821c424ef5ca7
7
+ data.tar.gz: ebf8ce6a1719ea8784895a7e7fbf23bbe243557d87ec7a7e9cf6c26d268f876995b1ef22021c4c9ee54bc4fe8e507bc5f9eb6b27f2cd476ec67d10cfb6c912ce
@@ -34,7 +34,9 @@ class SimpleMappr
34
34
  #
35
35
  # {
36
36
  # imageURL: "http://img.simplemappr.net/579273e6_1dd1_2.png",
37
- # expiry: "2016-07-22T21:28:38-04:00"
37
+ # expiry: "2016-07-22T21:28:38-04:00",
38
+ # bad_points: [],
39
+ # bad_drawings: []
38
40
  # }
39
41
  #
40
42
  def create
@@ -58,7 +60,7 @@ class SimpleMappr
58
60
  end
59
61
  file = [file_title,output].join(".")
60
62
  File.open(file, 'wb') do |fo|
61
- fo.write open(create[:imageURL]).read
63
+ fo.write(Transporter.send_data(@parameters, true))
62
64
  end
63
65
  file
64
66
  end
@@ -382,12 +384,12 @@ class SimpleMappr
382
384
  end
383
385
 
384
386
  ##
385
- # Include wkt regions as a Hash
386
- # Specify color, title, and data as keys
387
+ # Include wkt regions as an Array of Hashes
388
+ # Specify color, title, and data as keys for each element
387
389
  #
388
390
  # == Example
389
391
  #
390
- # instance.wkt = { color: "200,200,200", title: "My Regions", data: "POLYGON((-70 63,-70 48,-106 48,-106 63,-70 63))"}
392
+ # instance.wkt = [{ color: "200,200,200", title: "My Regions", data: "POLYGON((-70 63,-70 48,-106 48,-106 63,-70 63))" }]
391
393
  #
392
394
  def wkt=(wkt)
393
395
  Validator.validate_wkt(wkt)
@@ -1,6 +1,6 @@
1
1
  class SimpleMappr
2
2
 
3
- API_URL = "http://www.simplemappr.net/api/"
3
+ API_URL = "http://www.simplemappr.local/api/"
4
4
 
5
5
  PROJECTIONS = [
6
6
  'epsg:4326',
@@ -6,11 +6,15 @@ require "simple-mappr/validator"
6
6
  class SimpleMappr
7
7
  class Transporter
8
8
 
9
- def self.send_data params
9
+ def self.send_data params, download = false
10
10
  Validator.validate_type(params, 'Hash')
11
11
  params.delete_if{ |k,v| !v }
12
12
  RestClient.post(API_URL, params) do |response, request, result, &block|
13
- JSON.parse(response.body, :symbolize_names => true)
13
+ if response.code == 303 && download
14
+ response.follow_redirection
15
+ else
16
+ JSON.parse(response.body, :symbolize_names => true)
17
+ end
14
18
  end
15
19
  end
16
20
 
@@ -1,5 +1,5 @@
1
1
  class SimpleMappr
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-mappr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse