Ruby

Showing 19-27 of 35 results
EngineeringIcon ChevronBack-end

Building a Color-based Image Search Engine in Ruby

by Nazar Hussain

With modern image editing tools, we often take for granted the ability to extract or identify color on some part of any image. However, doing it programmatically is not exactly so straightforward. Camalian, a Ruby gem, changes that, making extracting and manipulating colors in an image as easy as possible. In this article, Toptal engineer Nazar Hussain provides some insight into how various color spaces work, introduces Camalian, and gives an overview of how to use it to build a color-based image search engine in Ruby.

7 minute readContinue Reading
EngineeringIcon ChevronTechnology

Ruby Metaprogramming Is Even Cooler Than It Sounds

by Nikola Todorovic

Ruby metaprogramming, one of the most interesting aspects of Ruby, enables the programming language to achieve an extreme level of expressiveness. It is because of this very feature that many gems, such as RSpec and ActiveRecord, can work the way they do. In this article, Toptal engineer Nikola Todorovic demystifies Ruby metaprogramming using some examples that are relevant to everyday programming and aims to bring it closer to average Ruby developers.

9 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

How to Use Rails Helpers: A Bootstrap Carousel Demonstration

by Carlos Ramirez III

One of the most misused, misunderstood, and neglected of all the Rails built-in structures is the view helper. Helpers often get a bad reputation for being a dumping ground for one-off methods used across the entire application's view layer. But what if your helpers could be more semantic, better organized, and even reusable across projects? What if they could be more than just one-off functions sprinkled throughout the view, but powerful methods that generated complex markup with ease leaving your views free of conditional logic and code? Let's see how to do this when building an image carousel, with the familiar Twitter Bootstrap framework and some good old-fashioned object-oriented programming.

7 minute readContinue Reading
EngineeringIcon ChevronTechnology

Learn to Code: Wisdom and Tools for the Journey

by Nick McCrea

It's no surprise that more and more people, from all kinds of backgrounds, are deciding to learn to code. But, each person who tackles the task is soon faced with an unpleasant reality: Learning to program is hard. Contrary to expectations, the feeling of "I don't get it," may persist unabated long into the journey, making once bright-eyed beginners feel hopeless, lost, and ready to give up. The moral of the story is this: Be prepared. The path to programmer paradise is a long one, and without the right mindset at the beginning, it can quickly lose its appeal. In this article, I'll attempt to give you some guidance on what to expect on your journey, how best to go about it, and what tools and resources you may find helpful along the way.

15 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

Meet Volt, A Promising Ruby Framework For Dynamic Applications

by Amaury Andres Peniche Gonzalez

In an attempt to make web applications a lot more dynamic, front-end Javascript frameworks like Angular.js, Backbone.js and Ember.js have gained a lot of popularity. However, these frameworks often require a back-end application to be useful, so they are used in conjunction with web frameworks like Ruby on Rails and Django. On the other hand, Volt is capable of managing the back-end and a dynamic front-end; since both functionalities are tightly integrated into its core.

8 minute readContinue Reading
EngineeringIcon ChevronBack-end

Ruby Concurrency and Parallelism: A Practical Tutorial

by Eqbal Quran

A thorough and practical introduction to concurrent and parallel programming in Ruby, presenting and contrasting a number of techniques and options available, from the standpoints of both performance and complexity. Discusses forking, multithreading, the Global Interpreter Lock (GIL), and more.

10 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

The Publish-Subscribe Pattern on Rails: An Implementation Tutorial

by Ahmed AbdelHalim

The publish-subscribe pattern] (or pub/sub, for short) is a messaging pattern where senders of messages (publishers), do not program the messages to be sent directly to specific receivers (subscribers). Instead, the programmer "publishes" messages (events), without any knowledge of any subscribers there may be. This article provides insight in how to use the pub/sub pattern, in Rails, to communicate messages between different system components without these components knowing anything about each other's identity.

8 minute readContinue Reading
EngineeringIcon ChevronBack-end

A Guide to Rails Engines in the Wild: Real World Examples of Rails Engines in Action

by Joe James

Why are Rails Engines not used more often? I don't know the answer, but I do think that the generalization of "Everything is an Engine" has hidden the problem domains that they can help to solve.

12 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

The Many Interpreters and Runtimes of the Ruby Programming Language

by Ryan Wilcox

Which Ruby implementation is right for your project? While the reference implementation (Ruby MRI) remains the interpreter of choice, an alternate Ruby implementation may be right for your project, depending on your operational goals and constraints. This article showcases the Ruby interpreter implementations and runtimes available today, discussing the advantages and disadvantages of each.

9 minute readContinue Reading

Join the Toptal® community.