Skip to content

Instantly share code, notes, and snippets.

@TheNotary
Created May 2, 2013 02:17
Show Gist options
  • Save TheNotary/5499752 to your computer and use it in GitHub Desktop.
Save TheNotary/5499752 to your computer and use it in GitHub Desktop.
require 'yaml'
require 'open-uri'
URL = "https://github.com/TheNotary/the_notarys_linux_mint_postinstall_configuration"
def valid_yaml_string?(yaml)
!!YAML.load(yaml)
rescue Exception => e
STDERR.puts e.message
return false
end
puts valid_yaml_string?(open(URL).read)
# http://stackoverflow.com/questions/16329059/ruby-check-if-valid-yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment