{"id":13747256,"url":"https://github.com/perfectline/validates_url","last_synced_at":"2025-05-09T08:32:04.880Z","repository":{"id":1061267,"uuid":"895991","full_name":"perfectline/validates_url","owner":"perfectline","description":"URL Validation for Rails","archived":false,"fork":false,"pushed_at":"2025-03-18T06:12:39.000Z","size":123,"stargazers_count":594,"open_issues_count":25,"forks_count":114,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-08T11:01:59.988Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perfectline.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-09-08T12:10:17.000Z","updated_at":"2025-05-07T12:15:59.000Z","dependencies_parsed_at":"2024-11-05T18:37:47.777Z","dependency_job_id":"a055f3d4-0d6d-4322-8ac3-3cb606e63707","html_url":"https://github.com/perfectline/validates_url","commit_stats":{"total_commits":142,"total_committers":58,"mean_commits":"2.4482758620689653","dds":0.7323943661971831,"last_synced_commit":"efc636f07bcbea656272d8f9bcebe0e658bb8a8f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectline%2Fvalidates_url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectline%2Fvalidates_url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectline%2Fvalidates_url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectline%2Fvalidates_url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perfectline","download_url":"https://codeload.github.com/perfectline/validates_url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253217074,"owners_count":21873012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T06:01:22.963Z","updated_at":"2025-05-09T08:32:04.035Z","avatar_url":"https://github.com/perfectline.png","language":"Ruby","readme":"# Validates URL\n\nThis gem adds the capability of validating URLs to ActiveRecord and ActiveModel.\n\n## Installation\n\nAdd this to your `Gemfile`:\n\n```ruby\ngem \"validate_url\"\n```\n\nOr install it yourself:\n\n```sh\nsudo gem install validate_url\n```\n\n## Usage\n\n### With ActiveRecord\n\n```ruby\nclass Pony \u003c ActiveRecord::Base\n  # standard validation\n  validates :homepage, url: true\n\n  # with allow_nil\n  validates :homepage, url: { allow_nil: true }\n\n  # with allow_blank\n  validates :homepage, url: { allow_blank: true }\n\n  # without local hostnames\n  validates :homepage, url: { no_local: true }\n\n  # with custom schemes\n  validates :homepage, url: { schemes: ['https'] }\n\n  # with public suffix database https://publicsuffix.org/\n  validates :homepage, url: { public_suffix: true }\n\n  # with Postgres array of urls, described [here](https://guides.rubyonrails.org/active_record_postgresql.html#array)\n  validates :homepage, url: { accept_array: true }\nend\n```\n\n### With ActiveModel\n\n```ruby\nclass Unicorn\n  include ActiveModel::Validations\n\n  attr_accessor :homepage\n\n  # with legacy syntax (the syntax above works also)\n  validates_url :homepage, allow_blank: true\nend\n```\n\n### With RSpec\n\nRequire the matcher in `spec_helper.rb` or `rails_helper.rb`:\n\n```ruby\nrequire 'validate_url/rspec_matcher'\n```\n\nIn your spec:\n\n```ruby\nRSpec.describe Unicorn\n  it { is_expected.to validate_url_of(:homepage) }\nend\n```\n\n### I18n\n\nThe default error message `is not a valid URL`.\nYou can pass the `message: \"my custom error\"` option to your validation to define your own, custom message.\n\n\n## Contributing\n\n\nBig thanks to Tanel Suurhans, Tarmo Lehtpuu, Steve Smith and all the [contributors](https://github.com/perfectline/validates_url/contributors)! We appreciate all your work on new features and bugfixes.\n\n## Credits\n\nValidates URL is created and maintained by [PerfectLine](http://www.perfectline.co), LLC.\n\n## License\n\nValidates URL is Copyright © 2010-2014 [PerfectLine](http://www.perfectline.co), LLC. It is free software, and may be\nredistributed under the terms specified in the LICENSE file.\n\n## How to push a new version\n\n1. Bump the version number automatically:\n\n```sh\nrake version:bump:patch\nrake gemspec\n```\n\n2. Manually update `validate_url.gemspec` to remove incorrect strings\n3. Update `CHANGELOG.md` to describe what is changing in the new version\n4. Commit and push the updated version information, gemspec and changelog to GitHub\n5. Build and push the gem to RubyGems\n\n```sh\ngem build validate_url.gemspec\ngem push validate_url-1.0.8.gem\n```\n","funding_links":[],"categories":["Uncategorized","Ruby","ActiveRecord Validations"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectline%2Fvalidates_url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperfectline%2Fvalidates_url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectline%2Fvalidates_url/lists"}