Module: Diffend::Plugin
- Defined in:
- lib/diffend/plugin.rb
Class Method Summary collapse
-
.execute ⇒ Object
Execute diffend plugin.
-
.register ⇒ Object
Registers the plugin and add before install all hook.
Class Method Details
.execute ⇒ Object
Execute diffend plugin
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/diffend/plugin.rb', line 46 def execute return unless Diffend::Enabled.call config = Diffend::Config.new(severity: Diffend::Logger::INFO) unless config.valid? config.print_errors exit 255 end Diffend::LatestVersion.call(config) Diffend::Execute.call(config) rescue Diffend::Errors::HandledException # config will not be initialized when configuration file is missing return if config&.ignore_errors? exit 255 rescue StandardError => e Diffend::HandleErrors::Report.call( exception: e, config: config, message: :unhandled_exception, report: true, raise_exception: false ) return if config.ignore_errors? exit 255 end |
.register ⇒ Object
Registers the plugin and add before install all hook
39 40 41 42 43 |
# File 'lib/diffend/plugin.rb', line 39 def register ::Bundler::Plugin.add_hook('before-install-all') do |_| execute end end |