fluoride-collector 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c5a859fb19f96aa3640e06ba654c5fbe887ea06
4
- data.tar.gz: 0a295ed1d22617b187be2a446fcf58042edadb06
3
+ metadata.gz: a54cd336efc2c5d59e2c9cd3a00c6ca579f8f155
4
+ data.tar.gz: 7bb320297f6e4620811a116eede521c5fbc4e203
5
5
  SHA512:
6
- metadata.gz: da0889ab97c77b64a3ccdc2489a8a85c2262397fb5c57aa250b90e7c27ba05116de989da726bd2e5083a159aaa2ecf316971555ba33cec5cab46caee7882c7fb
7
- data.tar.gz: 795e63f92f12646eb040715c87d1338bd86309dabd95def0982c153f864345dd720efe8cdd8f5b3d29d573a4e3bf8baa665a9afedcd3fb0672697d03cfbd47f8
6
+ metadata.gz: 9ed9b473dcaadd0cf257e72355171204f7c0d75f29ef417f799d5dd9adf2a92a9d18bfede4b58cd74195e006f425fbb20e58569ef85a71cba63fb15fc61e5dc2
7
+ data.tar.gz: 67fe004ab0c308a96d8113e4d8774354d549640d5143e32a03647ec194ee8bef1bfa7ea4961942db8a59959bd5918357e2afb4ae9edddc8b8df29a26a6e6cd63
@@ -7,9 +7,10 @@ module Fluoride
7
7
  module Collector
8
8
  class Storage
9
9
  class S3 < Storage
10
+ attr_reader :response
10
11
  def write
11
- Net::HTTP.start(host, port) do |http|
12
- res = http.request(put_request)
12
+ Net::HTTP.start(host, port, :use_ssl => true) do |http|
13
+ @response = http.request(put_request)
13
14
  end
14
15
  end
15
16
 
@@ -50,7 +51,7 @@ module Fluoride
50
51
  end
51
52
 
52
53
  def authorization
53
- hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new, string_to_sign, access_secret)
54
+ hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new, access_secret, string_to_sign)
54
55
  signature = Base64.strict_encode64(hmac)
55
56
 
56
57
  "AWS #{key_id}:#{signature}"
@@ -69,17 +70,20 @@ module Fluoride
69
70
  end
70
71
 
71
72
  def date
72
- @date ||= Time.now.strftime("+%a, %d %h %Y %T %z")
73
+ @date ||= Time.now.strftime("%a, %d %h %Y %T %z")
73
74
  end
74
75
 
75
76
  def put_request
76
- req = Net::HTTP::Put.new(uri)
77
- req["Authorization"] = authorization
78
- req["Date"] = date
79
- req["Content-MD5"] = content_md5
80
- req["Content-Type"] = content_type
81
- req.body = record_yaml
82
- return req
77
+ @req ||=
78
+ begin
79
+ req = Net::HTTP::Put.new(uri)
80
+ req["Authorization"] = authorization
81
+ req["Date"] = date
82
+ req["Content-MD5"] = content_md5
83
+ req["Content-Type"] = content_type
84
+ req.body = record_yaml
85
+ req
86
+ end
83
87
  end
84
88
  end
85
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluoride-collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Judson Lester
@@ -46,7 +46,7 @@ rdoc_options:
46
46
  - --main
47
47
  - doc/README
48
48
  - --title
49
- - fluoride-collector-0.0.4 Documentation
49
+ - fluoride-collector-0.0.5 Documentation
50
50
  require_paths:
51
51
  - lib/
52
52
  required_ruby_version: !ruby/object:Gem::Requirement