https://github.com/perfectline/validates_url
URL Validation for Rails
https://github.com/perfectline/validates_url
Keywords from Contributors
feature-flag activerecord rack rubygems mvc activejob rubocop marshalling sidekiq static-code-analysis
Last synced: about 1 hour ago
JSON representation
Repository metadata
URL Validation for Rails
- Host: GitHub
- URL: https://github.com/perfectline/validates_url
- Owner: perfectline
- License: mit
- Created: 2010-09-08T12:10:17.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2025-03-18T06:12:39.000Z (12 months ago)
- Last Synced: 2026-02-16T11:32:26.041Z (15 days ago)
- Language: Ruby
- Homepage:
- Size: 120 KB
- Stars: 598
- Watchers: 16
- Forks: 111
- Open Issues: 28
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
README.md
Validates URL
This gem adds the capability of validating URLs to ActiveRecord and ActiveModel.
Installation
Add this to your Gemfile:
gem "validate_url"
Or install it yourself:
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 }
# without local hostnames
validates :homepage, url: { no_local: true }
# with custom schemes
validates :homepage, url: { schemes: ['https'] }
# with public suffix database https://publicsuffix.org/
validates :homepage, url: { public_suffix: true }
# with Postgres array of urls, described [here](https://guides.rubyonrails.org/active_record_postgresql.html#array)
validates :homepage, url: { accept_array: 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
With RSpec
Require the matcher in spec_helper.rb or rails_helper.rb:
require 'validate_url/rspec_matcher'
In your spec:
RSpec.describe Unicorn
it { is_expected.to validate_url_of(:homepage) }
end
I18n
The default error message is not a valid URL.
You can pass the message: "my custom error" option to your validation to define your own, custom message.
Contributing
Big thanks to Tanel Suurhans, Tarmo Lehtpuu, Steve Smith and all the contributors! We appreciate all your work on new features and bugfixes.
Credits
Validates URL is created and maintained by PerfectLine, LLC.
License
Validates URL is Copyright © 2010-2014 PerfectLine, LLC. It is free software, and may be
redistributed under the terms specified in the LICENSE file.
How to push a new version
- Bump the version number automatically:
rake version:bump:patch
rake gemspec
- Manually update
validate_url.gemspecto remove incorrect strings - Update
CHANGELOG.mdto describe what is changing in the new version - Commit and push the updated version information, gemspec and changelog to GitHub
- Build and push the gem to RubyGems
gem build validate_url.gemspec
gem push validate_url-1.0.8.gem
Owner metadata
- Name: PerfectLine
- Login: perfectline
- Email: write@perfectline.co
- Kind: organization
- Description:
- Website: https://www.perfectline.co
- Location: Estonia
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/75787?v=4
- Repositories: 46
- Last ynced at: 2024-04-21T04:44:06.280Z
- Profile URL: https://github.com/perfectline
GitHub Events
Total
- Pull request event: 6
- Fork event: 6
- Issues event: 1
- Watch event: 26
- Push event: 3
- Pull request review event: 3
Last Year
- Pull request event: 5
- Fork event: 3
- Watch event: 11
- Push event: 2
- Pull request review event: 2
Committers metadata
Last synced: 3 days ago
Total Commits: 146
Total Committers: 58
Avg Commits per committer: 2.517
Development Distribution Score (DDS): 0.74
Commits in past year: 4
Committers in past year: 2
Avg Commits per committer in past year: 2.0
Development Distribution Score (DDS) in past year: 0.5
| Name | Commits | |
|---|---|---|
| Vladimir Krylov | v****v@p****o | 38 |
| dependabot[bot] | 4****] | 10 |
| Antoine Niek | a****k@a****m | 9 |
| Tanel Suurhans | t****s@p****e | 9 |
| Olle Jonsson | o****n@g****m | 4 |
| Donald Piret | d****d@d****m | 4 |
| Christopher Guess | c****s@g****m | 4 |
| gaga5lala | g****3@g****m | 3 |
| Yusuf YALIM | y****m@g****m | 3 |
| Tim Rogers | me@t****k | 3 |
| Chris Mason | c****s@c****m | 3 |
| Susan van den Broek | s****k@a****m | 2 |
| Erica Love and Matt Olenick | p****o@m****m | 2 |
| Aaron Reisman | a****n@l****t | 2 |
| Alex Kestner | a****r@g****m | 2 |
| Martin Kivi | m****i@p****o | 2 |
| Novik | n****5@g****m | 2 |
| Seedot1234 | s****4@g****m | 2 |
| Wojtek Kruszewski | w****k@o****l | 2 |
| Benjamin L | b****r@j****m | 2 |
| Eric Guo | e****c@c****m | 1 |
| Derek | q****a@g****m | 1 |
| David Wilkie | d****e@g****m | 1 |
| Clarissa Borges | c****8@g****m | 1 |
| Anthony Truskinger | a****r@g****m | 1 |
| David Revelo | d****d@a****g | 1 |
| Jordan Maguire | j****e@t****u | 1 |
| Miguel A. Diab | m****l@h****m | 1 |
| PerfectLine | i****o@p****e | 1 |
| tferrerITBA | t****r@i****r | 1 |
| and 28 more... | ||
Committer domains:
- perfectline.co: 2
- perfectline.ee: 2
- adgear.com: 1
- donaldpiret.com: 1
- timrogers.co.uk: 1
- chaione.com: 1
- axini.com: 1
- ministryofvelocity.com: 1
- lifeiscontent.net: 1
- oxos.pl: 1
- jobteaser.com: 1
- cloud-mes.com: 1
- aperturaradical.org: 1
- thefrontiergroup.com.au: 1
- hint.com: 1
- itba.edu.ar: 1
- shopify.com: 1
- rimenes.net: 1
- coneybeare.me: 1
- manuelvanrijn.nl: 1
- goodreads.com: 1
- jsf.io: 1
- foramnagaidhlig.net: 1
Issue and Pull Request metadata
Last synced: 15 days ago
Total issues: 41
Total pull requests: 74
Average time to close issues: 6 months
Average time to close pull requests: 3 months
Total issue authors: 38
Total pull request authors: 36
Average comments per issue: 2.68
Average comments per pull request: 0.7
Merged pull request: 52
Bot issues: 0
Bot pull requests: 25
Past year issues: 3
Past year pull requests: 6
Past year average time to close issues: N/A
Past year average time to close pull requests: about 3 hours
Past year issue authors: 2
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.33
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- rhymes (2)
- gravitystorm (2)
- sshaw (2)
- grzegorz-jakubiak (1)
- Liquidsoul (1)
- JulienItard (1)
- Jeremy1026 (1)
- madmax (1)
- ishields (1)
- NAR8789 (1)
- coneybeare (1)
- overdrivemachines (1)
- HenryHaller (1)
- krtschmr (1)
- dobryakov (1)
Top Pull Request Authors
- dependabot[bot] (25)
- seedot1234 (6)
- zapo (4)
- olleolleolle (4)
- petergoldstein (2)
- atruskie (2)
- benjamin-ltr (2)
- MothOnMars (1)
- NDuggan (1)
- Quintasan (1)
- jaynetics (1)
- NAR8789 (1)
- coneybeare (1)
- cguess (1)
- timrogers (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (25)
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 160,884,912 total
- Total docker downloads: 1,028,566,524
- Total dependent packages: 16 (may contain duplicates)
- Total dependent repositories: 2,686 (may contain duplicates)
- Total versions: 54
- Total maintainers: 3
gem.coop: validate_url
Library for validating urls in Rails.
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: http://www.rubydoc.info/gems/validate_url/
- Licenses: mit
- Latest release: 1.0.15 (published almost 4 years ago)
- Last Synced: 2026-03-01T10:32:30.193Z (2 days ago)
- Versions: 22
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 80,441,795 Total
- Docker Downloads: 514,283,262
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.141%
- Docker downloads count: 0.19%
- Downloads: 0.374%
- Maintainers (3)
rubygems.org: validate_url
Library for validating urls in Rails.
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: http://www.rubydoc.info/gems/validate_url/
- Licenses: mit
- Latest release: 1.0.15 (published almost 4 years ago)
- Last Synced: 2026-03-01T13:02:24.383Z (2 days ago)
- Versions: 22
- Dependent Packages: 16
- Dependent Repositories: 2,686
- Downloads: 80,443,117 Total
- Docker Downloads: 514,283,262
-
Rankings:
- Docker downloads count: 0.235%
- Downloads: 0.412%
- Dependent repos count: 0.618%
- Dependent packages count: 1.232%
- Average: 1.234%
- Stargazers count: 2.391%
- Forks count: 2.514%
- Maintainers (3)
ubuntu-23.10: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Licenses:
- Latest release: 1.0.2+git-2 (published 18 days ago)
- Last Synced: 2026-02-13T18:35:28.041Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: https://packages.debian.org/bullseye/ruby-validate-url
- Licenses:
- Latest release: 1.0.2+git-2 (published 21 days ago)
- Last Synced: 2026-02-13T08:26:07.054Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Licenses:
- Latest release: 1.0.2+git-2 (published 20 days ago)
- Last Synced: 2026-02-11T06:52:02.876Z (20 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: https://packages.debian.org/buster/ruby-validate-url
- Licenses:
- Latest release: 1.0.2+git-2 (published 20 days ago)
- Last Synced: 2026-02-13T04:26:47.801Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Licenses:
- Latest release: 1.0.2+git-2 (published 18 days ago)
- Last Synced: 2026-02-13T13:28:21.096Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Licenses:
- Latest release: 1.0.2+git-2 (published 18 days ago)
- Last Synced: 2026-02-13T07:24:57.151Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: https://packages.debian.org/bookworm/ruby-validate-url
- Licenses:
- Latest release: 1.0.2+git-2 (published 19 days ago)
- Last Synced: 2026-02-12T23:43:41.732Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-validate-url
- Homepage: http://github.com/perfectline/validates_url/tree/master
- Documentation: https://packages.debian.org/trixie/ruby-validate-url
- Licenses:
- Latest release: 1.0.2+git-2 (published 19 days ago)
- Last Synced: 2026-02-13T13:20:45.414Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- activemodel 5.2.4.5
- activerecord 5.2.4.5
- activesupport 5.2.4.5
- addressable 2.4.0
- arel 9.0.0
- builder 3.2.3
- concurrent-ruby 1.1.8
- descendants_tracker 0.0.4
- diff-lcs 1.3
- faraday 0.9.2
- git 1.5.0
- github_api 0.16.0
- hashie 3.6.0
- highline 2.0.0
- i18n 1.8.10
- jeweler 2.3.9
- jwt 2.1.0
- mime-types 2.99.3
- mini_portile2 2.8.0
- minitest 5.14.4
- multi_json 1.13.1
- multi_xml 0.6.0
- multipart-post 2.0.0
- nokogiri 1.13.6
- oauth2 1.4.1
- psych 4.0.3
- public_suffix 4.0.6
- racc 1.6.0
- rack 2.2.3
- rake 13.0.1
- rdoc 6.4.0
- rspec 3.8.0
- rspec-core 3.8.0
- rspec-expectations 3.8.2
- rspec-mocks 3.8.0
- rspec-support 3.8.0
- semver2 3.4.2
- sqlite3 1.3.13
- stringio 3.0.2
- thread_safe 0.3.6
- tzinfo 1.2.9
- validate_url 1.0.13
- actions/cache v2 composite
- actions/checkout v2 composite
Score: 31.396554140842134