vidibus-validate_uri 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +64 -0
- data/Rakefile +44 -0
- data/VERSION +1 -0
- data/config/locales/en.yml +5 -0
- data/lib/vidibus-validate_uri.rb +2 -0
- data/lib/vidibus/validate_uri.rb +5 -0
- data/lib/vidibus/validate_uri/extensions.rb +5 -0
- data/lib/vidibus/validate_uri/extensions/controller.rb +15 -0
- data/lib/vidibus/validate_uri/instance_methods.rb +58 -0
- data/lib/vidibus/validate_uri/uri_validator.rb +13 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/vidibus/validate_uri/action_controller_spec.rb +9 -0
- data/spec/vidibus/validate_uri/instance_methods_spec.rb +183 -0
- data/spec/vidibus/validate_uri/uri_validator_spec.rb +34 -0
- data/vidibus-validate_uri.gemspec +68 -0
- metadata +119 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Andre Pankratz
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
= vidibus-validate_uri
|
2
|
+
|
3
|
+
This gem is part of the open source SOA framework Vidibus: http://www.vidibus.org
|
4
|
+
|
5
|
+
It provides validation of URIs (URLs) to ActiveModel records and ActionControllers in Rails 3.
|
6
|
+
|
7
|
+
|
8
|
+
== Installation
|
9
|
+
|
10
|
+
Add the dependency to the Gemfile of your application:
|
11
|
+
|
12
|
+
gem "vidibus-validate_uri"
|
13
|
+
|
14
|
+
Then call bundle install on your console.
|
15
|
+
|
16
|
+
|
17
|
+
== Usage
|
18
|
+
|
19
|
+
To validate an URI in your ActiveModel record, simply add the uri validator to the field you want to validate as URI:
|
20
|
+
|
21
|
+
class Model
|
22
|
+
include Mongoid::Document
|
23
|
+
field :some_uri
|
24
|
+
validates :some_uri, :uri => true
|
25
|
+
end
|
26
|
+
|
27
|
+
To validate an URI in any model, include ActiveModel::Validations:
|
28
|
+
|
29
|
+
class Model
|
30
|
+
include ActiveModel::Validations
|
31
|
+
attr_accessor :uri
|
32
|
+
validates :some_uri, :uri => true
|
33
|
+
end
|
34
|
+
|
35
|
+
Just in case you'll need it, a method #valid_uri? is available to controllers that inherit from ActionController::Base. Use it like this:
|
36
|
+
|
37
|
+
valid_uri?("something") # => false
|
38
|
+
|
39
|
+
|
40
|
+
=== Validation options
|
41
|
+
|
42
|
+
To restrict validation to a certain protocol, provide a :protocol option:
|
43
|
+
|
44
|
+
validates :some_uri, :uri => { :protocol => :rtmp }
|
45
|
+
validates :some_uri, :uri => { :protocol => [:rtsp, :rtmp] }
|
46
|
+
|
47
|
+
To check if the uri is accessible over the network, provide an :accessible option:
|
48
|
+
|
49
|
+
validates :some_uri, :uri => { :accessible => true }
|
50
|
+
|
51
|
+
Just like for any other ActiveModel validation, you may allow blank values by providing an :allow_blank option:
|
52
|
+
|
53
|
+
validates :some_uri, :uri => { :allow_blank => true }
|
54
|
+
|
55
|
+
You may provide those validation options to the #valid_uri? method as well:
|
56
|
+
|
57
|
+
valid_uri?(your_uri, :accessible => true)
|
58
|
+
valid_uri?(your_uri, :protocol => :rtmp)
|
59
|
+
valid_uri?(your_uri, :protocol => [:rtsp, :rtmp])
|
60
|
+
|
61
|
+
|
62
|
+
== Copyright
|
63
|
+
|
64
|
+
Copyright (c) 2010 Andre Pankratz. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "vidibus-validate_uri"
|
8
|
+
gem.summary = %Q{Provides an URI validator for Rails 3.}
|
9
|
+
gem.description = %Q{It provides validation of URIs (URLs) to ActiveModel records and ActionControllers in Rails 3.}
|
10
|
+
gem.email = "andre@vidibus.com"
|
11
|
+
gem.homepage = "http://github.com/vidibus/vidibus-validate_uri"
|
12
|
+
gem.authors = ["Andre Pankratz"]
|
13
|
+
gem.add_development_dependency "rspec"
|
14
|
+
gem.add_dependency "rails", ">= 3.0.0.rc"
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
+
end
|
20
|
+
|
21
|
+
require "spec/rake/spectask"
|
22
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
23
|
+
spec.libs << "lib" << "spec"
|
24
|
+
spec.spec_files = FileList["spec/**/*_spec.rb"]
|
25
|
+
end
|
26
|
+
|
27
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
28
|
+
t.spec_files = FileList["spec/vidibus/**/*_spec.rb"]
|
29
|
+
t.rcov = true
|
30
|
+
t.rcov_opts = ["--exclude", "^spec,/gems/"]
|
31
|
+
end
|
32
|
+
|
33
|
+
task :spec => :check_dependencies
|
34
|
+
task :default => :spec
|
35
|
+
|
36
|
+
require "rake/rdoctask"
|
37
|
+
Rake::RDocTask.new do |rdoc|
|
38
|
+
version = File.exist?("VERSION") ? File.read("VERSION") : ""
|
39
|
+
rdoc.rdoc_dir = "rdoc"
|
40
|
+
rdoc.title = "vidibus-remote #{version}"
|
41
|
+
rdoc.rdoc_files.include("README*")
|
42
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
43
|
+
rdoc.options << "--charset=utf-8"
|
44
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require "net/http"
|
2
|
+
|
3
|
+
module Vidibus
|
4
|
+
module ValidateUri
|
5
|
+
module InstanceMethods
|
6
|
+
|
7
|
+
PORT_REGEXP = /(([:]\d+)?)/
|
8
|
+
DOMAIN_REGEXP = /([äüößa-z0-9\-]+\.?)*([äüößa-z0-9]{2,})\.([a-z]{2,}){1,2}/ # TODO: Support more UTF-8 chars
|
9
|
+
IP_REGEXP = /(?>(?:1?\d?\d|2[0-4]\d|25[0-5])\.){3}(?:1?\d?\d|2[0-4]\d|25[0-5])(?:\/(?:[12]?\d|3[012])|-(?>(?:1?\d?\d|2[0-4]\d|25[0-5])\.){3}(?:1?\d?\d|2[0-4]\d|25[0-5]))?/
|
10
|
+
PATH_REGEXP = /(\/[a-z0-1\-_\.\,\/]*)?/
|
11
|
+
PARAMS_REGEXP = /\/?(\?[a-z0-1\-_\&=]*)?/
|
12
|
+
FRAGMENT_REGEXP = /(\#.*)?/
|
13
|
+
|
14
|
+
# Returns true if given uri is valid.
|
15
|
+
#
|
16
|
+
# To restrict to a certain protocol, provide :protocol option:
|
17
|
+
#
|
18
|
+
# valid_uri?(your_uri, :protocol => :rtmp)
|
19
|
+
# valid_uri?(your_uri, :protocol => [:rtsp, :rtmp])
|
20
|
+
#
|
21
|
+
# To check if the uri is accessible, provide :accessible option:
|
22
|
+
#
|
23
|
+
# valid_uri?(your_uri, :accessible => true)
|
24
|
+
#
|
25
|
+
def valid_uri?(uri, options = {})
|
26
|
+
return false if uri.blank?
|
27
|
+
if protocol = options[:protocol]
|
28
|
+
protocol = [protocol] unless p.is_a?(Array)
|
29
|
+
protocol_regexp = /#{protocol.join("|")}/
|
30
|
+
else
|
31
|
+
protocol_regexp = /\w+/
|
32
|
+
end
|
33
|
+
regexp = /^#{protocol_regexp}:\/\/(localhost|#{DOMAIN_REGEXP}|#{IP_REGEXP})#{PORT_REGEXP}#{PATH_REGEXP}#{PARAMS_REGEXP}#{FRAGMENT_REGEXP}$/i
|
34
|
+
valid = uri.match(regexp) ? true : false
|
35
|
+
|
36
|
+
if options[:accessible] == true
|
37
|
+
valid = accessible_uri?(uri)
|
38
|
+
end
|
39
|
+
|
40
|
+
return valid
|
41
|
+
end
|
42
|
+
|
43
|
+
protected
|
44
|
+
|
45
|
+
# Checks if given uri is accessible.
|
46
|
+
def accessible_uri?(uri)
|
47
|
+
_uri = URI.parse(uri)
|
48
|
+
path = _uri.path.blank? ? "/" : _uri.path
|
49
|
+
begin
|
50
|
+
Net::HTTP.start(_uri.host, _uri.port) { |http| http.head(path) }
|
51
|
+
true
|
52
|
+
rescue
|
53
|
+
false
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Vidibus
|
2
|
+
module ValidateUri
|
3
|
+
class UriValidator < ActiveModel::EachValidator
|
4
|
+
include Vidibus::ValidateUri::InstanceMethods
|
5
|
+
|
6
|
+
def validate_each(record, attribute, value)
|
7
|
+
unless valid_uri?(value, options)
|
8
|
+
record.errors.add(attribute, :invalid_uri)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
3
|
+
|
4
|
+
require "rubygems"
|
5
|
+
require "active_support/core_ext"
|
6
|
+
require "active_record"
|
7
|
+
require "action_controller"
|
8
|
+
require "vidibus-validate_uri"
|
9
|
+
require "spec"
|
10
|
+
require "spec/autorun"
|
11
|
+
|
12
|
+
I18n.load_path += Dir[File.join('config', 'locales', '**', '*.{rb,yml}')]
|
@@ -0,0 +1,183 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
class Test
|
4
|
+
include Vidibus::ValidateUri::InstanceMethods
|
5
|
+
end
|
6
|
+
|
7
|
+
describe "Vidibus::ValidateUri::InstanceMethods" do
|
8
|
+
let(:test) { Test.new }
|
9
|
+
|
10
|
+
describe "#valid_uri?" do
|
11
|
+
it "should validate http://mydomain.local" do
|
12
|
+
uri = "http://mydomain.local"
|
13
|
+
test.valid_uri?(uri).should be_true
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should validate http://mydomain.local/" do
|
17
|
+
uri = "http://mydomain.local/"
|
18
|
+
test.valid_uri?(uri).should be_true
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should validate http://mydomain.com" do
|
22
|
+
uri = "http://mydomain.com"
|
23
|
+
test.valid_uri?(uri).should be_true
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should validate http://www.mydomain.com" do
|
27
|
+
uri = "http://www.mydomain.com"
|
28
|
+
test.valid_uri?(uri).should be_true
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should validate http://mydomain.com:8080" do
|
32
|
+
uri = "http://mydomain.com:8080"
|
33
|
+
test.valid_uri?(uri).should be_true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should validate http://mydomain.local/" do
|
37
|
+
uri = "http://mydomain.local/"
|
38
|
+
test.valid_uri?(uri).should be_true
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should validate http://localhost" do
|
42
|
+
uri = "http://localhost"
|
43
|
+
test.valid_uri?(uri).should be_true
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should validate http://localhost/" do
|
47
|
+
uri = "http://localhost/"
|
48
|
+
test.valid_uri?(uri).should be_true
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should fail for http://localhosts" do
|
52
|
+
uri = "http://localhosts"
|
53
|
+
test.valid_uri?(uri).should be_false
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should validate http://localhost:3000" do
|
57
|
+
uri = "http://localhost:3000"
|
58
|
+
test.valid_uri?(uri).should be_true
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should validate http://localhost:3000/" do
|
62
|
+
uri = "http://localhost:3000/"
|
63
|
+
test.valid_uri?(uri).should be_true
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should validate http://84.191.143.127" do
|
67
|
+
uri = "http://84.191.199.127"
|
68
|
+
test.valid_uri?(uri).should be_true
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should validate http://84.191.143.127/" do
|
72
|
+
uri = "http://84.191.199.127/"
|
73
|
+
test.valid_uri?(uri).should be_true
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should validate http://84.191.143.127:80" do
|
77
|
+
uri = "http://84.191.199.127:80"
|
78
|
+
test.valid_uri?(uri).should be_true
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should fail for http://84.2a.143.127" do
|
82
|
+
uri = "http://84.2a.143.127"
|
83
|
+
test.valid_uri?(uri).should be_false
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should validate https://some.weird.sub.1.mydomain.com:10000" do
|
87
|
+
uri = "https://some.weird.sub.1.mydomain.com:10000"
|
88
|
+
test.valid_uri?(uri).should be_true
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should validate http://mydomain.local?some=params" do
|
92
|
+
uri = "http://mydomain.local?some=params"
|
93
|
+
test.valid_uri?(uri).should be_true
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should validate http://mydomain.local/?some=params" do
|
97
|
+
uri = "http://mydomain.local/?some=params"
|
98
|
+
test.valid_uri?(uri).should be_true
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should validate http://mydomain.local/hello/world" do
|
102
|
+
uri = "http://mydomain.local/hello/world"
|
103
|
+
test.valid_uri?(uri).should be_true
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should fail for http://mydomain.local/hel lo/world" do
|
107
|
+
uri = "http://mydomain.local/hel lo/world"
|
108
|
+
test.valid_uri?(uri).should be_false
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should validate http://mydomain.local/hello/world/" do
|
112
|
+
uri = "http://mydomain.local/hello/world/"
|
113
|
+
test.valid_uri?(uri).should be_true
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should validate http://mydomain.local/hello/world.html" do
|
117
|
+
uri = "http://mydomain.local/hello/world.html"
|
118
|
+
test.valid_uri?(uri).should be_true
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should validate http://mydomain.local/hello/world.html#doit" do
|
122
|
+
uri = "http://mydomain.local/hello/world.html#doit"
|
123
|
+
test.valid_uri?(uri).should be_true
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should validate http://mydomain.local/hello/world?some=params" do
|
127
|
+
uri = "http://mydomain.local/hello/world?some=params"
|
128
|
+
test.valid_uri?(uri).should be_true
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should validate http://mydomain.local/hello/world/?some=params" do
|
132
|
+
uri = "http://mydomain.local/hello/world/?some=params"
|
133
|
+
test.valid_uri?(uri).should be_true
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should validate http://mydomain.local?some=params&another=one" do
|
137
|
+
uri = "http://mydomain.local?some=params&another=one"
|
138
|
+
test.valid_uri?(uri).should be_true
|
139
|
+
end
|
140
|
+
|
141
|
+
it "should validate http://mydomain.local?some=params&another=one#withFragment" do
|
142
|
+
uri = "http://mydomain.local?some=params&another=one#withFragment"
|
143
|
+
test.valid_uri?(uri).should be_true
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should validate https://mydomain.local" do
|
147
|
+
uri = "https://mydomain.local"
|
148
|
+
test.valid_uri?(uri).should be_true
|
149
|
+
end
|
150
|
+
|
151
|
+
it "should validate https://mydomain.local with protocol => :https" do
|
152
|
+
uri = "https://mydomain.local"
|
153
|
+
test.valid_uri?(uri, :protocol => :https).should be_true
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should validate https://mydomain.local with protocol => [:http, :https]" do
|
157
|
+
uri = "https://mydomain.local"
|
158
|
+
test.valid_uri?(uri, :protocol => [:http, :https]).should be_true
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should fail for https://mydomain.local with protocol => :http" do
|
162
|
+
uri = "https://mydomain.local"
|
163
|
+
test.valid_uri?(uri, :protocol => :http).should be_false
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should fail for https://mydomain.local with protocol => [:http, :rtmp]" do
|
167
|
+
uri = "https://mydomain.local"
|
168
|
+
test.valid_uri?(uri, :protocol => [:http, :rtmp]).should be_false
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "with accessibility check" do
|
172
|
+
it "should validate http://www.vidibus.org" do
|
173
|
+
uri = "http://www.vidibus.org"
|
174
|
+
test.valid_uri?(uri, :accessible => true).should be_true
|
175
|
+
end
|
176
|
+
|
177
|
+
it "should fail for http://www.vidibus.zzz" do
|
178
|
+
uri = "http://www.vidibus.zzz"
|
179
|
+
test.valid_uri?(uri, :accessible => true).should be_false
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
class Model
|
4
|
+
include ActiveModel::Validations
|
5
|
+
attr_accessor :uri, :https_uri
|
6
|
+
validates :uri, :uri => true
|
7
|
+
validates :https_uri, :uri => { :protocol => "https", :allow_blank => true }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "Vidibus::ValidateUri::UriValidator" do
|
11
|
+
let(:model) { Model.new }
|
12
|
+
|
13
|
+
it "should be available as URI validator" do
|
14
|
+
Model.validators_on(:uri).first.should be_a_kind_of(Vidibus::ValidateUri::UriValidator)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should add an error to model if URI is blank" do
|
18
|
+
model.uri = nil
|
19
|
+
model.should be_invalid
|
20
|
+
model.errors[:uri].should eql(["is not a valid uri"])
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should add an error to model if URI is invalid" do
|
24
|
+
model.uri = "http://localhosts"
|
25
|
+
model.should be_invalid
|
26
|
+
model.errors[:uri].should eql(["is not a valid uri"])
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should allow options" do
|
30
|
+
model.https_uri = "http://www.vidibus.org"
|
31
|
+
model.should be_invalid
|
32
|
+
model.errors[:https_uri].should have(1).error
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{vidibus-validate_uri}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Andre Pankratz"]
|
12
|
+
s.date = %q{2010-08-17}
|
13
|
+
s.description = %q{It provides validation of URIs (URLs) to ActiveModel records and ActionControllers in Rails 3.}
|
14
|
+
s.email = %q{andre@vidibus.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"config/locales/en.yml",
|
27
|
+
"lib/vidibus-validate_uri.rb",
|
28
|
+
"lib/vidibus/validate_uri.rb",
|
29
|
+
"lib/vidibus/validate_uri/extensions.rb",
|
30
|
+
"lib/vidibus/validate_uri/extensions/controller.rb",
|
31
|
+
"lib/vidibus/validate_uri/instance_methods.rb",
|
32
|
+
"lib/vidibus/validate_uri/uri_validator.rb",
|
33
|
+
"spec/spec.opts",
|
34
|
+
"spec/spec_helper.rb",
|
35
|
+
"spec/vidibus/validate_uri/action_controller_spec.rb",
|
36
|
+
"spec/vidibus/validate_uri/instance_methods_spec.rb",
|
37
|
+
"spec/vidibus/validate_uri/uri_validator_spec.rb",
|
38
|
+
"vidibus-validate_uri.gemspec"
|
39
|
+
]
|
40
|
+
s.homepage = %q{http://github.com/vidibus/vidibus-validate_uri}
|
41
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
42
|
+
s.require_paths = ["lib"]
|
43
|
+
s.rubygems_version = %q{1.3.7}
|
44
|
+
s.summary = %q{Provides an URI validator for Rails 3.}
|
45
|
+
s.test_files = [
|
46
|
+
"spec/spec_helper.rb",
|
47
|
+
"spec/vidibus/validate_uri/action_controller_spec.rb",
|
48
|
+
"spec/vidibus/validate_uri/instance_methods_spec.rb",
|
49
|
+
"spec/vidibus/validate_uri/uri_validator_spec.rb"
|
50
|
+
]
|
51
|
+
|
52
|
+
if s.respond_to? :specification_version then
|
53
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
|
+
s.specification_version = 3
|
55
|
+
|
56
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
57
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
58
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.0.rc"])
|
59
|
+
else
|
60
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
61
|
+
s.add_dependency(%q<rails>, [">= 3.0.0.rc"])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rails>, [">= 3.0.0.rc"])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vidibus-validate_uri
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Andre Pankratz
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-08-17 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rspec
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rails
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 7712042
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
- rc
|
49
|
+
version: 3.0.0.rc
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
description: It provides validation of URIs (URLs) to ActiveModel records and ActionControllers in Rails 3.
|
53
|
+
email: andre@vidibus.com
|
54
|
+
executables: []
|
55
|
+
|
56
|
+
extensions: []
|
57
|
+
|
58
|
+
extra_rdoc_files:
|
59
|
+
- LICENSE
|
60
|
+
- README.rdoc
|
61
|
+
files:
|
62
|
+
- .document
|
63
|
+
- .gitignore
|
64
|
+
- LICENSE
|
65
|
+
- README.rdoc
|
66
|
+
- Rakefile
|
67
|
+
- VERSION
|
68
|
+
- config/locales/en.yml
|
69
|
+
- lib/vidibus-validate_uri.rb
|
70
|
+
- lib/vidibus/validate_uri.rb
|
71
|
+
- lib/vidibus/validate_uri/extensions.rb
|
72
|
+
- lib/vidibus/validate_uri/extensions/controller.rb
|
73
|
+
- lib/vidibus/validate_uri/instance_methods.rb
|
74
|
+
- lib/vidibus/validate_uri/uri_validator.rb
|
75
|
+
- spec/spec.opts
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
- spec/vidibus/validate_uri/action_controller_spec.rb
|
78
|
+
- spec/vidibus/validate_uri/instance_methods_spec.rb
|
79
|
+
- spec/vidibus/validate_uri/uri_validator_spec.rb
|
80
|
+
- vidibus-validate_uri.gemspec
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: http://github.com/vidibus/vidibus-validate_uri
|
83
|
+
licenses: []
|
84
|
+
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options:
|
87
|
+
- --charset=UTF-8
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.3.7
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: Provides an URI validator for Rails 3.
|
115
|
+
test_files:
|
116
|
+
- spec/spec_helper.rb
|
117
|
+
- spec/vidibus/validate_uri/action_controller_spec.rb
|
118
|
+
- spec/vidibus/validate_uri/instance_methods_spec.rb
|
119
|
+
- spec/vidibus/validate_uri/uri_validator_spec.rb
|