Straasio

Short description and motivation.

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'sraas'

And then execute:

$ bundle

In rails root run instalation script

$ rake sraas:install

Add your api key in config/initializers/sraas.rb

Sraas.configure do |config|
  # Sraas provider URL
  config.url         = ENV["SRAAS_URL"] || "https://www.sraas.io"

  # API key
  config.api_key     = Rails.application.secrets.sraas_api_key
end

Run migrations

$ rake db:migrate

Using

Add to models/user.rb next line

class User < ApplicationRecord
  has_sraas
end

This will create polymorphic association sraas_consumer which provides interface for using SRAAS API

CLI new features

  • Get template cards specified by template_deck id bash $ sraas template_card template_cards xxxx
  • Get template card specified by template_card id bash $ sraas template_card info xxxx
  • Get template card's children specified by template_card id bash $ sraas template_card children xxxx
  • Get template card's parents specified by template_card id bash $ sraas template_card parents xxxx
  • Get lesson cards specified by consumer id and lessons id bash $ sraas cards lesson --consumer_id=xxxx --lesson_id=x
  • Get card specified by card id bash $ sraas cards info xxxx
  • Get card's children specified by card id bash $ sraas cards children xxxx
  • Get card's parents specified by card id bash $ sraas cards parents xxxx

Tests

Preparation

$ cd specs/dummy/
$ rake db:migrate

Runing

$ rake spec

Contributing

Contribution directions go here.

License

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

cd test/dummy; bin/rails generate model Hickwall sraas_consumer_id:string

Deploy updated gem:

gem install pkg/sraas-0.2.2.gem