Module: Bundler::ShellsplitPlugin

Defined in:
lib/bundler/shellsplit_plugin.rb,
lib/bundler/shellsplit_plugin/version.rb

Overview

Plugin module containing the hotfix for the shellsplit error.

Defined Under Namespace

Modules: ShellsplitSpecSettings

Constant Summary collapse

OLDEST_AFFECTED =
Gem::Version.new('1.17.3')
NEWEST_AFFECTED =
Gem::Version.new('2.0.2')
VERSION =
'1.0.1'

Class Method Summary collapse

Class Method Details

.bundler_affected?Boolean

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/bundler/shellsplit_plugin.rb', line 25

def bundler_affected?
  bundler_version = Gem::Version.new(Bundler::VERSION)
  bundler_version >= OLDEST_AFFECTED && bundler_version <= NEWEST_AFFECTED
end

.registerObject



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/bundler/shellsplit_plugin.rb', line 30

def register
  unless bundler_affected?
    Warning.warn('The Bundler::ShellsplitPlugin plugin is intended ' \
                 'for Bundler versions >= 1.17.3 and <= 2.0.2. It ' \
                 'has no effect on other versions, which do not have ' \
                 'the bug it attempts to fix.')
    return
  end

  Bundler::Plugin.add_hook('before-install') do
    Bundler::GemInstaller.prepend ShellsplitSpecSettings
  end
end