Class: Ironment::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/ironment/finder.rb

Instance Method Summary collapse

Constructor Details

#initializeFinder

Returns a new instance of Finder.



5
6
7
# File 'lib/ironment/finder.rb', line 5

def initialize
  @pwd = Pathname.pwd
end

Instance Method Details

#findObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/ironment/finder.rb', line 9

def find
  Enumerator.new do |y|
    until @pwd.root?
      y << Runcom.new(cdrc) if has_cdrc?
      @pwd = @pwd.parent
    end

    y << Runcom.new(cdrc) if has_cdrc?
  end
end