Japanda

Japanda provides an object-oriented and a functional wrapper around Instructure Canvas Api's

Disclaimer: For testing purposes only.

Installation

Add this line to your application's Gemfile:

gem 'japanda'

And then execute:

$ bundle

Or install it yourself as:

$ gem install japanda

Usage

Set a few enviroment variables( or use .env.example file)

export CANVAS_API_HOST=
export CANVAS_API_TOKEN=
export CANVAS_ACCOUNT_ID=

To create a new course

CanvasFactory::Course.new

To create a new course by providing a custom hash(merge)

opts = { course:{ name: 'coursename1', course_code: "code-change#{SecureRandom.hex}" } }
course = CanvasFactory::Course.new(opts)

To create a new course by providing a custom hash(no merge)

opts = {
         account_id: '10',
         course: {
           name: "code-name#{SecureRandom.hex}",
           course_code: "course_code#{SecureRandom.hex}"
         },
         offer: true
       }
course = CanvasFactory::Course.new(opts, false)

Development

After checking out the repo, run bundle install to install dependencies. Then, run rspec to run the tests. To install this gem onto your local machine, run bundle exec rake install.

Run in docker

Make sure your .env variable contains

CANVAS_API_HOST=<canvas_host>
CANVAS_API_TOKEN=<canvas_api_token>
CANVAS_ACCOUNT_ID=<canvas_account_id>

Building the testrunner

docker-compose build

Running the tests:

docker-compose run testrunner bundle exec rspec spec/

Release a new version

To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/babababili/japanda. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

For testing purposes only.

The gem is available as open source under the terms of the MIT License.