georgedrummond_sinatra_helpers 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,24 @@ require "digest/md5"
4
4
  module GeorgeDrummond
5
5
  module Sinatra
6
6
  module Helpers
7
- # Creates the gravatar (www.gravatar.com) html from the email address and arguements provided.
7
+ # Creates the html for a mail_to link being given an email address and an optional text argument
8
+ #
9
+ # ==== Examples
10
+ #
11
+ # With only an email address provided
12
+ #
13
+ # mail_to("georgedrummond@gmail.com")
14
+ # # => <a href="mailto:georgedrummond@gmail.com" class="mailto">georgedrummond@gmail.com</a>
15
+ #
16
+ # With an optional text field provided
17
+ #
18
+ # mail_to("georgedrummond@gmail.com", "George Drummond")
19
+ # # => <a href="mailto:georgedrummond@gmail.com" class="mailto">George Drummond</a>
20
+ def mail_to(email, text=email)
21
+ "<a href=\"mailto:\"#{email}\" class=\"mailto\">#{text}</a>"
22
+ end
23
+
24
+ # Creates the gravatar (www.gravatar.com) html from the email address and arguments provided.
8
25
  # If no size is specified then it defaults to 50x50px
9
26
  #
10
27
  # ==== Examples
@@ -18,7 +35,6 @@ module GeorgeDrummond
18
35
  #
19
36
  # gravatar_image("georgedrummond@gmail.com", 150)
20
37
  # # => <img src="http://www.gravatar.com/avatar/d278a12b969a495ab16fdd942e748fe5?s=150" class="gravatar" />
21
- #
22
38
  def gravatar_image(email, size=50)
23
39
  hash = Digest::MD5.hexdigest(email)
24
40
  "<img src=\"http://www.gravatar.com/avatar/#{hash}?s=#{size}\" class=\"gravatar\" />"
@@ -1,7 +1,7 @@
1
1
  module GeorgeDrummond
2
2
  module Sinatra
3
3
  module Helpers
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: georgedrummond_sinatra_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: