paperclip-defaults 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/paperclip-defaults/version.rb +1 -1
- data/lib/paperclip-defaults.rb +9 -4
- metadata +30 -30
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Paperclip::Defaults [![Build Status](
|
1
|
+
Paperclip::Defaults [![Build Status](https://secure.travis-ci.org/socialreferral/paperclip-defaults.png)](http://travis-ci.org/socialreferral/paperclip-defaults)
|
2
2
|
==============
|
3
3
|
Configurable Rails application wide defaults for Paperclip.
|
4
4
|
|
data/lib/paperclip-defaults.rb
CHANGED
@@ -12,11 +12,16 @@ module Paperclip
|
|
12
12
|
module ClassMethods
|
13
13
|
alias_method :has_attached_file_without_defaults, :has_attached_file
|
14
14
|
def has_attached_file_with_defaults(name, options = {})
|
15
|
-
if options[:default_asset_url]
|
16
|
-
options[:default_url] = ActionController::Base.new.view_context.asset_path(options[:default_asset_url])
|
17
|
-
options.delete(:default_asset_url)
|
18
|
-
end
|
19
15
|
paperclip_options = ::Rails.application.config.paperclip_defaults.merge(options)
|
16
|
+
if paperclip_options[:default_asset_url]
|
17
|
+
begin
|
18
|
+
paperclip_options[:default_url] = ActionController::Base.new.view_context.asset_path(paperclip_options[:default_asset_url])
|
19
|
+
rescue StandardError => e
|
20
|
+
::Rails.logger.warn("Could not set default asset url for '#{default_options[:default_asset_url]}'")
|
21
|
+
end
|
22
|
+
|
23
|
+
paperclip_options.delete(:default_asset_url)
|
24
|
+
end
|
20
25
|
has_attached_file_without_defaults(name, paperclip_options)
|
21
26
|
end
|
22
27
|
alias_method :has_attached_file, :has_attached_file_with_defaults
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-defaults
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &8985260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *8985260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mocha
|
27
|
-
requirement: &
|
27
|
+
requirement: &9591040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *9591040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard
|
38
|
-
requirement: &
|
38
|
+
requirement: &9588960 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *9588960
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: guard-bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &9587920 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *9587920
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: guard-minitest
|
60
|
-
requirement: &
|
60
|
+
requirement: &9587020 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *9587020
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rb-inotify
|
71
|
-
requirement: &
|
71
|
+
requirement: &9585660 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *9585660
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: libnotify
|
82
|
-
requirement: &
|
82
|
+
requirement: &9584900 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *9584900
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: activerecord
|
93
|
-
requirement: &
|
93
|
+
requirement: &9597800 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *9597800
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: sqlite3
|
104
|
-
requirement: &
|
104
|
+
requirement: &9596340 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *9596340
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rake
|
115
|
-
requirement: &
|
115
|
+
requirement: &9595280 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *9595280
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: paperclip
|
126
|
-
requirement: &
|
126
|
+
requirement: &9592680 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *9592680
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: activesupport
|
137
|
-
requirement: &
|
137
|
+
requirement: &9610920 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *9610920
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: rails
|
148
|
-
requirement: &
|
148
|
+
requirement: &9610100 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *9610100
|
157
157
|
description: Configurable application wide defaults for Paperclip
|
158
158
|
email:
|
159
159
|
- mark@socialreferral.com
|
@@ -195,10 +195,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '0'
|
196
196
|
segments:
|
197
197
|
- 0
|
198
|
-
hash:
|
198
|
+
hash: 3647513342438907165
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
|
-
rubygems_version: 1.8.
|
201
|
+
rubygems_version: 1.8.10
|
202
202
|
signing_key:
|
203
203
|
specification_version: 3
|
204
204
|
summary: Configurable application wide defaults for Paperclip
|