netstorageapi 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/akamai/netstorage.rb +17 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4daec73ec1ad8aed1cfdf265537e45b60f70ccea
|
4
|
+
data.tar.gz: '0859f7214b61fd8af75424a3a371a6cc57bebe04'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d3a26b5667351524206abafd320f3acb5557045031dad101d22ac28ab2d5b7f37ff685e3f445b4124505ba4c6f3d4f7c3c930e53b5f75370b7247c037c2a3e
|
7
|
+
data.tar.gz: f6d6579283da2b4251fd8fc89fff62e345819259aaeb41c17587bd20b84671f443a71be2ef3a5abea0bd1c16191947e342fd69b2257192693b06a0392cd5c6b7
|
data/lib/akamai/netstorage.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Original author: Astin Choi <achoi@akamai.com>
|
4
4
|
|
5
|
-
# Copyright
|
5
|
+
# Copyright 2018 Akamai Technologies http://developer.akamai.com.
|
6
6
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
# you may not use this file except in compliance with the License.
|
@@ -131,8 +131,14 @@ module Akamai
|
|
131
131
|
|
132
132
|
public
|
133
133
|
|
134
|
-
def dir(ns_path)
|
135
|
-
return _request(action: "dir&format=xml",
|
134
|
+
def dir(ns_path, option={})
|
135
|
+
return _request(action: "dir&format=xml&#{URI.encode_www_form(option)}",
|
136
|
+
method: "GET",
|
137
|
+
path: ns_path)
|
138
|
+
end
|
139
|
+
|
140
|
+
def list(ns_path, option={})
|
141
|
+
return _request(action: "list&format=xml&#{URI.encode_www_form(option)}",
|
136
142
|
method: "GET",
|
137
143
|
path: ns_path)
|
138
144
|
end
|
@@ -202,15 +208,20 @@ module Akamai
|
|
202
208
|
path: ns_destination)
|
203
209
|
end
|
204
210
|
|
205
|
-
def upload(local_source, ns_destination)
|
211
|
+
def upload(local_source, ns_destination, index_zip=false)
|
206
212
|
if File.file?(local_source)
|
207
|
-
if ns_destination
|
213
|
+
if ns_destination.end_with?('/')
|
208
214
|
ns_destination = "#{ns_destination}#{File.basename(local_source)}"
|
209
215
|
end
|
210
216
|
else
|
211
217
|
raise NetstorageError, "[NetstorageError] #{ns_destination} doesn't exist or is directory"
|
212
218
|
end
|
213
|
-
|
219
|
+
action = "upload"
|
220
|
+
if index_zip == true or index_zip.to_s.downcase == "true"
|
221
|
+
action += "&index-zip=2"
|
222
|
+
end
|
223
|
+
|
224
|
+
return _request(action: action,
|
214
225
|
method: "PUT",
|
215
226
|
source: local_source,
|
216
227
|
path: ns_destination)
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Astin Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-07 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
|
@@ -17,7 +17,7 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/akamai/netstorage.rb
|
20
|
-
homepage: https://github.com/akamai
|
20
|
+
homepage: https://github.com/akamai/NetstorageKit-Ruby
|
21
21
|
licenses:
|
22
22
|
- Apache
|
23
23
|
metadata: {}
|
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
39
|
rubyforge_project:
|
40
|
-
rubygems_version: 2.
|
40
|
+
rubygems_version: 2.5.2
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
43
|
summary: Akamai Netstorage API for Ruby
|