Class: FlutterRb::PluginPodspecNameCheck

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

Overview

This class represents a check for Flutter plugin’s name 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 name in the podspec file. It compares the name in the pubspec file with the name 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:



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/flutter_rb/checks/plugin_podspec_check.rb', line 55

def check(project)
  name_in_pubspec = project.pubspec.pubspec_info.name
  podspec = project.ios_folder.podspec
  name_in_podspec = podspec.name

  CheckReport.new(
    name,
    name_in_pubspec == name_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 ‘name’.

Returns:

  • (String)

    the parameter for which the check is performed



44
45
46
# File 'lib/flutter_rb/checks/plugin_podspec_check.rb', line 44

def podspec_parameter
  'name'
end