Class: FlutterRb::PluginDirectoriesCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/flutter_rb/checks/plugin_directories_check.rb

Overview

This class represents a check for plugin directories structure in a Flutter project.

Constant Summary

Constants inherited from Check

Check::UNIMPLEMENTED_ERROR

Instance Method Summary collapse

Instance Method Details

#check(project) ⇒ CheckReport

Performs the check on the given project.

Parameters:

  • project (Project)

    The project to perform the check on.

Returns:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/flutter_rb/checks/plugin_directories_check.rb', line 27

def check(project)
  # Check if android and ios folders exist.
  android_exists = !project.android_folder.nil?
  ios_exists = !project.ios_folder.nil?

  # Determine the check result based on the existence of android and ios folders.
  check_result = android_exists && ios_exists || !android_exists && !ios_exists

  # Create a new CheckReport with the result.
  CheckReport.new(
    name,
    check_result ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
    description,
    project.path
  )
end

#descriptionString

Returns a description of the check.

Returns:

  • (String)

    A description of the check.



19
20
21
# File 'lib/flutter_rb/checks/plugin_directories_check.rb', line 19

def description
  'Check plugin directories structure in pubspec file'
end

#nameString

Returns the name of the check.

Returns:

  • (String)

    The name of the check.



12
13
14
# File 'lib/flutter_rb/checks/plugin_directories_check.rb', line 12

def name
  'PluginDirectoriesCheck'
end