6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/motion-bundler/simulator/console.rb', line 6
def print
if require_statement = [:require, :require_relative, :load, :autoload].include?(@method)
return if MotionBundler::REQUIRED.include? @args.last
end
warning = "Warning Called `#{[@object, @method].compact.join "."}"
warning += " #{@args.collect(&:inspect).join ", "}" unless @args.nil? || @args.empty?
warning += "`"
warning = warning.yellow
if require_statement
warning += "\nAdd within setup block: ".yellow
warning += "app.require \"#{@args.last}\"".green
elsif @message
warning += "\n#{@message}".green
end
puts " #{warning.gsub("\n", "\n" + (" " * 11))}"
end
|