No commit activity in last 3 years
No release in over 3 years
Code Generator for Sinatra
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

>= 0
>= 0
 Project Readme

Modularize Sinatra

Gem Version

Modularized Code Generator for Sinatra. Gem available on rubygems More information at: http://goyalankit.com/blog/2013/07/23/modularize-sinatra/

Installation

$ gem install modularize_sinatra

Usage

To generate the skeleton structure with custom controller:

modularize_sinatra new myapp -C user

To Start the app:

rackup -p 9292

It will generate a default index page for you, which can be accessed at:

http://localhost:9292/

You'll get the following directory structure with above command:

    .
    ├── config
    │   └── environment.rb
    ├── lib
    │   ├── controllers
    │   │   └── user.rb
    │   ├── views
    │   │   └── users
    │   │       └── index.erb
    │   └── app.rb
    ├── spec
    │   ├── controllers
    │   │   └── user_spec.rb
    │   └── spec_helper.rb
    ├── Gemfile
    ├── Rakefile
    ├── config.ru
    └── myapp.rb

Without the -C paramter( not recommended ), it will generate a default controller for you called Ping and will create the following route:

GET http://localhost:9292/ping
> Ahoy! from Myapp 2013-04-07 00:33:58 +0530

Currently rspec is configured by default. Hope to release support for other frameworks in future versions.

To Run specs:

bundle exec rake 

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request