nvx-sds 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/RELEASENOTES +4 -0
- data/lib/nvx/sds/httpdownload.rb +2 -2
- data/lib/nvx/sds/httpupload.rb +2 -2
- data/lib/nvx/sds/transport.rb +9 -2
- metadata +2 -2
data/RELEASENOTES
CHANGED
data/lib/nvx/sds/httpdownload.rb
CHANGED
@@ -25,9 +25,9 @@ module NVX
|
|
25
25
|
# = Overview
|
26
26
|
# Retrieves a file from the remote server and saves it to the local file system.
|
27
27
|
class HttpDownload
|
28
|
-
USERAGENT = "Nirvanix Ruby SDK"
|
28
|
+
USERAGENT = "Nirvanix Ruby SDK" unless const_defined? "USERAGENT"
|
29
29
|
Newline = "\r\n" unless const_defined? "Newline"
|
30
|
-
BLOCKSIZE = 1024*1024 * 4
|
30
|
+
BLOCKSIZE = 1024*1024 * 4 unless const_defined? "BLOCKSIZE"
|
31
31
|
|
32
32
|
# = Overview
|
33
33
|
# Retrieves a file from the remote server and saves it to the local file system
|
data/lib/nvx/sds/httpupload.rb
CHANGED
@@ -14,11 +14,11 @@ require 'uri'
|
|
14
14
|
module NVX
|
15
15
|
module SDS
|
16
16
|
|
17
|
-
USERAGENT = "Nirvanix Ruby SDK"
|
17
|
+
USERAGENT = "Nirvanix Ruby SDK" unless const_defined? "USERAGENT"
|
18
18
|
Newline = "\r\n" unless const_defined? "Newline"
|
19
19
|
# upload 4 Mb chunks. 4 Mb is usually quite efficient but you may want to change this
|
20
20
|
# to a larger value if you are on a very fast connection or have very high latency.
|
21
|
-
BLOCKSIZE = 1024 * 1024 * 4
|
21
|
+
BLOCKSIZE = 1024 * 1024 * 4 unless const_defined? "BLOCKSIZE"
|
22
22
|
|
23
23
|
# = Overview
|
24
24
|
#
|
data/lib/nvx/sds/transport.rb
CHANGED
@@ -15,7 +15,8 @@ module NVX
|
|
15
15
|
require 'uri'
|
16
16
|
|
17
17
|
Newline = "\r\n" unless const_defined? "Newline"
|
18
|
-
|
18
|
+
USERAGENT = "Nirvanix Ruby SDK" unless const_defined? "USERAGENT"
|
19
|
+
|
19
20
|
# = Overview
|
20
21
|
#
|
21
22
|
# This is an internal class that handles the requests and responses from the Nirvanix REST web services.
|
@@ -52,8 +53,14 @@ module NVX
|
|
52
53
|
# put the SSL in the correct mode based on the apicommand
|
53
54
|
h.use_ssl = apicommand.is_secure?
|
54
55
|
|
56
|
+
# Set the headers to avoid an issue in certain versions of Ruby (1.8.4)
|
57
|
+
headers = {
|
58
|
+
'Content-Type' => 'application/x-www-form-urlencoded',
|
59
|
+
'User-Agent' => USERAGENT
|
60
|
+
}
|
61
|
+
|
55
62
|
# do the command and return the response.
|
56
|
-
response = h.post(url, params)
|
63
|
+
response = h.post(url, params, headers)
|
57
64
|
|
58
65
|
#print "OUTPUT URL: " + rest_api_url + url + "\r\n\r\n"
|
59
66
|
#print "RESPONSE XML: " + response.body + "\r\n\r\n"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nvx-sds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barry Ruffner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-22 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|