Class: CycloneDX::CocoaPods::Source::GitRepository
- Inherits:
-
Object
- Object
- CycloneDX::CocoaPods::Source::GitRepository
- Defined in:
- lib/cyclonedx/cocoapods/source.rb,
lib/cyclonedx/cocoapods/bom_builder.rb,
lib/cyclonedx/cocoapods/pod_attributes.rb
Constant Summary collapse
- VALID_TYPES =
%i[branch tag commit].freeze
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #attributes_for(pod:) ⇒ Object
-
#initialize(url:, type: nil, label: nil) ⇒ GitRepository
constructor
A new instance of GitRepository.
- #source_qualifier ⇒ Object
Constructor Details
#initialize(url:, type: nil, label: nil) ⇒ GitRepository
Returns a new instance of GitRepository.
38 39 40 41 42 43 44 |
# File 'lib/cyclonedx/cocoapods/source.rb', line 38 def initialize(url:, type: nil, label: nil) raise ArgumentError, 'Invalid checkout information' if !type.nil? && !VALID_TYPES.include?(type) @url = url @type = type @label = label end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
36 37 38 |
# File 'lib/cyclonedx/cocoapods/source.rb', line 36 def label @label end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
36 37 38 |
# File 'lib/cyclonedx/cocoapods/source.rb', line 36 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
36 37 38 |
# File 'lib/cyclonedx/cocoapods/source.rb', line 36 def url @url end |
Instance Method Details
#attributes_for(pod:) ⇒ Object
65 66 67 |
# File 'lib/cyclonedx/cocoapods/pod_attributes.rb', line 65 def attributes_for(pod:) ::Pod::Config.instance.sandbox.specification(pod.name).attributes_hash end |
#source_qualifier ⇒ Object
40 41 42 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 40 def source_qualifier { vcs_url: (label.nil? ? url : "#{url}@#{label}") } end |