diff options
| author | Markus Reiter | 2017-04-28 12:39:00 +0200 | 
|---|---|---|
| committer | Markus Reiter | 2017-04-30 21:11:28 +0200 | 
| commit | 22f624b373d77ede5c15db6f62672bdd81e6c9da (patch) | |
| tree | 2e74f0456b0d8e9707b19c545735208f939c00fe /Library/Homebrew/PATH.rb | |
| parent | e70f2ec33233422b70db047338aa85d9e2088042 (diff) | |
| download | brew-22f624b373d77ede5c15db6f62672bdd81e6c9da.tar.bz2 | |
Make `PATH` enumerable.
Diffstat (limited to 'Library/Homebrew/PATH.rb')
| -rw-r--r-- | Library/Homebrew/PATH.rb | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 6c5cd9e41..0bee1a5f2 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -1,4 +1,9 @@  class PATH +  include Enumerable +  extend Forwardable + +  def_delegator :@paths, :each +    def initialize(*paths)      @paths = parse(*paths)    end @@ -13,6 +18,11 @@ class PATH      self    end +  def insert(index, *paths) +    @paths = parse(*@paths.insert(index, *paths)) +    self +  end +    def to_ary      @paths    end | 
