Project

chespirito

0.0
The project is in a healthy, maintained state
A dead simple, yet Rack-compatible, web framework written in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

chespirito

rubygems rubygems rubygems

Build Ruby Style Guide Ruby Style Guide

       ( )                         _        _ ( )_
   ___ | |__     __    ___  _ _   (_) _ __ (_)| ,_)   _
 /'___)|  _ `\ /'__`\/',__)( '_`\ | |( '__)| || |   /'_`\
( (___ | | | |(  ___/\__, \| (_) )| || |   | || |_ ( (_) )
`\____)(_) (_)`\____)(____/| ,__/'(_)(_)   (_)`\__)`\___/'
                           | |
                           (_)

chespirito is a dead simple, yet Rack-compatible, web framework written in Ruby.

Requirements

Ruby

Installation

$ gem install chespirito

Development tooling

Make and Docker

Using make

$ make help

Output:

Usage: make <target>
  help                       Prints available commands
  bundle.install             Installs the Ruby gems
  bash                       Creates a container Bash
  run.tests                  Runs Unit tests
  rubocop                    Runs code linter
  ci                         Runs code linter and unit tests in CI
  sample.hello-app           Runs a sample Hello World app
  sample.login-app           Runs a sample app with Login feature
  gem.publish                Publishes the gem to https://rubygems.org (auth required)
  gem.yank                   Removes a specific version from the Rubygems

Boostrapping an application using Chespirito and Adelnor

  1. Install the gems:
$ gem install chespirito adelnor
  1. Register the Chespirito app and routes:
class MyApp
  def self.application
    Chespirito::App.configure do |app|
      app.register_route('GET',  '/', [HelloController, :index])
      app.register_route('POST', '/', [HelloController, :create])
    end
  end
end
  1. Create the Controller and action:
class HelloController < Chespirito::Controller
  def index
    response.status = 200

    response.headers['Content-Type'] = 'text/html'

    response.body = '<h1>Hello, world!</h1>'
  end

  def create
    response.status = 204
  end
end
  1. Run the app using Adelnor (or you can choose another web server like Puma, Unicorn, etc):
Adelnor::Server.run MyApp.application, 3000
  1. Open localhost:3000 and cheers!

ASCII art generator