Class: Simpli::ScriptFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/simpli/script_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(relative_script_path) ⇒ ScriptFinder

Returns a new instance of ScriptFinder.



3
4
5
# File 'lib/simpli/script_finder.rb', line 3

def initialize(relative_script_path)
  @relative_script_path = relative_script_path
end

Instance Method Details

#upsearch(dir_path) ⇒ Object



7
8
9
10
# File 'lib/simpli/script_finder.rb', line 7

def upsearch(dir_path)
  return if dir_path == '/'
  path_to_simply_script(dir_path) || search_in_parent_directory(dir_path)
end