Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dba2f5169a

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
lib
spec
.gitignore
.simplecov
Gemfile
Gemfile.lock
LICENSE
NOTICE
README.md
Rakefile
cf-runtime.gemspec

README.md

cf-runtime

A library for interacting with Cloud Foundry services. Provides methods for obtaining pre-configured connection objects and connection properties.

Copyright (c) 2011-2012 VMware, Inc. Please see the LICENSE file.

require 'cfruntime'

Connect to mysql service named 'mysql-test'

client = CFRuntime::Mysql2Client.create_from_svc 'mysql-test'

Connect to a single service of type MongoDB

connection = CFRuntime::MongoClient.create db = connection.db

Obtain connection properties for 'myservice'

if CFRuntime::CloudApp.running_in_cloud? service_props = CFRuntime::CloudApp.service_props 'myservice' end

Obtain connection properties for single service of type MySQL

service_props = CFRuntime::CloudApp.service_props 'mysql'

Other handy methods

CFRuntime::CloudApp.host CFRuntime::CloudApp.port CFRuntime::CloudApp.service_names CFRuntime::CloudApp.service_names_of_type 'mysql'

Something went wrong with that request. Please try again.