url_validation 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +52 -0
- data/README.md +143 -0
- data/Rakefile +5 -35
- data/lib/url_validation/version.rb +9 -0
- data/lib/url_validation.rb +144 -115
- data/url_validation.gemspec +43 -69
- metadata +56 -61
- data/.document +0 -5
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -96
- data/README.textile +0 -36
- data/VERSION +0 -1
- data/spec/spec_helper.rb +0 -13
- data/spec/url_validator_spec.rb +0 -231
data/url_validation.gemspec
CHANGED
|
@@ -1,75 +1,49 @@
|
|
|
1
|
-
#
|
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
-
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: url_validation 1.1.0 ruby lib
|
|
1
|
+
# frozen_string_literal: true
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
s.name = "url_validation"
|
|
9
|
-
s.version = "1.1.0"
|
|
3
|
+
require_relative "lib/url_validation/version"
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
s.email = "git@timothymorgan.info"
|
|
17
|
-
s.extra_rdoc_files = [
|
|
18
|
-
"LICENSE",
|
|
19
|
-
"README.textile"
|
|
20
|
-
]
|
|
21
|
-
s.files = [
|
|
22
|
-
".document",
|
|
23
|
-
".rspec",
|
|
24
|
-
".ruby-gemset",
|
|
25
|
-
".ruby-version",
|
|
26
|
-
"Gemfile",
|
|
27
|
-
"Gemfile.lock",
|
|
28
|
-
"LICENSE",
|
|
29
|
-
"README.textile",
|
|
30
|
-
"Rakefile",
|
|
31
|
-
"VERSION",
|
|
32
|
-
"lib/url_validation.rb",
|
|
33
|
-
"spec/spec_helper.rb",
|
|
34
|
-
"spec/url_validator_spec.rb",
|
|
35
|
-
"url_validation.gemspec"
|
|
36
|
-
]
|
|
37
|
-
s.homepage = "http://github.com/riscfuture/url_validation"
|
|
38
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
|
39
|
-
s.rubygems_version = "2.4.2"
|
|
40
|
-
s.summary = "Simple URL validation in Rails 3"
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "url_validation"
|
|
7
|
+
spec.version = UrlValidation::VERSION
|
|
8
|
+
spec.authors = ["Tim Morgan"]
|
|
9
|
+
spec.email = ["git@timothymorgan.info"]
|
|
41
10
|
|
|
42
|
-
|
|
43
|
-
|
|
11
|
+
spec.summary = "Simple URL validation for ActiveModel."
|
|
12
|
+
spec.description = "A simple, localizable ActiveModel::EachValidator for URL fields. " \
|
|
13
|
+
"Supports format validation as well as optional network reachability " \
|
|
14
|
+
"checks via HEAD (or any other HTTP verb) requests."
|
|
15
|
+
spec.homepage = "https://github.com/riscfuture/url_validation"
|
|
16
|
+
spec.license = "MIT"
|
|
44
17
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
end
|
|
64
|
-
else
|
|
65
|
-
s.add_dependency(%q<addressable>, [">= 0"])
|
|
66
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
|
67
|
-
s.add_dependency(%q<activerecord>, [">= 0"])
|
|
68
|
-
s.add_dependency(%q<httpi>, [">= 0"])
|
|
69
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
70
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
|
71
|
-
s.add_dependency(%q<RedCloth>, [">= 0"])
|
|
72
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
|
18
|
+
spec.required_ruby_version = ">= 3.1"
|
|
19
|
+
|
|
20
|
+
spec.metadata = {
|
|
21
|
+
"homepage_uri" => spec.homepage,
|
|
22
|
+
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
|
23
|
+
"changelog_uri" => "#{spec.homepage}/blob/master/CHANGELOG.md",
|
|
24
|
+
"rubygems_mfa_required" => "true"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
spec.files = Dir.chdir(__dir__) do
|
|
28
|
+
tracked = `git ls-files -z`.split("\x0")
|
|
29
|
+
# Always include these even if not yet committed (helps local builds).
|
|
30
|
+
extra = %w[CHANGELOG.md lib/url_validation/version.rb]
|
|
31
|
+
(tracked + extra).uniq.reject do |f|
|
|
32
|
+
f.match(%r{\A(?:test|spec|features|bin|gemfiles|\.github|\.idea)/}) ||
|
|
33
|
+
f.match(%r{\A\.(?:rspec|rubocop\.yml|standard\.yml|ruby-version|ruby-gemset|gitignore|document|travis\.yml)\z}) ||
|
|
34
|
+
f.match(%r{\AGemfile(?:\.lock)?\z}) ||
|
|
35
|
+
f == "VERSION"
|
|
36
|
+
end.select { |f| File.exist?(File.join(__dir__, f)) }
|
|
73
37
|
end
|
|
74
|
-
|
|
38
|
+
spec.require_paths = ["lib"]
|
|
75
39
|
|
|
40
|
+
spec.add_dependency "activemodel", ">= 6.1"
|
|
41
|
+
spec.add_dependency "activesupport", ">= 6.1"
|
|
42
|
+
spec.add_dependency "addressable", "~> 2.8"
|
|
43
|
+
spec.add_dependency "httpi", "~> 4.0"
|
|
44
|
+
|
|
45
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
46
|
+
spec.add_development_dependency "rspec", "~> 3.13"
|
|
47
|
+
spec.add_development_dependency "standard", "~> 1.0"
|
|
48
|
+
spec.add_development_dependency "webmock", "~> 3.0"
|
|
49
|
+
end
|
metadata
CHANGED
|
@@ -1,153 +1,150 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: url_validation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Morgan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
13
|
+
name: activemodel
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '6.1'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
25
|
+
version: '6.1'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: activesupport
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
32
|
+
version: '6.1'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
39
|
+
version: '6.1'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
41
|
+
name: addressable
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
|
-
- - "
|
|
44
|
+
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
46
|
+
version: '2.8'
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
|
-
- - "
|
|
51
|
+
- - "~>"
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
53
|
+
version: '2.8'
|
|
55
54
|
- !ruby/object:Gem::Dependency
|
|
56
55
|
name: httpi
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements:
|
|
59
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
60
59
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
60
|
+
version: '4.0'
|
|
62
61
|
type: :runtime
|
|
63
62
|
prerelease: false
|
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
|
66
|
-
- - "
|
|
65
|
+
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
67
|
+
version: '4.0'
|
|
69
68
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
69
|
+
name: rake
|
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
|
72
71
|
requirements:
|
|
73
|
-
- - "
|
|
72
|
+
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
74
|
+
version: '13.0'
|
|
76
75
|
type: :development
|
|
77
76
|
prerelease: false
|
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
|
-
- - "
|
|
79
|
+
- - "~>"
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
81
|
+
version: '13.0'
|
|
83
82
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
83
|
+
name: rspec
|
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
|
86
85
|
requirements:
|
|
87
|
-
- - "
|
|
86
|
+
- - "~>"
|
|
88
87
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '
|
|
88
|
+
version: '3.13'
|
|
90
89
|
type: :development
|
|
91
90
|
prerelease: false
|
|
92
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
92
|
requirements:
|
|
94
|
-
- - "
|
|
93
|
+
- - "~>"
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
95
|
+
version: '3.13'
|
|
97
96
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
97
|
+
name: standard
|
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
|
100
99
|
requirements:
|
|
101
|
-
- - "
|
|
100
|
+
- - "~>"
|
|
102
101
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
102
|
+
version: '1.0'
|
|
104
103
|
type: :development
|
|
105
104
|
prerelease: false
|
|
106
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
106
|
requirements:
|
|
108
|
-
- - "
|
|
107
|
+
- - "~>"
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
109
|
+
version: '1.0'
|
|
111
110
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
111
|
+
name: webmock
|
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
|
114
113
|
requirements:
|
|
115
|
-
- - "
|
|
114
|
+
- - "~>"
|
|
116
115
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
116
|
+
version: '3.0'
|
|
118
117
|
type: :development
|
|
119
118
|
prerelease: false
|
|
120
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
120
|
requirements:
|
|
122
|
-
- - "
|
|
121
|
+
- - "~>"
|
|
123
122
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
125
|
-
description: A simple, localizable EachValidator for URL fields
|
|
126
|
-
|
|
123
|
+
version: '3.0'
|
|
124
|
+
description: A simple, localizable ActiveModel::EachValidator for URL fields. Supports
|
|
125
|
+
format validation as well as optional network reachability checks via HEAD (or any
|
|
126
|
+
other HTTP verb) requests.
|
|
127
|
+
email:
|
|
128
|
+
- git@timothymorgan.info
|
|
127
129
|
executables: []
|
|
128
130
|
extensions: []
|
|
129
|
-
extra_rdoc_files:
|
|
130
|
-
- LICENSE
|
|
131
|
-
- README.textile
|
|
131
|
+
extra_rdoc_files: []
|
|
132
132
|
files:
|
|
133
|
-
-
|
|
134
|
-
- ".rspec"
|
|
135
|
-
- ".ruby-gemset"
|
|
136
|
-
- ".ruby-version"
|
|
137
|
-
- Gemfile
|
|
138
|
-
- Gemfile.lock
|
|
133
|
+
- CHANGELOG.md
|
|
139
134
|
- LICENSE
|
|
140
|
-
- README.
|
|
135
|
+
- README.md
|
|
141
136
|
- Rakefile
|
|
142
|
-
- VERSION
|
|
143
137
|
- lib/url_validation.rb
|
|
144
|
-
-
|
|
145
|
-
- spec/url_validator_spec.rb
|
|
138
|
+
- lib/url_validation/version.rb
|
|
146
139
|
- url_validation.gemspec
|
|
147
|
-
homepage:
|
|
148
|
-
licenses:
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
homepage: https://github.com/riscfuture/url_validation
|
|
141
|
+
licenses:
|
|
142
|
+
- MIT
|
|
143
|
+
metadata:
|
|
144
|
+
homepage_uri: https://github.com/riscfuture/url_validation
|
|
145
|
+
bug_tracker_uri: https://github.com/riscfuture/url_validation/issues
|
|
146
|
+
changelog_uri: https://github.com/riscfuture/url_validation/blob/master/CHANGELOG.md
|
|
147
|
+
rubygems_mfa_required: 'true'
|
|
151
148
|
rdoc_options: []
|
|
152
149
|
require_paths:
|
|
153
150
|
- lib
|
|
@@ -155,16 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
155
152
|
requirements:
|
|
156
153
|
- - ">="
|
|
157
154
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: 1
|
|
155
|
+
version: '3.1'
|
|
159
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
157
|
requirements:
|
|
161
158
|
- - ">="
|
|
162
159
|
- !ruby/object:Gem::Version
|
|
163
160
|
version: '0'
|
|
164
161
|
requirements: []
|
|
165
|
-
|
|
166
|
-
rubygems_version: 2.4.2
|
|
167
|
-
signing_key:
|
|
162
|
+
rubygems_version: 4.0.11
|
|
168
163
|
specification_version: 4
|
|
169
|
-
summary: Simple URL validation
|
|
164
|
+
summary: Simple URL validation for ActiveModel.
|
|
170
165
|
test_files: []
|
data/.document
DELETED
data/.rspec
DELETED
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
url_validation
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.1.4
|
data/Gemfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'addressable', :require => 'addressable/uri' # for unicode URIs
|
|
4
|
-
gem 'activesupport'
|
|
5
|
-
gem 'activerecord'
|
|
6
|
-
gem 'httpi'
|
|
7
|
-
|
|
8
|
-
group :development do
|
|
9
|
-
gem 'jeweler'
|
|
10
|
-
gem 'yard'
|
|
11
|
-
gem 'RedCloth', require: 'redcloth'
|
|
12
|
-
gem 'rspec'
|
|
13
|
-
end
|
data/Gemfile.lock
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
RedCloth (4.2.9)
|
|
5
|
-
activemodel (4.1.7)
|
|
6
|
-
activesupport (= 4.1.7)
|
|
7
|
-
builder (~> 3.1)
|
|
8
|
-
activerecord (4.1.7)
|
|
9
|
-
activemodel (= 4.1.7)
|
|
10
|
-
activesupport (= 4.1.7)
|
|
11
|
-
arel (~> 5.0.0)
|
|
12
|
-
activesupport (4.1.7)
|
|
13
|
-
i18n (~> 0.6, >= 0.6.9)
|
|
14
|
-
json (~> 1.7, >= 1.7.7)
|
|
15
|
-
minitest (~> 5.1)
|
|
16
|
-
thread_safe (~> 0.1)
|
|
17
|
-
tzinfo (~> 1.1)
|
|
18
|
-
addressable (2.3.6)
|
|
19
|
-
arel (5.0.1.20140414130214)
|
|
20
|
-
builder (3.2.2)
|
|
21
|
-
descendants_tracker (0.0.4)
|
|
22
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
|
23
|
-
diff-lcs (1.2.5)
|
|
24
|
-
faraday (0.9.0)
|
|
25
|
-
multipart-post (>= 1.2, < 3)
|
|
26
|
-
git (1.2.8)
|
|
27
|
-
github_api (0.12.2)
|
|
28
|
-
addressable (~> 2.3)
|
|
29
|
-
descendants_tracker (~> 0.0.4)
|
|
30
|
-
faraday (~> 0.8, < 0.10)
|
|
31
|
-
hashie (>= 3.3)
|
|
32
|
-
multi_json (>= 1.7.5, < 2.0)
|
|
33
|
-
nokogiri (~> 1.6.3)
|
|
34
|
-
oauth2
|
|
35
|
-
hashie (3.3.1)
|
|
36
|
-
highline (1.6.21)
|
|
37
|
-
httpi (2.2.7)
|
|
38
|
-
rack
|
|
39
|
-
i18n (0.6.11)
|
|
40
|
-
jeweler (2.0.1)
|
|
41
|
-
builder
|
|
42
|
-
bundler (>= 1.0)
|
|
43
|
-
git (>= 1.2.5)
|
|
44
|
-
github_api
|
|
45
|
-
highline (>= 1.6.15)
|
|
46
|
-
nokogiri (>= 1.5.10)
|
|
47
|
-
rake
|
|
48
|
-
rdoc
|
|
49
|
-
json (1.8.1)
|
|
50
|
-
jwt (1.0.0)
|
|
51
|
-
mini_portile (0.6.1)
|
|
52
|
-
minitest (5.4.2)
|
|
53
|
-
multi_json (1.10.1)
|
|
54
|
-
multi_xml (0.5.5)
|
|
55
|
-
multipart-post (2.0.0)
|
|
56
|
-
nokogiri (1.6.4.1)
|
|
57
|
-
mini_portile (~> 0.6.0)
|
|
58
|
-
oauth2 (1.0.0)
|
|
59
|
-
faraday (>= 0.8, < 0.10)
|
|
60
|
-
jwt (~> 1.0)
|
|
61
|
-
multi_json (~> 1.3)
|
|
62
|
-
multi_xml (~> 0.5)
|
|
63
|
-
rack (~> 1.2)
|
|
64
|
-
rack (1.5.2)
|
|
65
|
-
rake (10.3.2)
|
|
66
|
-
rdoc (4.1.2)
|
|
67
|
-
json (~> 1.4)
|
|
68
|
-
rspec (3.1.0)
|
|
69
|
-
rspec-core (~> 3.1.0)
|
|
70
|
-
rspec-expectations (~> 3.1.0)
|
|
71
|
-
rspec-mocks (~> 3.1.0)
|
|
72
|
-
rspec-core (3.1.7)
|
|
73
|
-
rspec-support (~> 3.1.0)
|
|
74
|
-
rspec-expectations (3.1.2)
|
|
75
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
|
-
rspec-support (~> 3.1.0)
|
|
77
|
-
rspec-mocks (3.1.3)
|
|
78
|
-
rspec-support (~> 3.1.0)
|
|
79
|
-
rspec-support (3.1.2)
|
|
80
|
-
thread_safe (0.3.4)
|
|
81
|
-
tzinfo (1.2.2)
|
|
82
|
-
thread_safe (~> 0.1)
|
|
83
|
-
yard (0.8.7.6)
|
|
84
|
-
|
|
85
|
-
PLATFORMS
|
|
86
|
-
ruby
|
|
87
|
-
|
|
88
|
-
DEPENDENCIES
|
|
89
|
-
RedCloth
|
|
90
|
-
activerecord
|
|
91
|
-
activesupport
|
|
92
|
-
addressable
|
|
93
|
-
httpi
|
|
94
|
-
jeweler
|
|
95
|
-
rspec
|
|
96
|
-
yard
|
data/README.textile
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
h1. url_validation -- Simple URL validator for Rails 3
|
|
2
|
-
|
|
3
|
-
| *Author* | Tim Morgan |
|
|
4
|
-
| *Version* | 1.0 (May 9, 2011) |
|
|
5
|
-
| *License* | Released under the MIT license. |
|
|
6
|
-
|
|
7
|
-
h2. About
|
|
8
|
-
|
|
9
|
-
This gem adds a very simple URL format validator to be used with ActiveRecord
|
|
10
|
-
models in Rails 3.0. It supports localized error messages. It can validate many
|
|
11
|
-
different kinds of URLs, including HTTP and HTTPS. It supports advanced
|
|
12
|
-
validation features like sending @HEAD@ requests to URLS to verify that they are
|
|
13
|
-
valid endpoints.
|
|
14
|
-
|
|
15
|
-
h2. Installation
|
|
16
|
-
|
|
17
|
-
Add the gem to your project's @Gemfile@:
|
|
18
|
-
|
|
19
|
-
<pre><code>
|
|
20
|
-
gem 'url_validation'
|
|
21
|
-
</code></pre>
|
|
22
|
-
|
|
23
|
-
h2. Usage
|
|
24
|
-
|
|
25
|
-
This gem is an @EachValidator@, and thus is used with the @validates@ method:
|
|
26
|
-
|
|
27
|
-
<pre><code>
|
|
28
|
-
class User < ActiveRecord::Base
|
|
29
|
-
validates :terms_of_service_link,
|
|
30
|
-
:presence => true,
|
|
31
|
-
:url => true
|
|
32
|
-
end
|
|
33
|
-
</code></pre>
|
|
34
|
-
|
|
35
|
-
There are other options to fine-tune your validation; see the {UrlValidator}
|
|
36
|
-
class for more, and for a list of error message localization keys.
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.1.0
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require 'bundler'
|
|
2
|
-
Bundler.require :default, :development
|
|
3
|
-
|
|
4
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
5
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
6
|
-
|
|
7
|
-
require 'url_validation'
|
|
8
|
-
require 'active_model'
|
|
9
|
-
require 'active_support/core_ext/kernel/singleton_class'
|
|
10
|
-
|
|
11
|
-
RSpec.configure do |c|
|
|
12
|
-
|
|
13
|
-
end
|