common_view_helpers 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -36,6 +36,10 @@ A set of view helpers Gemini uses in all of our Rails applications.
36
36
 
37
37
  # Javascript friendly (escaped) string
38
38
  js_string(string)
39
+
40
+ # Generates a URL and automatically adds http:// if not already there
41
+ # Useful alongside link() when linking to user submitted addresses
42
+ urlify(address)
39
43
 
40
44
  == Copyright & Licensing
41
45
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -107,6 +107,12 @@ module CommonViewHelpers
107
107
 
108
108
  string.gsub(/(\\|<\/|\r\n|[\n\r"'])/) { js_escape_map[$1] }
109
109
  end
110
+
111
+ # Generates a URL and automatically adds http:// if not already there
112
+ # Useful alongside link() or when linking to user submitted addresses
113
+ def urlify(addr)
114
+ (addr.blank? || addr.starts_with?('http')) ? addr : "http://#{addr}"
115
+ end
110
116
 
111
117
  end
112
118
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_view_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zeke Sikelianos
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-14 00:00:00 -04:00
19
+ date: 2010-07-15 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency