method
create_command
v2_6_3 -
Show latest stable
- Class:
Bundler::Thor
create_command(meth)protected
No documentation available.
# File lib/bundler/vendor/thor/lib/thor.rb, line 407
def create_command(meth) #:nodoc:
@usage ||= nil
@desc ||= nil
@long_desc ||= nil
@hide ||= nil
if @usage && @desc
base_class = @hide ? Bundler::Thor::HiddenCommand : Bundler::Thor::Command
commands[meth] = base_class.new(meth, @desc, @long_desc, @usage, method_options)
@usage, @desc, @long_desc, @method_options, @hide = nil
true
elsif all_commands[meth] || meth == "method_missing"
true
else
puts "[WARNING] Attempted to create command #{meth.inspect} without usage or description. " "Call desc if you want this method to be available as command or declare it inside a " "no_commands{} block. Invoked from #{caller[1].inspect}."
false
end
end