module Googlepub

Constants

ROOT
VERSION

Public Class Methods

call_apk(options = {}) click to toggle source
# File lib/googlepub.rb, line 42
def self.call_apk(options = {})
  if !options["file"]
    p "Please provide the file to input: "
    @file = gets.chomp
    if !@file
      p "No APK file provided".red
    end
  else
    @file = options["file"]
  end

  if !options["track"]
    p "Please provide the Track for the APK [alpha, beta, prod] (for ease use --track)"
    @track = gets.chomp
    if !@track
      p "No track provided".red
    end
  else
    @track = options["track"]
  end

  if !options["version"]
    p "Please provide the Version (Code) for the APK"
    @version = gets.chomp
  else
    @version = options["version"]
  end
  if !@version
    p "Invalid request, Please provide a Version!".red
    exit (1)
  end
  @apk = Googlepub::APK.new(@file, @track)
  @apk.upload_apk
  @apk.select_version(@version)

end
call_inapps(options = {}) click to toggle source
# File lib/googlepub.rb, line 79
def self.call_inapps(options = {})
  if !options["sku"]
    puts "SKU (Product Id) of the In-App Purchase (eg: \"com.keshav.inapp.001\"):"
    @sku = gets.chomp
  else
    @sku = options["sku"]
  end
  @iap = Googlepub::Inapps.new(@sku, options["language"])
  @iap.find_inapp
  if options["price"] || options["title"] || options["description"]
    @iap.edit_inapp(options)
  else
    puts "No option passed to Edit the In-App"
  end

end
call_metadata(options = {}) click to toggle source
# File lib/googlepub.rb, line 11
def self.call_metadata(options = {})
  @pack = Googlepub::Metadata.new(options["language"])
  if options["store"]
    p "Going to edit Store Listing"
    @pack.edit_listings(options["title"], options["fullDescription"], options["shortDescription"], options["video"])
  end
  if options["icon"]
    p "Going to Upload Icon on GooglePlay Store:"
    @pack.imagefile("icon", options["icon"])
  end

  if options["details"]
    p "Going to edit Details"
    @pack.edit_details(options["website"], options["email"], options["phone"])
  end

  if options["screenshots"]
    p "Going to Update Screenshots"
    types = ["featureGraphic", "phoneScreenshots", "promoGraphic", "sevenInchScreenshots", "tenInchScreenshots", "tvBanner", "tvScreenshots", "wearScreenshots"]
    types.each do |t|
      if options[t]
        screens = options[t].split(",")
        screens.each do |sc|
          @pack.imagefile(t, sc)
        end
      end
    end
  end

end