Module: Dafuq::Code

Defined in:
lib/dafuq/code.rb

Class Method Summary collapse

Class Method Details

.notail(edit_path, recursive = true) ⇒ Object

‘remove tailing whitespace’



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/dafuq/code.rb', line 5

def self.notail(edit_path, recursive = true)
  Dir.glob(File.expand_path(File.join edit_path, '*')).each do |fyl|
    if File.symlink? fyl
      next
    elsif File.directory?(fyl) && recursive
      notail(fyl)
    else
      Dafuq.log_me "Processing: #{fyl}"
      %x{sed -i 's/\ *$//g' #{fyl}}
    end
  end
end