Skip to content

Instantly share code, notes, and snippets.

@guimello
Forked from Arcath/gist:481321
Created December 17, 2010 15:30
Show Gist options
  • Select an option

  • Save guimello/745112 to your computer and use it in GitHub Desktop.

Select an option

Save guimello/745112 to your computer and use it in GitHub Desktop.

Revisions

  1. @Arcath Arcath revised this gist Jul 21, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    def gravatar_url(email,options)
    def gravatar_url(email,options = {})
    require 'digest/md5'
    hash = Digest::MD5.hexdigest(email)
    url = "http://www.gravatar.com/avatar/#{hash}"
  2. @Arcath Arcath revised this gist Jul 21, 2010. 1 changed file with 11 additions and 4 deletions.
    15 changes: 11 additions & 4 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,12 @@
    def gravatar_url(email)
    require 'digest/md5'
    hash = Digest::MD5.hexdigest(email)
    "http://www.gravatar.com/avatar/#{hash}"
    def gravatar_url(email,options)
    require 'digest/md5'
    hash = Digest::MD5.hexdigest(email)
    url = "http://www.gravatar.com/avatar/#{hash}"
    options.each do |option|
    option == options.first ? url+="?" : url+="&"
    key = option[0].to_s
    value = option[1].to_s
    url+=key + "=" + value
    end
    url
    end
  3. @Arcath Arcath created this gist Jul 19, 2010.
    5 changes: 5 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    def gravatar_url(email)
    require 'digest/md5'
    hash = Digest::MD5.hexdigest(email)
    "http://www.gravatar.com/avatar/#{hash}"
    end