favicon_maker_rails 0.0.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/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ *.gem
3
+ .bundle
4
+ Gemfile.lock
5
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Dependencies in favicon_maker_rails.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Adam Michel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Favicon Maker for Rails
2
+
3
+ This is a very simple gem that adds a rake task to your Rails project for generating favicons of various sizes and formats from a single source file by making use of the [FaviconMaker](https://github.com/follmann/favicon_maker) library.
4
+
5
+ ## Install
6
+
7
+ Add the following line to your Gemfile:
8
+
9
+ gem 'favicon_maker_rails'
10
+
11
+ ## Usage
12
+
13
+ 1. Place your PNG favicon* in app/assets/images, calling it favicon.png.
14
+ 2. Type `rake favicon` in your terminal.
15
+ 3. Your generated favicons will be output into your public directory.
16
+
17
+ *: The largest size used is 228x228 for Apple Retina displays, I recommend using an image this size or larger for best results.
18
+
19
+ ## TODO
20
+
21
+ * Add options for customizing source and output directories?
22
+ * Allow additional output options.
23
+
24
+ ## Copyright
25
+
26
+ Copyright (c) 2012 Adam Michel. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "favicon_maker_rails/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "favicon_maker_rails"
7
+ s.version = FaviconMakerRails::VERSION
8
+ s.authors = ["Adam Michel"]
9
+ s.email = ["awmichel90@gmail.com"]
10
+ s.homepage = "http://amichel.me"
11
+ s.summary = %q{Simple rake task for generating favicons from a .png source.}
12
+ s.description = %q{Uses the FaviconMaker library for generating favicons in various formats from a single .png source file.}
13
+
14
+ s.rubyforge_project = "favicon_maker_rails"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ s.add_dependency("favicon_maker", ">= 0.0.7")
21
+ s.add_development_dependency("rake")
22
+ end
@@ -0,0 +1,7 @@
1
+ module FaviconMakerRails
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load "favicon_maker_rails/tasks.rake"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,30 @@
1
+ require 'favicon_maker'
2
+
3
+ def say(message)
4
+ puts message unless Rake.application.options.silent
5
+ end
6
+
7
+ namespace :favicon do
8
+ task :generate do
9
+ options = {
10
+ :versions => [:apple_114, :apple_57, :apple, :fav_png, :fav_ico],
11
+ :custom_versions => {:apple_extreme_retina => {:filename => "apple-touch-icon-228x228-precomposed.png", :dimensions => "228x228", :format => "png"}},
12
+ :root_dir => Rails.root,
13
+ :input_dir => File.join('app', 'assets', 'images'),
14
+ :base_image => 'favicon.png',
15
+ :output_dir => 'public',
16
+ :copy => true
17
+ }
18
+
19
+ if File::exists?(File.join('app', 'assets', 'images', 'favicon.png'))
20
+ FaviconMaker::Generator.create_versions(options) do |filepath|
21
+ say "Created favicon: #{filepath}"
22
+ end
23
+ else
24
+ say "No source favicon found, please create favicon.png in your app/assets/images directory."
25
+ end
26
+ end
27
+ end
28
+
29
+ desc "Generate favicons from single favicon.png source"
30
+ task :favicon => "favicon:generate"
@@ -0,0 +1,3 @@
1
+ module FaviconMakerRails
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ require "favicon_maker_rails/version"
2
+ require "favicon_maker_rails/railtie" if defined? Rails
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: favicon_maker_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Adam Michel
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: favicon_maker
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.0.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.0.7
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Uses the FaviconMaker library for generating favicons in various formats
47
+ from a single .png source file.
48
+ email:
49
+ - awmichel90@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE
57
+ - README.md
58
+ - Rakefile
59
+ - favicon_maker_rails.gemspec
60
+ - lib/favicon_maker_rails.rb
61
+ - lib/favicon_maker_rails/railtie.rb
62
+ - lib/favicon_maker_rails/tasks.rake
63
+ - lib/favicon_maker_rails/version.rb
64
+ homepage: http://amichel.me
65
+ licenses: []
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project: favicon_maker_rails
84
+ rubygems_version: 1.8.24
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: Simple rake task for generating favicons from a .png source.
88
+ test_files: []