wordnik_ruby_helpers 0.0.9 → 0.1.0

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.
@@ -1,3 +1,3 @@
1
1
  module WordnikRubyHelpers
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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
- !self.match(/https?:\/\/([^\/]+)(.*)/).nil?
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.9
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-03-22 00:00:00 -07:00
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.6.2
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