valid_url 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a547c3a0eca1f7836299a7c4ee0acc2c95163e83
4
- data.tar.gz: c6f0b2174b0bc8ae58152f0a0c8800679ae60cdb
3
+ metadata.gz: 56efe4960294c736061d9d9309065c86c871c955
4
+ data.tar.gz: 4e5d139226ef13a8d4e94b9f8a9e45052ccd94f7
5
5
  SHA512:
6
- metadata.gz: 71141983204523487fb11782f3d88239dd76f38d7b3d077d0deaa5835cba23940c3b7038177d80ef6228e8f93809ebf71957d975ca1fd875d5774f9042bc8f51
7
- data.tar.gz: f7fc9f6efd4acce8c0254c9d488e9661625f6467e7cd8ec0636133f1802e7df0cb1ba5fedeb2e31921d49c789f45a6e9e1f813b2634a30d8503aebd328cde499
6
+ metadata.gz: c4047abe4af9c4b085d341db820b6916761ec42b1411fa6bac013cf835f5c13cb6586c9b6f9eeb76e6206ec848c32550810ca16bcb07b30bc4303145ac5fc3fe
7
+ data.tar.gz: 84973913156ebd70f8f713601e89b2da9093aa6703c9d38da835022e603ea2eb6215bd904bb11f792ff2413a0a8d596df34041cceb5e5a4f42bc08a1d85fc9ed
@@ -4,14 +4,14 @@ require "resolv"
4
4
  module ActiveModel
5
5
  module Validations
6
6
  class UrlValidator < ActiveModel::EachValidator
7
- domain = YAML.load File.read(File.dirname(__FILE__) + '/config/domain.yml')
7
+ domain = YAML.load File.read(File.dirname(__FILE__) + '/valid_url/config/domain.yml')
8
8
 
9
9
  PROTOCOLS = domain["protocols"]
10
10
  ZONES = domain["zones"]
11
11
 
12
12
  def validate_each(record, attribute, value)
13
- url = ensure_protocol(value)
14
13
  begin
14
+ url = ensure_protocol(value)
15
15
  uri = Addressable::URI.parse(url)
16
16
  rescue
17
17
  invalid = true
@@ -1,3 +1,3 @@
1
1
  module ValidUrl
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -4,6 +4,7 @@
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
6
  #
7
+
7
8
  default: &default
8
9
  adapter: sqlite3
9
10
  pool: 5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valid_url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Ralovets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2014-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -62,9 +62,9 @@ files:
62
62
  - MIT-LICENSE
63
63
  - README.rdoc
64
64
  - Rakefile
65
- - lib/config/domain.yml
66
65
  - lib/tasks/valid_url_tasks.rake
67
66
  - lib/valid_url.rb
67
+ - lib/valid_url/config/domain.yml
68
68
  - lib/valid_url/version.rb
69
69
  - test/dummy/README.rdoc
70
70
  - test/dummy/Rakefile