Module: Pod::Command::ProjectDirectory

Defined in:
lib/cocoapods/command/project.rb

Overview

Provides support for commands to take a user-specified ‘project directory`

Defined Under Namespace

Modules: Options

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
# File 'lib/cocoapods/command/project.rb', line 14

def self.included(base)
  base.extend(Options)
end

Instance Method Details

#initialize(argv) ⇒ Object



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

def initialize(argv)
  if project_directory = argv.option('project-directory')
    @project_directory = Pathname.new(project_directory).expand_path
  end
  config.installation_root = @project_directory
  super
end

#validate!Object



26
27
28
29
30
31
32
# File 'lib/cocoapods/command/project.rb', line 26

def validate!
  super
  if @project_directory && !@project_directory.directory?
    raise Informative,
          "`#{@project_directory}` is not a valid directory."
  end
end