Class: Guard::Yaml

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/yaml.rb

Instance Method Summary collapse

Instance Method Details

#run_on_changes(paths) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/guard/yaml.rb', line 7

def run_on_changes(paths)
  paths.each do |path|
    begin
      YAML.load(File.open(path))
    rescue Psych::SyntaxError => e
      puts "#{e.class}: #{e.message}"
    end
  end
end