Class: Pod::X::Sandbox

Inherits:
Object
  • Object
show all
Includes:
Protocol
Defined in:
lib/cocoapods-x/extension/sandbox.rb,
lib/cocoapods-x/extension/sandbox/repos.rb,
lib/cocoapods-x/extension/sandbox/project.rb,
lib/cocoapods-x/extension/sandbox/projects.rb,
lib/cocoapods-x/extension/sandbox/protocol.rb,
lib/cocoapods-x/extension/sandbox/template.rb,
lib/cocoapods-x/extension/sandbox/workspace.rb

Defined Under Namespace

Modules: Protocol Classes: Project, Projects, Repos, Template, Workspace

Constant Summary collapse

PODFILE_NAMES =
[
    'CocoaPods.podfile.yaml',
    'CocoaPods.podfile',
    'Podfile',
    'Podfile.rb',
].freeze
XCODE_POD_CACHEFILE =
{
    'Pods' => File.join(Dir.pwd, 'Pods'),
    'Podfile.lock' => File.join(Dir.pwd, 'Podfile.lock'),
    'DerivedData' => File.join(File.expand_path('~'), 'Library/Developer/Xcode/DerivedData'),
}.freeze

Class Method Summary collapse

Methods included from Protocol

#install!, #update!

Class Method Details

.find_podfile(dir) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/cocoapods-x/extension/sandbox.rb', line 35

def self.find_podfile dir
    PODFILE_NAMES.each do |filename|
        candidate = dir + filename
        if candidate.file?
            return candidate
        end
    end
    nil
end

.install!Object



19
20
21
# File 'lib/cocoapods-x/extension/sandbox.rb', line 19

def self.install!
    Pod::X::Sandbox::workspace::install!
end

.podfile_exists!(dir) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/cocoapods-x/extension/sandbox.rb', line 27

def self.podfile_exists! dir
    podfile = Pod::X::Sandbox::find_podfile(dir)
    if podfile.nil?
        raise Informative, "No `Podfile' found in the project directory."
    end
    podfile
end

.update!Object



23
24
25
# File 'lib/cocoapods-x/extension/sandbox.rb', line 23

def self.update!
    Pod::X::Sandbox::workspace::update!
end

.workspaceObject



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

def self.workspace
    @@workspace ||= Pod::X::Sandbox::Workspace::new
    @@workspace
end

.xcode_cachefilesObject



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

def self.xcode_cachefiles
    XCODE_POD_CACHEFILE
end