Code Monkey home page Code Monkey logo

bcc-community's Introduction

This is the source code for the sinatra-template project on github.
It's the basic structure I use for my Sinatra projects and it make things a bit more organized.

What's inside?

  • Modular Sinatra app version 1.3.2 using ruby 1.9.3-p125
  • minitest for unit-level tests
  • rack-test for routes tests
  • capybara + minitest for integration tests (no need for rspec)
  • yard for documentation
  • Rakefile, Gemfile, .rvmrc, .gitignore

Folders Structure

app.rb         # require sinatra, vendor'd gems, models/init, routes/init, helpers/init

helpers/         
  init.rb      # Require each helper file
  helper1.rb   # Related helper methods

models/          
  init.rb      # Require each model, in controlled order
  user.rb      # model
  picture.rb   # model

routes/          
  init.rb      # Require each route, in controlled order
  user.rb      # One or more routes related to some feature
  admin.rb     # One or more routes related to administration

views/
  layout.erb   # Common layout
  index.erb    # Specific view

test/         
  models       # minitest
  routes       # rack-test
  acceptance  # capybara + minitest

Setup

Install Ruby 1.9.3 (if necessary). RVM is optional, but highly recommended

rvm install ruby-1.9.3-p125
git clone https://github.com/oren/sinatra-template.git
cd sinatra-template (it will create sinatra-template gemset)

Install QT (needed for capybara-webkit)

Install bundler

gem install bundler

Install the gems

bundle install --without production staging

View all available rake commands

rake -T

rake                  # Run all tests
rake test:acceptance  # Run acceptance tests
rake test:models      # Run models tests
rake test:routes      # Run routes tests
rake yard             # Generate YARD Documentation

Run the server

shotgun

Go to http://127.0.0.1:9393

bcc-community's People

Stargazers

Andrew Kim avatar

Watchers

Andrew Kim avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.