class VagrantHosts::Action::VersionCheck

Constants

MINIMUM_VERSION

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-hosts/action/version_check.rb, line 9
def initialize(app, env)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-hosts/action/version_check.rb, line 13
def call(env)
  unless Gem::Version.new(Vagrant::VERSION) > Gem::Version.new(MINIMUM_VERSION)
    env[:env].ui.warn I18n.t(
      'vagrant_hosts.action.version_check.deprecated_vagrant_version',
      minimum_version: MINIMUM_VERSION,
      vagrant_version: Vagrant::VERSION
    )
  end

  @app.call(env)
end