paperclip-cloudfiles 2.3.8.3 → 2.3.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,14 +102,22 @@ module Paperclip
102
102
  cloudfiles_container.object_exists?(path(style))
103
103
  end
104
104
 
105
- def read
106
- self.data
105
+ def read(style = default_style)
106
+ cloudfiles_container.object(path(style)).data
107
107
  end
108
108
 
109
109
  # Returns representation of the data of the file assigned to the given
110
110
  # style, in the format most representative of the current storage.
111
111
  def to_file style = default_style
112
- @queued_for_write[style] || cloudfiles_container.create_object(path(style))
112
+ return @queued_for_write[style] if @queued_for_write[style]
113
+ filename = path(style)
114
+ extname = File.extname(filename)
115
+ basename = File.basename(filename, extname)
116
+ file = Tempfile.new([basename, extname])
117
+ file.binmode
118
+ file.write(cloudfiles_container.object(path(style)).data)
119
+ file.rewind
120
+ return file
113
121
  end
114
122
  alias_method :to_io, :to_file
115
123
 
@@ -1,3 +1,3 @@
1
1
  module Paperclip
2
- VERSION = "2.3.8.3" unless defined? Paperclip::VERSION
2
+ VERSION = "2.3.8.4" unless defined? Paperclip::VERSION
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-cloudfiles
3
3
  version: !ruby/object:Gem::Version
4
- hash: 81
4
+ hash: 95
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
9
  - 8
10
- - 3
11
- version: 2.3.8.3
10
+ - 4
11
+ version: 2.3.8.4
12
12
  platform: ruby
13
13
  authors:
14
14
  - Jon Yurek
@@ -17,12 +17,10 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-03-10 00:00:00 -05:00
20
+ date: 2011-04-06 00:00:00 -04:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- prerelease: false
25
- type: :runtime
26
24
  requirement: &id001 !ruby/object:Gem::Requirement
27
25
  none: false
28
26
  requirements:
@@ -32,11 +30,11 @@ dependencies:
32
30
  segments:
33
31
  - 0
34
32
  version: "0"
33
+ prerelease: false
34
+ type: :runtime
35
35
  name: activerecord
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
38
- prerelease: false
39
- type: :runtime
40
38
  requirement: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
40
  requirements:
@@ -46,11 +44,11 @@ dependencies:
46
44
  segments:
47
45
  - 0
48
46
  version: "0"
47
+ prerelease: false
48
+ type: :runtime
49
49
  name: activesupport
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
52
- prerelease: false
53
- type: :development
54
52
  requirement: &id003 !ruby/object:Gem::Requirement
55
53
  none: false
56
54
  requirements:
@@ -60,11 +58,11 @@ dependencies:
60
58
  segments:
61
59
  - 0
62
60
  version: "0"
61
+ prerelease: false
62
+ type: :development
63
63
  name: shoulda
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- prerelease: false
67
- type: :development
68
66
  requirement: &id004 !ruby/object:Gem::Requirement
69
67
  none: false
70
68
  requirements:
@@ -74,11 +72,11 @@ dependencies:
74
72
  segments:
75
73
  - 0
76
74
  version: "0"
75
+ prerelease: false
76
+ type: :development
77
77
  name: appraisal
78
78
  version_requirements: *id004
79
79
  - !ruby/object:Gem::Dependency
80
- prerelease: false
81
- type: :development
82
80
  requirement: &id005 !ruby/object:Gem::Requirement
83
81
  none: false
84
82
  requirements:
@@ -88,11 +86,11 @@ dependencies:
88
86
  segments:
89
87
  - 0
90
88
  version: "0"
89
+ prerelease: false
90
+ type: :development
91
91
  name: mocha
92
92
  version_requirements: *id005
93
93
  - !ruby/object:Gem::Dependency
94
- prerelease: false
95
- type: :development
96
94
  requirement: &id006 !ruby/object:Gem::Requirement
97
95
  none: false
98
96
  requirements:
@@ -102,11 +100,11 @@ dependencies:
102
100
  segments:
103
101
  - 0
104
102
  version: "0"
103
+ prerelease: false
104
+ type: :development
105
105
  name: aws-s3
106
106
  version_requirements: *id006
107
107
  - !ruby/object:Gem::Dependency
108
- prerelease: false
109
- type: :development
110
108
  requirement: &id007 !ruby/object:Gem::Requirement
111
109
  none: false
112
110
  requirements:
@@ -118,11 +116,11 @@ dependencies:
118
116
  - 4
119
117
  - 15
120
118
  version: 1.4.15
119
+ prerelease: false
120
+ type: :development
121
121
  name: cloudfiles
122
122
  version_requirements: *id007
123
123
  - !ruby/object:Gem::Dependency
124
- prerelease: false
125
- type: :development
126
124
  requirement: &id008 !ruby/object:Gem::Requirement
127
125
  none: false
128
126
  requirements:
@@ -132,6 +130,8 @@ dependencies:
132
130
  segments:
133
131
  - 0
134
132
  version: "0"
133
+ prerelease: false
134
+ type: :development
135
135
  name: sqlite3-ruby
136
136
  version_requirements: *id008
137
137
  description: Easy upload management for ActiveRecord with Rackspace Cloud Files support