Method: Bundler::Thor::Base::ClassMethods#remove_command
- Defined in:
- lib/bundler/vendor/thor/lib/thor/base.rb
permalink #remove_command(*names) ⇒ Object Also known as: remove_task
Removes a given command from this Bundler::Thor class. This is usually done if you are inheriting from another class and don’t want it to be available anymore.
By default it only remove the mapping to the command. But you can supply :undefine => true to undefine the method from the class as well.
Parameters
- name<Symbol|String>
-
The name of the command to be removed
- options<Hash>
-
You can give :undefine => true if you want commands the method to be undefined from the class as well.
500 501 502 503 504 505 506 507 508 |
# File 'lib/bundler/vendor/thor/lib/thor/base.rb', line 500 def remove_command(*names) = names.last.is_a?(Hash) ? names.pop : {} names.each do |name| commands.delete(name.to_s) all_commands.delete(name.to_s) undef_method name if [:undefine] end end |