validate_as_url 0.0.1 → 0.0.2
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.
- data/lib/validate_as_url.rb +5 -9
- data/validate_as_url.gemspec +18 -19
- metadata +2 -3
- data/lib/validate_as_url/version.rb +0 -3
data/lib/validate_as_url.rb
CHANGED
@@ -1,21 +1,17 @@
|
|
1
|
-
require "validate_as_url/version"
|
2
|
-
|
3
1
|
module ValidateAsUrl
|
4
2
|
|
5
|
-
require 'resolv'
|
6
|
-
|
7
|
-
VERSION = '0.0.1'
|
3
|
+
#require 'resolv'
|
8
4
|
|
9
5
|
MessageScope = defined?(ActiveModel) ? :activemodel : :activerecord
|
10
6
|
|
11
|
-
LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/
|
7
|
+
#LocalPartSpecialChars = /[\!\#\$\%\&\'\*\-\/\=\?\+\-\^\_\`\{\|\}\~]/
|
12
8
|
|
13
9
|
def self.validate_as_url(url, options={})
|
14
10
|
|
15
11
|
default_options = {
|
16
|
-
message_invalid: I18n.t(:invalid_url, :scope => [MessageScope, :errors, :messages], :default => 'does not appear to be valid url'),
|
17
|
-
message_nil:
|
18
|
-
message_blank: I18n.t(:invalid_url, :scope => [MessageScope, :errors, :messages], :default => '
|
12
|
+
message_invalid: ::I18n.t(:invalid_url, :scope => [MessageScope, :errors, :messages], :default => 'does not appear to be valid url'),
|
13
|
+
message_nil: ::I18n.t(:invalid_url, :scope => [MessageScope, :errors, :messages], :default => 'cannot be null'),
|
14
|
+
message_blank: ::I18n.t(:invalid_url, :scope => [MessageScope, :errors, :messages], :default => 'cannot be blank'),
|
19
15
|
allow_nil: false,
|
20
16
|
allow_blank: false
|
21
17
|
}
|
data/validate_as_url.gemspec
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
|
4
|
-
require 'validate_as_url/version'
|
2
|
+
#lib = File.expand_path('../lib', __FILE__)
|
3
|
+
#$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
6
|
+
spec.name = "validate_as_url"
|
7
|
+
spec.version = '0.0.2'
|
8
|
+
spec.author = ["Mitrofanov Dmitry"]
|
9
|
+
spec.email = ["mdima@it-guru.biz"]
|
10
|
+
spec.description = %q{This Gem is Used for Validations URLs}
|
11
|
+
spec.summary = %q{This Gem is Used for Validations URLs}
|
12
|
+
spec.homepage = "http://myitguru.info"
|
13
|
+
spec.license = "MIT"
|
14
|
+
#gem.add_dependency "active_support"
|
15
|
+
#gem.add_dependency "activerecord"
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
21
|
+
spec.add_development_dependency "rake"
|
23
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validate_as_url
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -62,9 +62,8 @@ files:
|
|
62
62
|
- README.md
|
63
63
|
- Rakefile
|
64
64
|
- lib/validate_as_url.rb
|
65
|
-
- lib/validate_as_url/version.rb
|
66
65
|
- validate_as_url.gemspec
|
67
|
-
homepage:
|
66
|
+
homepage: http://myitguru.info
|
68
67
|
licenses:
|
69
68
|
- MIT
|
70
69
|
post_install_message:
|