Class: Pod::Config

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

Defined Under Namespace

Modules: Mixin

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



18
19
20
21
22
23
# File 'lib/cocoapods/config.rb', line 18

def initialize
  @repos_dir = Pathname.new(File.expand_path("~/.cocoapods"))
  @clean = true
  @verbose = false
  @silent = false
end

Instance Attribute Details

#cleanObject Also known as: clean?

Returns the value of attribute clean.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def clean
  @clean
end

#project_pods_rootObject

Returns the value of attribute project_pods_root.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def project_pods_root
  @project_pods_root
end

#project_rootObject

Returns the value of attribute project_root.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def project_root
  @project_root
end

#repos_dirObject

Returns the value of attribute repos_dir.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def repos_dir
  @repos_dir
end

#rootspecObject

Returns the spec at the pat returned from project_podfile.



44
45
46
# File 'lib/cocoapods/config.rb', line 44

def rootspec
  @rootspec
end

#silentObject Also known as: silent?

Returns the value of attribute silent.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def silent
  @silent
end

#verboseObject Also known as: verbose?

Returns the value of attribute verbose.



13
14
15
# File 'lib/cocoapods/config.rb', line 13

def verbose
  @verbose
end

Class Method Details

.instanceObject



5
6
7
# File 'lib/cocoapods/config.rb', line 5

def self.instance
  @instance ||= new
end

.instance=(instance) ⇒ Object



9
10
11
# File 'lib/cocoapods/config.rb', line 9

def self.instance=(instance)
  @instance = instance
end

Instance Method Details

#ios?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/cocoapods/config.rb', line 57

def ios?
  rootspec.platform == :ios if rootspec
end

#osx?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/cocoapods/config.rb', line 61

def osx?
  rootspec.platform == :osx if rootspec
end

#project_podfileObject



33
34
35
36
37
38
39
40
41
# File 'lib/cocoapods/config.rb', line 33

def project_podfile
  unless @project_podfile
    @project_podfile = project_root + 'Podfile'
    unless @project_podfile.exist?
      @project_podfile = project_root.glob('*.podspec').first
    end
  end
  @project_podfile
end