Module: AppiconGenerate
- Defined in:
- lib/appicon_generate.rb,
lib/appicon_generate/version.rb
Defined Under Namespace
Classes: Icon
Constant Summary collapse
- DEST_PATH =
'icons'
- VERSION =
"0.1.3"
Class Method Summary collapse
Class Method Details
.run(file, options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/appicon_generate.rb', line 9 def run(file, ) icons = [] icons += icons_ios if [:ios] icons += icons_android if [:android] img = Magick::Image.read(file).first icons.each do |icon| path = "#{DEST_PATH}/#{icon.path}" FileUtils.mkdir_p File.dirname(path) img.resize(icon.px, icon.px).write(path) end img.destroy! end |