icon-banner 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/icon_banner.rb +1 -1
- data/lib/icon_banner/ic_launcher.rb +17 -1
- data/lib/icon_banner/process.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3a2c8b2bc9d5c45b65dacb6b3056f4c64833a1
|
4
|
+
data.tar.gz: 39e6f79af8d63bb8eaa29378aabdb05d7735e76f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 016d9230c576877baecab16ba3b29cd2fccd2198e25729ccfd5e51cdc04c700062e09a1018078745cef072ce4fb38219c0cb5802d35651a21d5918ab13bd1cc2
|
7
|
+
data.tar.gz: 66ceab0eb31ddd7ad600fa7340fe619664d9ce069094122ad752fa276f1864c2771b0030b7d86d06dc6ffe28d67c9254f939e51cf9a0c09680074bb0b4781dbc
|
data/lib/icon_banner.rb
CHANGED
@@ -75,7 +75,23 @@ module IconBanner
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def backup_path(path)
|
78
|
-
|
78
|
+
ext = File.extname path
|
79
|
+
backup_path = path
|
80
|
+
backup_path = append_parent_dirname(path, 'res', BACKUP_EXTENSION) if path.include?('/res/')
|
81
|
+
backup_path = path.gsub('/src/', "/src#{BACKUP_EXTENSION}/") if path == backup_path
|
82
|
+
backup_path = path.gsub('/app/', "/src#{BACKUP_EXTENSION}/") if path == backup_path
|
83
|
+
backup_path = path.gsub('/android/', "/src#{BACKUP_EXTENSION}/") if path == backup_path
|
84
|
+
backup_path = path.gsub(ext, BACKUP_EXTENSION + ext) if path == backup_path
|
85
|
+
backup_path
|
86
|
+
end
|
87
|
+
|
88
|
+
def append_parent_dirname(path, dir, suffix)
|
89
|
+
segments = path.split(File::SEPARATOR)
|
90
|
+
dir_index = segments.index(dir)
|
91
|
+
return path unless dir_index && dir_index - 1 >= 0
|
92
|
+
|
93
|
+
parent_segment = segments[dir_index-1]
|
94
|
+
path.gsub("/#{parent_segment}/","/#{parent_segment}#{suffix}/")
|
79
95
|
end
|
80
96
|
|
81
97
|
def should_ignore_icon(icon)
|
data/lib/icon_banner/process.rb
CHANGED
@@ -34,8 +34,8 @@ module IconBanner
|
|
34
34
|
end unless color
|
35
35
|
|
36
36
|
banner_file = Tempfile.new %w[banner .png]
|
37
|
-
generate_banner banner_file.path, label, color, font
|
38
|
-
process_icon icon_path, banner_file.path
|
37
|
+
# generate_banner banner_file.path, label, color, font
|
38
|
+
# process_icon icon_path, banner_file.path
|
39
39
|
banner_file.close
|
40
40
|
|
41
41
|
UI.verbose "Completed processing #{File.basename icon_path}"
|
@@ -65,6 +65,8 @@ module IconBanner
|
|
65
65
|
UI.message "Completed #{self.class::PLATFORM} restore."
|
66
66
|
end
|
67
67
|
|
68
|
+
private
|
69
|
+
|
68
70
|
def get_app_icons(path)
|
69
71
|
app_icons = Dir.glob("#{path}#{self.class::BASE_ICON_PATH}")
|
70
72
|
app_icons.reject { |icon| should_ignore_icon(icon) }
|