diff options
| author | Markus Reiter | 2017-04-28 12:42:17 +0200 | 
|---|---|---|
| committer | Markus Reiter | 2017-04-30 21:11:28 +0200 | 
| commit | 4d5d6a65e35f9a57139710c3dc547bfa51810630 (patch) | |
| tree | 5c1dd86b3bcac57d13749c8953ac18e432fbc7f7 /Library/Homebrew/PATH.rb | |
| parent | 22f624b373d77ede5c15db6f62672bdd81e6c9da (diff) | |
| download | brew-4d5d6a65e35f9a57139710c3dc547bfa51810630.tar.bz2 | |
Rename `PATH#validate` to `PATH#existing`.
Diffstat (limited to 'Library/Homebrew/PATH.rb')
| -rw-r--r-- | Library/Homebrew/PATH.rb | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 0bee1a5f2..eaa963ea5 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -23,6 +23,14 @@ class PATH      self    end +  def select(&block) +    self.class.new(@paths.select(&block)) +  end + +  def reject(&block) +    self.class.new(@paths.reject(&block)) +  end +    def to_ary      @paths    end @@ -49,9 +57,9 @@ class PATH      @paths.empty?    end -  def validate -    validated_path = self.class.new(@paths.select(&File.method(:directory?))) -    validated_path unless validated_path.empty? +  def existing +    existing_path = select(&File.method(:directory?)) +    existing_path unless existing_path.empty?    end    private | 
