Class: FlutterRb::PluginPubspecCheck

Inherits:
Check
  • Object
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. It is an abstract class and should be subclassed to perform specific checks.

Constant Summary

Constants inherited from Check

Check::UNIMPLEMENTED_ERROR

Instance Method Summary collapse

Methods inherited from Check

#check

Instance Method Details

#descriptionString

Returns the description of the check. The description explains what the check is validating.

Returns:

  • (String)

    the description of the check



31
32
33
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 31

def description
  "Validate Flutter plugin's #{pubspec_parameter} in pubspec.yaml"
end

#nameString

Returns the name of the check. The name is constructed by appending the capitalized pubspec_parameter to “PluginPubspecCheck”.

Returns:

  • (String)

    the name of the check



14
15
16
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 14

def name
  "PluginPubspec#{pubspec_parameter.capitalize}Check"
end

#pubspec_parameterString

Returns the parameter to be checked in the pubspec.yaml file. This method should be implemented in subclasses to specify the specific parameter to be checked.

Returns:

  • (String)

    the parameter to be checked

Raises:

  • (NotImplementedError)

    if not implemented in subclasses



23
24
25
# File 'lib/flutter_rb/checks/plugin_pubspec_check.rb', line 23

def pubspec_parameter
  raise UNIMPLEMENTED_ERROR
end