Class: Fastlane::Actions::SauceDevicesAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::SauceDevicesAction
- Defined in:
- lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
64 65 66 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 64 def self. ["Ian Hamilton"] end |
.available_options ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 29 def self. [ FastlaneCore::ConfigItem.new(key: :platform, description: "Device platform that you wish to query", optional: true, is_string: true, default_value: ''), FastlaneCore::ConfigItem.new(key: :region, description: "Data Center region (us or eu), set using: region: 'eu'", optional: false, type: String, verify_block: proc do |value| UI.user_error!(@messages['region_error'].gsub!('$region', value)) unless @messages['supported_regions'].include?(value) end), FastlaneCore::ConfigItem.new(key: :sauce_username, env_name: "SAUCE_USERNAME", description: "Your sauce labs username in order to authenticate upload requests", default_value: Actions.lane_context[SharedValues::SAUCE_USERNAME], optional: false, type: String, verify_block: proc do |value| UI.user_error!(@messages['sauce_username_error']) unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :sauce_access_key, env_name: "SAUCE_ACCESS_KEY", description: "Your sauce labs access key in order to authenticate upload requests", default_value: Actions.lane_context[SharedValues::SAUCE_ACCESS_KEY], optional: false, type: String, verify_block: proc do |value| UI.user_error!(@messages['sauce_api_key_error']) unless value && !value.empty? end) ] end |
.category ⇒ Object
68 69 70 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 68 def self.category :testing end |
.description ⇒ Object
21 22 23 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 21 def self.description "Returns a list of Device IDs for all devices in the data center that are currently free for testing." end |
.details ⇒ Object
25 26 27 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 25 def self.details "Returns a list of Device IDs for all devices in the data center that are currently free for testing." end |
.example_code ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 76 def self.example_code [ "sauce_devices({platform: 'android', region: 'eu', sauce_username: 'foo', sauce_access_key: 'bar123', })", "sauce_devices({region: 'eu', sauce_username: 'foo', sauce_access_key: 'bar123', })", "sauce_devices({region: 'us', sauce_username: 'foo', sauce_access_key: 'bar123', })" ] end |
.is_supported?(platform) ⇒ Boolean
72 73 74 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 72 def self.is_supported?(platform) [:ios, :android].include?(platform) end |
.run(params) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fastlane/plugin/saucectl/actions/sauce_devices_action.rb', line 9 def self.run(params) platform = params[:platform] case platform when 'android' Fastlane::Saucectl::Api.new(params).fetch_android_devices when 'ios' Fastlane::Saucectl::Api.new(params).fetch_ios_devices else Fastlane::Saucectl::Api.new(params).available_devices end end |