favicon_maker 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/LICENSE +16 -3
  2. data/README.md +2 -0
  3. data/lib/favicon_maker.rb +16 -15
  4. data/lib/version.rb +1 -1
  5. metadata +30 -48
data/LICENSE CHANGED
@@ -1,7 +1,20 @@
1
1
  Copyright (c) 2011 Andreas Follmann
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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:
4
10
 
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
6
13
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 CHANGED
@@ -31,6 +31,7 @@ Uses the following defaults:
31
31
 
32
32
  options = {
33
33
  :versions => [:apple_114, :apple_72, :apple_57, :apple_pre, :apple, :fav_png, :fav_ico],
34
+ :custom_versions = {},
34
35
  :root_dir => File.dirname(__FILE__),
35
36
  :input_dir => "favicons",
36
37
  :base_image => "favicon_base.png",
@@ -43,6 +44,7 @@ Uses the following defaults:
43
44
 
44
45
  options = {
45
46
  :versions => [:apple_114, :apple_57, :apple, :fav_png, :fav_ico],
47
+ :custom_versions => {:apple_extreme_retina => {:filename => "apple-touch-icon-228x228-precomposed.png", :dimensions => "228x228", :format => "png"}
46
48
  :root_dir => Rails.root,
47
49
  :input_dir => File.join(Rails.root, "app", "assets", "public"),
48
50
  :base_image => "favico.png",
data/lib/favicon_maker.rb CHANGED
@@ -6,13 +6,13 @@ module FaviconMaker
6
6
  VERSION = "0.0.1"
7
7
 
8
8
  ICON_VERSIONS = {
9
- :apple_114 => ["apple-touch-icon-114x114-precomposed.png", "114x114", "png"],
10
- :apple_72 => ["apple-touch-icon-72x72-precomposed.png", "72x72", "png"],
11
- :apple_57 => ["apple-touch-icon-57x57-precomposed.png", "57x57", "png"],
12
- :apple_pre => ["apple-touch-icon-precomposed.png", "57x57", "png"],
13
- :apple => ["apple-touch-icon.png", "57x57", "png"],
14
- :fav_png => ["favicon.png", "16x16", "png"],
15
- :fav_ico => ["favicon.ico", "16x16", "ico"]
9
+ :apple_114 => {:filename => "apple-touch-icon-114x114-precomposed.png", :dimensions => "114x114", :format => "png"},
10
+ :apple_72 => {:filename => "apple-touch-icon-72x72-precomposed.png", :dimensions => "72x72", :format => "png"},
11
+ :apple_57 => {:filename => "apple-touch-icon-57x57-precomposed.png", :dimensions => "57x57", :format => "png"},
12
+ :apple_pre => {:filename => "apple-touch-icon-precomposed.png", :dimensions => "57x57", :format => "png"},
13
+ :apple => {:filename => "apple-touch-icon.png", :dimensions => "57x57", :format => "png"},
14
+ :fav_png => {:filename => "favicon.png", :dimensions => "16x16", :format => "png"},
15
+ :fav_ico => {:filename => "favicon.ico", :dimensions => "16x16", :format => "ico"}
16
16
  }
17
17
 
18
18
  class << self
@@ -20,6 +20,7 @@ module FaviconMaker
20
20
  def create_versions(options={}, &block)
21
21
  options = {
22
22
  :versions => ICON_VERSIONS.keys,
23
+ :custom_versions => {},
23
24
  :root_dir => File.dirname(__FILE__),
24
25
  :input_dir => "favicons",
25
26
  :base_image => "favicon_base.png",
@@ -30,12 +31,12 @@ module FaviconMaker
30
31
  raise ArgumentError unless options[:versions].is_a? Array
31
32
  base_path = File.join(options[:root_dir], options[:input_dir])
32
33
  input_path = File.join(base_path, options[:base_image])
33
-
34
- options[:versions].each do |version|
35
- version = ICON_VERSIONS[version]
36
- filename = version[0]
37
- composed_path = File.join(base_path, filename)
38
- output_path = File.join(options[:root_dir], options[:output_dir], filename)
34
+
35
+ icon_versions = ICON_VERSIONS.merge(options[:custom_versions])
36
+ (options[:versions] + options[:custom_versions].keys).uniq.each do |version|
37
+ version = icon_versions[version]
38
+ composed_path = File.join(base_path, version[:filename])
39
+ output_path = File.join(options[:root_dir], options[:output_dir], version[:filename])
39
40
 
40
41
  created = false
41
42
  # check for self composed icon file
@@ -46,8 +47,8 @@ module FaviconMaker
46
47
  end
47
48
  else
48
49
  image = MiniMagick::Image.open(input_path)
49
- image.resize version[1]
50
- image.format version[2]
50
+ image.resize version[:dimensions]
51
+ image.format version[:format]
51
52
  image.write output_path
52
53
  created = true
53
54
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FaviconMaker
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,79 +1,61 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: favicon_maker
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 3
9
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Andreas Follmann
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-11-01 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-01 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: mini_magick
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
16
+ requirement: &70207928196580 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 3
29
- - 0
30
- version: "3.0"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
31
22
  type: :runtime
32
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *70207928196580
33
25
  description: Create favicon files in various sizes from a base image
34
26
  email:
35
27
  executables: []
36
-
37
28
  extensions: []
38
-
39
29
  extra_rdoc_files: []
40
-
41
- files:
30
+ files:
42
31
  - .gitignore
43
32
  - LICENSE
44
33
  - README.md
45
34
  - favicon_maker.gemspec
46
35
  - lib/favicon_maker.rb
47
36
  - lib/version.rb
48
- has_rdoc: true
49
37
  homepage: https://github.com/follmann/favicon_maker
50
38
  licenses: []
51
-
52
39
  post_install_message:
53
40
  rdoc_options: []
54
-
55
- require_paths:
41
+ require_paths:
56
42
  - lib
57
- required_ruby_version: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- segments:
62
- - 0
63
- version: "0"
64
- required_rubygems_version: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- version: "0"
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
71
55
  requirements: []
72
-
73
56
  rubyforge_project: favicon_maker
74
- rubygems_version: 1.3.6
57
+ rubygems_version: 1.8.10
75
58
  signing_key:
76
59
  specification_version: 3
77
60
  summary: Create favicon files in various sizes from a base image
78
61
  test_files: []
79
-