paperclip-cloudfiles 2.3.1.1.5 → 2.3.1.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -24,6 +24,12 @@ on Gemcutter's gem server.
24
24
 
25
25
  ==Quick Start
26
26
 
27
+ In your environment.rb:
28
+
29
+ config.gem "paperclip-cloudfiles", :lib => 'paperclip'
30
+
31
+ This is because the gem name and the library name don't match.
32
+
27
33
  In your model:
28
34
 
29
35
  class User < ActiveRecord::Base
@@ -286,6 +286,7 @@ module Paperclip
286
286
  module CloudFile
287
287
  def self.extended base
288
288
  require 'cloudfiles'
289
+ @@container ||= {}
289
290
  base.instance_eval do
290
291
  @cloudfiles_credentials = parse_credentials(@options[:cloudfiles_credentials])
291
292
  @container_name = @options[:container] || @cloudfiles_credentials[:container]
@@ -305,14 +306,14 @@ module Paperclip
305
306
  @@cf ||= CloudFiles::Connection.new(@cloudfiles_credentials[:username], @cloudfiles_credentials[:api_key], true, @cloudfiles_credentials[:servicenet])
306
307
  end
307
308
 
309
+ def create_container
310
+ container = cloudfiles.create_container(@container_name)
311
+ container.make_public
312
+ container
313
+ end
314
+
308
315
  def cloudfiles_container
309
- if @container
310
- @container
311
- else
312
- @container = cloudfiles.create_container(@container_name)
313
- @container.make_public
314
- @container
315
- end
316
+ @@container[@container_name] ||= create_container
316
317
  end
317
318
 
318
319
  def container_name
data/lib/paperclip.rb CHANGED
@@ -46,7 +46,7 @@ end
46
46
  # documentation for Paperclip::ClassMethods for more useful information.
47
47
  module Paperclip
48
48
 
49
- VERSION = "2.3.1.1.5"
49
+ VERSION = "2.3.1.1.6"
50
50
 
51
51
  class << self
52
52
  # Provides configurability to Paperclip. There are a number of options available, such as:
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 3
8
8
  - 1
9
9
  - 1
10
- - 5
11
- version: 2.3.1.1.5
10
+ - 6
11
+ version: 2.3.1.1.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Jon Yurek
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-05 00:00:00 -06:00
20
+ date: 2010-04-19 00:00:00 -05:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency