middleman-favicon-maker 4.0.5 → 4.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57b0433e183c68686843e2d41299fdbe27cdb378
4
- data.tar.gz: 40bc39f57dc5b71b30513e703b28ac84c1777e13
3
+ metadata.gz: 37e88f68bd6296f3109b10f7ad61702769689e7f
4
+ data.tar.gz: 15135900040a395325ec3351af7e664127c2b6f3
5
5
  SHA512:
6
- metadata.gz: 2f3d2a2d8436950b1dd5f0f1013c28d5ab01c666bcfda9c7135f901cf78b1ebd48692224aa4f4e517466ce88daed06da783263bfb0e032d627ea488df29e8168
7
- data.tar.gz: ccca9560b23183d8770473189cd2595ce19fb498789072baf4262590300b416a389e7ab96aef61c01e1ab8a8e9df0d0ad7e472da34fc17828f4e35aa47b371c5
6
+ metadata.gz: 5d67dba363b0cd21d699da024516e2c73802f9ccba721d71a6c062af24671117c3f24afe3dd4ae869babbe405de8e6006588ac526cafcc0c3f1b4bb9c3d5829d
7
+ data.tar.gz: 6f1e61b5f2f4932d3359c5af476d2491cc05f651081218344663023ec81b7950b20e7edc3872dbb525b1a2b6525d26edd0ea7d9c66a6132df6875efb175b0c01
@@ -10,13 +10,11 @@ module Middleman
10
10
  option :icons, {}, "Hash with template filename (key) and Array of Hashes with icon configs"
11
11
 
12
12
  def after_configuration
13
- options[:template_dir] ||= source_path
14
- options[:output_dir] ||= build_path
13
+ options[:template_dir] ||= app.config.source
14
+ options[:output_dir] ||= app.config.build_dir
15
15
  end
16
16
 
17
17
  def after_build(builder)
18
-
19
- template_files = []
20
18
  ::FaviconMaker.generate do
21
19
  setup do
22
20
  template_dir options[:template_dir]
@@ -31,18 +29,10 @@ module Middleman
31
29
  end
32
30
  end
33
31
 
34
- each_icon do |filepath, template_filepath|
35
- pathname = Pathname.new(filepath)
36
- rel_path =
37
- if pathname.absolute?
38
- pathname.relative_path_from(Pathname.new(app.root)).to_s
39
- else
40
- filepath
41
- end
42
- builder.trigger(:created, rel_path)
32
+ each_icon do |filepath, _template_filepath|
33
+ builder.trigger(:created, relative_path_to_root(filepath))
43
34
  end
44
35
  end
45
-
46
36
  end
47
37
 
48
38
  def manipulate_resource_list(resources)
@@ -51,7 +41,7 @@ module Middleman
51
41
  ::Middleman::Sitemap::Resource.new(
52
42
  app.sitemap,
53
43
  item[:icon],
54
- File.join(app.root, options[:template_dir], src)
44
+ File.join(app.root, relative_path_to_root(options[:template_dir]), src)
55
45
  )
56
46
  end
57
47
  end
@@ -60,12 +50,13 @@ module Middleman
60
50
 
61
51
  private
62
52
 
63
- def source_path
64
- File.join(app.root, app.config.source)
65
- end
66
-
67
- def build_path
68
- File.join(app.root, app.config.build_dir)
53
+ def relative_path_to_root(filepath)
54
+ pathname = Pathname.new(filepath)
55
+ if pathname.absolute?
56
+ pathname.relative_path_from(Pathname.new(app.root)).to_s
57
+ else
58
+ filepath
59
+ end
69
60
  end
70
61
  end
71
62
  end
@@ -1,8 +1,8 @@
1
1
  module Middleman
2
2
  module FaviconMaker
3
3
  MAJOR = 4
4
- MINOR = 0
5
- PATCH = 5
4
+ MINOR = 1
5
+ PATCH = 0
6
6
  BUILD = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-favicon-maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Follmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-19 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.4.5
85
+ rubygems_version: 2.5.1
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Generate favicon files in various sizes from a base image in your Middleman