class Pod::Command::Reinstall

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-dongjia/command/reinstall.rb, line 27
def initialize(argv)
  @save = argv.flag?("save")
  path = argv.shift_argument
  @project_path = Pathname.new(path) if path
  super
end
options() click to toggle source
# File lib/cocoapods-dongjia/command/reinstall.rb, line 21
def self.options
  [
    ["--save", "将重新生成的 project.pbxproj 文件保存下来"]
  ]
end

Public Instance Methods

run() click to toggle source
# File lib/cocoapods-dongjia/command/reinstall.rb, line 51
def run

  deintegrator = Deintegrator.new
  deintegrator.deintegrate_project(@project)
  @project.save if @save

  verify_podfile_exists!
  installer = installer_for_config
  installer.repo_update = repo_update?(:default => false)
  installer.update = false
  installer.deployment = @deployment
  installer.clean_install = @clean_install
  installer.install!

end
validate!() click to toggle source
Calls superclass method
# File lib/cocoapods-dongjia/command/reinstall.rb, line 34
def validate!
  super

  unless @project_path
    xcodeprojs = Pathname.glob('*.xcodeproj')
    @project_path = xcodeprojs.first if xcodeprojs.size == 1
  end

  help! 'A valid Xcode project file is required.' unless @project_path
  help! "#{@project_path} does not exist." unless @project_path.exist?
  unless @project_path.directory? && (@project_path + 'project.pbxproj').exist?
    help! "#{@project_path} is not a valid Xcode project."
  end

  @project = Xcodeproj::Project.open(@project_path)
end