Build Status

Companion Cube

Ruby client for Companion Cube.

Installation

Add this line to your application's Gemfile:

gem "companion_cube"

And then execute:

bundle install

Or install it yourself as:

gem install companion_cube

Usage

# To start, create a client
cc = CompanionCube::Client.new(url: "https://cc.example.com")

# Retrieve all existing courses
courses = cc.courses

# Create a new course
params = {
  run:          "...",
  archive_file: File.new("...")
}
new_course = cc.create_course(params)

# Retrieve an existing course
course = cc.course(new_course["id"])

# Update a course
params = {
  archive_file: File.new("...")
}
updated_course = cc.update_course(course["id"], params)

Development

To run the tests, run:

docker-compose run --rm cc rake spec

You can also run the following command for an interactive prompt that will allow you to experiment.

docker-compose run --rm cc bin/console

For added flexibility, you can use Bash.

docker-compose run --rm cc bash

Build

Add the gem repo to your configuration:

# replace @ with %40 in your username
gem source -a \
  https://<USERNAME>:<PASSWORD>@na.artifactory.swg-devops.com/artifactory/api/gems/apset-ruby/

# keep @ AS IS
curl -u<USERNAME>:<PASSWORD> \
  https://na.artifactory.swg-devops.com/artifactory/api/gems/apset-ruby/api/v1/api_key.yaml \
  > ~/.gem/credentials

Build the gem:

gem build companion_cube.gemspec

Install the gem locally: (optional)

gem install companion_cube-*.gem

Push the gem:

gem push companion_cube-*.gem
rm companion_cube-*.gem

License

Please refer to LICENSE.

Authors