No description or website provided.
Ruby Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Barcelona is a simple HTTP to object mapper. HTTP methods & path names are assigned to methods on a processor object. Each processor method accepts one argument (Barcelona::Request) and returns a response (Barcelona::Response). Barcelona creates rack compatible objects so any standard web server will work. In short, it exposes objects to the internet via HTTP.

http_router & rack power the internals.


Mapping HTTP Verb & Path to a method is all you need. This approach is simple and object oriented. It also eliminates as much state as possible leaving request/response processing as functional as possible. It get out of your way to so you can generate a response in which ever way you like.


Add this line to your application's Gemfile:

gem 'barcelona'

And then execute:

$ bundle

Or install it yourself as:

$ gem install barcelona


Define a processor class that implements all required methods.

class Processor
    def create_user(request)
        Barcelona::Response.ok do |response|
            response.json = { nick: 'ahawkins' }

Now map HTTP track to methods.

app = do |http| '/users', :create_user

app responds to call so it can be used in via:

run app


$ make test


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