Sha256: dbd82b14e15828335c4e04aa99b7ca89620c1d2b99e29d6c3b0ac20ea7b41647

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

# frozen_string_literal: true

module Apkstats::Command
  module Executable
    require "open3"

    attr_reader :command_path

    def executable?
      File.executable?(command_path)
    end

    # Compare two apk files and return results.
    #
    # {
    #   base: {
    #     file_size: Integer,
    #     download_size: Integer,
    #     required_features: Array<String>,
    #     non_required_features: Array<String>,
    #     permissions: Array<String>,
    #     min_sdk: String,
    #     target_sdk: String,
    #   },
    #   other: {
    #     file_size: Integer,
    #     download_size: Integer,
    #     required_features: Array<String>,
    #     non_required_features: Array<String>,
    #     permissions: Array<String>,
    #     min_sdk: String,
    #     target_sdk: String,
    #   },
    #   diff: {
    #     file_size: Integer,
    #     download_size: Integer,
    #     required_features: {
    #       new: Array<String>,
    #       removed: Array<String>,
    #     },
    #     non_required_features:{
    #       new: Array<String>,
    #       removed: Array<String>,
    #     },
    #     permissions: {
    #       new: Array<String>,
    #       removed: Array<String>,
    #     },
    #     min_sdk: Array<String>,
    #     target_sdk: Array<String>,
    #   }
    # }
    #
    # @return [Hash]
    def compare_with(apk_filepath, other_apk_filepath)
      base = Apkstats::Entity::ApkInfo.new(self, apk_filepath)
      other = Apkstats::Entity::ApkInfo.new(self, other_apk_filepath)

      Apkstats::Entity::ApkInfoDiff.new(base, other).to_h
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danger-apkstats-0.1.2 lib/apkstats/command/executable.rb
danger-apkstats-0.1.1.pre.1 lib/apkstats/command/executable.rb
danger-apkstats-0.1.0 lib/apkstats/command/executable.rb