Class: FlutterRb::PluginPodspecVersionCheck

Inherits:
PluginPodspecCheck show all
Defined in:
lib/flutter_rb/checks/plugin_podspec_check.rb

Overview

This class represents a check for Flutter plugin’s version in the podspec file. It is a subclass of PluginPodspecCheck and overrides the necessary methods to perform the specific check.

Constant Summary

Constants inherited from Check

Check::UNIMPLEMENTED_ERROR

Instance Method Summary collapse

Methods inherited from PluginPodspecCheck

#description, #name

Methods inherited from Check

#description, #name

Instance Method Details

#check(project) ⇒ CheckReport

Performs the check for the plugin’s version in the podspec file. It compares the version in the pubspec file with the version in the podspec file. If they match, it returns a CheckReport with a normal status. If they do not match, it returns a CheckReport with a warning status.

Parameters:

  • project (Project)

    the project for which the check is performed

Returns:



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/flutter_rb/checks/plugin_podspec_check.rb', line 87

def check(project)
  version_in_pubspec = project.pubspec.pubspec_info.version
  podspec = project.ios_folder.podspec
  version_in_podspec = podspec.version

  CheckReport.new(
    name,
    version_in_pubspec == version_in_podspec ? ::CheckReportStatus::NORMAL : ::CheckReportStatus::WARNING,
    description,
    podspec.path
  )
end

#podspec_parameterString

Returns the parameter for which the check is performed in the podspec file. In this case, it returns ‘version’.

Returns:

  • (String)

    the parameter for which the check is performed



76
77
78
# File 'lib/flutter_rb/checks/plugin_podspec_check.rb', line 76

def podspec_parameter
  'version'
end