Class: FlutterRb::PluginPubspecVersionCheck

Inherits:
PluginPubspecCheck show all
Defined in:
lib/flutter_rb/checks/plugin_pubspec_check.rb

Overview

This class represents a check for Flutter plugin’s pubspec.yaml file for ‘version’ parameter. It inherits from PluginPubspecCheck class.

Constant Summary

Constants inherited from Check

Check::UNIMPLEMENTED_ERROR

Instance Method Summary collapse

Methods inherited from PluginPubspecCheck

#description, #name

Methods inherited from Check

#description, #name

Instance Method Details

#check(project) ⇒ CheckReport

Performs the check for the ‘version’ parameter in the pubspec.yaml file. It creates a CheckReport object with the result of the check.

Parameters:

  • project (Project)

    the project to be checked

Returns:



108
109
110
111
112
113
114
115
116
117
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 108

def check(project)
  pubspec = project.pubspec

  CheckReport.new(
    name,
    pubspec.pubspec_info.version.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
    description,
    pubspec.path
  )
end

#pubspec_parameterString

Returns the parameter to be checked in the pubspec.yaml file. In this case, it returns ‘version’.

Returns:

  • (String)

    the parameter to be checked



99
100
101
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 99

def pubspec_parameter
  'version'
end