Class: Opal::CLI::PathFinder
Overview
RUN CODE
Instance Attribute Summary collapse
-
#paths ⇒ Object
Returns the value of attribute paths.
Instance Method Summary collapse
Instance Attribute Details
#paths ⇒ Object
Returns the value of attribute paths
40 41 42 |
# File 'opal/lib/opal/cli.rb', line 40 def paths @paths end |
Instance Method Details
#find(filename) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'opal/lib/opal/cli.rb', line 41 def find(filename) full_path = nil _path = paths.find do |path| full_path = File.join(path, filename) File.exist? full_path end full_path or raise(ArgumentError, "file: #{filename} not found") end |