gravatar-turczyn 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/gravatar_turczyn.rb +7 -1
  2. metadata +3 -3
@@ -5,7 +5,13 @@ module GravatarTurczyn
5
5
  end
6
6
  module InstanceMethods
7
7
  def gravatar(size = 40)
8
- "<img src='//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(self.email)}?s=#{size}'>".html_safe
8
+ unless self.email
9
+ clean_email = "example@example.com"
10
+ else
11
+ clean_email = self.email.downcase.strip
12
+ clean_email = "example@example.com" if clean_email == ""
13
+ end
14
+ "<img src='//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(clean_email)}?s=#{size}'>".html_safe
9
15
  end
10
16
  end
11
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravatar-turczyn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-28 00:00:00.000000000 Z
12
+ date: 2013-06-30 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Add a gravatar-image instance method
15
15
  email: steve@turczyn.co.uk
@@ -18,7 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/gravatar_turczyn.rb
21
- homepage: http://www.turczyn.co.uk
21
+ homepage: https://github.com/steveturczyn/gravatar_gem
22
22
  licenses: []
23
23
  post_install_message:
24
24
  rdoc_options: []