simple-mappr 0.1.4 → 0.1.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 +3 -5
- data/lib/simple-mappr/transporter.rb +5 -7
- data/lib/simple-mappr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d93f123b34119994c306a3fa2ca297090d2a39d0
|
4
|
+
data.tar.gz: 21df503f135df9b43bd01f555b0e9d76894260de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae8e34b0206fdea1da7f51c115b50b6bd614125456e2b0161976cd1cf99c0007e9e82b474c95fbd14a1d6e12faca7accffb938e18fcfedae32d9eece1e8e9433
|
7
|
+
data.tar.gz: 399e60f6686051b5e3d25d268bf112cce68e05892b81298102c2c95cedac457a7ea75c6f4a4ad40b5dd12796373e1199df1d5bcff3774c7bc9aa0b9bc6480f1c
|
data/lib/simple-mappr.rb
CHANGED
@@ -58,11 +58,9 @@ class SimpleMappr
|
|
58
58
|
if !file_title
|
59
59
|
raise InvalidParameterValue, "File path is required"
|
60
60
|
end
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
end
|
65
|
-
file
|
61
|
+
file_name = [file_title,output].join(".")
|
62
|
+
IO.copy_stream(open(create[:imageURL]), file_name)
|
63
|
+
file_name
|
66
64
|
end
|
67
65
|
|
68
66
|
##
|
@@ -6,15 +6,13 @@ 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
|
10
10
|
Validator.validate_type(params, 'Hash')
|
11
11
|
params.delete_if{ |k,v| v.nil? }
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
JSON.parse(response.body, :symbolize_names => true)
|
17
|
-
end
|
12
|
+
begin
|
13
|
+
RestClient::Request.execute(method: :post, url: API_URL, payload: params, max_redirects: 0)
|
14
|
+
rescue RestClient::ExceptionWithResponse => err
|
15
|
+
JSON.parse(err.response.body, :symbolize_names => true)
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
data/lib/simple-mappr/version.rb
CHANGED