ack_favicon_maker_rails 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2c62e67a6c8ff203e42ecb4af9c27d9e1d518efd
4
+ data.tar.gz: be8edb808b2a9d5a790555e73a70de4f4789ebf0
5
+ SHA512:
6
+ metadata.gz: 3111d493810e2e10cc16acf8e640b703020d03b2bed277154d5ea1b1e05df10b25015b64f6977f0c5f46a79b8b46b6ba4841b7c419a93a42a75086cb2869f92a
7
+ data.tar.gz: 7a41b6bb7188d672688bdccf4e1bfea87b3189908baf67f3b57d926c3beb71f6c61249e9d75d1dfbbac11e3ae2b6a1a4e47b220d0f0f209cd2d80a2d5b44689b
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ .idea
2
+ .idea/*
3
+
4
+ .bundle/
5
+ log/*.log
6
+ pkg/
7
+ test/dummy/db/*.sqlite3
8
+ test/dummy/log/*.log
9
+ test/dummy/tmp/
10
+ test/dummy/.sass-cache
11
+ *.gem
12
+ *.DS_Store
13
+
14
+ .DS_Store
15
+ *.gem
16
+ .bundle
17
+ Gemfile.lock
18
+ pkg/*
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ ack_favicon_maker_rails
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
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', github: 'ack43/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 = "ack_favicon_maker_rails"
7
+ s.version = FaviconMakerRails::VERSION
8
+ s.authors = ["Alexander Kiseliev", "Adam Michel"]
9
+ s.email = ["dev@enjoycreate.ru", "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', '>= 1.3.1')
21
+ s.add_development_dependency('rake')
22
+ end
@@ -0,0 +1 @@
1
+ require "favicon_maker_rails"
@@ -0,0 +1,2 @@
1
+ require "favicon_maker_rails/version"
2
+ require "favicon_maker_rails/railtie" if defined? Rails
@@ -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,85 @@
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/favicons',
16
+ copy: true
17
+ }
18
+
19
+ if File::exists?(File.join('app', 'assets', 'images', 'favicon.png'))
20
+ if Gem.loaded_specs['favicon_maker'].version < Gem::Version.new('1.0.0')
21
+ FaviconMaker::Generator.create_versions(options) do |filepath|
22
+ say "Created favicon: #{filepath}"
23
+ end
24
+ else
25
+ FaviconMaker.generate do
26
+
27
+ setup do
28
+ template_dir options[:root_dir].join(options[:input_dir])
29
+ output_dir options[:root_dir].join(options[:output_dir])
30
+ end
31
+
32
+ unless Dir.exist?(output_dir)
33
+ Dir.mkdir(output_dir)
34
+ end
35
+
36
+ from 'favicon.png' do
37
+ icon '../favicon.ico', size: '64x64,32x32,24x24,16x16'
38
+ icon '../favicon.png', size: '16x16'
39
+
40
+ # http://realfavicongenerator.net/faq#.VxlagR8VxCW
41
+ icon 'favicon.ico', size: '64x64,32x32,24x24,16x16'
42
+ icon 'favicon-16x16.png'
43
+ icon 'favicon-32x32.png'
44
+ icon 'favicon-96x96.png'
45
+ # icon 'favicon-160x160.png'
46
+ # icon 'favicon-196x196.png'
47
+
48
+ icon 'android-chrome-36x36.png'
49
+ icon 'android-chrome-48x48.png'
50
+ icon 'android-chrome-72x72.png'
51
+ icon 'android-chrome-96x96.png'
52
+ icon 'android-chrome-144x144.png'
53
+ icon 'android-chrome-192x192.png'
54
+
55
+ icon 'mstile-70x70.png'
56
+ icon 'mstile-144x144.png'
57
+ icon 'mstile-150x150.png'
58
+ icon 'mstile-310x310.png'
59
+ icon 'mstile-310x150.png'
60
+
61
+ icon 'apple-touch-icon-57x57-precomposed.png'
62
+ icon 'apple-touch-icon-60x60-precomposed.png'
63
+ icon 'apple-touch-icon-72x72-precomposed.png'
64
+ icon 'apple-touch-icon-76x76-precomposed.png'
65
+ icon 'apple-touch-icon-120x120-precomposed.png'
66
+ icon 'apple-touch-icon-144x144-precomposed.png'
67
+ icon 'apple-touch-icon-152x152-precomposed.png'
68
+ icon 'apple-touch-icon-180x180-precomposed.png'
69
+ icon 'apple-touch-icon-precomposed.png', size: '57x57'
70
+ icon 'apple-touch-icon.png', size: '57x57'
71
+ end
72
+
73
+ each_icon do |filepath|
74
+ puts filepath # verbose example
75
+ end unless Rake.application.options.silent
76
+ end
77
+ end
78
+ else
79
+ say 'No source favicon found, please create favicon.png in your app/assets/images directory.'
80
+ end
81
+ end
82
+ end
83
+
84
+ desc 'Generate favicons from single favicon.png source'
85
+ task favicon: "favicon:generate"
@@ -0,0 +1,3 @@
1
+ module FaviconMakerRails
2
+ VERSION = "1.0.1"
3
+ end
data/release.sh ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/bash
2
+ bundle update
3
+ git add --all .
4
+ git commit -am "${*:1}"
5
+ git push
6
+ git push gh master
7
+ rake release
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ack_favicon_maker_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Kiseliev
8
+ - Adam Michel
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-07-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: favicon_maker
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 1.3.1
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 1.3.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: Uses the FaviconMaker library for generating favicons in various formats
43
+ from a single .png source file.
44
+ email:
45
+ - dev@enjoycreate.ru
46
+ - awmichel90@gmail.com
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".gitignore"
52
+ - ".ruby-gemset"
53
+ - ".ruby-version"
54
+ - Gemfile
55
+ - LICENSE
56
+ - README.md
57
+ - Rakefile
58
+ - favicon_maker_rails.gemspec
59
+ - lib/ack_favicon_maker_rails.rb
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
+ - release.sh
65
+ homepage: http://amichel.me
66
+ licenses: []
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.4.7
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Simple rake task for generating favicons from a .png source.
88
+ test_files: []