module Thor::Util

def self.convert_constants_to_namespaces(yaml)


TrueClass|FalseClass:: Returns true if any change to the yaml file was made.
==== Returns

TODO Deprecate this method in the future.

This was added to deal with deprecated versions of Thor.
Receives a yaml (hash) and updates all constants entries to namespace.
def self.convert_constants_to_namespaces(yaml)
  yaml_changed = false
  yaml.each do |k, v|
    next unless v[:constants] && v[:namespaces].nil?
    yaml_changed = true
    yaml[k][:namespaces] = v[:constants].map{|c| Thor::Util.namespace_from_thor_class(c)}
  end
  yaml_changed
end