Class: Googlepub::Options
- Inherits:
-
Object
- Object
- Googlepub::Options
- Defined in:
- lib/googlepub/options.rb
Constant Summary collapse
- BANNER =
"Googlepub it gem for Google Android Publisheing API.\nAbilities:\n1) Store Listing\n2) APK - All tracks\n3) In-App Purchases (Managed and Subscriptions)\n\nUsage:\n googlepub COMMAND [OPTIONS]\n Main commands:\napk. metadata, inapps\nExample:\n googlepub metadata -l \"en-US\" -p \"com.keshav.goel\" --store -t \"Title\" -s \"Short Description\" -f \"fullDescription\" --icon \"icon.png\"\n googlepub apk -p \"com.keshav.goel\" --file \"file.apk\" --track \"beta\"\n googlepub inapps -p \"com.keshav.goel\" --sku \"com.keshav.inapp.12\" --title \"InApp 12\" --fullDescription \"Description\" --price 1990000\n\nDependencies:\n Ruby, HTTP\n\nAuthor: @thekeshavgoel\nEmail: [email protected]\n"
Instance Method Summary collapse
-
#initialize ⇒ Options
constructor
Creating a CommandLine runs off of the contents of ARGV.
- #run ⇒ Object
-
#usage ⇒ Object
Print out the usage help message.
Constructor Details
#initialize ⇒ Options
Creating a CommandLine runs off of the contents of ARGV.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/googlepub/options.rb', line 35 def initialize cmd = ARGV.shift @command = cmd && cmd.to_sym @auth = Googlepub::Auth.new() if @command != :inapps @auth.edit run @auth.validate_edit @auth.commit_edit else run end end |
Instance Method Details
#run ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/googlepub/options.rb', line 50 def run begin case @command when :apk then puts Googlepub.call_apk() when :metadata then puts Googlepub.() when :inapps then puts Googlepub.call_inapps() else puts "Please provide command to Excute - 'apk' or 'metadata'" exit (1) end end end |
#usage ⇒ Object
Print out the usage help message.
64 65 66 67 |
# File 'lib/googlepub/options.rb', line 64 def usage puts "\n#{@option_parser}\n" exit end |