BBenezech-papermill 0.2.0 → 0.2.1
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/VERSION +1 -1
- data/app/controllers/papermill_controller.rb +12 -10
- data/papermill.gemspec +1 -1
- metadata +2 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -4,18 +4,20 @@ class PapermillController < ApplicationController
|
|
4
4
|
|
5
5
|
def show
|
6
6
|
begin
|
7
|
-
|
8
|
-
|
7
|
+
asset = PapermillAsset.find(params[:id])
|
8
|
+
raise if asset.nil? || params[:style] == "original"
|
9
|
+
style = Papermill::PAPERMILL_DEFAULTS[:aliases][params[:style]] || !Papermill::PAPERMILL_DEFAULTS[:alias_only] && params[:style]
|
10
|
+
raise unless style
|
11
|
+
|
12
|
+
if asset.image?
|
13
|
+
temp_thumbnail = Paperclip::Thumbnail.make(asset_file = asset.file, style)
|
14
|
+
new_parent_folder_path = File.dirname(new_image_path = asset_file.path(params[:style]))
|
15
|
+
FileUtils.mkdir_p new_parent_folder_path unless File.exists? new_parent_folder_path
|
16
|
+
FileUtils.cp temp_thumbnail.path, new_image_path
|
17
|
+
redirect_to asset.url(params[:style])
|
9
18
|
else
|
10
|
-
|
19
|
+
redirect_to asset.url
|
11
20
|
end
|
12
|
-
raise unless style
|
13
|
-
asset = PapermillAsset.find(params[:id])
|
14
|
-
temp_thumbnail = Paperclip::Thumbnail.make(asset_file = asset.file, style)
|
15
|
-
new_parent_folder_path = File.dirname(new_image_path = asset_file.path(params[:style]))
|
16
|
-
FileUtils.mkdir_p new_parent_folder_path unless File.exists? new_parent_folder_path
|
17
|
-
FileUtils.cp temp_thumbnail.path, new_image_path
|
18
|
-
redirect_to asset.url(params[:style])
|
19
21
|
rescue
|
20
22
|
render :text => t("not-processed", :scope => "papermill"), :status => "500"
|
21
23
|
end
|
data/papermill.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: BBenezech-papermill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Benoit B\xC3\xA9n\xC3\xA9zech"
|
@@ -63,7 +63,6 @@ files:
|
|
63
63
|
- uninstall.rb
|
64
64
|
has_rdoc: false
|
65
65
|
homepage: http://github.com/BBenezech/papermill
|
66
|
-
licenses:
|
67
66
|
post_install_message:
|
68
67
|
rdoc_options:
|
69
68
|
- --charset=UTF-8
|
@@ -84,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
83
|
requirements: []
|
85
84
|
|
86
85
|
rubyforge_project:
|
87
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.2.0
|
88
87
|
signing_key:
|
89
88
|
specification_version: 3
|
90
89
|
summary: Paperclip wrapper
|