Sha256: 81e2e1c0e6f233da5913282a13ffd53cf12ba04dc32db00ecc73227bb1f89ac0
Contents?: true
Size: 1.42 KB
Versions: 2
Compression:
Stored size: 1.42 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 # Rails In your `config/routes.rb` file: ```ruby mount SocialAvatarProxy::Engine, at: "/avatars" ``` The engine is basically a proxy for the Rack app, it also adds the path helpers below: In your views: ```ruby # for a Twitter user, by username: image_tag(twitter_avatar_path("username")) # by ID: image_tag(twitter_avatar_path(12345)) # for a Facebook user, by username: image_tag(facebook_avatar_path("username")) # by ID: image_tag(facebook_avatar_path(12345)) ``` # Rack The Rack app is available at: SocialAvatarProxy::App. Both the class and an instance respond to `call` so either can be mounted. The reason for this is that you might wish to set some options first, example: ```ruby use SocialAvatarProxy::App.new(cache_control: false) ``` ## 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
social-avatar-proxy-1.0.1 | README.md |
social-avatar-proxy-1.0.0 | README.md |