Method not available on this version
This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
namespaces_in_content(contents, file = __FILE__)
public
Given the contents, evaluate it inside the sandbox and returns the
namespaces defined in the sandbox.
Parameters
contents
Returns
Array[Object]
# File lib/bundler/vendor/thor/lib/thor/util.rb, line 58
def namespaces_in_content(contents, file = __FILE__)
old_constants = Bundler::Thor::Base.subclasses.dup
Bundler::Thor::Base.subclasses.clear
load_thorfile(file, contents)
new_constants = Bundler::Thor::Base.subclasses.dup
Bundler::Thor::Base.subclasses.replace(old_constants)
new_constants.map!(&:namespace)
new_constants.compact!
new_constants
end