|
1 | 1 | require_relative "command"
|
2 | 2 | require_relative "core_ext/hash_with_indifferent_access"
|
3 |
| -require_relative "core_ext/ordered_hash" |
4 | 3 | require_relative "error"
|
5 | 4 | require_relative "invocation"
|
6 | 5 | require_relative "parser"
|
@@ -89,6 +88,7 @@ def initialize(args = [], local_options = {}, config = {})
|
89 | 88 |
|
90 | 89 | class << self
|
91 | 90 | def included(base) #:nodoc:
|
| 91 | + super(base) |
92 | 92 | base.extend ClassMethods
|
93 | 93 | base.send :include, Invocation
|
94 | 94 | base.send :include, Shell
|
@@ -353,22 +353,22 @@ def group(name = nil)
|
353 | 353 | # Returns the commands for this Bundler::Thor class.
|
354 | 354 | #
|
355 | 355 | # ==== Returns
|
356 |
| - # OrderedHash:: An ordered hash with commands names as keys and Bundler::Thor::Command |
357 |
| - # objects as values. |
| 356 | + # Hash:: An ordered hash with commands names as keys and Bundler::Thor::Command |
| 357 | + # objects as values. |
358 | 358 | #
|
359 | 359 | def commands
|
360 |
| - @commands ||= Bundler::Thor::CoreExt::OrderedHash.new |
| 360 | + @commands ||= Hash.new |
361 | 361 | end
|
362 | 362 | alias_method :tasks, :commands
|
363 | 363 |
|
364 | 364 | # Returns the commands for this Bundler::Thor class and all subclasses.
|
365 | 365 | #
|
366 | 366 | # ==== Returns
|
367 |
| - # OrderedHash:: An ordered hash with commands names as keys and Bundler::Thor::Command |
368 |
| - # objects as values. |
| 367 | + # Hash:: An ordered hash with commands names as keys and Bundler::Thor::Command |
| 368 | + # objects as values. |
369 | 369 | #
|
370 | 370 | def all_commands
|
371 |
| - @all_commands ||= from_superclass(:all_commands, Bundler::Thor::CoreExt::OrderedHash.new) |
| 371 | + @all_commands ||= from_superclass(:all_commands, Hash.new) |
372 | 372 | @all_commands.merge!(commands)
|
373 | 373 | end
|
374 | 374 | alias_method :all_tasks, :all_commands
|
@@ -502,7 +502,7 @@ def handle_argument_error(command, error, args, arity) #:nodoc:
|
502 | 502 | msg = "ERROR: \"#{basename} #{name}\" was called with ".dup
|
503 | 503 | msg << "no arguments" if args.empty?
|
504 | 504 | msg << "arguments " << args.inspect unless args.empty?
|
505 |
| - msg << "\nUsage: #{banner(command).inspect}" |
| 505 | + msg << "\nUsage: \"#{banner(command).split("\n").join("\"\n \"")}\"" |
506 | 506 | raise InvocationError, msg
|
507 | 507 | end
|
508 | 508 |
|
@@ -596,13 +596,15 @@ def find_and_refresh_command(name) #:nodoc:
|
596 | 596 | # Everytime someone inherits from a Bundler::Thor class, register the klass
|
597 | 597 | # and file into baseclass.
|
598 | 598 | def inherited(klass)
|
| 599 | + super(klass) |
599 | 600 | Bundler::Thor::Base.register_klass_file(klass)
|
600 | 601 | klass.instance_variable_set(:@no_commands, false)
|
601 | 602 | end
|
602 | 603 |
|
603 | 604 | # Fire this callback whenever a method is added. Added methods are
|
604 | 605 | # tracked as commands by invoking the create_command method.
|
605 | 606 | def method_added(meth)
|
| 607 | + super(meth) |
606 | 608 | meth = meth.to_s
|
607 | 609 |
|
608 | 610 | if meth == "initialize"
|
|
0 commit comments