Module: Diffend
- Defined in:
- lib/diffend.rb,
lib/diffend/errors.rb,
lib/diffend/voting.rb,
lib/diffend/request.rb,
lib/diffend/commands.rb,
lib/diffend/config/fetcher.rb,
lib/diffend/config/validator.rb,
lib/diffend/config/file_finder.rb,
lib/diffend/handle_errors/report.rb,
lib/diffend/voting/versions/local.rb,
lib/diffend/handle_errors/messages.rb,
lib/diffend/voting/versions/remote.rb,
lib/diffend/build_bundler_definition.rb,
lib/diffend/handle_errors/display_to_stdout.rb,
lib/diffend/handle_errors/build_exception_payload.rb
Overview
Diffend main namespace
Defined Under Namespace
Modules: BuildBundlerDefinition, Commands, Config, Errors, HandleErrors, Request, Voting
Constant Summary collapse
- VERSION =
Current plugin version
'0.2.25'- HOMEPAGE =
Diffend homepage
'https://diffend.io'
Class Method Summary collapse
- .build_outdated_version_message(version) ⇒ String
-
.command ⇒ String
Command that was run with bundle.
- .detect_installed_version ⇒ Object
-
.execute ⇒ Object
Execute diffend plugin.
-
.fetch_config ⇒ OpenStruct?
Fetch diffend config file.
-
.installed_version ⇒ String
Installed plugin version.
-
.register ⇒ Object
Registers the plugin and add before install all hook.
Class Method Details
.build_outdated_version_message(version) ⇒ String
78 79 80 81 82 83 |
# File 'lib/diffend.rb', line 78 def (version) <<~MSG \nYou are running an outdated version (#{version}) of the plugin, which will lead to issues. \nPlease upgrade to the latest one (#{VERSION}) by executing "rm -rf .bundle/plugin".\n MSG end |
.command ⇒ String
Command that was run with bundle
99 100 101 |
# File 'lib/diffend.rb', line 99 def command ARGV.first || Bundler.feature_flag.default_cli_command.to_s end |
.detect_installed_version ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/diffend.rb', line 66 def detect_installed_version return if installed_version == VERSION (installed_version) .tap(&Bundler.ui.method(:error)) exit 1 end |
.execute ⇒ Object
Execute diffend plugin
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/diffend.rb', line 43 def execute detect_installed_version config = fetch_config Diffend::Voting.call( command, config, Diffend::BuildBundlerDefinition.call( command, Bundler.default_gemfile, Bundler.default_lockfile ) ) rescue StandardError => e Diffend::HandleErrors::Report.call( exception: e, config: config, message: :unhandled_exception, report: true ) end |
.fetch_config ⇒ OpenStruct?
Fetch diffend config file
108 109 110 111 112 |
# File 'lib/diffend.rb', line 108 def fetch_config Config::Fetcher.call( File.('..', Bundler.bin_path) ) end |
.installed_version ⇒ String
Returns installed plugin version.
86 87 88 89 90 91 92 93 94 |
# File 'lib/diffend.rb', line 86 def installed_version Bundler::Plugin .index .plugin_path('diffend') .basename .to_s .split('-') .last end |
.register ⇒ Object
Registers the plugin and add before install all hook
36 37 38 39 40 |
# File 'lib/diffend.rb', line 36 def register Bundler::Plugin.add_hook('before-install-all') do |_| execute end end |