Sha256: 4be93f08fa957cea3e0c88ae9ce8f39312e96d94da97557542ade8aef2dbea1f
Contents?: true
Size: 1.58 KB
Versions: 1
Compression:
Stored size: 1.58 KB
Contents
# SocialAvatarProxy This gem acts as a proxy for avatars on Twitter & Facebook. [![Build Status][2]][1] [1]: http://travis-ci.org/platformq/social-avatar-proxy [2]: https://secure.travis-ci.org/platformq/social-avatar-proxy.png?branch=master ## Installation Add this line to your application's Gemfile: ```ruby gem "social-avatar-proxy" ``` And then execute: $ bundle Or install it yourself as: $ gem install social-avatar-proxy ## Usage This usage is based on Rails, however it should be easily adaptable for other languages: In your `config/routes.rb` file: ```ruby mount SocialAvatarProxy::App, at: "/avatars", as: :sap ``` Note: you must specify an `as` option above, otherwise the path helpers below won't work. In your views: ```ruby # for a Twitter user, by username: image_tag(sap.twitter_avatar_path("username")) # by ID: image_tag(sap.twitter_avatar_path(12345)) # for a Facebook user, by username: image_tag(sap.facebook_avatar_path("username")) # by ID: image_tag(sap.facebook_avatar_path(12345)) ``` The above path helper methods are provided by the `SocialAvatarProxy::PathHelpers` module. Note: `image_tag` is a Rails helper, replace with your framework's equivalent. You'll need to call `avatar_base_path=` with the mounted path prefix (in the example above we were mounted at `/avatars`, however Rails handles it automatically) ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
social-avatar-proxy-0.0.7 | README.md |