Class: FlutterRb::FlutterRbConfigInitializer
- Inherits:
-
Object
- Object
- FlutterRb::FlutterRbConfigInitializer
- Defined in:
- lib/flutter_rb/config/flutter_rb_config_initializer.rb
Overview
Class that initialize configuration
Constant Summary collapse
- FLUTTER_CHECKS =
[ PluginDirectoriesCheck.new, PluginPubspecNameCheck.new, PluginPubspecDescriptionCheck.new, PluginPubspecVersionCheck.new, PluginPubspecAuthorCheck.new, PluginPubspecHomepageCheck.new, PluginPubspecLintsCheck.new, PluginPubspecFlutterLintsCheck.new ].freeze
- ANDROID_CHECKS =
[ PluginGradleAndroidPackageCheck.new, PluginGradleVersionCheck.new ].freeze
- IOS_CHECKS =
[ PluginPodspecNameCheck.new, PluginPodspecVersionCheck.new, PluginPodspecAuthorsCheck.new, PluginPodspecSourceCheck.new ].freeze
Instance Method Summary collapse
- #default ⇒ FlutterRbConfig
-
#parse(path) ⇒ FlutterRbConfig
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity.
Instance Method Details
#default ⇒ FlutterRbConfig
70 71 72 73 74 75 76 |
# File 'lib/flutter_rb/config/flutter_rb_config_initializer.rb', line 70 def default FlutterRbConfig.new( FLUTTER_CHECKS, ANDROID_CHECKS, IOS_CHECKS ) end |
#parse(path) ⇒ FlutterRbConfig
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/flutter_rb/config/flutter_rb_config_initializer.rb', line 37 def parse(path) config = YAML.load_file(path) exclude_flutter_checks = ::Set.new exclude_android_checks = ::Set.new exclude_ios_checks = ::Set.new unless config.nil? exclude_checks = YAML.load_file(path)['exclude'] unless exclude_checks['flutter'].nil? exclude_flutter_checks += exclude_checks['flutter'].map { |check| "FlutterRb::#{check}" } end unless exclude_checks['android'].nil? exclude_android_checks += exclude_checks['android'].map { |check| "FlutterRb::#{check}" } end unless exclude_checks['ios'].nil? exclude_ios_checks += exclude_checks['ios'].map { |check| "FlutterRb::#{check}" } end end FlutterRbConfig.new( FLUTTER_CHECKS.reject { |check| exclude_flutter_checks&.include?(check.class.name) }, ANDROID_CHECKS.reject { |check| exclude_android_checks&.include?(check.class.name) }, IOS_CHECKS.reject { |check| exclude_ios_checks&.include?(check.class.name) } ) end |