Socket
Book a DemoInstallSign in
Socket

avatarize

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avatarize

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Avatarize

Gem to create letter avatars from users name (or any string). It uses HTML canvas to generate the image (base64).

Based on Lee Crossley's gist

Installation

Add this line to your application's Gemfile:

gem 'avatarize'

Add the following to application.js:

  //= require avatarize

  window.addEventListener("turbolinks:load", Avatarizer.processAll);
  // Or this if not uing turbolinks
  window.addEventListener("load", Avatarizer.processAll);

Usage

To create an avatar:

  <%= avatar_tag 'Avatarize' %>

  # Custom size
  <%= avatar_tag 'Avatarize', 200 %>

  # Other html attributes
  <%= avatar_tag 'Avatarize', nil, class: 'rounded-circle', title: 'Avatar' %>

Contributing

Bug reports and pull requests are welcome.

  • Fork the project https://github.com/rbague/avatarize/fork
  • Run bundle and bundle exec rake
  • Make your feature or bug fix
  • Add tests for it. This is important so that it does not break in a future version.
  • Submit a new Pull Request

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 12 Mar 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.