Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

A simple Battlesnake AI written in Ruby

License

Notifications You must be signed in to change notification settings

BattlesnakeOfficial/starter-snake-ruby-2018

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

starter-snake-ruby

A simple Battlesnake AI written in Ruby with Sinatra.

This is loosely based on Heroku's official Getting Started with Ruby App.

Deploy

App Overview

  • web.rb is where the three actions must be implemented: start, move, end

  • Each handler is already set up to parse and render JSON.

Setup and Installation

1. Install Ruby

These steps assume you've installed ruby locally. If you haven't, a good Ruby version manager is rbenv or asdf with asdf ruby.

If you're opting for rbenv, this might be handy: Install Ruby

2. Fork and clone this repo:

git clone git@github.com:battlesnakeio/starter-snake-ruby.git
cd starter-snake-ruby

3. Install Bundler:

gem install bundler

4. Install dependencies:

bundle install

5. Run the server:

foreman start web

Test the client in your browser: http://localhost:5000

Deploying to Heroku

Click the Deploy to Heroku button at the top or use the command line commands below.

Create a new Heroku app:

heroku apps:create APP_NAME

Push code to Heroku servers:

git push heroku master

Open Heroku app in browser:

heroku open

Or go directly via http://APP_NAME.herokuapp.com

View/stream server logs:

heroku logs --tail