Class: SyntaxFix::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_fix/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rel_pathObject

Returns the value of attribute rel_path.



3
4
5
# File 'lib/syntax_fix/checker.rb', line 3

def rel_path
  @rel_path
end

#verboseObject

Returns the value of attribute verbose.



3
4
5
# File 'lib/syntax_fix/checker.rb', line 3

def verbose
  @verbose
end

Instance Method Details

#fix_code(path) ⇒ Object



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

def fix_code(path)
  dirfile = SyntaxFix::DirFile.new(path)
  if dirfile.is_dir?
    Dir.foreach(path) do |name|
      current_item = SyntaxFix::DirFile.new([path, name].join('/'))
      current_item.is_dir? ? fix_code(current_item.path) : fix_file(current_item)
    end
  elsif dirfile.is_file?
    fix_file dirfile
  end
end