<commit_before># ValidateUrl

This gem adds the capability of validating URLs to ActiveRecord and ActiveModel (Rails 3).

### Installation
    # add this to your Gemfile
    gem "validate_url"

    # and  run
    sudo gem install validate_url

### Usage

#### With ActiveRecord
    class Pony < ActiveRecord::Base
      # standard validation
      validates :homepage, :url => true

      # with allow_nil
      validates :homepage, :url => {:allow_nil => true}

      # with allow_blank
      validates :homepage, :url => {:allow_blank => true}
    end

#### With ActiveModel
    class Unicorn
      include ActiveModel::Validations

      attr_accessor :homepage

      # with legacy syntax (the syntax above works also)
      validates_url :homepage, :allow_blank => true
    end

#### I18n

The default error message `is not valid url`.
You can pass the `:message => "my custom error"` option to your validation to define your own, custom message.

## Authors

**<NAME>** (<http://twitter.com/tanelsuurhans>)
**<NAME>** (<http://twitter.com/tarmolehtpuu>)

## License
Copyright 2010 by PerfectLine LLC (<http://www.perfectline.co.uk>) and is released under the MIT license.<commit_msg>- update README<commit_after># ValidateUrl

This gem adds the capability of validating URLs to ActiveRecord and ActiveModel (Rails 3).

### Installation
    # add this to your Gemfile
    gem "validate_url"

    # and  run
    sudo gem install validate_url

### Usage

#### With ActiveRecord
    class Pony < ActiveRecord::Base
      # standard validation
      validates :homepage, :url => true

      # with allow_nil
      validates :homepage, :url => {:allow_nil => true}

      # with allow_blank
      validates :homepage, :url => {:allow_blank => true}
    end

#### With ActiveModel
    class Unicorn
      include ActiveModel::Validations

      attr_accessor :homepage

      # with legacy syntax (the syntax above works also)
      validates_url :homepage, :allow_blank => true
    end

#### I18n

The default error message `is not valid url`.
You can pass the `:message => "my custom error"` option to your validation to define your own, custom message.

## Authors

**<NAME>** (<http://twitter.com/tanelsuurhans>)  
**<NAME>** (<http://twitter.com/tarmolehtpuu>)

## Contributions
Thanks to **<NAME>** for making the validation process even simpler.

## License
Copyright 2010 by PerfectLine LLC (<http://www.perfectline.co.uk>) and is released under the MIT license.
{'fraction_non_alphanumeric': 0.10773592547590118, 'fraction_numerical': 0.005670311867152693, 'mean_word_length': 3.4265232974910393, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5237284', 'n_tokens_mistral': 743, 'n_tokens_neox': 702, 'n_words': 260}