Class: Valise::Unpath::WorkspaceFinder
- Inherits:
-
Object
- Object
- Valise::Unpath::WorkspaceFinder
- Includes:
- Valise::Unpath
- Defined in:
- lib/valise/utils.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#fallback ⇒ Object
Returns the value of attribute fallback.
-
#search_from ⇒ Object
Returns the value of attribute search_from.
-
#workspace_children ⇒ Object
Returns the value of attribute workspace_children.
Instance Method Summary collapse
Methods included from Valise::Unpath
#clean_pathname, #containing_workspace, #current_directory, #file_from_backtrace, #from_here, #make_pathname, #starting_directory, #up_to, #up_until
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
57 58 59 |
# File 'lib/valise/utils.rb', line 57 def description @description end |
#fallback ⇒ Object
Returns the value of attribute fallback.
57 58 59 |
# File 'lib/valise/utils.rb', line 57 def fallback @fallback end |
#search_from ⇒ Object
Returns the value of attribute search_from.
57 58 59 |
# File 'lib/valise/utils.rb', line 57 def search_from @search_from end |
#workspace_children ⇒ Object
Returns the value of attribute workspace_children.
57 58 59 |
# File 'lib/valise/utils.rb', line 57 def workspace_children @workspace_children end |
Instance Method Details
#find ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/valise/utils.rb', line 77 def find up_until(search_start, description) do |path| path.children(false).any? do |child| workspace_children.any? do |vc_config| child.fnmatch? vc_config end end end rescue Errors::NoMatchingPath if fallback.nil? raise else fallback end end |
#search_start ⇒ Object
71 72 73 74 75 |
# File 'lib/valise/utils.rb', line 71 def search_start path = make_pathname(search_from) path = path.realpath unless path.absolute? path end |