Class: Fastlane::Saucectl::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/saucectl/helper/storage.rb

Overview

This class provides the ability to store, delete, and retrieve data from the Sauce Labs Storage API

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Storage



10
11
12
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 10

def initialize(config)
  @config = config
end

Instance Method Details

#delete_all_apps_for_group_idObject

Deletes the specified group of files from Sauce Storage. The Sauce Labs identifier of the group of files. You can look up file IDs using the Get App Storage Groups endpoint. https://docs.saucelabs.com/dev/api/storage/#get-app-storage-groups



33
34
35
36
37
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 33

def delete_all_apps_for_group_id
  path = "v1/storage/files/#{@config[:group_id]}"
  api = Fastlane::Saucectl::Api.new(@config)
  api.delete_app(path)
end

#delete_app_with_file_idObject

Delete app by the Sauce Labs identifier of the stored file. You can look up file IDs using the Get App Storage Files endpoint. https://docs.saucelabs.com/dev/api/storage/#get-app-storage-files



24
25
26
27
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 24

def delete_app_with_file_id
  api = Fastlane::Saucectl::Api.new(@config)
  api.delete_app("v1/storage/files/#{@config[:app_id]}")
end

#retrieve_all_appsObject

Get App Storage Files



16
17
18
19
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 16

def retrieve_all_apps
  api = Fastlane::Saucectl::Api.new(@config)
  api.retrieve_all_apps
end

#upload_appObject

Uploads an application file to Sauce Storage for the purpose of mobile application testing



41
42
43
# File 'lib/fastlane/plugin/saucectl/helper/storage.rb', line 41

def upload_app
  Fastlane::Saucectl::Api.new(@config).upload
end