class IconBanner::IcLauncher
Constants
- BASE_ICON_PATH
- PLATFORM
- PLATFORM_CODE
Public Instance Methods
append_parent_dirname(path, dir, suffix)
click to toggle source
# File lib/icon_banner/ic_launcher.rb, line 88 def append_parent_dirname(path, dir, suffix) segments = path.split(File::SEPARATOR) dir_index = segments.index(dir) return path unless dir_index && dir_index - 1 >= 0 parent_segment = segments[dir_index-1] path.gsub("/#{parent_segment}/","/#{parent_segment}#{suffix}/") end
backup_path(path)
click to toggle source
# File lib/icon_banner/ic_launcher.rb, line 77 def backup_path(path) ext = File.extname path backup_path = path backup_path = append_parent_dirname(path, 'res', BACKUP_EXTENSION) if path.include?('/res/') backup_path = path.gsub('/src/', "/src#{BACKUP_EXTENSION}/") if path == backup_path backup_path = path.gsub('/app/', "/src#{BACKUP_EXTENSION}/") if path == backup_path backup_path = path.gsub('/android/', "/src#{BACKUP_EXTENSION}/") if path == backup_path backup_path = path.gsub(ext, BACKUP_EXTENSION + ext) if path == backup_path backup_path end
should_ignore_icon(icon)
click to toggle source
# File lib/icon_banner/ic_launcher.rb, line 97 def should_ignore_icon(icon) icon[/\/build\//] || icon[/\/generated\//] || icon[/#{BACKUP_EXTENSION}/] end