Sha256: 6f08dc920438190e78a54338fe555b770765c5f3e2c6d4db533881a1cee6daff

Contents?: true

Size: 1.63 KB

Versions: 9

Compression:

Stored size: 1.63 KB

Contents

module Pod
  class Command
    # @CocoaPods 1.0.0.beta.1
    #
    class Deintegrate < Command
      include ProjectDirectory

      self.summary = 'Deintegrate CocoaPods from your project'
      self.description = <<-DESC
        Deintegrate your project from CocoaPods. Removing all traces
        of CocoaPods from your Xcode project.

        If no xcodeproj is specified, then a search for an Xcode project
        will be made in the current directory.
      DESC
      self.arguments = [
        CLAide::Argument.new('XCODE_PROJECT', false),
      ]

      def initialize(argv)
        path = argv.shift_argument
        @project_path = Pathname.new(path) if path
        super
      end

      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

      def run
        # We don't traverse a Podfile and try to de-intergrate each target.
        # Instead, we're just deintegrating anything CP could have done to a
        # project. This is so that it will clean stale, and modified projects.
        deintegrator = Deintegrator.new
        deintegrator.deintegrate_project(@project)
        @project.save
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
cocoapods-deintegrate-1.0.5 lib/cocoapods/command/deintegrate.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/cocoapods-deintegrate-1.0.4/lib/cocoapods/command/deintegrate.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/cocoapods-deintegrate-1.0.4/lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.4 lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.3 lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.2 lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.1 lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.0 lib/cocoapods/command/deintegrate.rb
cocoapods-deintegrate-1.0.0.rc.2 lib/cocoapods/command/deintegrate.rb