Ruby GEM for using the Scalarium API
Ruby
Latest commit e79d615 Jul 16, 2012 @phorsuedzie phorsuedzie Version 0.0.9
Failed to load latest commit information.
lib Version 0.0.9 Jul 16, 2012
spec Can provide options for rest client now. Closes #5 Jul 16, 2012
tasks
.gitignore Jeweler => .gemspec Feb 3, 2012
Gemfile Jeweler => .gemspec Feb 3, 2012
Gemfile.lock Version 0.0.9 Jul 16, 2012
MIT-LICENSE Added License Jul 6, 2012
README.rdoc Version 0.0.9 Jul 16, 2012
Rakefile Jeweler => .gemspec Feb 3, 2012
scalapi.gemspec Added License Jul 6, 2012

README.rdoc

Scalarium Connector

Library to interact with the Scalarium API.

Simple Example

require 'scalapi'

# setup your configuration
Scalapi.configure do |config|
  config.token = "your scalarium token"
end

# get a "default" scalarium - using your configuration
root = Scalapi.scalarium

# get all clouds
clouds = root.clouds

# get the applications of a cloud
cloud = clouds.first
first_cloud_applications = cloud.applications

# create a new cloud
new_cloud = root.create_cloud({...})

Extended Example (using two tokens)

require 'scalapi'

# setup the default token
Scalapi.configure do |config|
  config.token = "default scalarium token"
end

standard_configuration = Scalapi::Configuration.configuration

# create a new configuration with fallback to the standard (by reference, not copy)
extended_configuration = Scalapi::Configuration.new(standard_configuration)

# setup a different api token and setup logging for all invocations of <resource>."get"
extended_configuration.configure do |config|
  config.token = "different token"
  config.trace = [:get]
end

# the top level scalarium bound to the default token
default_scalarium = Scalapi.scalarium # same as Scalapi.bind(standard_configuration)

# the (other) top level scalarium bound to the different token
the_other_scalarium = Scalapi.bind(extended_configuration)

License

MIT - see [MIT-LICENSE](raw.github.com/infopark/scalapi/master/MIT-LICENSE)

ChangeLog

0.0.9

  • Configurable resource_builder - can specify a (higher) request timeout now:

    Scalapi.configure.tap do |config|
      config.resource_builder = lambda {|url, options|
        require 'restclient'
        ::RestClient::Resource.new(url, options.merge(:timeout => 60))
      }
    end

0.0.8

  • License: Feel free to use scalapi at any time at your own risk.

0.0.7

  • Scalarium/Rails 3.2 requires a proper request format declaration

  • Scalarium/Rails 3.2 responds an additional charset (yet ignored)

0.0.6

  • Fix: MultiJson API detection improved (was confused by ActiveSupport::Dependencies::Loadable)

0.0.5

  • Fix: Model#find(nil) returns nil now (instead of the result of an index request)

0.0.4

  • uses new MultiJson API when available (less noisy deprecation warnings)

0.0.3

  • added resource model: Credentials