Module: Googlepub

Defined in:
lib/googlepub.rb,
lib/googlepub/apk.rb,
lib/googlepub/auth.rb,
lib/googlepub/inapps.rb,
lib/googlepub/options.rb,
lib/googlepub/metadata.rb

Defined Under Namespace

Classes: APK, Auth, Inapps, Metadata, Options

Constant Summary collapse

ROOT =
File.expand_path(File.dirname(__FILE__) + '/..')
VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.call_apk(options = {}) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# 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 = {}) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# 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 = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/googlepub.rb', line 11

def self.(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