Skip to content
AssetHost API Ruby Client
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
LICENSE.txt
README.md
Rakefile
asset_host_client.gemspec
circle.yml
config.ru

README.md

AssetHostClient

Simple Ruby client for the AssetHost API.

Build Status

Installation

gem 'asset_host_client'

The gem is "AssetHostClient", so it doesn't get mixed up with "AssetHost". However, it creates and/or extends the "AssetHost" module.

Usage

Configuration

Configure your app to connect to assethost, either in an initializer or your environment files:

  AssetHostClient.setup do |config|
    config.server  = "assets.yoursite.org"
    config.token  = "{your assethost token}"
    config.prefix  = "/api"
  end

Finding

AssetHost::Asset.find(asset_id)

You should also provide fallback JSON files at lib/asset_host_client/fallback/asset.json and lib/asset_host_client/fallback/outputs.json.

This is so that if the API is unavailable for some reason, it won't bring your entire website down. You can override that path by setting config.fallback_root = Rails.root.join('lib', 'fallbacks') in your initializer.

Creating

AssetHost::Asset.create(attributes)

Contributing

Sure!

rake test to run tests.

Something went wrong with that request. Please try again.