Class: CocoaPodsAcknowledgements::AddOns::SwiftPackageAccumulator
- Inherits:
-
Object
- Object
- CocoaPodsAcknowledgements::AddOns::SwiftPackageAccumulator
- Defined in:
- lib/cocoapods_acknowledgements/addons/swift_package_accumulator.rb
Instance Method Summary collapse
-
#acknowledgements ⇒ Array<Acknowledgement>
The array of Acknowledgement objects.
-
#initialize(xcodeproj_path = nil) ⇒ SwiftPackageAccumulator
constructor
A new instance of SwiftPackageAccumulator.
Constructor Details
#initialize(xcodeproj_path = nil) ⇒ SwiftPackageAccumulator
Returns a new instance of SwiftPackageAccumulator.
10 11 12 13 14 15 16 17 18 |
# File 'lib/cocoapods_acknowledgements/addons/swift_package_accumulator.rb', line 10 def initialize(xcodeproj_path = nil) if xcodeproj_path.nil? @files = [] else build_dir = %x{xcodebuild -project "#{xcodeproj_path}" -showBuildSettings | grep -m 1 BUILD_DIR | grep -oEi "\/.*"}.strip source_packages_dir = Pathname(build_dir) + "../../SourcePackages/checkouts" @files = Dir[source_packages_dir + "*/*.podspec"] # skip nested git submodules end end |
Instance Method Details
#acknowledgements ⇒ Array<Acknowledgement>
Returns the array of Acknowledgement objects.
22 23 24 |
# File 'lib/cocoapods_acknowledgements/addons/swift_package_accumulator.rb', line 22 def acknowledgements @files.map { |file| Acknowledgement.new(file) } end |