radiant-clipped-extension 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,8 +4,8 @@ if Radiant.config.table_exists?
4
4
  if Radiant.config['assets.create_image_thumbnails?']
5
5
  # Check that we can run convert
6
6
  begin
7
- output = Paperclip.run('convert', '-version').to_a.first
8
- Rails.logger.info "Using image thumbnailer: #{output.sub(/Version: /i, '')}"
7
+ output = Paperclip.run('convert', '-version')
8
+ Rails.logger.info %{[Clipped] Using image thumbnailer: #{output.split("\n").first.sub(/^Version: /i, '')}}
9
9
  rescue Cocaine::CommandNotFoundError
10
10
  Radiant.config['assets.create_image_thumbnails?'] = false
11
11
  Radiant.config['assets.create_pdf_thumbnails?'] = false
@@ -19,7 +19,7 @@ if Radiant.config.table_exists?
19
19
  # Check that we can run ghostscript
20
20
  begin
21
21
  output = Paperclip.run('gs', '-v')
22
- Rails.logger.info "Using PDF thumbnailer: #{output}".to_a.first
22
+ Rails.logger.info %{[Clipped] Using PDF thumbnailer: #{output.split("\n").first}}
23
23
  rescue Cocaine::CommandNotFoundError
24
24
  Radiant.config['assets.create_pdf_thumbnails?'] = false
25
25
  Rails.logger.warn "Ghostscript 'gs' executable not found: pdf thumbnailing disabled."
@@ -31,8 +31,8 @@ if Radiant.config.table_exists?
31
31
  if Radiant.config['assets.create_video_thumbnails?']
32
32
  # Check that we can run ffmpeg
33
33
  begin
34
- output = Paperclip.run('ffmpeg', '-version').to_a.first
35
- Rails.logger.info "Using video frame grabber: #{output}"
34
+ output = Paperclip.run('ffmpeg', '-version 2> /dev/null')
35
+ Rails.logger.info %{[Clipped] Using video frame grabber: #{output.split("\n").first}}
36
36
  rescue Cocaine::CommandNotFoundError
37
37
  Radiant.config['assets.create_video_thumbnails?'] = false
38
38
  Rails.logger.warn "FFmpeg executable not found: video thumbnailing disabled."
data/lib/asset_tags.rb CHANGED
@@ -113,7 +113,7 @@ module AssetTags
113
113
  desc %{
114
114
  Renders the value for a top padding for the image. Put the image in a
115
115
  container with specified height and using this tag you can vertically
116
- align the image within it's container.
116
+ align the image within its container.
117
117
 
118
118
  *Usage*:
119
119
  <pre><code><r:asset:top_padding container = "140" [size="icon"]/></code></pre>
@@ -136,8 +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
- img_height = asset.height(size)
140
- (container.to_i - img_height.to_i)/2
139
+ (container.to_i - asset.height(size).to_i)/2
141
140
  end
142
141
 
143
142
  ['height','width'].each do |dimension|
@@ -1,5 +1,5 @@
1
1
  module RadiantClippedExtension
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  SUMMARY = %q{Assets for Radiant CMS}
4
4
  DESCRIPTION = %q{Asset-management derived from Keith Bingman's Paperclipped extension.}
5
5
  URL = "http://radiantcms.org"
@@ -25,6 +25,10 @@ describe AssetTags do
25
25
  end
26
26
 
27
27
  context "rendering tag" do
28
+ before do
29
+ Radiant.config['assets.create_image_thumbnails?'] = true
30
+ end
31
+
28
32
  it "assets:each" do
29
33
  page.should render('<r:assets:each><r:asset:id />,</r:assets:each>').as( "#{asset_id(:test2)},#{asset_id(:test1)}," )
30
34
  end
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
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-08-14 00:00:00 +01:00
21
+ date: 2011-08-15 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: "\n Add this to your radiant project with:\n config.gem 'radiant-clipped-extension', :version => '~>1.0.4'\n "
208
+ post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-clipped-extension', :version => '~>1.0.5'\n "
209
209
  rdoc_options: []
210
210
 
211
211
  require_paths: