-
Notifications
You must be signed in to change notification settings - Fork 71
/
app.rb
49 lines (41 loc) · 1.38 KB
/
app.rb
1
2
3
4
5
6
7
8
9
10
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
41
42
43
44
45
46
47
48
49
require "thor"
module CandyCheck
module CLI
# Main class for the executable 'candy_check'
# @example
# $> candy_check help
class App < Thor
package_name "CandyCheck"
desc "app_store RECEIPT_DATA", "Verify a base64 encoded AppStore receipt"
method_option :environment,
default: "production",
type: :string,
enum: %w(production sandbox),
aliases: "-e",
desc: "The environment to use for verfication"
method_option :secret,
aliases: "-s",
type: :string,
desc: "The shared secret for auto-renewable subscriptions"
def app_store(receipt)
Commands::AppStore.run(receipt, **options)
end
desc "play_store PACKAGE PRODUCT_ID TOKEN", "Verify PlayStore purchase"
method_option :json_key_file,
required: true,
type: :string,
aliases: "-k",
desc: "The json key file to use for API authentication"
def play_store(package, product_id, token)
Commands::PlayStore.run(package, product_id, token, **options)
end
desc "version", 'Print the gem\'s version'
def version
Commands::Version.run
end
def self.exit_on_failure?
true
end
end
end
end