Author: admin
-
What is Geocoding?
Geocoding is a process that involves converting addresses (like “1600 Amphitheatre Parkway, Mountain View, CA”) into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map. In simpler terms, it is the computational process of transforming a physical address description to a location…
-
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…