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)
|
||||||
end
|
@shell.say("\#{line_reset}\#{format_message(message, opts)}", color)
|
||||||
|
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
|
||||||
opts ||= {}
|
def #{method}(message, opts=nil)
|
||||||
@shell.send(method, format_message(message, opts), opts[:color])
|
opts ||= {}
|
||||||
end
|
@shell.send(method, format_message(message, opts), opts[:color])
|
||||||
|
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