Module: AppCask
- Defined in:
- lib/appcask.rb,
lib/appcask/version.rb,
lib/appcask/local_app.rb,
sig/appcask.rbs
Defined Under Namespace
Constant Summary collapse
- ICON_SIZES =
{ "0" => { display: "60x60", key: "artworkUrl60" }, "1" => { display: "100x100", key: "artworkUrl100" }, "2" => { display: "512x512", key: "artworkUrl512" }, "3" => { display: "1024x1024", key: "artworkUrl512" } }.freeze
- SCREENSHOT_DEVICES =
{ "iphone" => "iPhone screenshots", "ipad" => "iPad screenshots" }.freeze
- COUNTRIES =
{ "us" => "United States", "cn" => "China", "jp" => "Japan", "kr" => "South Korea", "hk" => "Hong Kong", "tw" => "Taiwan", "gb" => "United Kingdom", "de" => "Germany", "fr" => "France" }.freeze
- DOWNLOAD_MODES =
{ "1" => { name: "Icon Only", method: :download_icon }, "2" => { name: "Screenshots Only", method: :download_screenshots }, "3" => { name: "Description Only", method: :download_description }, "4" => { name: "All Assets", method: :download_all } }.freeze
- VERSION =
"0.6.0"
Class Method Summary collapse
Class Method Details
.get ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/appcask.rb', line 64 def get app_name = get_app_name country = get_country puts "\nš Searching for \"#{app_name}\"..." results = search_app(app_name, country) if results.nil? || results["resultCount"].to_i.zero? warn "ā No apps found for \"#{app_name}\"." return end selected_app = select_app(results) return unless selected_app mode = select_download_mode return unless mode send(mode[:method], selected_app, country) end |
.main ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/appcask.rb', line 44 def main command = ARGV[0]&.downcase case command when "fetch", "local" require_relative "appcask/local_app" AppCask::LocalApp.fetch_all else get end rescue Interrupt puts "\n\nš Goodbye!" exit 0 rescue StandardError => e warn "\nā Error: #{e.}" warn e.backtrace if ENV["DEBUG"] exit 1 end |