Sha256: 410d1709ba7b8c115ecc84dfe257dc04d5e013d76fbe0f9d2de38c4e6c8e9849

Contents?: true

Size: 1.5 KB

Versions: 14

Compression:

Stored size: 1.5 KB

Contents

namespace :orats do
  desc 'Create favicons from a single base png'
  task :favicons do
    require 'favicon_maker'

    FaviconMaker.generate do
      setup do
        template_dir Rails.root.join('app', 'assets', 'favicon')
        output_dir Rails.root.join('public')
      end

      favicon_base_path = "#{template_dir}/favicon_base.png"

      unless File.exist?(favicon_base_path)
        puts
        puts 'A base favicon could not be found, make sure one exists at:'
        puts favicon_base_path
        puts
        exit 1
      end

      from File.basename(favicon_base_path) do
        icon 'speeddial-160x160.png'
        icon 'apple-touch-icon-228x228-precomposed.png'
        icon 'apple-touch-icon-152x152-precomposed.png'
        icon 'apple-touch-icon-144x144-precomposed.png'
        icon 'apple-touch-icon-120x120-precomposed.png'
        icon 'apple-touch-icon-114x114-precomposed.png'
        icon 'apple-touch-icon-76x76-precomposed.png'
        icon 'apple-touch-icon-72x72-precomposed.png'
        icon 'apple-touch-icon-60x60-precomposed.png'
        icon 'apple-touch-icon-57x57-precomposed.png'
        icon 'favicon-196x196.png'
        icon 'favicon-160x160.png'
        icon 'favicon-96x96.png'
        icon 'favicon-64x64.png'
        icon 'favicon-32x32.png'
        icon 'favicon-24x24.png'
        icon 'favicon-16x16.png'
        icon 'favicon.ico', size: '64x64,32x32,24x24,16x16'
      end

      each_icon do |filepath|
        puts "Creating favicon @ #{filepath}"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
orats-0.9.7 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.6 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.5 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.4 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.3 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.2 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.1 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.9.0 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.8.1 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.8.0 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.7.3 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.7.2 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.7.1 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake
orats-0.7.0 lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake