# 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! { |c| c.namespace }
        new_constants.compact!
        new_constants
      end