Class: IconCreater::Create
- Inherits:
-
Object
- Object
- IconCreater::Create
- Defined in:
- lib/iconCreater/create.rb
Instance Method Summary collapse
- #createicon(input, output) ⇒ Object
-
#initialize(ahash) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(ahash) ⇒ Create
Returns a new instance of Create.
5 6 7 |
# File 'lib/iconCreater/create.rb', line 5 def initialize(ahash) @ahash = ahash end |
Instance Method Details
#createicon(input, output) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/iconCreater/create.rb', line 9 def createicon(input ,output) @ahash.each do |key,value| if File::exist?(input) if output == nil oput = `pwd`.chomp! elsif File::ftype(output).eql?'directory' oput = output else p '输出路径并不是文件夹' exit 0 end `/usr/local/bin/convert -resize #{value}x#{value} #{input} #{oput}/#{key}` else p '输入路径无图片' exit 0 end end p "输入图片路径:#{input}" if File::exist?(input) p "默认输出图片路径:#{`pwd`.chomp!}" if output == nil p "输出图片路径:#{output}" unless output == nil end |