Class: PEBuild::Action::VersionCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/pe_build/action/version_check.rb

Overview

Check for deprecated Vagrant versions

Constant Summary collapse

MINIMUM_VERSION =
'2.0.0'

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ VersionCheck

Returns a new instance of VersionCheck.



8
9
10
# File 'lib/pe_build/action/version_check.rb', line 8

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pe_build/action/version_check.rb', line 12

def call(env)
  unless Gem::Version.new(Vagrant::VERSION) > Gem::Version.new(MINIMUM_VERSION)
    env[:env].ui.warn I18n.t(
      'pebuild.action.version_check.deprecated_vagrant_version',
      minimum_version: MINIMUM_VERSION,
      vagrant_version: Vagrant::VERSION
    )
  end

  @app.call(env)
end