Class: Pod::Extension::Sandbox

Inherits:
Object
  • Object
show all
Includes:
Protocol
Defined in:
lib/cocoapods-extension/sandbox.rb,
lib/cocoapods-extension/sandbox/repos.rb,
lib/cocoapods-extension/sandbox/project.rb,
lib/cocoapods-extension/sandbox/projects.rb,
lib/cocoapods-extension/sandbox/protocol.rb,
lib/cocoapods-extension/sandbox/template.rb,
lib/cocoapods-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

Class Method Summary collapse

Methods included from Protocol

#install!, #update!

Class Method Details

.find_podfile(dir) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/cocoapods-extension/sandbox.rb', line 32

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

.install!Object



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

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

.podfile_exists!(dir) ⇒ Object



26
27
28
29
30
# File 'lib/cocoapods-extension/sandbox.rb', line 26

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

.update!Object



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

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

.workspaceObject



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

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