wordnik_ruby_helpers 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wordnik_ruby_helpers/version.rb +1 -1
- data/lib/wordnik_ruby_helpers.rb +7 -2
- metadata +3 -3
data/lib/wordnik_ruby_helpers.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
1
3
|
module WordnikRubyHelpers
|
2
4
|
module ViewHelpers
|
3
5
|
|
@@ -222,9 +224,12 @@ class String
|
|
222
224
|
|
223
225
|
# Returns true or false depending on whether a string appears to be a URL
|
224
226
|
def valid_url?
|
225
|
-
|
227
|
+
URI.parse(self)
|
228
|
+
true
|
229
|
+
rescue
|
230
|
+
false
|
226
231
|
end
|
227
|
-
|
232
|
+
|
228
233
|
# Returns true or false depending on whether a string appears to be an email address
|
229
234
|
def valid_email?
|
230
235
|
!self.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$/i).nil?
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: wordnik_ruby_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0
|
5
|
+
version: 0.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Zeke Sikelianos
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-04-19 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements: []
|
94
94
|
|
95
95
|
rubyforge_project: wordnik_ruby_helpers
|
96
|
-
rubygems_version: 1.
|
96
|
+
rubygems_version: 1.5.1
|
97
97
|
signing_key:
|
98
98
|
specification_version: 3
|
99
99
|
summary: A handful of monkey patches and view helpers that we use in our rails projects
|