module Thor::Util
def self.namespaces_in_content(contents, file=__FILE__)
Array[Object]
==== Returns
contents
==== Parameters
namespaces defined in the sandbox.
Given the contents, evaluate it inside the sandbox and returns the
def self.namespaces_in_content(contents, file=__FILE__) old_constants = Thor::Base.subclasses.dup Thor::Base.subclasses.clear load_thorfile(file, contents) new_constants = Thor::Base.subclasses.dup Thor::Base.subclasses.replace(old_constants) new_constants.map!{ |c| c.namespace } new_constants.compact! new_constants end