Class: Gem::MultiPathSearcher
- Inherits:
-
Object
- Object
- Gem::MultiPathSearcher
- Defined in:
- lib/generators/templates/application/common/merb_thor/common.rb
Instance Method Summary collapse
- #find(path) ⇒ Object
- #find_all(path) ⇒ Object
-
#initialize ⇒ MultiPathSearcher
constructor
A new instance of MultiPathSearcher.
Constructor Details
#initialize ⇒ MultiPathSearcher
Returns a new instance of MultiPathSearcher.
33 34 35 36 |
# File 'lib/generators/templates/application/common/merb_thor/common.rb', line 33 def initialize @main_searcher = ArbitrarySearcher.new(MAIN_INDEX) @fallback_searcher = ArbitrarySearcher.new(FALLBACK_INDEX) end |
Instance Method Details
#find(path) ⇒ Object
38 39 40 41 42 |
# File 'lib/generators/templates/application/common/merb_thor/common.rb', line 38 def find(path) try = @main_searcher.find(path) return try if try @fallback_searcher.find(path) end |
#find_all(path) ⇒ Object
44 45 46 47 48 |
# File 'lib/generators/templates/application/common/merb_thor/common.rb', line 44 def find_all(path) try = @main_searcher.find_all(path) return try unless try.empty? @fallback_searcher.find_all(path) end |