Class: Pod::Extension::Sandbox::Workspace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorkspace

Returns a new instance of Workspace.



13
14
15
16
17
18
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 13

def initialize
    super File.join(File.expand_path('~'), '.cocoapods/extension')
    @repos = Pod::Extension::Sandbox::Repos::new root
    @template = Pod::Extension::Sandbox::Template::new root
    @projects = Pod::Extension::Sandbox::Projects::new root
end

Instance Attribute Details

#projectsObject (readonly)

Returns the value of attribute projects.



11
12
13
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11

def projects
  @projects
end

#reposObject (readonly)

Returns the value of attribute repos.



11
12
13
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11

def repos
  @repos
end

#templateObject (readonly)

Returns the value of attribute template.



11
12
13
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 11

def template
  @template
end

Instance Method Details

#install!Object



20
21
22
23
24
25
26
27
28
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 20

def install!
    @repos.install!
    @template.install! 
    @projects.install!

    unless source_file.exist?
        cp! [@template::source_file, source_file]
    end
end

#source_fileObject



39
40
41
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 39

def source_file
    root + 'source'
end

#update!Object



30
31
32
33
34
35
36
37
# File 'lib/cocoapods-extension/sandbox/workspace.rb', line 30

def update!
    @repos.update!
    @template.update!
    @projects.update!
    
    rm! ['-rf', source_file]
    cp! [@template::source_file, source_file]
end