swift_client 0.0.8 → 0.0.9
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.
- data/.travis.yml +13 -0
- data/README.md +6 -1
- data/lib/swift_client.rb +2 -0
- data/lib/swift_client/version.rb +1 -1
- data/test/swift_client_test.rb +6 -0
- metadata +3 -2
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
[](http://travis-ci.org/mrkamel/swift_client)
|
2
|
+
[](https://codeclimate.com/github/mrkamel/swift_client)
|
3
|
+
[](https://gemnasium.com/mrkamel/swift_client)
|
4
|
+
[](http://badge.fury.io/rb/swift_client)
|
5
|
+
|
1
6
|
# SwiftClient
|
2
7
|
|
3
8
|
Small but powerful client to interact with OpenStack Swift.
|
@@ -66,7 +71,7 @@ SwiftClient offers the following requests:
|
|
66
71
|
* head_object(object_name, container_name) -> HTTParty::Response
|
67
72
|
* delete_object(object_name, container_name) -> HTTParty::Response
|
68
73
|
* get_objects(container_name, query = {}) -> HTTParty::Response
|
69
|
-
*
|
74
|
+
* paginate_objects(container_name, query = {}) -> Enumerator
|
70
75
|
* public_url(object_name, container_name) -> HTTParty::Response
|
71
76
|
* temp_url(object_name, container_name) -> HTTParty::Response
|
72
77
|
|
data/lib/swift_client.rb
CHANGED
data/lib/swift_client/version.rb
CHANGED
data/test/swift_client_test.rb
CHANGED
@@ -136,6 +136,12 @@ class SwiftClientTest < MiniTest::Test
|
|
136
136
|
assert_equal 201, @swift_client.put_object("object", "data", "container", "X-Object-Meta-Test" => "Test").code
|
137
137
|
end
|
138
138
|
|
139
|
+
def test_put_object_with_renewed_authorization
|
140
|
+
stub_request(:put, "https://example.com/v1/AUTH_account/container/object").with(:body => "data", :headers => { "Transfer-Encoding" => "chunked", "Content-Type" => "application/octet-stream", "Accept" => "application/json", "X-Auth-Token" => "Token" }).to_return({ :status => 401, :body => "", :headers => {}}, { :status => 201, :body => "", :headers => {}})
|
141
|
+
|
142
|
+
assert_equal 201, @swift_client.put_object("object", "data", "container").code
|
143
|
+
end
|
144
|
+
|
139
145
|
def test_put_object_without_mime_type
|
140
146
|
stub_request(:put, "https://example.com/v1/AUTH_account/container/object.jpg").with(:body => "data", :headers => { "Transfer-Encoding" => "chunked", "Accept" => "application/json", "Content-Type" => "image/jpeg", "X-Auth-Token" => "Token", "X-Object-Meta-Test" => "Test" }).to_return(:status => 201, :body => "", :headers => {})
|
141
147
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swift_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -115,6 +115,7 @@ extensions: []
|
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
117
|
- .gitignore
|
118
|
+
- .travis.yml
|
118
119
|
- Gemfile
|
119
120
|
- LICENSE.txt
|
120
121
|
- README.md
|