walk_up 0.0.11 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/walk_up.rb +2 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1682cc294cec6c48260095c64f8cb8ce89504f568a92113f207ea449a0b4af1a
4
- data.tar.gz: 73793b437dd3b3b076687897c040afa475a58bdbeeed5e9aa5e666fe752a96ef
3
+ metadata.gz: b7b8adaff0ebe4f2e7082e7d5ed6df7178c7a28868a729cf925b0fd148d25b72
4
+ data.tar.gz: 6759b28f721367610eb6b811ef81f0b0495543cd01c6ecbd5cf364d93f026179
5
5
  SHA512:
6
- metadata.gz: 2c93ad6e45760152065346c28e2a8a8fe0495b1986a4590c65d72674a8b00a77f25658872575adf9a737259052d52a0fb0e956c683b9c8f4637e34e0a98ddbd9
7
- data.tar.gz: 2e43b283a809c1ea3c882460f89ba0ece2c3ef450a2a2600a591a6d45c7c97a915855bc2689b32f8720fdc1658c7552eb45839ff147f14c5e4e1f336c510dec3
6
+ metadata.gz: 9ceb117b845c01730d5cc125d17a168f471e46058ee8c944de541349a3fad49b0ed7787e5ea611b70c53941502a61e14962853c0452d8cc07ca0995fcfd6dea2
7
+ data.tar.gz: 525887940580607a18e60d033915ca478295762ac595a135d8cb7c8bd15ab91c3fbd2f179c556cb24db521b787a411421aa4c1eb000b9d048795131f5fd6e802
data/lib/walk_up.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "pathname"
3
3
 
4
- def walk_up(file_to_find, start_path=nil)
4
+ def walk_up_until(file_to_find, start_path=nil)
5
5
  here = start_path || Dir.pwd
6
6
  # if absolute
7
7
  if not Pathname.new(here).absolute?
@@ -10,7 +10,7 @@ def walk_up(file_to_find, start_path=nil)
10
10
  loop do
11
11
  check_path = File.join(here, file_to_find)
12
12
  if File.exist?(check_path)
13
- return here
13
+ return check_path
14
14
  end
15
15
  # reached the top
16
16
  if here == File.dirname(here)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: walk_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Hykin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-09 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: