Module | YAML |
In: |
lib/standard/facets/yaml/file.rb
lib/standard/facets/yaml/read.rb |
Provides a simplistic way to check if a file is a YAML formatted file:
YAML.file?('project.yaml') #=> true YAML.file?('project.xml') #=> false
Note this isn‘t perfect. At present it depends on the use use of an initial document separator (eg. ’—’). With YAML 1.1 the %YAML delaration is supposed to be manditory, so in the future this can be adapted to fit that standard.