Sha256: 4ad32cb438e4145efe58b2dcefe51aaa7b7417c67b9cf10095a237a9838097f1

Contents?: true

Size: 540 Bytes

Versions: 85

Compression:

Stored size: 540 Bytes

Contents

# encoding: utf-8

module FIR
  module Parser
    module Common

      # when type is ipa, the icon data is a png file.
      # when type is apk, the icon data is a binary data.
      def generate_tmp_icon data, type
        tmp_icon_path = "#{Dir.tmpdir}/icon-#{SecureRandom.hex[4..9]}.png"

        if type == :ipa
          FileUtils.cp(data, tmp_icon_path)
        elsif type == :apk
          File.open(tmp_icon_path, 'w+') { |f| f << data }
        else
          return
        end

        tmp_icon_path
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 4 rubygems

Version Path
fir-cli-xsl-2.0.1 lib/fir/util/parser/common.rb
fir-cli-xsl-2.0.0 lib/fir/util/parser/common.rb
fir-cli-xsl-1.0.4 lib/fir/util/parser/common.rb
fir-cli-x-1.7.2.1 lib/fir/util/parser/common.rb
fir-cli-1.7.2 lib/fir/util/parser/common.rb
fir-cli-1.7.1 lib/fir/util/parser/common.rb
fir-cli-1.7.0 lib/fir/util/parser/common.rb
fir-cli-1.6.13 lib/fir/util/parser/common.rb
fir-cli-1.6.12 lib/fir/util/parser/common.rb
fir-cli-1.6.11 lib/fir/util/parser/common.rb
omt-cli-1.6.7 lib/fir/util/parser/common.rb
omt-cli-1.6.6 lib/fir/util/parser/common.rb
fir-cli-1.6.10 lib/fir/util/parser/common.rb
fir-cli-1.6.9 lib/fir/util/parser/common.rb
omt-cli-1.6.5 lib/fir/util/parser/common.rb
omt-cli-1.6.4 lib/fir/util/parser/common.rb
fir-cli-1.6.8 lib/fir/util/parser/common.rb
fir-cli-1.6.7.beta lib/fir/util/parser/common.rb
fir-cli-1.6.7.alpha lib/fir/util/parser/common.rb
fir-cli-1.6.6 lib/fir/util/parser/common.rb