Class: Scirocco::CLI
- Inherits:
-
Thor
- Object
- Thor
- Scirocco::CLI
- Defined in:
- lib/scirocco/cli.rb
Instance Method Summary collapse
- #abort_all ⇒ Object
- #abort_test ⇒ Object
- #apps ⇒ Object
- #check_test ⇒ Object
- #devices ⇒ Object
- #get_device_id ⇒ Object
- #projects ⇒ Object
- #run_test ⇒ Object
- #tests ⇒ Object
- #upload_app ⇒ Object
Instance Method Details
#abort_all ⇒ Object
61 62 63 64 |
# File 'lib/scirocco/cli.rb', line 61 def abort_all client = Scirocco::Client.new([:api_key], ) pp client.abort_all end |
#abort_test ⇒ Object
55 56 57 58 |
# File 'lib/scirocco/cli.rb', line 55 def abort_test client = Scirocco::Client.new([:api_key], ) pp client.abort_test([:test_job_id]) end |
#apps ⇒ Object
99 100 101 102 |
# File 'lib/scirocco/cli.rb', line 99 def apps client = Scirocco::Client.new([:api_key], ) pp client.apps([:project_id]) end |
#check_test ⇒ Object
48 49 50 51 |
# File 'lib/scirocco/cli.rb', line 48 def check_test client = Scirocco::Client.new([:api_key], ) pp client.check_test([:test_job_id]) end |
#devices ⇒ Object
74 75 76 77 |
# File 'lib/scirocco/cli.rb', line 74 def devices client = Scirocco::Client.new([:api_key], ) pp client.devices([:project_id], ) end |
#get_device_id ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/scirocco/cli.rb', line 87 def get_device_id client = Scirocco::Client.new([:api_key], ) devices = client.devices([:project_id], )["devices"] if devices.length > 0 p devices[0]["device_id"] else p "" end end |
#projects ⇒ Object
12 13 14 15 |
# File 'lib/scirocco/cli.rb', line 12 def projects client = Scirocco::Client.new([:api_key], ) pp client.projects() end |
#run_test ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/scirocco/cli.rb', line 28 def run_test client = Scirocco::Client.new([:api_key], ) test_job = client.run_test([:test_class_id], [:device_id])["test_job"] puts "* test_job:" pp test_job if [:poll] test_status = client.poll_test_result(test_job["test_job_id"]) if test_status["status"] == "passed" puts "**** PASSED ****" pp test_status elsif test_status["status"] == "failed" puts "**** FAILED ****" pp test_status raise SciroccoTestError.new(test_status["result"]) end end end |
#tests ⇒ Object
19 20 21 22 |
# File 'lib/scirocco/cli.rb', line 19 def tests client = Scirocco::Client.new([:api_key], ) pp client.tests([:project_id]) end |
#upload_app ⇒ Object
107 108 109 110 |
# File 'lib/scirocco/cli.rb', line 107 def upload_app client = Scirocco::Client.new([:api_key], ) pp client.upload_app([:project_id], [:app_path]) end |