Class: VagrantPlugins::DevCommands::Registry::Messager

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/devcommands/registry/messager.rb

Overview

Generic registry message printer

Constant Summary collapse

I18N_KEY =
'vagrant_devcommands.registry'

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Messager

Returns a new instance of Messager.



10
11
12
# File 'lib/vagrant/devcommands/registry/messager.rb', line 10

def initialize(env)
  @env = env
end

Instance Method Details

#chain_ignored(message, name) ⇒ Object



14
15
16
17
# File 'lib/vagrant/devcommands/registry/messager.rb', line 14

def chain_ignored(message, name)
  @env.ui.warn I18n.t("#{I18N_KEY}.#{message}", name: name)
  @env.ui.warn I18n.t("#{I18N_KEY}.chain_ignored")
end

#command_alias_ignored(message, name) ⇒ Object



19
20
21
22
# File 'lib/vagrant/devcommands/registry/messager.rb', line 19

def command_alias_ignored(message, name)
  @env.ui.warn I18n.t("#{I18N_KEY}.#{message}", name: name)
  @env.ui.warn I18n.t("#{I18N_KEY}.command_alias_ignored")
end

#def_duplicate(args) ⇒ Object



24
25
26
27
# File 'lib/vagrant/devcommands/registry/messager.rb', line 24

def def_duplicate(args)
  @env.ui.warn I18n.t("#{I18N_KEY}.def_duplicate", **args)
  @env.ui.warn ''
end

#def_ignored(message, args) ⇒ Object



29
30
31
32
33
# File 'lib/vagrant/devcommands/registry/messager.rb', line 29

def def_ignored(message, args)
  @env.ui.warn I18n.t("#{I18N_KEY}.#{message}", **args)
  @env.ui.warn I18n.t("#{I18N_KEY}.def_ignored")
  @env.ui.warn ''
end

#unknown_options(args) ⇒ Object



35
36
37
38
# File 'lib/vagrant/devcommands/registry/messager.rb', line 35

def unknown_options(args)
  @env.ui.warn I18n.t("#{I18N_KEY}.unknown_options", **args)
  @env.ui.warn ''
end