Sha256: 8e7f8e7f660c24b30bc6869f9013bcc1f5b9461aebc4f4b4fb4c74aebc748e37

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

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

module Ocean
  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 = Ocean::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

5 entries across 5 versions & 1 rubygems

Version Path
cocoapods-swordfish-1.0.2 lib/swordfish/helpers/library.rb
cocoapods-swordfish-1.0.1 lib/swordfish/helpers/library.rb
cocoapods-swordfish-1.0.0 lib/swordfish/helpers/library.rb
cocoapods-swordfish-0.1.7 lib/swordfish/helpers/library.rb
cocoapods-swordfish-0.1.6 lib/swordfish/helpers/library.rb