rabbit_swift 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7b83e0622bbb373887ef857e296df667d3144e2
4
- data.tar.gz: 8c7c986bc62c8282f43c113b47ec0583cee1da06
3
+ metadata.gz: fd3a3a34458347d6a54a79408cf8793a18f32c2e
4
+ data.tar.gz: 748a6daa62ba05ecf07e9b927df1260839075354
5
5
  SHA512:
6
- metadata.gz: f1a4600366624f4b41a12c84ff1b7531b18a43a951bc45a45baf3d3ce4dece15db822cfe9e1e846a5b2c655fe92d2ccee2646ba46554f27c5365e890dc19f71f
7
- data.tar.gz: dae051dbe539283c7f92343c6e8aa0032da36dd6f747634d4759b64c924fe61cb0c8a902ea016b0ebeed3da13859617fd968983920a00a5728d0741542d3951c
6
+ metadata.gz: 8423c7faccaf15d1ed43993302041fcf7b67565fb373a6a2478ded4c2cf9e669c22602889d5e196fc97afb1f64d0a10c91ec8f0de6db81ce6f7b249de6f0d8d3
7
+ data.tar.gz: b6231e027f0d94e81d6ab3a8b0b257bd5cf12fef1f4f17d81b5270b9d9e3c90d40f1839a9f1af7bf1dbeaffae448059056a13453575200a146f641e2566955b5
@@ -10,6 +10,7 @@ module RabbitSwift
10
10
  class Client
11
11
 
12
12
  UPLOAD_SUCCESS_HTTP_STATUS_CODE = 201
13
+ HEAD_SUCCESS_HTTP_STATUS_CODE = 204
13
14
 
14
15
  def initialize(opt)
15
16
  @auth_url = opt['auth_url']
@@ -36,6 +37,16 @@ module RabbitSwift
36
37
  response_json_body['access']['token']['id']
37
38
  end
38
39
 
40
+ def head(token, end_point, object_path)
41
+ auth_header = {
42
+ 'X-Auth-Token' => token
43
+ }
44
+ target_url = add_filename_to_url(end_point, file_path)
45
+ http_client = HTTPClient.new
46
+ response = http_client.head(URI.parse(URI.encode(target_url)))
47
+ response
48
+ end
49
+
39
50
  # curl -i -X PUT -H "X-Auth-Token: トークン" オブジェクトストレージエンドポイント/コンテナ名/ -T オブジェクトへのパス
40
51
  def upload(token, end_point, input_file_path)
41
52
  #相対パスがきた時のために絶対パスに変換
@@ -1,3 +1,3 @@
1
1
  module RabbitSwift
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_swift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AKB428