Ruby client for Companion Cube.
Add this line to your application's Gemfile:
gem "companion_cube"And then execute:
bundle installOr install it yourself as:
gem install companion_cube# 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)To run the tests, run:
docker-compose run --rm cc rake specYou can also run the following command for an interactive prompt that will allow you to experiment.
docker-compose run --rm cc bin/consoleFor added flexibility, you can use Bash.
docker-compose run --rm cc bashAdd 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/credentialsBuild the gem:
gem build companion_cube.gemspecInstall the gem locally: (optional)
gem install companion_cube-*.gemPush the gem:
gem push companion_cube-*.gem --host https://rubygems.org
rm companion_cube-*.gemThe credentials for the team account are in the box folder and in 1Password.
Please refer to LICENSE.
- Partner Ecosystem Team, IBM Digital Business Group mailto:imcloud@ca.ibm.com