uber-s3 0.2.1 → 0.2.2

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/lib/uber-s3.rb CHANGED
@@ -11,17 +11,22 @@ require 'mime/types'
11
11
  class UberS3
12
12
  extend Forwardable
13
13
 
14
- attr_accessor :connection, :bucket
14
+ attr_reader :connection
15
+ attr_accessor :bucket, :options
15
16
  def_delegators :@bucket, :store, :set, :object, :get, :head, :[], :exists?, :objects
16
17
 
17
18
  def initialize(options={})
18
- self.connection = Connection.open(self, options)
19
- self.bucket = options[:bucket]
19
+ self.options = options
20
+ self.bucket = options[:bucket]
20
21
  end
21
-
22
+
22
23
  def inspect
23
24
  "#<UberS3 client v#{UberS3::VERSION}>"
24
25
  end
26
+
27
+ def connection
28
+ Thread.current['[uber-s3]:connection'] ||= Connection.open(self, options)
29
+ end
25
30
 
26
31
  def bucket=(bucket)
27
32
  @bucket = bucket.is_a?(String) ? Bucket.new(self, bucket) : bucket
@@ -16,7 +16,7 @@ module UberS3::Operation::Object
16
16
  module InstanceMethods
17
17
 
18
18
  # Default mime-types to be auto-gzipped if gzip == :web
19
- WEB_GZIP_TYPES = ['text/html', 'text/plain', 'text/css',
19
+ WEB_GZIP_TYPES = ['text/html', 'text/plain', 'text/css', 'application/json',
20
20
  'application/javascript', 'application/x-javascript',
21
21
  'text/xml', 'application/xml', 'application/xml+rss']
22
22
 
@@ -1,3 +1,3 @@
1
1
  class UberS3
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uber-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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: 2012-04-24 00:00:00.000000000 Z
12
+ date: 2012-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mime-types