parent_paths 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6783c3c77067649617f46ba80b6637024586f0f8
4
- data.tar.gz: 8e62049d650768895aa289369bdaf313d64d7333
3
+ metadata.gz: 81f9210b7c28d25e97600ff562291dd4f1b31394
4
+ data.tar.gz: 4baab1d17ef63cabffba23deda7da2a370e486fe
5
5
  SHA512:
6
- metadata.gz: 1ff27cdefafbd639daea65a8091ea9196ce9770d580a8d7f3420416760017cdea5324d43daf782a1564facf2de879f9a3bb53ca553a1ed6675334e340c4c24ba
7
- data.tar.gz: dccc5a2999243a4f73d8c10fc103192af2530b886ec13fa791fc53d53a0b25999ccf91b0f6ae0d1f7c58691084c4b78623c2ef94e38a3b6b42cbede9aa585b8a
6
+ metadata.gz: b6ad4125294f2705ed8a94f426b159723e2b7a94c6f393525f0763e171801c48b7236848a21710bbacaead28398177832ba4a59957233e880cd7abe9d8dd5f7a
7
+ data.tar.gz: 476c5509ddd5ca99edd30cc6378793399e70eecbb68af52d7a4ecfcd749e992adf5353202f514da0a1eb658de624a3f9941a8055490acce99f4b0efd67acbd1e
data/README.md CHANGED
@@ -8,7 +8,7 @@ Include `parent_paths` in your Gemfile, or call `gem install parent_paths`.
8
8
 
9
9
  ## `ParentPaths` module
10
10
 
11
- ### scan(start = nil, &criteria)
11
+ ### find(start = nil, &criteria)
12
12
 
13
13
  From the given starting path, scan upward through the file hierachy until a particular criteria is met. The criteria is determined by a block that receives the path of the next directory in the hierarchy.
14
14
 
@@ -17,12 +17,12 @@ If a starting path is not provided, it is assumed to be the path of the file tha
17
17
  ```
18
18
  # Find the first ancestor directory of the current file to contain more than 5
19
19
  # files
20
- ParentPaths.scan do |path|
20
+ ParentPaths.find do |path|
21
21
  Dir.glob(path + '*').size > 5
22
22
  end
23
23
  ```
24
24
 
25
- ### scan_for_owner(filename, start = nil)
25
+ ### find_owner(filename, start = nil)
26
26
 
27
27
  From the given starting path, scan upward through the file hierachy until a particular filename is discovered.
28
28
 
@@ -31,7 +31,7 @@ If a starting path is not provided, it is assumed to be the path of the file tha
31
31
  ```
32
32
  # Find the first ancestor directory of the current file that contains a
33
33
  # particular filename.
34
- ParentPaths.scan_for_owner('Gemfile')
34
+ ParentPaths.find_owner('Gemfile')
35
35
  ```
36
36
 
37
37
 
@@ -1,3 +1,3 @@
1
1
  module ParentPaths
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/parent_paths.rb CHANGED
@@ -8,7 +8,7 @@ module ParentPaths
8
8
  #
9
9
  # If a starting path is not provided, it is assumed to be the path of the
10
10
  # file that calls this method.
11
- def self.scan(start = nil, &criteria)
11
+ def self.find(start = nil, &criteria)
12
12
  start ||= caller_path
13
13
  if criteria.call(start)
14
14
  return start
@@ -17,7 +17,7 @@ module ParentPaths
17
17
  if start == parent
18
18
  nil
19
19
  else
20
- scan parent, &criteria
20
+ find parent, &criteria
21
21
  end
22
22
  end
23
23
  end
@@ -27,9 +27,9 @@ module ParentPaths
27
27
  #
28
28
  # If a starting path is not provided, it is assumed to be the path of the
29
29
  # file that calls this method.
30
- def self.scan_for_owner(filename, start = nil)
30
+ def self.find_owner(filename, start = nil)
31
31
  start ||= caller_path
32
- scan(start) { |path| File.exist?(File.join(path, filename)) }
32
+ find(start) { |path| File.exist?(File.join(path, filename)) }
33
33
  end
34
34
 
35
35
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parent_paths
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lee