Class: Spaceship::Launcher

Inherits:
Object
  • Object
show all
Defined in:
spaceship/lib/spaceship/launcher.rb

Instance Attribute Summary collapse

Login Helper collapse

Helper methods for managing multiple instances of spaceship collapse

Instance Method Summary collapse

Constructor Details

#initialize(user = nil, password = nil) ⇒ Launcher

Launch a new spaceship, which can be used to maintain multiple instances of spaceship. You can call ‘.new` without any parameters, but you’ll have to call ‘.login` at a later point. If you prefer, you can pass the login credentials here already.

Authenticates with Apple’s web services. This method has to be called once to generate a valid session. The session will automatically be used from then on.

This method will automatically use the username from the Appfile (if available) and fetch the password from the Keychain (if available)

Parameters:

  • user (String) (defaults to: nil)

    (optional): The username (usually the email address)

  • password (String) (defaults to: nil)

    (optional): The password

Raises:

  • InvalidUserCredentialsError: raised if authentication failed



23
24
25
26
27
28
29
# File 'spaceship/lib/spaceship/launcher.rb', line 23

def initialize(user = nil, password = nil)
  @client = PortalClient.new

  if user || password
    @client.(user, password)
  end
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



5
6
7
# File 'spaceship/lib/spaceship/launcher.rb', line 5

def client
  @client
end

Instance Method Details

#appClass

Returns Access the apps for this spaceship.

Returns:

  • (Class)

    Access the apps for this spaceship



72
73
74
# File 'spaceship/lib/spaceship/launcher.rb', line 72

def app
  Spaceship::Portal::App.set_client(@client)
end

#app_groupClass

Returns Access the app groups for this spaceship.

Returns:

  • (Class)

    Access the app groups for this spaceship



77
78
79
# File 'spaceship/lib/spaceship/launcher.rb', line 77

def app_group
  Spaceship::Portal::AppGroup.set_client(@client)
end

#certificateClass

Returns Access the certificates for this spaceship.

Returns:

  • (Class)

    Access the certificates for this spaceship



87
88
89
# File 'spaceship/lib/spaceship/launcher.rb', line 87

def certificate
  Spaceship::Portal::Certificate.set_client(@client)
end

#deviceClass

Returns Access the devices for this spaceship.

Returns:

  • (Class)

    Access the devices for this spaceship



82
83
84
# File 'spaceship/lib/spaceship/launcher.rb', line 82

def device
  Spaceship::Portal::Device.set_client(@client)
end

#login(user, password) ⇒ Spaceship::Client

Authenticates with Apple’s web services. This method has to be called once to generate a valid session. The session will automatically be used from then on.

This method will automatically use the username from the Appfile (if available) and fetch the password from the Keychain (if available)

Parameters:

  • user (String)

    (optional): The username (usually the email address)

  • password (String)

    (optional): The password

Returns:

Raises:

  • InvalidUserCredentialsError: raised if authentication failed



48
49
50
# File 'spaceship/lib/spaceship/launcher.rb', line 48

def (user, password)
  @client.(user, password)
end

#provisioning_profileClass

Returns Access the provisioning profiles for this spaceship.

Returns:

  • (Class)

    Access the provisioning profiles for this spaceship



92
93
94
# File 'spaceship/lib/spaceship/launcher.rb', line 92

def provisioning_profile
  Spaceship::Portal::ProvisioningProfile.set_client(@client)
end

#select_teamString

Open up the team selection for the user (if necessary).

If the user is in multiple teams, a team selection is shown. The user can then select a team by entering the number

Additionally, the team ID is shown next to each team name so that the user can use the environment variable ‘FASTLANE_TEAM_ID` for future user.

Returns:

  • (String)

    The ID of the select team. You also get the value if the user is only in one team.



63
64
65
# File 'spaceship/lib/spaceship/launcher.rb', line 63

def select_team
  @client.select_team
end