Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-cfs
--format documentation
--color
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
url_validation
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.2
15 changes: 10 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
source :rubygems
source 'https://rubygems.org'

gem 'addressable', :require => 'addressable/uri' # for unicode URIs
gem 'addressable', require: 'addressable/uri' # for unicode URIs
gem 'activesupport'
gem 'activerecord'
gem 'httpi'

group :development do
gem 'jeweler'
gem 'yard'
gem 'RedCloth', require: 'redcloth'
# PUBLISHING
gem 'juwelier'

# DOCS
gem 'yard', require: nil
gem 'redcarpet', require: nil

# SPECS
gem 'rspec'
end
130 changes: 92 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,53 +1,107 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
RedCloth (4.2.7)
activemodel (3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activesupport (3.0.7)
addressable (2.2.6)
arel (2.0.10)
builder (2.1.2)
diff-lcs (1.1.2)
git (1.2.5)
httpi (0.9.4)
pyu-ntlm-http (>= 0.1.3.1)
activemodel (5.1.5)
activesupport (= 5.1.5)
activerecord (5.1.5)
activemodel (= 5.1.5)
activesupport (= 5.1.5)
arel (~> 8.0)
activesupport (5.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
arel (8.0.0)
builder (3.2.3)
concurrent-ruby (1.0.5)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
git (1.3.0)
github_api (0.18.2)
addressable (~> 2.4)
descendants_tracker (~> 0.0.4)
faraday (~> 0.8)
hashie (~> 3.5, >= 3.5.2)
oauth2 (~> 1.0)
hashie (3.5.7)
highline (1.7.10)
httpi (2.4.3)
rack
i18n (0.5.0)
jeweler (1.6.0)
bundler (~> 1.0.0)
git (>= 1.2.5)
socksify
i18n (0.9.5)
concurrent-ruby (~> 1.0)
juwelier (2.4.9)
builder
bundler
git
github_api
highline
kamelcase (~> 0)
nokogiri
psych
rake
pyu-ntlm-http (0.1.3.1)
rack (1.3.0)
rake (0.9.0)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.3)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
tzinfo (0.3.27)
yard (0.7.1)
rdoc
semver2
jwt (1.5.6)
kamelcase (0.0.2)
semver2 (~> 3)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
psych (3.0.2)
public_suffix (3.0.2)
rack (2.0.4)
rake (12.3.1)
rdoc (6.0.2)
redcarpet (3.4.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
semver2 (3.4.2)
socksify (1.7.1)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
yard (0.9.12)

PLATFORMS
ruby

DEPENDENCIES
RedCloth
activerecord
activesupport
addressable
httpi
jeweler
juwelier
redcarpet
rspec
yard

BUNDLED WITH
1.16.1
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# url_validation

Simple URL validator for Rails 3.

| | |
|:------------|:--------------------------------|
| **Author** | Tim Morgan |
| **Version** | 1.0 (May 9, 2011) |
| **License** | Released under the MIT license. |

## About

This gem adds a very simple URL format validator to be used with Active Record
models in Rails 3.0. It supports localized error messages. It can validate many
different kinds of URLs, including HTTP and HTTPS. It supports advanced
validation features like sending `HEAD` requests to URLS to verify that they are
valid endpoints.

## Installation

Add the gem to your project's Gemfile:

``` ruby
gem 'url_validation'
```

## Usage

This gem is an `EachValidator`, and thus is used with the `validates` method:

``` ruby
class User < ActiveRecord::Base
validates :terms_of_service_link,
presence: true,
url: true
end
```

There are other options to fine-tune your validation; see the {UrlValidator}
class for more, and for a list of error message localization keys.
36 changes: 0 additions & 36 deletions README.textile

This file was deleted.

34 changes: 17 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ rescue Bundler::BundlerError => e
end
require 'rake'

require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "url_validation"
gem.summary = %Q{Simple URL validation in Rails 3}
require 'juwelier'
Juwelier::Tasks.new do |gem|
gem.name = 'url_validation'
gem.summary = %Q{Simple URL validation in Rails 3+}
gem.description = %Q{A simple, localizable EachValidator for URL fields in ActiveRecord 3.0.}
gem.email = "git@timothymorgan.info"
gem.homepage = "http://github.com/riscfuture/url_validation"
gem.authors = [ "Tim Morgan" ]
gem.required_ruby_version = '>= 1.8.7'
gem.email = 'git@timothymorgan.info'
gem.homepage = 'http://github.com/riscfuture/url_validation'
gem.authors = ['Tim Morgan']
gem.required_ruby_version = '>= 2.0.0'
end
Jeweler::RubygemsDotOrgTasks.new
Juwelier::RubygemsDotOrgTasks.new

require 'yard'
YARD::Rake::YardocTask.new('doc') do |doc|
doc.options << "-m" << "textile"
doc.options << "--protected" << "--no-private"
doc.options << "-r" << "README.textile"
doc.options << "-o" << "doc"
doc.options << "--title" << "url_validation Documentation".inspect
doc.files = [ 'lib/*_validator.rb', 'README.textile' ]
doc.options << '-m' << 'markdown' << '-M' << 'redcarpet'
doc.options << '--protected' << '--no-private'
doc.options << '-r' << 'README.md'
doc.options << '-o' << 'doc'
doc.options << '--title' << 'url_validation Documentation'.inspect

doc.files = %w(lib/**/*.rb README.md)
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

task :default => :spec
task default: :spec
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.2.0
Loading