simple-mappr 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple-mappr.rb +26 -3
- data/lib/simple-mappr/transporter.rb +1 -0
- data/lib/simple-mappr/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: e4004acbac50f68a55b67776b47aeb2855336b99
|
4
|
+
data.tar.gz: bf019aa91227af84255bba397d61c1a7563b3556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 008db01cb68e3c11068493c14689857f705e35b3c65c4943c9377af3c761417d68295310fb1a5efbe6e0695bece609c2870506447b49ac864aeaca913a9b40e8
|
7
|
+
data.tar.gz: e7e4c20bbf46d1125542849917c9bf610c5eb6bc86e378408a24c281b61de8deddc505c30b5167eb8211c003245fe899a9a1c933047d44bfc0a3d0426114990b
|
data/lib/simple-mappr.rb
CHANGED
@@ -2,6 +2,7 @@ require "simple-mappr/constants"
|
|
2
2
|
require "simple-mappr/exceptions"
|
3
3
|
require "simple-mappr/transporter"
|
4
4
|
require "simple-mappr/validator"
|
5
|
+
require "simple-mappr/version"
|
5
6
|
|
6
7
|
class SimpleMappr
|
7
8
|
|
@@ -40,6 +41,28 @@ class SimpleMappr
|
|
40
41
|
Transporter.send_data @parameters
|
41
42
|
end
|
42
43
|
|
44
|
+
##
|
45
|
+
# Send the SimpleMappr object to the RESTful API and a file title
|
46
|
+
# without extension and download the resulting image
|
47
|
+
# Returns the file path for the downloaded file
|
48
|
+
#
|
49
|
+
# == Example
|
50
|
+
#
|
51
|
+
# instance.download("/tmp/my_map")
|
52
|
+
# Returns
|
53
|
+
# /tmp/my_map.png
|
54
|
+
#
|
55
|
+
def download(file_title = nil)
|
56
|
+
if !file_title
|
57
|
+
raise InvalidParameterValue, "File path is required"
|
58
|
+
end
|
59
|
+
file = [file_title,output].join(".")
|
60
|
+
File.open(file, 'wb') do |fo|
|
61
|
+
fo.write open(create[:imageURL]).read
|
62
|
+
end
|
63
|
+
file
|
64
|
+
end
|
65
|
+
|
43
66
|
##
|
44
67
|
# Set a bounding box in decimal degrees as minx,miny,maxx,maxy
|
45
68
|
#
|
@@ -77,7 +100,7 @@ class SimpleMappr
|
|
77
100
|
#
|
78
101
|
# == Example
|
79
102
|
#
|
80
|
-
# instance.
|
103
|
+
# instance.file_path = "/Users/SimpleMappr/demo.txt"
|
81
104
|
#
|
82
105
|
def file_path=(file_path)
|
83
106
|
Validator.validate_type(file_path, 'File')
|
@@ -145,7 +168,7 @@ class SimpleMappr
|
|
145
168
|
#
|
146
169
|
# == Example
|
147
170
|
#
|
148
|
-
# instance.
|
171
|
+
# instance.legend = ['My First Legend','My Second Legend']
|
149
172
|
#
|
150
173
|
def legend=(legend)
|
151
174
|
Validator.validate_type(legend, 'Array')
|
@@ -202,7 +225,7 @@ class SimpleMappr
|
|
202
225
|
end
|
203
226
|
|
204
227
|
def output
|
205
|
-
@parameters[:output] ||
|
228
|
+
@parameters[:output] || "png"
|
206
229
|
end
|
207
230
|
|
208
231
|
##
|
data/lib/simple-mappr/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David P. Shorthouse
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.5.1
|
132
|
+
rubygems_version: 2.4.5.1
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: A gem to access the SimpleMappr API
|