module Bundler::Thor::Util

def namespace_from_thor_class(constant)


String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
==== Returns

constant:: The constant to be converted to the thor path.
==== Parameters

namespace from a class, just call namespace on it.
older versions of Bundler::Thor. On current versions, if you need to get the
This method should not be used in general because it's used to deal with

removing the sandbox namespace.
commands can be added to a sandbox, this method is also responsible for
Receives a constant and converts it to a Bundler::Thor namespace. Since Bundler::Thor
def namespace_from_thor_class(constant)
  constant = constant.to_s.gsub(/^Bundler::Thor::Sandbox::/, "")
  constant = snake_case(constant).squeeze(":")
  constant
end