Class: Pod::X::Sandbox::Project

Inherits:
Sandbox
  • Object
show all
Includes:
Protocol
Defined in:
lib/cocoapods-x/extension/sandbox/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ Project

Returns a new instance of Project.



12
13
14
15
16
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 12

def initialize conf
    @conf = conf
    super conf.project_debug_url
    @repos = Pod::X::Sandbox::Repos::new conf::project_debug_url
end

Instance Attribute Details

#confObject (readonly)

Returns the value of attribute conf.



10
11
12
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 10

def conf
  @conf
end

#reposObject (readonly)

Returns the value of attribute repos.



10
11
12
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 10

def repos
  @repos
end

Instance Method Details

#install!Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 18

def install!
    @conf.sync
    @conf.save!

    unless pods_file.exist?
        cp! [Pod::X::Sandbox::workspace::template::pods_file, pods_file]
    end

    unless source_file.exist?
        ln! ['-s', Pod::X::Sandbox::workspace::source_file, source_file]
    end

end

#pods_fileObject



36
37
38
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 36

def pods_file
    root + 'pods'
end

#project_nameObject



44
45
46
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 44

def project_name 
    File.basename(@conf.project_url)
end

#source_fileObject



40
41
42
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 40

def source_file
    root + 'sources'
end

#update!Object



32
33
34
# File 'lib/cocoapods-x/extension/sandbox/project.rb', line 32

def update!
    install!
end