Class: Pod::SPM::Package
- Inherits:
-
Object
- Object
- Pod::SPM::Package
- Defined in:
- lib/cocoapods-spm/def/spm_package.rb
Instance Attribute Summary collapse
-
#linkage ⇒ Object
readonly
Returns the value of attribute linkage.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#relative_path ⇒ Object
readonly
Returns the value of attribute relative_path.
-
#requirement ⇒ Object
readonly
Returns the value of attribute requirement.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #create_pkg_ref(project) ⇒ Object
-
#initialize(name, options = {}) ⇒ Package
constructor
A new instance of Package.
- #inspect ⇒ Object
- #local? ⇒ Boolean
- #to_dependencies ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ Package
Returns a new instance of Package.
9 10 11 12 13 14 15 16 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 9 def initialize(name, = {}) @name = name = @requirement = requirement_from() @url = [:url] @relative_path = [:relative_path] @linkage = [:linkage] end |
Instance Attribute Details
#linkage ⇒ Object (readonly)
Returns the value of attribute linkage.
7 8 9 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 7 def linkage @linkage end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 7 def name @name end |
#relative_path ⇒ Object (readonly)
Returns the value of attribute relative_path.
7 8 9 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 7 def relative_path @relative_path end |
#requirement ⇒ Object (readonly)
Returns the value of attribute requirement.
7 8 9 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 7 def requirement @requirement end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 7 def url @url end |
Instance Method Details
#create_pkg_ref(project) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 34 def create_pkg_ref(project) cls = local? ? Object::XCLocalSwiftPackageReference : Object::XCRemoteSwiftPackageReference ref = project.new(cls) ref.name = name if local? ref.relative_path = relative_path else ref.repositoryURL = url ref.requirement = requirement end ref end |
#inspect ⇒ Object
18 19 20 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 18 def inspect "#<#{self.class} name=#{name}>" end |
#local? ⇒ Boolean
22 23 24 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 22 def local? @relative_path != nil end |
#to_dependencies ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/cocoapods-spm/def/spm_package.rb', line 26 def to_dependencies if (products = [:products]) products.map { |product| Dependency.new(@name, product: product, pkg: self) } else [Dependency.new(@name, pkg: self)] end end |