class GAConfiguration
@author Vittorio Monaco
Constants
- GAConfigurationDefaultReporter
- GAConfigurationDefaultSuffix
- GAConfigurationDefaultXctoolPath
- GAConfigurationProject
- GAConfigurationReporter
- GAConfigurationScheme
- GAConfigurationSuffix
- GAConfigurationTarget
- GAConfigurationWorkspace
- GAConfigurationXctoolPath
Public Class Methods
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
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
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
@return the configured xcode project, if not using workspaces
# File lib/ga_configuration.rb, line 21 def project @project end
@return the configured xctool reporter
# File lib/ga_configuration.rb, line 41 def reporter @reporter end
@return the configured xcode scheme
# File lib/ga_configuration.rb, line 16 def scheme @scheme end
@return the configured suffix for tests files
# File lib/ga_configuration.rb, line 31 def suffix @suffix end
@return the configured xcode tests target
# File lib/ga_configuration.rb, line 36 def target @target end
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
@return the configured xcode workspace, if not using projects
# File lib/ga_configuration.rb, line 26 def workspace @workspace end
@return the configured xctool executable path
# File lib/ga_configuration.rb, line 46 def xctool_path @xctool_path end