appiconset 2.6.0 → 2.7.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
  SHA256:
3
- metadata.gz: 04c392fedbb90f46a1a68063f3e355ec5fa8bd81123d250a7799d453ea243dc9
4
- data.tar.gz: 5128b965a8349ad8094ce560a5681935b36f652d7590ee624ec2bc87bb3a1573
3
+ metadata.gz: 91ca34e89d534da0a0db5aeb3a28ab1f6e1c3a6edf19a8d306d76414a800058e
4
+ data.tar.gz: 6cef3caf6d961a2c564374a67d40a35086fc941ffe1ffe160390ab9055629620
5
5
  SHA512:
6
- metadata.gz: 34f6a72de126bf51135bf2ad8bc9cf0780e187d37507872e74a24f14324d9c92f8a0c395573c315e25066b79cda73fee98356fc66f7d0b896f66c76add624d56
7
- data.tar.gz: f2bf02f8b5663a0153343358f3a669a6f407c108415f26ef0c8de02cbd9aef8e14f5d232684429d183a32492603eb7b810b12e97d8638fa9b74d30cdc2141ae3
6
+ metadata.gz: b0d570d40bd186c8c0c9e99d55127b0b13c5c81ea39a0585ac44e016abad3488766f79a27e388d66adf07c8b27ac0e328f6265e945f26f3398b5f49bcb9daa61
7
+ data.tar.gz: b27e74468419a9d62f5f036e4f442bf7162f9cae128bdf49adee8c86aa906b90f8667834daf7fcba2da5e2b74cb03e6274c6164b0ac4267d734d73031140f97f
data/.rubocop_todo.yml CHANGED
@@ -9,7 +9,7 @@
9
9
  # Offense count: 3
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
- Max: 40
12
+ Max: 50
13
13
 
14
14
  # Offense count: 1
15
15
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
@@ -31,3 +31,6 @@ Metrics/CyclomaticComplexity:
31
31
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
32
32
  Metrics/MethodLength:
33
33
  Max: 64
34
+
35
+ Metrics/PerceivedComplexity:
36
+ Max: 12
@@ -32,8 +32,6 @@ module Appiconset
32
32
  def square_platforms
33
33
  return unless size_match?([1024, 1024])
34
34
 
35
- show_info('square')
36
-
37
35
  json_dir = "#{__dir__}/settings/*.json"
38
36
 
39
37
  Dir.glob(json_dir).each do |path|
@@ -44,9 +42,10 @@ module Appiconset
44
42
  # プラットフォームごとのディレクトリ
45
43
  platform = File.basename(path).gsub('-Contents.json', '')
46
44
  output_dir = "#{@output}#{platform}/"
47
-
48
45
  FileUtils.mkdir_p(output_dir)
49
46
 
47
+ show_info(platform)
48
+
50
49
  json_data['images'].each do |image|
51
50
  size = image['size'].match(/(.*?)x/)[1].to_f
52
51
  scale = image['scale'].gsub('x', '').to_i
@@ -66,12 +65,20 @@ module Appiconset
66
65
  rescue StandardError
67
66
  # none
68
67
  end
68
+
69
+ if platform == 'icns.iconset' && RbConfig::CONFIG['host_os'].match(/darwin|mac os/)
70
+ # macOSで実行可能
71
+ system("iconutil -c icns --output #{output_dir}/Icon.icns #{output_dir}/")
72
+ elsif platform == 'favicon'
73
+ images = Dir.glob("#{output_dir}*")
74
+ image = Magick::ImageList.new(*images)
75
+ image.format = 'ICO'
76
+ image.write("#{output_dir}favicon.ico")
77
+ end
69
78
  end
70
79
  end
71
80
 
72
- # rubocop:todo Metrics/PerceivedComplexity
73
- # rubocop:todo Metrics/AbcSize
74
- def any_platforms # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity
81
+ def any_platforms
75
82
  platforms = [
76
83
  {
77
84
  name: 'universal',
@@ -105,37 +112,6 @@ module Appiconset
105
112
  { width: 4640, height: 1440, name: 'Icon@2x.png' },
106
113
  { width: 2320, height: 720, name: 'Icon@1x.png' }
107
114
  ]
108
- },
109
- {
110
- name: 'icns.iconset',
111
- size: [1024, 1024],
112
- contents: [
113
- { width: 1024, height: 1024, name: 'icon_512x512@2x.png' },
114
- { width: 512, height: 512, name: 'icon_512x512.png' },
115
- { width: 512, height: 512, name: 'icon_256x256@2x.png' },
116
- { width: 256, height: 256, name: 'icon_256x256.png' },
117
- { width: 256, height: 256, name: 'icon_128x128@2x.png' },
118
- { width: 128, height: 128, name: 'icon_128x128.png' },
119
- { width: 128, height: 128, name: 'icon_64x64@2x.png' },
120
- { width: 64, height: 64, name: 'icon_64x64.png' },
121
- { width: 64, height: 64, name: 'icon_32x32@2x.png' },
122
- { width: 32, height: 32, name: 'icon_32x32.png' },
123
- { width: 32, height: 32, name: 'icon_16x16@2x.png' },
124
- { width: 16, height: 16, name: 'icon_16x16.png' }
125
- ]
126
- },
127
- {
128
- name: 'favicon',
129
- size: [1024, 1024],
130
- contents: [
131
- { width: 256, height: 256, name: 'icon_256x256.png' },
132
- { width: 128, height: 128, name: 'icon_128x128.png' },
133
- { width: 64, height: 64, name: 'icon_64x64.png' },
134
- { width: 48, height: 48, name: 'icon_48x48.png' },
135
- { width: 32, height: 32, name: 'icon_32x32.png' },
136
- { width: 24, height: 24, name: 'icon_24x24.png' },
137
- { width: 16, height: 16, name: 'icon_16x16.png' }
138
- ]
139
115
  }
140
116
  ]
141
117
 
@@ -163,26 +139,8 @@ module Appiconset
163
139
  image.format = 'PNG'
164
140
  image.write(output_dir + name)
165
141
  end
166
-
167
- if platform_name == 'icns.iconset' && RbConfig::CONFIG['host_os'].match(/darwin|mac os/)
168
- # macOSで実行可能
169
- show_info('icns')
170
- system("iconutil -c icns --output #{@output}Icon.icns #{@output}icns.iconset/")
171
- elsif platform_name == 'favicon'
172
- images = platforms.find do |x|
173
- x[:name] == 'favicon'
174
- end[:contents].map do |x| # rubocop:disable Style/MultilineBlockChain
175
- "#{output_dir}#{x[:name]}"
176
- end
177
-
178
- image = Magick::ImageList.new(*images)
179
- image.format = 'ICO'
180
- image.write("#{@output}favicon/favicon.ico")
181
- end
182
142
  end
183
143
  end
184
- # rubocop:enable Metrics/AbcSize
185
- # rubocop:enable Metrics/PerceivedComplexity
186
144
 
187
145
  private
188
146
 
@@ -0,0 +1,39 @@
1
+ {
2
+ "images": [
3
+ {
4
+ "size": "256x256",
5
+ "filename": "icon_256x256.png",
6
+ "scale": "1x"
7
+ },
8
+ {
9
+ "size": "128x128",
10
+ "filename": "icon_128x128.png",
11
+ "scale": "1x"
12
+ },
13
+ {
14
+ "size": "64x64",
15
+ "filename": "icon_64x64.png",
16
+ "scale": "1x"
17
+ },
18
+ {
19
+ "size": "48x48",
20
+ "filename": "icon_48x48.png",
21
+ "scale": "1x"
22
+ },
23
+ {
24
+ "size": "32x32",
25
+ "filename": "icon_32x32.png",
26
+ "scale": "1x"
27
+ },
28
+ {
29
+ "size": "24x24",
30
+ "filename": "icon_24x24.png",
31
+ "scale": "1x"
32
+ },
33
+ {
34
+ "size": "16x16",
35
+ "filename": "icon_16x16.png",
36
+ "scale": "1x"
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "images": [
3
+ {
4
+ "size": "512x512",
5
+ "filename": "icon_512x512@2x.png",
6
+ "scale": "2x"
7
+ },
8
+ {
9
+ "size": "512x512",
10
+ "filename": "icon_512x512.png",
11
+ "scale": "1x"
12
+ },
13
+ {
14
+ "size": "256x256",
15
+ "filename": "icon_256x256@2x.png",
16
+ "scale": "2x"
17
+ },
18
+ {
19
+ "size": "256x256",
20
+ "filename": "icon_256x256.png",
21
+ "scale": "1x"
22
+ },
23
+ {
24
+ "size": "128x128",
25
+ "filename": "icon_128x128@2x.png",
26
+ "scale": "2x"
27
+ },
28
+ {
29
+ "size": "128x128",
30
+ "filename": "icon_128x128.png",
31
+ "scale": "1x"
32
+ },
33
+ {
34
+ "size": "64x64",
35
+ "filename": "icon_64x64@2x.png",
36
+ "scale": "2x"
37
+ },
38
+ {
39
+ "size": "64x64",
40
+ "filename": "icon_64x64.png",
41
+ "scale": "1x"
42
+ },
43
+ {
44
+ "size": "32x32",
45
+ "filename": "icon_32x32@2x.png",
46
+ "scale": "2x"
47
+ },
48
+ {
49
+ "size": "32x32",
50
+ "filename": "icon_32x32.png",
51
+ "scale": "1x"
52
+ },
53
+ {
54
+ "size": "16x16",
55
+ "filename": "icon_16x16@2x.png",
56
+ "scale": "2x"
57
+ },
58
+ {
59
+ "size": "16x16",
60
+ "filename": "icon_16x16.png",
61
+ "scale": "1x"
62
+ }
63
+ ]
64
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appiconset
4
- VERSION = '2.6.0'
4
+ VERSION = '2.7.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appiconset
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - arthur87
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -89,6 +89,8 @@ files:
89
89
  - lib/appiconset.rb
90
90
  - lib/appiconset/cli.rb
91
91
  - lib/appiconset/generator.rb
92
+ - lib/appiconset/settings/favicon-Contents.json
93
+ - lib/appiconset/settings/icns.iconset-Contents.json
92
94
  - lib/appiconset/settings/iphone-xcode9.1-Contents.json
93
95
  - lib/appiconset/settings/mac-xcode9.1-Contents.json
94
96
  - lib/appiconset/settings/mipmap-hdpi-Contents.json
@@ -127,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
129
  - !ruby/object:Gem::Version
128
130
  version: '0'
129
131
  requirements: []
130
- rubygems_version: 3.5.11
132
+ rubygems_version: 3.3.3
131
133
  signing_key:
132
134
  specification_version: 4
133
135
  summary: appiconset generator for Xcode