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, PluginPubspecEffectiveDartCheck.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 ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Layout/LineLength.
-
#parse(path) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Layout/LineLength.
Instance Method Details
#default ⇒ Object
rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Layout/LineLength
48 49 50 51 52 53 54 |
# File 'lib/flutter_rb/config/flutter_rb_config_initializer.rb', line 48 def default FlutterRbConfig.new( FLUTTER_CHECKS, ANDROID_CHECKS, IOS_CHECKS ) end |
#parse(path) ⇒ Object
rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Layout/LineLength
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/flutter_rb/config/flutter_rb_config_initializer.rb', line 32 def parse(path) config = YAML.load_file(path)['include'] flutter_checks = [] flutter_checks += config['flutter'].map { |check| Object.const_get("FlutterRb::#{check}").new } unless config['flutter'].nil? android_checks = [] android_checks += config['android'].map { |check| Object.const_get("FlutterRb::#{check}").new } unless config['android'].nil? ios_checks = [] ios_checks += config['ios'].map { |check| Object.const_get("FlutterRb::#{check}").new } unless config['ios'].nil? FlutterRbConfig.new( flutter_checks.empty? ? FLUTTER_CHECKS : flutter_checks, android_checks.empty? ? ANDROID_CHECKS : android_checks, ios_checks.empty? ? IOS_CHECKS : ios_checks ) end |