class Object - bundler-1.9.9 Documentation

# class Object

### Public Instance Methods

namespace(name) click to toggle source
Calls superclass method

    # File lib/bundler/vendor/thor/lib/thor/rake_compat.rb, line 60
    def namespace(name)
      if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
        const_name = Bundler::Thor::Util.camel_case(name.to_s).to_sym
        klass.const_set(const_name, Class.new(Bundler::Thor))
        new_klass = klass.const_get(const_name)
        Bundler::Thor::RakeCompat.rake_classes << new_klass
      end

      super
      Bundler::Thor::RakeCompat.rake_classes.pop
    end

Also aliased as: rake_namespace
rake_namespace(name)
Alias for: namespace
task(*) click to toggle source
Calls superclass method

    # File lib/bundler/vendor/thor/lib/thor/rake_compat.rb, line 40
    def task(*)
      task = super

      if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
        non_namespaced_name = task.name.split(":").last

        description = non_namespaced_name
        description << task.arg_names.map { |n| n.to_s.upcase }.join(" ")
        description.strip!

        klass.desc description, Rake.application.last_description || non_namespaced_name
        Rake.application.last_description = nil
        klass.send :define_method, non_namespaced_name do |*args|
          Rake::Task[task.name.to_sym].invoke(*args)
        end
      end

      task
    end