Class: PhTools::Phls

Inherits:
Runner show all
Defined in:
lib/phls.rb

Overview

list generation

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Runner

#initialize

Constructor Details

This class inherits a constructor from PhTools::Runner

Class Method Details

.aboutObject



10
11
12
# File 'lib/phls.rb', line 10

def self.about
  %Q{generates list of phtools friendly files}
end

Instance Method Details

#run!Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/phls.rb', line 14

def run!
  @dirs_to_scan.each do |dir|
    fmask = File.join(dir, @options_cli['--recursive'] ? '**' : '', "{#{@filemasks * ','}}")
    Dir.glob(fmask, File::FNM_CASEFOLD).each { |f| output_file(f) if File.file?(f) }
  end

rescue SignalException
  PhTools.puts_error 'EXIT on user interrupt Ctrl-C'
  exit 1
rescue => e
  PhTools.puts_error "FATAL: #{e.message}", e
  exit 1
end