Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to ignore invalid fields #28

Merged
merged 3 commits into from
Nov 22, 2016
Merged

Allow to ignore invalid fields #28

merged 3 commits into from
Nov 22, 2016

Commits on Nov 21, 2016

  1. Allow to ignore invalid fields

    In some cases you do not want to loose all data if you have only one invalid field in encoded VCard (especially for multi-contact vcards).
    
    This change add two config parameters
    ::Vcard.configuration.raise_on_invalid_line (default true).
    When this parameter is set to true, decode will raise ::Vcard::InvalidEncodingError if found a field that encoded incorrectly (default behavior).
    When raise_on_invalid_line = false, exception will not be raised but field will be marked as invalid.
    
    With parameter ::Vcard.configuration.ignore_invalid_vcards you can define behavior for invalid fields.
    If ignore_invalid_vcards = true, then ::Vcard.decode will ignore a vcard that have at least one incorrect field.
    With ignore_invalid_vcards = false, vcard only invalid fields will be ignored, but vcard will be added to list, returned by .decode
    Anton Petrunich committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    be66672 View commit details
    Browse the repository at this point in the history
  2. Update README.md

    brendon authored Nov 21, 2016
    Configuration menu
    Copy the full SHA
    d683f82 View commit details
    Browse the repository at this point in the history
  3. code cleanup

    solenko committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    cde74eb View commit details
    Browse the repository at this point in the history