Class: Mdq::CLI
- Inherits:
-
Thor
- Object
- Thor
- Mdq::CLI
- Defined in:
- lib/mdq/cli.rb
Overview
entry point
Class Method Summary collapse
Instance Method Summary collapse
- #apps ⇒ Object
- #cap ⇒ Object
- #check ⇒ Object
- #devices ⇒ Object
- #install ⇒ Object
- #list ⇒ Object
- #simcap ⇒ Object
- #uninstall ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
10 11 12 |
# File 'lib/mdq/cli.rb', line 10 def exit_on_failure? true end |
.help(shell, subcommand) ⇒ Object
100 101 102 103 |
# File 'lib/mdq/cli.rb', line 100 def self.help(shell, subcommand) super puts 'Online documentation: https://github.com/arthur87/mdq' end |
Instance Method Details
#apps ⇒ Object
43 44 45 46 47 |
# File 'lib/mdq/cli.rb', line 43 def apps db = Mdq::DB.new db.get(is_android: [:android], is_apple: [:apple]) puts(JSON.pretty_generate(App.all.as_json)) end |
#cap ⇒ Object
65 66 67 68 69 |
# File 'lib/mdq/cli.rb', line 65 def cap db = Mdq::DB.new db.get(is_apps: false) db.device_screencap([:output], [:udid]) end |
#check ⇒ Object
21 22 23 24 25 |
# File 'lib/mdq/cli.rb', line 21 def check db = Mdq::DB.new puts "adb is installed: #{db.android_discoverable?}" puts "Xcode is installed: #{db.apple_discoverable?}" end |
#devices ⇒ Object
32 33 34 35 36 |
# File 'lib/mdq/cli.rb', line 32 def devices db = Mdq::DB.new db.get(is_android: [:android], is_apple: [:apple], is_apps: false) puts(JSON.pretty_generate(Device.all.as_json)) end |
#install ⇒ Object
85 86 87 88 89 |
# File 'lib/mdq/cli.rb', line 85 def install db = Mdq::DB.new db.get(is_apps: false) db.app_install([:input], [:udid], [:replace]) end |
#list ⇒ Object
55 56 57 58 59 60 |
# File 'lib/mdq/cli.rb', line 55 def list db = Mdq::DB.new db.get(is_android: [:android], is_apple: [:apple]) result = db.query(['query']) puts(JSON.pretty_generate(result.as_json)) end |
#simcap ⇒ Object
75 76 77 78 |
# File 'lib/mdq/cli.rb', line 75 def simcap db = Mdq::DB.new db.sim_screencap([:output], is_android: [:platform] == 'android') end |