Coder Social home page Coder Social logo

williamlutz / roda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeremyevans/roda

0.0 0.0 0.0 8.11 MB

Routing Tree Web Toolkit

Home Page: http://roda.jeremyevans.net

License: MIT License

Ruby 96.43% CSS 0.01% JavaScript 0.01% HTML 3.56% SCSS 0.01%

roda's Introduction

Roda

Roda is a routing tree web toolkit, designed for building fast and maintainable web applications in ruby.

Installation

$ gem install roda

Resources

Website

roda.jeremyevans.net

Source

github.com/jeremyevans/roda

Bugs

github.com/jeremyevans/roda/issues

Google Group

groups.google.com/group/ruby-roda

Goals

  • Simplicity

  • Reliability

  • Extensibility

  • Performance

Simplicity

Roda is designed to be simple, both internally and externally. It uses a routing tree to enable you to write simpler and DRYer code.

Reliability

Roda supports and encourages immutability. Roda apps are designed to be frozen in production, which eliminates possible thread safety issues. Additionally, Roda limits the instance variables, constants, and methods that it uses, so that they do not conflict with the ones you use for your application.

Extensibility

Roda is built completely out of plugins, which makes it very extensible. You can override any part of Roda and call super to get the default behavior.

Performance

Roda has low per-request overhead, and the use of a routing tree and intelligent caching of internal datastructures makes it significantly faster than other popular ruby web frameworks.

Usage

Here’s a simple application, showing how the routing tree works:

# cat config.ru
require "roda"

class App < Roda
  route do |r|
    # GET / request
    r.root do
      r.redirect "/hello"
    end

    # /hello branch
    r.on "hello" do
      # Set variable for all routes in /hello branch
      @greeting = 'Hello'

      # GET /hello/world request
      r.get "world" do
        "#{@greeting} world!"
      end

      # /hello request
      r.is do
        # GET /hello request
        r.get do
          "#{@greeting}!"
        end

        # POST /hello request
        r.post do
          puts "Someone said #{@greeting}!"
          r.redirect
        end
      end
    end
  end
end

run App.freeze.app

roda's People

Contributors

jeremyevans avatar soveran avatar celsworth avatar janko avatar adam12 avatar kenaniah avatar kematzy avatar frodsan avatar rosenfeld avatar vais avatar papierkorb avatar martinpoljak avatar plukevdh avatar eregon avatar cyx avatar chrisfrank avatar luciusgone avatar vangberg avatar aekobear avatar docelic avatar evanleck avatar skade avatar rkh avatar freaky avatar agis avatar mwpastore avatar foca avatar olleolleolle avatar pat avatar phoffer 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.