Class: Googlepub::Options
- Inherits:
-
Object
- Object
- Googlepub::Options
- Defined in:
- lib/googlepub/options.rb
Constant Summary collapse
- BANNER =
<<-EOS Googlepub it gem for Google Android Publisheing API. Abilities: 1) Store Listing 2) APK - All tracks 3) In-App Purchases (Managed and Subscriptions) Usage: googlepub COMMAND [OPTIONS] Main commands: apk. metadata, inapps Example: googlepub metadata -l "en-US" -p "com.keshav.goel" --store -t "Title" -s "Short Description" -f "fullDescription" --icon "icon.png" googlepub apk -p "com.keshav.goel" --file "file.apk" --track "beta" googlepub inapps -p "com.keshav.goel" --sku "com.keshav.inapp.12" --title "InApp 12" --fullDescription "Description" --price 1990000 Dependencies: Ruby, HTTP Author: @thekeshavgoel Email: [email protected] EOS
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(@options) 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(@options) when :metadata then puts Googlepub.(@options) when :inapps then puts Googlepub.call_inapps(@options) 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 |