url_format 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fe998b83cee06143d40eca7c8d300b31adf3f9b
4
- data.tar.gz: 01c4b0e9d360b665e412dcf953595b34f318e092
3
+ metadata.gz: e6b078f50cf4d767034c1f5e38ee163e4d49dd9a
4
+ data.tar.gz: 336ec031f947da651cc04ef7c3ca66c8d3e9f9b1
5
5
  SHA512:
6
- metadata.gz: 78d21347e179ab750f7ef3edde1f8deee279a5f51812644e0e27ff8e22ebcb480fb14f5a7be11e3c59a5dc5617fa8f57aa062c91783d916ee05b89746a18d6f8
7
- data.tar.gz: 61002189135f128dd3436cec6946c4d1ff79eba8b436d0d222471685e1053c50eac678cb4ba6b65838628d0d864ba5625e5e28d5cfd879462905452382be379f
6
+ metadata.gz: 9b03cd6d1d2b9e252649cd870ab0c70f64f61edc9a320953a9750511832fbb1a4f585d2a1358eecb622ffe37af34b88b1035cb7b3a2566dbee775c5f168dd6e4
7
+ data.tar.gz: 7ca4d0efaa33b74096d0e019843c80bc50d29dd1c3bdd6a02a929255c42d2df6ecf3af899b0f503d0a146f00f75d830c458b36b5e61f6374aa4f6145381c3c6f
@@ -1,6 +1,6 @@
1
1
  class UrlFormatValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
- unless URI.parse(value).kind_of?(URI::HTTP)
3
+ unless URI.parse(value).kind_of?(URI::HTTP) && value =~ /\.\w{2,6}/
4
4
  record.errors[attribute] << (options[:message] || "is invalid")
5
5
  end
6
6
  rescue URI::InvalidURIError
@@ -1,3 +1,3 @@
1
1
  module UrlFormat
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Otander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-14 00:00:00.000000000 Z
11
+ date: 2013-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,28 +28,28 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Validate the url format of an attribute.
@@ -78,17 +78,17 @@ require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ! '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ! '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.1.11
91
+ rubygems_version: 2.0.3
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Validate the url format of an attribute.