Giter VIP home page Giter VIP logo

sinatraband's Introduction

Sinatra Band

This is a snippet ruby code for a faster initial setup of a Sinatra App. This is not meant to be a framework of any kind (yet). It's just a way of making a clean start without loosing so much time.

Also, i think Sinatra sings better with a band...

Installation

$ gem install sinatraband

Requirements

require 'pathname'
require 'erb'

You need Ruby 1.9 to run SinatraBand and the Sinatra gem to run the app.

It's currently only supporting MySQL and Postgres database. But it's actually pretty easy to change the default values on the generated in config/config.rb. Take a look on ActiveRecord for help.

Usage

After setup you can do for creating a app:

$ sinatraband create app_name

Once you see the files created, you can move to the app_name directory:

$ cd app_name

Bundle the gem file with:

$ bundle

Then run the Sinatra app like you would normally do:

$ ruby app.rb

You can also create a model and it's following properties:

$ sinatraband model model_name attribute1:activerecord_type attribute2:other_activerecord_type

This also creates a sub-directory on the views directory with the name of the model and a controller file containing a basic scaffold idea. Remember that the views files called in the controller are not generated.

If you decide to create a model with the same name as another, the older model will be rewritten and the new one following your new properties will be created. That means you can lose some latter added code. So be careful when generating models.

Generating Tests

You are on your own...

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_sinatraband)
  3. Commit your changes (git commit -am "Added something")
  4. Push to the branch (git push origin my_sinatraband)
  5. Create an Issue with a link to your branch

sinatraband's People

Contributors

julioce avatar

Stargazers

Rodrigo Assis avatar  avatar

Watchers

James Cloos 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.