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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/akamai/netstorage.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98536983f38afcef837d9ecdab5e5728420e700f
4
- data.tar.gz: fb7cb2e986b5ef90f9b275932eeb7903438a6341
3
+ metadata.gz: 5b1bab088722b58d1273af1899566832074d68aa
4
+ data.tar.gz: 688562a84441a08b097cb9566133301ef3e388e2
5
5
  SHA512:
6
- metadata.gz: e5d4b6568b60b88f5477cb76d826e3ab2c6dea3b021042bf449883f3ea3bf7732b90bf1a82d9ae7268ee6667de4e1d4f135bd49bfcc436fd36213ac04f9f74db
7
- data.tar.gz: b1b19da5b75668dfc3ee39b553c65eb71b136d02cd6966932933b8ba165a1cb609bf67c32ac59e4ac014ce14d21f52bc4b211ec62782f369402e82308e61b75f
6
+ metadata.gz: bd8bfa7f71832578ff69b2c62bee5552353f73d6644aa64290558ce861b77f7c8c445ab4b7859be1659c45e0aba7a92d0972ad16c496ecc7fa68368dfd23fdda
7
+ data.tar.gz: 670f732c00520aed12b87aa9c082ce6ca5ea6cfa9f739e73d1f98645d4d4dc6c91211f096f441cb921b6cfac7ec26b5c6599ae8824fa1ea502a7a4ea3d3d10ea
@@ -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
- ns_filename = kwargs[:path][-1] != '/' ? File.basename(kwargs[:path]) : nil
55
+
56
56
  if local_destination == ''
57
- local_destination = ns_filename
57
+ local_destination = File.basename(kwargs[:path])
58
58
  elsif File.directory?(local_destination)
59
- local_destination = File.join(local_destination, ns_filename)
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.0
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-09-19 00:00:00.000000000 Z
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