No commit activity in last 3 years
No release in over 3 years
Ruby client for AssetHost
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.14

Runtime

~> 0.8
< 5, >= 3.0
 Project Readme

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.