Sha256: d76c20589d0d5afb94db3344f5c431ab7cb80f07c34eafb434645e4501056b34

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

# copy from https://github.com/CocoaPods/cocoapods-packager

module CBin
  class Library
    attr_reader :headers_path
    attr_reader :resources_path
    attr_reader :root_path
    attr_reader :versions_path
    attr_reader :name_path

    def initialize(name, platform, version)
      @name = name
      @platform = platform
      @version = version
    end

    def make
      make_root
      make_library
      make_headers
      make_resources
    end

    def delete_resources
      Pathname.new(@resources_path).rmtree
      (Pathname.new(@fwk_path) + Pathname.new('Resources')).delete
    end

    private

    def make_library
      @name_path = CBin::Config::Builder.instance.library_name_version(@name,@version)
      @fwk_path = @root_path + Pathname.new(@name_path)
      @fwk_path.mkdir unless @fwk_path.exist?

      @versions_path = @fwk_path
    end

    def make_headers
      @headers_path = @versions_path + Pathname.new('Headers')
      # @headers_path.mkpath unless @headers_path.exist?
    end

    def make_resources
      @resources_path = @versions_path + Pathname.new('Resources')
      # @resources_path.mkpath unless @resources_path.exist?
    end

    def make_root
      @root_path = Pathname.new(@platform)
      @root_path.mkpath unless @root_path.exist?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cocoapods-imy-bin-0.2.7 lib/cocoapods-imy-bin/helpers/library.rb
cocoapods-imy-bin-0.2.6 lib/cocoapods-imy-bin/helpers/library.rb
cocoapods-imy-bin-0.2.5 lib/cocoapods-imy-bin/helpers/library.rb
cocoapods-imy-bin-0.2.3 lib/cocoapods-imy-bin/helpers/library.rb
cocoapods-imy-bin-0.2.2 lib/cocoapods-imy-bin/helpers/library.rb
cocoapods-imy-bin-0.2.1 lib/cocoapods-imy-bin/helpers/library.rb