Module: RJack::TarPit::Util
- Included in:
- BaseStrategy
- Defined in:
- lib/rjack-tarpit/util.rb
Class Method Summary collapse
-
.clean_list(l) ⇒ Object
Cleanup a list of files.
-
.read_file_list(sfile) ⇒ Object
Read a list of files and return a cleaned list.
Class Method Details
.clean_list(l) ⇒ Object
Cleanup a list of files
28 29 30 31 32 33 |
# File 'lib/rjack-tarpit/util.rb', line 28 def clean_list( l ) Array( l ). compact. map { |f| f.strip }. reject { |f| f.empty? } end |
.read_file_list(sfile) ⇒ Object
Read a list of files and return a cleaned list.
23 24 25 |
# File 'lib/rjack-tarpit/util.rb', line 23 def read_file_list( sfile ) clean_list( open( sfile ) { |f| f.readlines } ) end |