From d47e9c317dff3e3c7123c6f0249fce3500f3a6e7 Mon Sep 17 00:00:00 2001 From: Aditya Prakash Date: Mon, 25 Apr 2016 17:18:02 +0530 Subject: [PATCH] Add rake task to reprocess sponsor logos rake logo:reprocess --- INSTALL.md | 5 ++--- lib/tasks/.gitkeep | 0 lib/tasks/logo.rake | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 lib/tasks/.gitkeep create mode 100644 lib/tasks/logo.rake diff --git a/INSTALL.md b/INSTALL.md index 69d4a15f..e86f0662 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -66,10 +66,9 @@ base operating systems. Check Google ;-) #### ImageMagick We use imagemagic for image manipulation of sponsor logo. You can get it from [direct install](http://software.opensuse.org/package/ImageMagick) page of the package or else check out [Download page](http://www.imagemagick.org/script/binary-releases.php) of ImageMagick. -If you are upgrading your osem instance and would like to resize the exisiting logos, you would need to `reprocess!` the images: +If you are upgrading your osem instance and would like to resize the exisiting logos, you would need to `reprocess!` the images. You can do it by running the following rake task: ``` -$ rails c -> Sponsor.find_each { |s| s.logo.reprocess! } +$ rake logo:reprocess ``` #### Use openID diff --git a/lib/tasks/.gitkeep b/lib/tasks/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/tasks/logo.rake b/lib/tasks/logo.rake new file mode 100644 index 00000000..cea95113 --- /dev/null +++ b/lib/tasks/logo.rake @@ -0,0 +1,6 @@ +namespace :logo do + desc 'Resize existing logo of sponsors after change in image manipulation specifications' + task reprocess: :environment do + Sponsor.find_each { |s| s.logo.reprocess! } + end +end