Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/thor/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def initialize(args = [], local_options = {}, config = {})

class << self
def included(base) #:nodoc:
super(base)
base.extend ClassMethods
base.send :include, Invocation
base.send :include, Shell
Expand Down Expand Up @@ -596,13 +597,15 @@ def find_and_refresh_command(name) #:nodoc:
# Everytime someone inherits from a Thor class, register the klass
# and file into baseclass.
def inherited(klass)
super(klass)
Thor::Base.register_klass_file(klass)
klass.instance_variable_set(:@no_commands, false)
end

# Fire this callback whenever a method is added. Added methods are
# tracked as commands by invoking the create_command method.
def method_added(meth)
super(meth)
meth = meth.to_s

if meth == "initialize"
Expand Down
1 change: 1 addition & 0 deletions lib/thor/rake_compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def self.rake_classes
end

def self.included(base)
super(base)
# Hack. Make rakefile point to invoker, so rdoc task is generated properly.
rakefile = File.basename(caller[0].match(/(.*):\d+/)[1])
Rake.application.instance_variable_set(:@rakefile, rakefile)
Expand Down