https://github.com/caisilus/ruby_lab
Website for learning Ruby with automatic code testing
https://github.com/caisilus/ruby_lab
ruby
Last synced: over 1 year ago
JSON representation
Website for learning Ruby with automatic code testing
- Host: GitHub
- URL: https://github.com/caisilus/ruby_lab
- Owner: caisilus
- Created: 2022-04-22T14:59:42.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-11T12:52:11.000Z (about 3 years ago)
- Last Synced: 2025-01-23T07:45:06.649Z (over 1 year ago)
- Topics: ruby
- Language: Ruby
- Homepage:
- Size: 1.06 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RubyLab
RubyLab is a web application for teaching Ruby and Ruby on Rails. It automatically tests student's code and display percentage of tests passed.
# Features
This project is in development. Not all of the features below are implemented.
## Github integration
You can log-in via github and add a link to a repo: RubyLab will trace your commits and test your committed code automatically.

## Real-time updates
There is no need to refresh the page after you push your code. Your score will be updated in real time.

## Gamification
Scoring system is aimed to create motivation and determine your strengths and weaknesses.
# Development
To be able to contribute to the app, follow this steps:
1) Clone this repo
2) Install required **ruby version** (3.2.1)
3) Install gem bundler
4) Install **redis**: https://redis.io/docs/getting-started/installation/
5) Install **ngrok**: https://ngrok.com/download
6) Install node js and yarn
7) Run
bundle install
8) Run
yarn install
9) Install postgresql
10) Create .env file and enter your db cridentials like that:
DATABASE_USERNAME=
DATABASE_PASSWORD=
11) Create and migrate database. Run
bundle exec rake db:create
bundle exec rake db:migrate
12) To have example data, run
bundle exec rake db:seed
## Before starting server
1) Run foreman start to have life-reload for js and css
foreman start -f Procefile.dev
2) Start redis service.
sudo service redis-server start
On Windows it will work via WSL.
3) Start ngrok server
ngrok http 3000
4) Set **DEV_URL** env variable to the url **ngrok** provides.
5) Create folder for testing user's code and set **SANDBOX_FOLDER** env variable to its path
6) Create tests folder in SANDBOX_FOLDER and add test files
7) Create github app and set **GITHUB_CLIENT_ID** and **GITHUB_CLIENT_SECRET** env variables
8) Edit **Homepage URL** and **Authorization callback URL** at GitHub App's page to match your ngrok url
9) Run server
rails s
### Latest feature:
Instead of making steps 3-5, you can now create ngrok.yml configuration file in `lib/tasks` like this:
version: "2"
console_ui: false
authtoken:
When you have this file, you can run **both ngrok and server** using rake task:
rails ngrok:start