Class: Configuration

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

Defined Under Namespace

Classes: UserConfig

Constant Summary collapse

@@user_config =
UserConfig.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shell) ⇒ Configuration

Returns a new instance of Configuration.



20
21
22
23
# File 'lib/configuration.rb', line 20

def initialize(shell)
  initialize_env(shell)
  initialize_cartrcfile
end

Instance Attribute Details

#carthage_dependenciesObject (readonly)

Returns the value of attribute carthage_dependencies.



14
15
16
# File 'lib/configuration.rb', line 14

def carthage_dependencies
  @carthage_dependencies
end

#server_uriObject (readonly)

Returns the value of attribute server_uri.



14
15
16
# File 'lib/configuration.rb', line 14

def server_uri
  @server_uri
end

#swift_versionObject (readonly)

Returns the value of attribute swift_version.



14
15
16
# File 'lib/configuration.rb', line 14

def swift_version
  @swift_version
end

#xcodebuild_versionObject (readonly)

Returns the value of attribute xcodebuild_version.



14
15
16
# File 'lib/configuration.rb', line 14

def xcodebuild_version
  @xcodebuild_version
end

Class Method Details

.new_with_defaultsObject



16
17
18
# File 'lib/configuration.rb', line 16

def self.new_with_defaults
  Configuration.new(ShellWrapper.new)
end

.setup {|@@user_config| ... } ⇒ Object

Yields:

  • (@@user_config)


10
11
12
# File 'lib/configuration.rb', line 10

def self.setup
  yield(@@user_config)
end

Instance Method Details

#all_framework_namesObject



25
26
27
# File 'lib/configuration.rb', line 25

def all_framework_names
  version_files.flat_map { |vf| vf.framework_names }.uniq.sort
end

#to_sObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/configuration.rb', line 29

def to_s
  "    Xcodebuild: \#{@xcodebuild_version}\n    ---\n    Swift: \#{@swift_version}\n    ---\n    Server: \#{@server_uri.to_s}\n    ---\n    Cartfile.resolved:\n    \#{@carthage_dependencies.join(\"\\n\")}\n    ---\n    Local Build Frameworks:\n    \#{framework_names_with_platforms.join(\"\\n\")}\n  EOS\nend\n"