netstorageapi 0.8.0 → 0.8.1
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 +4 -4
- data/lib/akamai/netstorage.rb +7 -3
- 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: 5b1bab088722b58d1273af1899566832074d68aa
|
4
|
+
data.tar.gz: 688562a84441a08b097cb9566133301ef3e388e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd8bfa7f71832578ff69b2c62bee5552353f73d6644aa64290558ce861b77f7c8c445ab4b7859be1659c45e0aba7a92d0972ad16c496ecc7fa68368dfd23fdda
|
7
|
+
data.tar.gz: 670f732c00520aed12b87aa9c082ce6ca5ea6cfa9f739e73d1f98645d4d4dc6c91211f096f441cb921b6cfac7ec26b5c6599ae8824fa1ea502a7a4ea3d3d10ea
|
data/lib/akamai/netstorage.rb
CHANGED
@@ -52,11 +52,11 @@ module Akamai
|
|
52
52
|
def _response(uri, kwargs)
|
53
53
|
if kwargs[:action] == "download"
|
54
54
|
local_destination = kwargs[:destination]
|
55
|
-
|
55
|
+
|
56
56
|
if local_destination == ''
|
57
|
-
local_destination =
|
57
|
+
local_destination = File.basename(kwargs[:path])
|
58
58
|
elsif File.directory?(local_destination)
|
59
|
-
local_destination = File.join(local_destination,
|
59
|
+
local_destination = File.join(local_destination, File.basename(kwargs[:path]))
|
60
60
|
end
|
61
61
|
|
62
62
|
response = Net::HTTP.start(uri.hostname, uri.port,
|
@@ -138,6 +138,10 @@ module Akamai
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def download(ns_source, local_destination='')
|
141
|
+
if ns_source.end_with?('/')
|
142
|
+
raise NetstorageError, "[NetstorageError] Nestorage download path shouldn't be a directory: #{ns_source}"
|
143
|
+
end
|
144
|
+
|
141
145
|
return _request(action: "download",
|
142
146
|
method: "GET",
|
143
147
|
path: ns_source,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netstorageapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Astin Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: NetstorageAPI is Akamai Netstorage (File/Object Store) API for Ruby 2.0+
|
14
14
|
email: achoi@akamai.com
|