class GAConfiguration

@author Vittorio Monaco

Constants

GAConfigurationDefaultReporter
GAConfigurationDefaultSuffix
GAConfigurationDefaultXctoolPath
GAConfigurationProject
GAConfigurationReporter
GAConfigurationScheme
GAConfigurationSuffix
GAConfigurationTarget
GAConfigurationWorkspace
GAConfigurationXctoolPath

Public Class Methods

new(configuration = { GAConfigurationSuffix => "Test", GAConfigurationReporter => "pretty", GAConfigurationXctoolPath => "xctool" }) click to toggle source

Creates an instance with the given configuration, or uses a default one if not provided @param configuration [GAConfiguration]

@note by default the suffix is implied as “Test”, the reporter as “pretty” and the xctool_path as “xctool”

# File lib/ga_configuration.rb, line 86
def initialize(configuration = { GAConfigurationSuffix => "Test", GAConfigurationReporter => "pretty", GAConfigurationXctoolPath => "xctool" })
  @scheme = configuration[GAConfigurationScheme]
  @workspace = configuration[GAConfigurationWorkspace]
  @target = configuration[GAConfigurationTarget]
  @suffix = configuration[GAConfigurationSuffix]
  @reporter = configuration[GAConfigurationReporter]
  @xctool_path = configuration[GAConfigurationXctoolPath]
  @project = configuration[GAConfigurationProject]
end
sample() click to toggle source

Creates a sample GAConfiguration instance to instruct the user

@return [GAConfiguration] an instance that should not be used apart from outputting on the console

# File lib/ga_configuration.rb, line 69
def self.sample
  sample = GAConfiguration.new({
    GAConfigurationWorkspace => 'MyProject',
    GAConfigurationScheme => 'MyProject-Dev',
    GAConfigurationTarget => 'MyProjectTests',
    GAConfigurationSuffix => GAConfigurationDefaultSuffix,
    GAConfigurationReporter => GAConfigurationDefaultReporter,
    GAConfigurationXctoolPath => GAConfigurationDefaultXctoolPath
  })
      
  return sample
end

Public Instance Methods

merge(other) click to toggle source

Merges two GAConfiguration instances

@param other [GAConfiguration] another instance of GAConfiguration you want to merge @note nil values will not overwrite valid values of self

# File lib/ga_configuration.rb, line 100
def merge(other)
  @scheme = other.scheme unless other.scheme.nil?
  @workspace = other.workspace unless other.workspace.nil?
  @target = other.target unless other.target.nil?
  @suffix = other.suffix unless other.suffix.nil?
  @reporter = other.reporter unless other.reporter.nil?
  @xctool_path = other.xctool_path unless other.xctool_path.nil?
  @project = other.project unless other.project.nil?
  
  return self
end
project() click to toggle source

@return the configured xcode project, if not using workspaces

# File lib/ga_configuration.rb, line 21
def project
  @project
end
reporter() click to toggle source

@return the configured xctool reporter

# File lib/ga_configuration.rb, line 41
def reporter
  @reporter
end
scheme() click to toggle source

@return the configured xcode scheme

# File lib/ga_configuration.rb, line 16
def scheme
  @scheme
end
suffix() click to toggle source

@return the configured suffix for tests files

# File lib/ga_configuration.rb, line 31
def suffix
  @suffix
end
target() click to toggle source

@return the configured xcode tests target

# File lib/ga_configuration.rb, line 36
def target
  @target
end
to_s() click to toggle source

Prints the configuration instance @return a [String] representation of the instance

# File lib/ga_configuration.rb, line 52
def to_s
  hashForOutput = {
    GAConfigurationScheme => @scheme,
    GAConfigurationWorkspace => @workspace,
    GAConfigurationTarget => @target,
    GAConfigurationSuffix => @suffix,
    GAConfigurationReporter => @reporter,
    GAConfigurationXctoolPath => @xctool_path,
    GAConfigurationProject => @project
  }
  
  return hashForOutput.to_s
end
workspace() click to toggle source

@return the configured xcode workspace, if not using projects

# File lib/ga_configuration.rb, line 26
def workspace
  @workspace
end
xctool_path() click to toggle source

@return the configured xctool executable path

# File lib/ga_configuration.rb, line 46
def xctool_path
  @xctool_path
end