lib/cc/cli.rb in codeclimate-0.17.0 vs lib/cc/cli.rb in codeclimate-0.18.0

- old
+ new

@@ -1,8 +1,9 @@ require "active_support" require "active_support/core_ext" require "cc/analyzer" +require "cc/workspace" require "cc/yaml" module CC module CLI autoload :Analyze, "cc/cli/analyze" @@ -13,7 +14,18 @@ autoload :Init, "cc/cli/init" autoload :Runner, "cc/cli/runner" autoload :Test, "cc/cli/test" autoload :ValidateConfig, "cc/cli/validate_config" autoload :Version, "cc/cli/version" + + def self.debug(message, values = {}) + if ENV["CODECLIMATE_DEBUG"] + if values.any? + message << " " + message << values.map { |k, v| "#{k}=#{v.inspect}" }.join(" ") + end + + $stderr.puts("[DEBUG] #{message}") + end + end end end