Sha256: 5c9d7ad1e8559f327ccc585540fce8aded48475856772287d66d1c363bcd25c6

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

module Pod
  class Command
    class Package < Command
      :private

      def install_pod(platform_name)
        podfile = podfile_from_spec(
          File.basename(@path),
          @spec.name,
          platform_name,
          @spec.deployment_target(platform_name))

        sandbox = Sandbox.new(config.sandbox_root)
        installer = Installer.new(sandbox, podfile)
        installer.install!

        sandbox
      end

      def podfile_from_spec(path, spec_name, platform_name, deployment_target)
        Pod::Podfile.new do
          platform(platform_name, deployment_target)
          if path
            pod spec_name, :podspec => path
          else
            pod spec_name, :path => '.'
          end
        end
      end

      def spec_with_name(name)
        return if name.nil?

        set = SourcesManager.search(Dependency.new(name))
        return nil if set.nil?

        set.specification.root
      end

      def spec_with_path(path)
        return if path.nil? || !Pathname.new(path).exist?

        @path = path
        Specification.from_file(path)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cocoapods-packager-0.5.0 lib/cocoapods-packager/pod_utils.rb
cocoapods-packager-0.4.0 lib/pod_utils.rb
cocoapods-packager-0.3.0 lib/pod_utils.rb