Sha256: a06a2a7408c6a7f07c23c3fd340c49b362c3ef4f82df9fbe911e174bc8effe19

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

# SocialAvatarProxy

This gem acts as a proxy for avatars on Twitter & Facebook.

[![Build Status][2]][1] [![Code Climate][3]][4]

  [1]: http://travis-ci.org/platformq/social-avatar-proxy
  [2]: https://secure.travis-ci.org/platformq/social-avatar-proxy.png?branch=master
  [3]: https://codeclimate.com/badge.png
  [4]: https://codeclimate.com/github/platformq/social-avatar-proxy

## 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

1 entries across 1 versions & 1 rubygems

Version Path
social-avatar-proxy-1.1.0 README.md