Don't use Ruby 1.9-only code
This commit is contained in:
parent
f47c59d4ba
commit
caa80d54ac
|
@ -26,16 +26,20 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
[[:warn, :yellow], [:error, :red], [:info, nil], [:confirm, :green]].each do |method, color|
|
[[:warn, :yellow], [:error, :red], [:info, nil], [:confirm, :green]].each do |method, color|
|
||||||
define_method(method) do |message, opts=nil|
|
class_eval <<-CODE
|
||||||
@shell.say("#{line_reset}#{format_message(message, opts)}", color)
|
def #{method}(message, opts=nil)
|
||||||
|
@shell.say("\#{line_reset}\#{format_message(message, opts)}", color)
|
||||||
end
|
end
|
||||||
|
CODE
|
||||||
end
|
end
|
||||||
|
|
||||||
[:ask, :no?, :yes?].each do |method|
|
[:ask, :no?, :yes?].each do |method|
|
||||||
define_method(method) do |message, opts=nil|
|
class_eval <<-CODE
|
||||||
|
def #{method}(message, opts=nil)
|
||||||
opts ||= {}
|
opts ||= {}
|
||||||
@shell.send(method, format_message(message, opts), opts[:color])
|
@shell.send(method, format_message(message, opts), opts[:color])
|
||||||
end
|
end
|
||||||
|
CODE
|
||||||
end
|
end
|
||||||
|
|
||||||
def report_progress(progress, total, show_parts=true)
|
def report_progress(progress, total, show_parts=true)
|
||||||
|
|
Loading…
Reference in New Issue