polypaperclip 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +21 -0
- data/VERSION +1 -1
- data/lib/polypaperclip/attachment.rb +26 -0
- data/polypaperclip.gemspec +4 -3
- metadata +28 -28
data/README.rdoc
CHANGED
@@ -20,6 +20,27 @@ Add polypaperclip to your Gemfile.
|
|
20
20
|
Generate the migration that creates the attachments table for you. The migration adds an index for optimized querying.
|
21
21
|
|
22
22
|
rails g polypaperclip:migration
|
23
|
+
|
24
|
+
Create config/paperclip.yml to override default paperclip options for different environments
|
25
|
+
Credit: jspies http://www.jonathanspies.com/posts/6-Using-yaml-to-configure-default-options-for-Paperclip
|
26
|
+
|
27
|
+
development:
|
28
|
+
storage: s3
|
29
|
+
bucket: bucket-name
|
30
|
+
s3_credentials: "./config/s3.yml"
|
31
|
+
path: "public:url"
|
32
|
+
|
33
|
+
test:
|
34
|
+
storage: s3
|
35
|
+
bucket: bucket-name
|
36
|
+
s3_credentials: "./config/s3.yml"
|
37
|
+
path: "public:url"
|
38
|
+
|
39
|
+
production:
|
40
|
+
storage: s3
|
41
|
+
bucket: bucket-name
|
42
|
+
s3_credentials: "./config/s3.yml"
|
43
|
+
path: "public:url"
|
23
44
|
|
24
45
|
== Performance Note
|
25
46
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -1,5 +1,31 @@
|
|
1
1
|
module Polypaperclip
|
2
2
|
class Attachment < Paperclip::Attachment
|
3
|
+
|
4
|
+
def self.default_options
|
5
|
+
#Credit http://www.jonathanspies.com/posts/6-Using-yaml-to-configure-default-options-for-Paperclip
|
6
|
+
return @default_options if @default_options
|
7
|
+
|
8
|
+
@default_options ||= {
|
9
|
+
:url => "/system/:attachment/:id/:style/:filename",
|
10
|
+
:path => ":rails_root/public:url",
|
11
|
+
:styles => {},
|
12
|
+
:processors => [:thumbnail],
|
13
|
+
:convert_options => {},
|
14
|
+
:default_url => "/:attachment/:style/missing.png",
|
15
|
+
:default_style => :original,
|
16
|
+
:storage => :filesystem,
|
17
|
+
:use_timestamp => true,
|
18
|
+
:whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails],
|
19
|
+
:use_default_time_zone => true,
|
20
|
+
:hash_digest => "SHA1",
|
21
|
+
:hash_data => ":class/:attachment/:id/:style/:updated_at"
|
22
|
+
}
|
23
|
+
|
24
|
+
if defined?(RAILS_ROOT) and File.exists?("#{RAILS_ROOT}/config/paperclip.yml")
|
25
|
+
@default_options.merge!(YAML.load_file("#{RAILS_ROOT}/config/paperclip.yml")[RAILS_ENV].symbolize_keys)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
3
29
|
def initialize(name, instance, options = {})
|
4
30
|
super
|
5
31
|
|
data/polypaperclip.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{polypaperclip}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Pickett"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-05}
|
13
13
|
s.description = %q{hacks paperclip to have a single repo of attachments}
|
14
14
|
s.email = %q{dpickett@enlightsolutions.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.homepage = %q{http://github.com/dpickett/polypaperclip}
|
42
42
|
s.licenses = ["MIT"]
|
43
43
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.
|
44
|
+
s.rubygems_version = %q{1.3.7}
|
45
45
|
s.summary = %q{Polymorphic attachments with paperclip}
|
46
46
|
s.test_files = [
|
47
47
|
"spec/page_spec.rb",
|
@@ -49,6 +49,7 @@ Gem::Specification.new do |s|
|
|
49
49
|
]
|
50
50
|
|
51
51
|
if s.respond_to? :specification_version then
|
52
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
52
53
|
s.specification_version = 3
|
53
54
|
|
54
55
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polypaperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 19
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Pickett
|
@@ -15,11 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-05 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
type: :runtime
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
23
|
none: false
|
25
24
|
requirements:
|
@@ -31,11 +30,11 @@ dependencies:
|
|
31
30
|
- 8
|
32
31
|
- 7
|
33
32
|
version: 0.8.7
|
33
|
+
type: :runtime
|
34
34
|
name: rake
|
35
|
-
version_requirements: *id001
|
36
35
|
prerelease: false
|
36
|
+
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
-
type: :runtime
|
39
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
@@ -46,11 +45,11 @@ dependencies:
|
|
46
45
|
- 2
|
47
46
|
- 3
|
48
47
|
version: "2.3"
|
48
|
+
type: :runtime
|
49
49
|
name: paperclip
|
50
|
-
version_requirements: *id002
|
51
50
|
prerelease: false
|
51
|
+
version_requirements: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
|
-
type: :runtime
|
54
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
54
|
none: false
|
56
55
|
requirements:
|
@@ -62,11 +61,11 @@ dependencies:
|
|
62
61
|
- 0
|
63
62
|
- 0
|
64
63
|
version: 3.0.0
|
64
|
+
type: :runtime
|
65
65
|
name: rails
|
66
|
-
version_requirements: *id003
|
67
66
|
prerelease: false
|
67
|
+
version_requirements: *id003
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
type: :development
|
70
69
|
requirement: &id004 !ruby/object:Gem::Requirement
|
71
70
|
none: false
|
72
71
|
requirements:
|
@@ -76,11 +75,11 @@ dependencies:
|
|
76
75
|
segments:
|
77
76
|
- 0
|
78
77
|
version: "0"
|
78
|
+
type: :development
|
79
79
|
name: ruby-debug
|
80
|
-
version_requirements: *id004
|
81
80
|
prerelease: false
|
81
|
+
version_requirements: *id004
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
|
-
type: :development
|
84
83
|
requirement: &id005 !ruby/object:Gem::Requirement
|
85
84
|
none: false
|
86
85
|
requirements:
|
@@ -92,11 +91,11 @@ dependencies:
|
|
92
91
|
- 3
|
93
92
|
- 0
|
94
93
|
version: 2.3.0
|
94
|
+
type: :development
|
95
95
|
name: rspec
|
96
|
-
version_requirements: *id005
|
97
96
|
prerelease: false
|
97
|
+
version_requirements: *id005
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
type: :development
|
100
99
|
requirement: &id006 !ruby/object:Gem::Requirement
|
101
100
|
none: false
|
102
101
|
requirements:
|
@@ -108,11 +107,11 @@ dependencies:
|
|
108
107
|
- 6
|
109
108
|
- 0
|
110
109
|
version: 0.6.0
|
110
|
+
type: :development
|
111
111
|
name: yard
|
112
|
-
version_requirements: *id006
|
113
112
|
prerelease: false
|
113
|
+
version_requirements: *id006
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
|
-
type: :development
|
116
115
|
requirement: &id007 !ruby/object:Gem::Requirement
|
117
116
|
none: false
|
118
117
|
requirements:
|
@@ -124,11 +123,11 @@ dependencies:
|
|
124
123
|
- 0
|
125
124
|
- 0
|
126
125
|
version: 1.0.0
|
126
|
+
type: :development
|
127
127
|
name: bundler
|
128
|
-
version_requirements: *id007
|
129
128
|
prerelease: false
|
129
|
+
version_requirements: *id007
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
|
-
type: :development
|
132
131
|
requirement: &id008 !ruby/object:Gem::Requirement
|
133
132
|
none: false
|
134
133
|
requirements:
|
@@ -140,11 +139,11 @@ dependencies:
|
|
140
139
|
- 5
|
141
140
|
- 2
|
142
141
|
version: 1.5.2
|
142
|
+
type: :development
|
143
143
|
name: jeweler
|
144
|
-
version_requirements: *id008
|
145
144
|
prerelease: false
|
145
|
+
version_requirements: *id008
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
|
-
type: :development
|
148
147
|
requirement: &id009 !ruby/object:Gem::Requirement
|
149
148
|
none: false
|
150
149
|
requirements:
|
@@ -156,11 +155,11 @@ dependencies:
|
|
156
155
|
- 3
|
157
156
|
- 0
|
158
157
|
version: 1.3.0
|
158
|
+
type: :development
|
159
159
|
name: sqlite3-ruby
|
160
|
-
version_requirements: *id009
|
161
160
|
prerelease: false
|
161
|
+
version_requirements: *id009
|
162
162
|
- !ruby/object:Gem::Dependency
|
163
|
-
type: :development
|
164
163
|
requirement: &id010 !ruby/object:Gem::Requirement
|
165
164
|
none: false
|
166
165
|
requirements:
|
@@ -170,11 +169,11 @@ dependencies:
|
|
170
169
|
segments:
|
171
170
|
- 0
|
172
171
|
version: "0"
|
172
|
+
type: :development
|
173
173
|
name: rcov
|
174
|
-
version_requirements: *id010
|
175
174
|
prerelease: false
|
175
|
+
version_requirements: *id010
|
176
176
|
- !ruby/object:Gem::Dependency
|
177
|
-
type: :development
|
178
177
|
requirement: &id011 !ruby/object:Gem::Requirement
|
179
178
|
none: false
|
180
179
|
requirements:
|
@@ -184,9 +183,10 @@ dependencies:
|
|
184
183
|
segments:
|
185
184
|
- 0
|
186
185
|
version: "0"
|
186
|
+
type: :development
|
187
187
|
name: mocha
|
188
|
-
version_requirements: *id011
|
189
188
|
prerelease: false
|
189
|
+
version_requirements: *id011
|
190
190
|
description: hacks paperclip to have a single repo of attachments
|
191
191
|
email: dpickett@enlightsolutions.com
|
192
192
|
executables: []
|
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
requirements: []
|
248
248
|
|
249
249
|
rubyforge_project:
|
250
|
-
rubygems_version: 1.
|
250
|
+
rubygems_version: 1.3.7
|
251
251
|
signing_key:
|
252
252
|
specification_version: 3
|
253
253
|
summary: Polymorphic attachments with paperclip
|