end
def is_valid_subscription?(content)
- content.length != 0 &&
- content.start_with?("---\n") &&
+ return false if content.length == 0
+ return false unless content.start_with?("---\n")
+ begin
YAML.load(content)
+ true
+ rescue ArgumentError
+ # Parse error
+ false
+ end
end
def is_valid_subscription_file?(file)