radiant-clipped-extension 1.0.6 → 1.0.7
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/Rakefile +2 -2
- data/app/models/asset.rb +10 -8
- data/app/models/asset_type.rb +56 -11
- data/app/views/admin/assets/_asset_table.html.haml +2 -2
- data/clipped_extension.rb +3 -3
- data/config/initializers/radiant_config.rb +1 -1
- data/lib/asset_tags.rb +1 -1
- data/lib/radiant-clipped-extension.rb +6 -6
- data/public/stylesheets/sass/admin/assets.sass +32 -16
- data/radiant-clipped-extension.gemspec +4 -9
- data/spec/lib/asset_tags_spec.rb +5 -4
- data/spec/models/asset_type_spec.rb +7 -4
- data/spec/models/post_processing_spec.rb +1 -0
- data/spec/spec.opts +1 -0
- metadata +5 -5
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ unless defined? RADIANT_ROOT
|
|
12
12
|
end
|
13
13
|
|
14
14
|
require 'rake'
|
15
|
-
require '
|
15
|
+
require 'rdoc/task'
|
16
16
|
require 'rake/testtask'
|
17
17
|
|
18
18
|
rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
|
@@ -97,7 +97,7 @@ namespace :spec do
|
|
97
97
|
end
|
98
98
|
|
99
99
|
desc 'Generate documentation for the clipped extension.'
|
100
|
-
|
100
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
101
101
|
rdoc.rdoc_dir = 'rdoc'
|
102
102
|
rdoc.title = 'ClippedExtension'
|
103
103
|
rdoc.options << '--line-numbers' << '--inline-source'
|
data/app/models/asset.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
class Asset < ActiveRecord::Base
|
2
|
-
|
3
2
|
has_many :page_attachments, :dependent => :destroy
|
4
3
|
has_many :pages, :through => :page_attachments
|
5
4
|
has_site if respond_to? :has_site
|
6
5
|
|
7
6
|
belongs_to :created_by, :class_name => 'User'
|
8
7
|
belongs_to :updated_by, :class_name => 'User'
|
9
|
-
|
8
|
+
|
10
9
|
default_scope :order => "created_at DESC"
|
11
|
-
|
10
|
+
|
12
11
|
named_scope :latest, lambda { |limit|
|
13
12
|
{ :order => "created_at DESC", :limit => limit }
|
14
13
|
}
|
@@ -103,10 +102,13 @@ class Asset < ActiveRecord::Base
|
|
103
102
|
end
|
104
103
|
|
105
104
|
def geometry(style_name='original')
|
106
|
-
|
105
|
+
@geometry ||= {}
|
106
|
+
@geometry[style_name] ||= if style_name.to_s == 'original'
|
107
107
|
original_geometry
|
108
|
-
elsif style = asset.styles[style_name.to_sym] # asset.styles
|
108
|
+
elsif style = self.asset.styles[style_name.to_sym] # self.asset.styles holds Style objects, where self.paperclip_styles is still just rule hashes
|
109
109
|
original_geometry.transformed_by(style.geometry)
|
110
|
+
else
|
111
|
+
raise PaperclipError, "Requested style #{style_name} is not defined."
|
110
112
|
end
|
111
113
|
end
|
112
114
|
|
@@ -146,7 +148,7 @@ class Asset < ActiveRecord::Base
|
|
146
148
|
end
|
147
149
|
|
148
150
|
def dimensions_known?
|
149
|
-
|
151
|
+
original_width? && original_height?
|
150
152
|
end
|
151
153
|
|
152
154
|
private
|
@@ -168,11 +170,11 @@ private
|
|
168
170
|
end
|
169
171
|
|
170
172
|
def assign_title
|
171
|
-
self.title = basename
|
173
|
+
self.title = basename unless title?
|
172
174
|
end
|
173
175
|
|
174
176
|
def assign_uuid
|
175
|
-
self.uuid = UUIDTools::UUID.timestamp_create.to_s
|
177
|
+
self.uuid = UUIDTools::UUID.timestamp_create.to_s unless uuid?
|
176
178
|
end
|
177
179
|
|
178
180
|
class << self
|
data/app/models/asset_type.rb
CHANGED
@@ -23,6 +23,7 @@ class AssetType
|
|
23
23
|
@icon_name = options[:icon] || name
|
24
24
|
@processors = options[:processors] || []
|
25
25
|
@styles = options[:styles] || {}
|
26
|
+
@styles = standard_styles if @styles == :standard
|
26
27
|
@default_radius_tag = options[:default_radius_tag] || 'link'
|
27
28
|
@extensions = options[:extensions] || []
|
28
29
|
@extensions.each { |ext| @@extension_lookup[ext] ||= self }
|
@@ -46,7 +47,7 @@ class AssetType
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def icon(style_name='icon')
|
49
|
-
if File.exist?("
|
50
|
+
if File.exist?(Rails.root + "public/images/admin/assets/#{icon_name}_#{style_name.to_s}.png")
|
50
51
|
return "/images/admin/assets/#{icon_name}_#{style_name.to_s}.png"
|
51
52
|
else
|
52
53
|
return "/images/admin/assets/#{icon_name}_icon.png"
|
@@ -54,7 +55,7 @@ class AssetType
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def icon_path(style_name='icon')
|
57
|
-
"
|
58
|
+
Rails.root + "public#{icon(style_name)}"
|
58
59
|
end
|
59
60
|
|
60
61
|
def condition
|
@@ -89,24 +90,68 @@ class AssetType
|
|
89
90
|
Radiant.config["assets.create_#{name}_thumbnails?"] ? processors : []
|
90
91
|
end
|
91
92
|
|
93
|
+
# Parses and combines the various ways in which paperclip styles can be defined, and normalises them into
|
94
|
+
# the format that paperclip expects. Note that :styles => :standard has already been replaced with the
|
95
|
+
# results of a call to standard_styles.
|
96
|
+
# Styles are passed to paperclip as a hash and arbitrary keys can be passed through from configuration.
|
97
|
+
#
|
92
98
|
def paperclip_styles
|
93
|
-
if
|
94
|
-
|
95
|
-
|
99
|
+
# Styles are not relevant if processors are not defined.
|
100
|
+
# TODO: should this default to an icon set?
|
101
|
+
@paperclip_styles ||= if paperclip_processors.any?
|
102
|
+
normalize_style_rules(configured_styles.merge(styles))
|
96
103
|
else
|
97
104
|
{}
|
98
105
|
end
|
106
|
+
@paperclip_styles
|
107
|
+
end
|
108
|
+
|
109
|
+
# Takes a motley collection of differently-defined styles and renders them into the standard hash-of-hashes format.
|
110
|
+
# Solitary strings are assumed to be
|
111
|
+
#TODO: define permitted and/or expected options for the asset type and pass through that subset of the style-definition hash
|
112
|
+
#
|
113
|
+
def normalize_style_rules(styles={})
|
114
|
+
styles.each_pair do |name, rule|
|
115
|
+
unless rule.is_a? Hash
|
116
|
+
if rule =~ /\=/
|
117
|
+
parameters = rule.split(',').collect{ |parameter| parameter.split('=') } # array of pairs
|
118
|
+
rule = Hash[parameters].symbolize_keys # into hash of :first => last
|
119
|
+
else
|
120
|
+
rule = {:geometry => rule} # simplest case: name:geom|name:geom
|
121
|
+
end
|
122
|
+
end
|
123
|
+
rule[:geometry] ||= rule.delete(:size)
|
124
|
+
styles[name.to_sym] = rule
|
125
|
+
end
|
126
|
+
styles
|
127
|
+
end
|
128
|
+
|
129
|
+
def standard_styles
|
130
|
+
{
|
131
|
+
:native => { :geometry => "", :format => :jpg },
|
132
|
+
:icon => { :geometry => '42x42#', :format => :png },
|
133
|
+
:thumbnail => { :geometry => '100x100#', :format => :png }
|
134
|
+
}
|
99
135
|
end
|
100
136
|
|
137
|
+
# Paperclip styles are defined in the config entry `assets.thumbnails.asset_type`, with the format:
|
138
|
+
# foo:key-x,key=y,key=z|bar:key-x,key=y,key=z
|
139
|
+
# where 'key' can be any parameter understood by your paperclip processors. Usually they include :geometry and :format.
|
140
|
+
# A typical entry would be:
|
141
|
+
#
|
142
|
+
# standard:geometry=640x640>,format=jpg
|
143
|
+
#
|
144
|
+
# This method parses that string and returns the defined styles as a hash of style-defining strings that will later be normalized into hashes.
|
145
|
+
#
|
101
146
|
def configured_styles
|
102
|
-
|
103
|
-
|
104
|
-
style_definitions.to_s.gsub(' ','').split('|').each do |definition|
|
147
|
+
@configured_styles ||= if style_definitions = Radiant.config["assets.thumbnails.#{name}"]
|
148
|
+
style_definitions.gsub(/\s/,'').split('|').each_with_object({}) do |definition, styles|
|
105
149
|
name, rule = definition.split(':')
|
106
|
-
styles[name.to_sym] = rule
|
150
|
+
styles[name.to_sym] = rule
|
107
151
|
end
|
152
|
+
else
|
153
|
+
{}
|
108
154
|
end
|
109
|
-
styles
|
110
155
|
end
|
111
156
|
|
112
157
|
def legacy_styles
|
@@ -115,7 +160,7 @@ class AssetType
|
|
115
160
|
|
116
161
|
def style_dimensions(style_name)
|
117
162
|
if style = paperclip_styles[style_name.to_sym]
|
118
|
-
style
|
163
|
+
style[:size]
|
119
164
|
end
|
120
165
|
end
|
121
166
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
%p
|
7
7
|
= t("clipped_extension.no_assets")
|
8
8
|
- else
|
9
|
-
- if with_pagination && assets.respond_to?(:
|
9
|
+
- if with_pagination && assets.respond_to?(:total_pages) && assets.total_pages > 1
|
10
10
|
= pagination_for(assets, pagination_parameters.merge(:depaginate => false, :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js'}))
|
11
11
|
|
12
12
|
%ul
|
@@ -26,5 +26,5 @@
|
|
26
26
|
%li= link_to t('clipped_extension.edit'), admin_asset_path(asset), :class => 'edit'
|
27
27
|
%li= link_to t("clipped_extension.remove"), remove_admin_asset_path(asset), :class => "delete"
|
28
28
|
|
29
|
-
- if with_pagination && assets.respond_to?(:
|
29
|
+
- if with_pagination && assets.respond_to?(:total_pages) && assets.total_pages > 1
|
30
30
|
= pagination_for(assets, pagination_parameters.merge(:depaginate => false, :param_name => 'p', :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js', :page_id => (page && page.id), :pp => assets.per_page }))
|
data/clipped_extension.rb
CHANGED
@@ -18,12 +18,12 @@ class ClippedExtension < Radiant::Extension
|
|
18
18
|
Page.send :include, AssetTags # radius tags for selecting sets of assets and presenting each one
|
19
19
|
UserActionObserver.instance.send :add_observer!, Asset # the usual creator- and updater-stamping
|
20
20
|
|
21
|
-
AssetType.new :image, :icon => 'image', :default_radius_tag => 'image', :processors => [:thumbnail], :styles =>
|
22
|
-
AssetType.new :video, :icon => 'video', :processors => [:frame_grab], :styles =>
|
21
|
+
AssetType.new :image, :icon => 'image', :default_radius_tag => 'image', :processors => [:thumbnail], :styles => :standard, :extensions => %w[jpg jpeg png gif], :mime_types => %w[image/png image/x-png image/jpeg image/pjpeg image/jpg image/gif]
|
22
|
+
AssetType.new :video, :icon => 'video', :processors => [:frame_grab], :styles => :standard, :mime_types => %w[application/x-mp4 video/mpeg video/quicktime video/x-la-asf video/x-ms-asf video/x-msvideo video/x-sgi-movie video/x-flv flv-application/octet-stream video/3gpp video/3gpp2 video/3gpp-tt video/BMPEG video/BT656 video/CelB video/DV video/H261 video/H263 video/H263-1998 video/H263-2000 video/H264 video/JPEG video/MJ2 video/MP1S video/MP2P video/MP2T video/mp4 video/MP4V-ES video/MPV video/mpeg4 video/mpeg4-generic video/nv video/parityfec video/pointer video/raw video/rtx video/ogg video/webm]
|
23
23
|
AssetType.new :audio, :icon => 'audio', :mime_types => %w[audio/mpeg audio/mpg audio/ogg application/ogg audio/x-ms-wma audio/vnd.rn-realaudio audio/x-wav]
|
24
24
|
AssetType.new :font, :icon => 'font', :extensions => %w[ttf otf eot woff]
|
25
25
|
AssetType.new :flash, :icon => 'flash', :default_radius_tag => 'flash', :extensions => %w{swf}, :mime_types => %w[application/x-shockwave-flash]
|
26
|
-
AssetType.new :pdf, :icon => 'pdf', :processors => [:thumbnail], :extensions => %w{pdf}, :mime_types => %w[application/pdf application/x-pdf], :styles =>
|
26
|
+
AssetType.new :pdf, :icon => 'pdf', :processors => [:thumbnail], :extensions => %w{pdf}, :mime_types => %w[application/pdf application/x-pdf], :styles => :standard
|
27
27
|
AssetType.new :document, :icon => 'document', :mime_types => %w[application/msword application/rtf application/vnd.ms-excel application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-works text/plain text/html]
|
28
28
|
AssetType.new :other, :icon => 'unknown'
|
29
29
|
|
@@ -22,7 +22,7 @@ Radiant.config do |config|
|
|
22
22
|
assets.define 'create_pdf_thumbnails?', :default => 'true'
|
23
23
|
|
24
24
|
assets.namespace 'thumbnails' do |thumbs| # NB :icon and :thumbnail are already defined as fixed formats for use in the admin interface and can't be changed
|
25
|
-
thumbs.define 'image', :default => 'normal:size=640x640
|
25
|
+
thumbs.define 'image', :default => 'normal:size=640x640>|small:size=320x320>'
|
26
26
|
thumbs.define 'video', :default => 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
|
27
27
|
thumbs.define 'pdf', :default => 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
|
28
28
|
end
|
data/lib/asset_tags.rb
CHANGED
@@ -136,7 +136,7 @@ module AssetTags
|
|
136
136
|
raise TagError, "'container' attribute required" unless options['container']
|
137
137
|
size = options['size'] ? options.delete('size') : 'icon'
|
138
138
|
container = options.delete('container')
|
139
|
-
(container.to_i - asset.height(size).to_i)/2
|
139
|
+
((container.to_i - asset.height(size).to_i)/2).to_s
|
140
140
|
end
|
141
141
|
|
142
142
|
['height','width'].each do |dimension|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module RadiantClippedExtension
|
2
|
-
VERSION
|
3
|
-
SUMMARY
|
2
|
+
VERSION = "1.0.7"
|
3
|
+
SUMMARY = %q{Assets for Radiant CMS}
|
4
4
|
DESCRIPTION = %q{Asset-management derived from Keith Bingman's Paperclipped extension.}
|
5
|
-
URL
|
6
|
-
AUTHORS
|
7
|
-
EMAIL
|
8
|
-
end
|
5
|
+
URL = "http://radiantcms.org"
|
6
|
+
AUTHORS = ["Keith Bingman", "Benny Degezelle", "William Ross", "John W. Long"]
|
7
|
+
EMAIL = ["radiant@radiantcms.org"]
|
8
|
+
end
|
@@ -4,7 +4,7 @@ p.asset
|
|
4
4
|
img.preview
|
5
5
|
border: 5px solid white
|
6
6
|
+box-shadow
|
7
|
-
|
7
|
+
|
8
8
|
.asset_filters
|
9
9
|
float: left
|
10
10
|
padding: 2px 0
|
@@ -27,12 +27,12 @@ p.asset
|
|
27
27
|
color: white
|
28
28
|
text-shadow: 0 1px 0 #333
|
29
29
|
|
30
|
-
.popup
|
30
|
+
.popup
|
31
31
|
div.toolbar
|
32
32
|
background: white
|
33
|
-
+linear-gradient(
|
33
|
+
+background-image(linear-gradient(white,#ddd))
|
34
34
|
border-bottom: 1px solid #ccc
|
35
|
-
+box-shadow(white, 0, 1px, 0)
|
35
|
+
+single-box-shadow(white, 0, 1px, 0)
|
36
36
|
margin: -20px -20px 0
|
37
37
|
padding: 6px 10px 3px 10px
|
38
38
|
font-size: 95%
|
@@ -62,7 +62,7 @@ p.asset
|
|
62
62
|
overflow-x: hidden
|
63
63
|
width: 610px
|
64
64
|
height: 310px
|
65
|
-
|
65
|
+
|
66
66
|
.attachment_actions
|
67
67
|
text-align: right
|
68
68
|
margin-bottom: -1em
|
@@ -146,7 +146,7 @@ p.asset
|
|
146
146
|
background: transparent url(/images/admin/spinner.gif) no-repeat center center
|
147
147
|
img
|
148
148
|
opacity: 0.2
|
149
|
-
|
149
|
+
|
150
150
|
#attachment_list.assets
|
151
151
|
background: #7e7e7e
|
152
152
|
+border-bottom-radius
|
@@ -171,9 +171,10 @@ p.asset
|
|
171
171
|
cursor: move
|
172
172
|
&:hover
|
173
173
|
font-weight: bold
|
174
|
-
|
174
|
+
|
175
175
|
#assets_table.assets
|
176
176
|
position: relative
|
177
|
+
overflow: auto
|
177
178
|
p
|
178
179
|
padding: 40px
|
179
180
|
top: 45px
|
@@ -189,21 +190,36 @@ p.asset
|
|
189
190
|
display: none
|
190
191
|
div.pagination
|
191
192
|
position: relative
|
193
|
+
overflow: hidden
|
192
194
|
clear: left
|
193
195
|
width: 100%
|
194
|
-
height:
|
195
|
-
|
196
|
-
|
197
|
-
a
|
198
|
-
|
196
|
+
height: 4em
|
197
|
+
margin: 1em 0
|
198
|
+
padding: 0 1em
|
199
|
+
span, a
|
200
|
+
display: block
|
201
|
+
float: left
|
202
|
+
padding: 0.25em
|
203
|
+
margin: 1em 2px 1em 0
|
204
|
+
+border-radius(2px)
|
199
205
|
text-decoration: none
|
206
|
+
span.current
|
207
|
+
color: #000
|
208
|
+
font-weight: bold
|
209
|
+
span.disabled
|
210
|
+
background-color: #eee
|
211
|
+
color: #ccc
|
212
|
+
a
|
213
|
+
background-color: #eee
|
214
|
+
color: #c00
|
200
215
|
&:hover
|
201
|
-
background-color: #
|
202
|
-
color: #
|
216
|
+
background-color: #c00
|
217
|
+
color: #fff
|
218
|
+
|
203
219
|
span
|
204
|
-
color: #
|
220
|
+
color: #888
|
205
221
|
span, a
|
206
222
|
display: block
|
207
223
|
float: left
|
208
|
-
padding:
|
224
|
+
padding: 2px 6px
|
209
225
|
line-height: 1.5em
|
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = RadiantClippedExtension::SUMMARY
|
13
13
|
s.description = RadiantClippedExtension::DESCRIPTION
|
14
14
|
|
15
|
-
s.add_dependency
|
16
|
-
s.add_dependency
|
17
|
-
s.add_dependency
|
15
|
+
s.add_dependency "acts_as_list", "~> 0.1.2"
|
16
|
+
s.add_dependency "paperclip", "~> 2.3.16"
|
17
|
+
s.add_dependency "uuidtools", "~> 2.1.2"
|
18
18
|
|
19
19
|
ignores = if File.exist?('.gitignore')
|
20
20
|
File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] }
|
@@ -25,9 +25,4 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.test_files = Dir['test/**/*','spec/**/*','features/**/*'] - ignores
|
26
26
|
# s.executables = Dir['bin/*'] - ignores
|
27
27
|
s.require_paths = ["lib"]
|
28
|
-
|
29
|
-
s.post_install_message = %{
|
30
|
-
Add this to your radiant project with:
|
31
|
-
config.gem 'radiant-clipped-extension', :version => '~>#{RadiantClippedExtension::VERSION}'
|
32
|
-
}
|
33
|
-
end
|
28
|
+
end
|
data/spec/lib/asset_tags_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
3
3
|
describe AssetTags do
|
4
4
|
dataset :assets
|
5
5
|
let(:page) { pages(:pictured) }
|
6
|
-
let(:asset) { assets(:
|
6
|
+
let(:asset) { assets(:test1) }
|
7
7
|
|
8
8
|
context "Asset tags" do
|
9
9
|
%w{width height caption asset_file_name asset_content_type asset_file_size id filename image flash url link extension page:title page:url}.each do |name|
|
@@ -27,17 +27,18 @@ describe AssetTags do
|
|
27
27
|
context "rendering tag" do
|
28
28
|
before do
|
29
29
|
Radiant.config['assets.create_image_thumbnails?'] = true
|
30
|
+
Radiant.config['assets.thumbnails.image'] = 'normal:size=640x640>|small:size=320x320>'
|
30
31
|
end
|
31
32
|
|
32
33
|
it "assets:each" do
|
33
|
-
page.should render('<r:assets:each><r:asset:id />,</r:assets:each>').as( "#{asset_id(:
|
34
|
+
page.should render('<r:assets:each><r:asset:id />,</r:assets:each>').as( "#{asset_id(:test1)},#{asset_id(:test2)}," )
|
34
35
|
end
|
35
36
|
|
36
37
|
it "assets:first" do
|
37
|
-
page.should render('<r:assets:first><r:asset:id /></r:assets:first>').as(
|
38
|
+
page.should render('<r:assets:first><r:asset:id /></r:assets:first>').as( asset.id.to_s )
|
38
39
|
end
|
39
40
|
|
40
|
-
it "should
|
41
|
+
it "should retrieve an asset by name" do
|
41
42
|
page.should render('<r:asset:id name="video" />').as( "#{asset_id(:video)}" )
|
42
43
|
end
|
43
44
|
|
@@ -27,7 +27,7 @@ describe AssetType do
|
|
27
27
|
its(:paperclip_processors) { should be_empty}
|
28
28
|
its(:paperclip_styles) { should be_empty}
|
29
29
|
its(:icon) { should == "/images/admin/assets/simple_icon.png"}
|
30
|
-
its(:icon_path) { should == "
|
30
|
+
its(:icon_path) { should == Rails.root + "public/images/admin/assets/simple_icon.png"}
|
31
31
|
end
|
32
32
|
|
33
33
|
context 'with initialized thumbnail sizes' do
|
@@ -35,18 +35,21 @@ describe AssetType do
|
|
35
35
|
subject{ AssetType.find(:complex) }
|
36
36
|
its(:paperclip_processors) { should == [:dummy] }
|
37
37
|
its(:paperclip_styles) { should_not be_empty }
|
38
|
-
its(:paperclip_styles) { should == {:something => "99x99>"} }
|
38
|
+
its(:paperclip_styles) { should == {:something => {:geometry => "99x99>"}} }
|
39
39
|
its(:icon) { should == "/images/admin/assets/document_icon.png"}
|
40
40
|
end
|
41
41
|
|
42
42
|
context 'with configured thumbnail sizes' do
|
43
43
|
before {
|
44
44
|
Radiant.config["assets.create_configured_thumbnails?"] = true
|
45
|
-
Radiant.config["assets.thumbnails.configured"] = "special:size=800x800>,format=jpg|tiny:size
|
45
|
+
Radiant.config["assets.thumbnails.configured"] = "special:size=800x800>,format=jpg|tiny:size=10x10#,format=png"
|
46
46
|
}
|
47
47
|
subject{ AssetType.find(:configured) }
|
48
48
|
its(:paperclip_processors) { should == [:dummy] }
|
49
|
-
its(:paperclip_styles) { should == {
|
49
|
+
its(:paperclip_styles) { should == {
|
50
|
+
:special => {:geometry => "800x800>", :format => 'jpg'},
|
51
|
+
:tiny => {:geometry => "10x10#", :format => 'png'}
|
52
|
+
}}
|
50
53
|
end
|
51
54
|
|
52
55
|
context 'AssetType class methods' do
|
@@ -15,6 +15,7 @@ describe Asset do
|
|
15
15
|
describe "on assigning a file to an asset" do
|
16
16
|
before do
|
17
17
|
Radiant.config["assets.create_image_thumbnails?"] = true
|
18
|
+
Radiant.config["assets.thumbnails.configured"] = "special:size=800x800>,format=jpg|tiny:size=#10x10,format=png"
|
18
19
|
end
|
19
20
|
|
20
21
|
it "should have saved the asset" do
|
data/spec/spec.opts
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-clipped-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 7
|
10
|
+
version: 1.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Keith Bingman
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
21
|
+
date: 2011-09-07 00:00:00 +01:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
@@ -205,7 +205,7 @@ has_rdoc: true
|
|
205
205
|
homepage: http://radiantcms.org
|
206
206
|
licenses: []
|
207
207
|
|
208
|
-
post_install_message:
|
208
|
+
post_install_message:
|
209
209
|
rdoc_options: []
|
210
210
|
|
211
211
|
require_paths:
|