Class: FlutterRb::PodspecParser

Inherits:
Object
  • Object
show all
Defined in:
lib/flutter_rb/project/specs/ios/podspec.rb

Overview

Represents a parser for Podspec files.

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ PodspecParser

Initializes a new instance of PodspecParser.

Parameters:

  • path (String)

    The path to the Podspec file to be parsed.



54
55
56
# File 'lib/flutter_rb/project/specs/ios/podspec.rb', line 54

def initialize(path)
  @path = path
end

Instance Method Details

#parsePodspec

Parses the Podspec file at the given path and returns a Podspec object.

Returns:

  • (Podspec)

    A Podspec object representing the parsed Podspec file.

Raises:

  • (Pod::DSLError)

    If there is an error parsing the Podspec file.



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/flutter_rb/project/specs/ios/podspec.rb', line 63

def parse
  # Parse the Podspec file using CocoaPods' Pod::Specification.
  podspec = Pod::Specification.from_file(@path)

  # Create a new Podspec object with the parsed data.
  @podspec = Podspec.new(
    @path,
    podspec.name,
    podspec.version.version,
    podspec.authors.nil? ? podspec.author : podspec.authors,
    podspec.source
  )
end