Sha256: 03af0f075a324757095ba6b7aaae06d1263bdb7e9c45f4a629f0958a06ebf002

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

module IconCreater
    class Create

       def initialize(ahash)
         @ahash = ahash
       end



       def createicon(input ,output)

         p "输入图片路径:#{input}" if File::exist?(input)
         p "输出图片路径:#{output}" if File::ftype(output).eql?'directory'
         p "默认输出图片路径:#{`pwd`.chomp!}"  if output == nil
         @ahash.each do |key,value|

           if File::exist?(input)

                if output == nil

                  output = `pwd`.chomp!

                  `cd /`
                  `/usr/local/bin/convert -resize #{value}x#{value}  #{input}  #{output}/#{key}`

                else
                  if File::ftype(output).eql?'directory'

                    `/usr/local/bin/convert -resize #{value}x#{value}  #{input}  #{output}/#{key}`
                  else
                    p '输出路径无效'
                  end

                end





           else
             p '输入路径无图片'
           end

         end



       end

    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iconCreater-0.2.2 lib/iconCreater/create.rb
iconCreater-0.2.0 lib/iconCreater/create.rb
iconCreater-0.1.9 lib/iconCreater/create.rb