Class: FastlaneCore::ActionLaunchContext

Inherits:
Object
  • Object
show all
Defined in:
fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb

Constant Summary collapse

UNKNOWN_P_HASH =
'unknown'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_name: nil, p_hash: UNKNOWN_P_HASH, platform: nil, fastlane_client_language: nil) ⇒ ActionLaunchContext

Returns a new instance of ActionLaunchContext.



13
14
15
16
17
18
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 13

def initialize(action_name: nil, p_hash: UNKNOWN_P_HASH, platform: nil, fastlane_client_language: nil)
  @action_name = action_name
  @p_hash = p_hash
  @platform = platform
  @fastlane_client_language = fastlane_client_language
end

Instance Attribute Details

#action_nameObject

Returns the value of attribute action_name.



8
9
10
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 8

def action_name
  @action_name
end

#fastlane_client_languageObject

example: ruby fastfile, swift fastfile



11
12
13
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 11

def fastlane_client_language
  @fastlane_client_language
end

#p_hashObject

Returns the value of attribute p_hash.



9
10
11
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 9

def p_hash
  @p_hash
end

#platformObject

Returns the value of attribute platform.



10
11
12
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 10

def platform
  @platform
end

Class Method Details

.context_for_action_name(action_name, fastlane_client_language: :ruby, args: nil) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 20

def self.context_for_action_name(action_name, fastlane_client_language: :ruby, args: nil)
  app_id_guesser = FastlaneCore::AppIdentifierGuesser.new(args: args)
  return self.new(
    action_name: action_name,
    p_hash: app_id_guesser.p_hash || UNKNOWN_P_HASH,
    platform: app_id_guesser.platform,
    fastlane_client_language: fastlane_client_language
  )
end

Instance Method Details

#build_tool_versionObject



30
31
32
33
34
35
36
# File 'fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb', line 30

def build_tool_version
  if platform == :android
    return 'android'
  else
    return "Xcode #{Helper.xcode_version}"
  end
end