Category: 1. Cuba
-
Setting the Road
Now that we know the basics of Cuba, we’re ready to make our twitter clone. In this chapter, we’ll set the road to start coding theapplication and have a look at how Cuba applications looks in the wild.After reading this chapter, you will know:The general layout of a Cuba application.How to properly manage project dependencies.How…
-
Rack & Roll!
As we mentioned earlier, Cuba is built on top of Rack … but what is Rack?Rack deals with HTTP requests. It provides a minimal interface between web servers supporting Ruby and Ruby frameworks. WithoutRack, Cuba would have to implement its own handler for each web server.You didn’t notice yet but we already used Rack. We…
-
Breaking Down the Syntax
Now that we know how to build a minimal Cuba application, let’s take a deeper look at the syntax. We can split this example into threeparts:First, we require Cuba to load the gem and get access to its functionality. require “cuba” Then we can identify four methods that appear in most Cuba applications: define , on…
-
Hello Cuba!
Before getting started, we have to install Cuba. Use the gem command: Now that Cuba is installed, it’s easy to create a Cuba application. Open your text editor of preference and create a file called with the following code: You already have a functional Cuba application! To see it in action, type in the command…
-
What’s Cuba?
To begin, let’s take a moment to answer “what is Cuba?” .Cuba is a web application micro-framework written in Ruby byMichel Martens. It rides onRack so we have the benefits of middleware,Rack libraries, and a variety of web servers for free.Cuba is minimalist by design (203 lines of code) which makes itfaster compared to other web frameworks. Also,…
-
Welcome Aboard
This first chapter focuses on the bare minimum you need to know to work with Cuba. We’ll learn some of the core concepts walkingthrough the creation of a simple application. After reading this, you will know:How to install Cuba.Create a “Hello world!” application.The basic principles behind Cuba.The basics of Rack.
-
The Guide to Cuba
The Guide to Cuba Learn how to make Ruby web applications by following a minimalistic approach. This book will teach you the basics ofCuba, the Rubymicroframework, and a set of micro libraries.This book is a work in progress. The content may change at any time.All content is licensed under theCreative Commons Attribution Non Commercial Share…