Module: Archfiend::Generators::Utils
- Defined in:
- lib/archfiend/generators/utils.rb
Class Method Summary collapse
- .find_directory(*names) ⇒ Object
-
.find_file(*names) ⇒ Object
Methods borrowed from Bundler source: bundler/lib/bundler/shared_helpers.rb.
Class Method Details
.find_directory(*names) ⇒ Object
13 14 15 16 17 |
# File 'lib/archfiend/generators/utils.rb', line 13 def find_directory(*names) search_up(*names) do |dirname| return dirname if File.directory?(dirname) end end |
.find_file(*names) ⇒ Object
Methods borrowed from Bundler source: bundler/lib/bundler/shared_helpers.rb
7 8 9 10 11 |
# File 'lib/archfiend/generators/utils.rb', line 7 def find_file(*names) search_up(*names) do |filename| return filename if File.file?(filename) end end |