ad_gear_client

This gem is Ruby 1.8.6, Ruby 1.8.7, Ruby 1.9 and JRuby 1.3 compatible.

AdGear::Client is a client for accessing AdGear’s RESTian web service.

AdGear is a product of Bloom Digital Platforms, a Montreal-based company founded in 2008. Through the AdGear family of products Bloom provides advertising management solutions to publishers, ad networks and platform developers looking to monetize their audiences.

Getting Started

Installation

$ gem install ad_gear_client -s http://gemcutter.org/

Usage

Create a config file, such as config/ad_gear.yml

# Sample ad_gear.yml configuration file.  This file uses the same environment specifications as Rails, but they are actually optional
development: &defaults
  site: http://adgear.local/api
  user: francois
  password: 94457f97dd3aa153c05257104e59a90f41a8110184cdefc8e52e4e295e48a782
  use_basic_authentication: false
  use_digest_authentication: true

  # This is RestClient's logger support
  logger: STDERR

test:
  <<: *defaults

production:
  <<: *defaults
  site:  http://admin.adgear.com/api
  user: francois
  password: 0
  logger: log/ad_gear.log

Then, load the configuration:

require "ad_gear_client"

AdGear.config = AdGear::Config.new("path/to/ad_gear.yml", RAILS_ENV) # or whatever ENV you need

# You can start using the client here
formats = AdGear::Format.find(:all)

The environment is actually optional. If you do not specify it, the site, user, password and other keys must exist at the root level of the file. If you specify a key, and the YAML file does not have that key at the root, an AdGear::Config::MissingEnvironmentSpecification will be raised (fail early).

Dependencies

AdGear::Client works best with the ActiveResource branch made by François Beausoleil, at github.com/francois/rails. This branch of ActiveResource supports Digest authentication. AdGear::Client will work wihout that branch, but without Digest authentication.

This gem also requires the francois-rest-client gem, for file upload support.

Copyright © 2009 François Beausoleil.

Copyright © 2009 Bloom Digital Platforms

See LICENSE for details.