Module: Thor::Actions::ClassMethods

Defined in:
lib/thor/actions.rb

Instance Method Summary collapse

Instance Method Details

#source_pathsObject

Hold source paths for one Thor instance. source_paths_for_search is the method responsible to gather source_paths from this current class, inherited paths and the source root.



35
36
37
# File 'lib/thor/actions.rb', line 35

def source_paths
  @source_paths ||= []
end

#source_paths_for_searchObject

Returns the source paths in the following order:

1) This class source paths
2) Source root
3) Parents source paths


45
46
47
48
49
50
51
# File 'lib/thor/actions.rb', line 45

def source_paths_for_search
  paths = []
  paths += self.source_paths
  paths << self.source_root if self.respond_to?(:source_root)
  paths += from_superclass(:source_paths, [])
  paths
end