New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple_gravatar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple_gravatar

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SimpleGravatar Build Status Code Climate Code Climate Coverage Dependency Status Gem Version

Add gravatars to your ruby project as simple as possible.

Installation

Add it to your Gemfile and run the bundle command:

gem 'simple_gravatar'

Usage

Include de module where you want to use it:

class UserDecorator
  include SimpleGravatar

  def initialize(user)
    @user = user
  end

  def gravatar
    gravatar_url @user.email
  end
end

Using in rails

Include the module in ActionView::Base, let's say, in config/initializers/simple_gravatar.rb:

ActionView::Base.send(:include, SimpleGravatar) if defined? ActionView::Base  

and use it anywhere in your views:

<%= image_tag gravatar_url('patriciomacadden@gmail.com') %>

Using in sinatra

Include the module as a helper:

helpers SimpleGravatar

get '/' do
  gravatar_url 'patriciomacadden@gmail.com'
end

Available options

All available options are the specified by Gravatar API documentation.

Contributing

  1. Fork it
  2. Create a branch (git checkout -b my_awesome_branch)
  3. Commit your changes (git commit -am "Added some magic")
  4. Push to the branch (git push origin my_awesome_branch)
  5. Send pull request

License

See the LICENSE.

FAQs

Package last updated on 18 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc