We love open source and we invest in continuous learning. We give back our knowledge to the community.

Improvements to Error Responses in Rails 5 API Mode

Comments

In previous posts, we demonstrated how to build an API application with Rails 5. Specifically, we covered integration with Backbone and Ember. At the time of writing of those posts, the only way to try out the all-new Rails API mode was by taking the code from the master branch, since Rails 5 had not yet been released. However, Rails-5-0-beta1 is available now, so you can easily start to build applications using Rails in its new API-flavored mode.

This Rails release also includes some changes related to the API mode that materialized in Rails a few weeks ago. The purpose of those changes is to improve error responses to JSON requests in Rails. We initiated a discussion about how Rails should handle and return responses in the proper format in the case of an error in processing a request, and then we finally came up with the necessary code changes in Rails.

Sometimes, It’s Good to Be Shy

Comments

Life doesn’t stand still.

Neither can the code that we write. In order to keep up with today’s near-frantic pace of change, we need to make every effort to write code that’s as loose–as flexible–as possible. Otherwise we may find our code quickly becoming outdated, or too brittle to fix, and may ultimately be left behind in the mad dash toward the future.

This quote, taken from the highly regarded The Pragmatic Programmer book, depicts beautifully an ongoing, everyday challenge software developers face: writing flexible enough code which smoothly adapts to change.

What Andy Hunt and Dave Thomas are telling us is that software we develop, just as much as the world we live in, resides in a constant state of evolution. Despite our best efforts, requirements will change, and we’ll be better off if our solution is prepared for it.

Immutable Strings in Ruby 2.3

Comments

String literals immutability is one of the new features you can find in Ruby 2.3. But, what does this imply?

  • Same value literals points to the same object
  • Better performance
  • Thread safety

Currently string immutability is included as opt-in, being the first step of a multi stage rollout and if it works well it will be enabled by default on Ruby 3.0. So it still can end up being just an experiment. Time will tell.

You can follow frozen string literals feature status in Ruby issue tracker Feature #11473: Immutable String literal in Ruby 3

Understanding unknownProperty in Ember

Comments

The Ember object model provides support for dynamically resolving properties in an object. In other words, if we request the value of a property from an Ember object, this object has the chance to respond to the request even if the property doesn’t exist.

This can easily be implemented using the handler unknownProperty.

Living With Singleton Controllers

Comments

As you already may know by now, Ember controllers are singleton, this can be handy under some circumstances for example for keeping global state, but by now, most of the Ember community is moving forward to other solutions (like Ember.Component and Ember.Service) to avoid certain problems that arise due to their singleton condition.

Using UNIX Tools

Comments

When I began studying Ruby, one of the things that most caught my attention was the length of time between having an idea and being able to validate the first step; if this were an article about TDD, I would refer to this as the speed with which we receive feedback. The feedback loop is very short.

When Is Ssh -a Insecure?

Comments

Introduction

What’s the authentication agent forwarding for?

Let’s start showing what man ssh says about it:

-A Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file. Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent’s UNIX-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent.

It tries to solve the following problem:

Laptop -> Server A -> Server B

User wants to connect to Server A and from Server A to Server B forwarding all authentication requests to Laptop.

Technical Thursdays Or: How We Do Continuous Learning

Comments

A conclusion I came to after years of watching software projects come and go, is that one of the biggest differences between teams who achieve consistent success and those who suffer through inconsistency is their commitment to continuous learning. Successful athletes continuously practice the fundamentals while learning more advanced strategies. Same should happen with developers.

Here at WyeWorks we strongly believe that curiosity and passion for learning are key to being a good developer. If you have people on your team who are curious and collaborative like we do, continuous learning comes naturally and performance will be high.

Either it is to share a tip, research a new technology, play around with that library that was on top of the head for weeks, or even watch someone’s keynote, people gather the entire morning at what we call Technical Thursdays with the same goal in mind: share and acquire knowledge.

Recently, a developer with no more than 10 days at the company (who was also new to Ruby) was able to get his first contribution to OSS accepted after fixing a bug encountered when playing around with a gem we were discussing. Everything happened that same morning: the learning on how to use the gem, the bug discovery, the teamwork to fix it, and finally the contribution to open source.

Here are a few pics of WyeWorkers at our Technical Thursdays

So technical Thursdays is part of what we do in order to improve and stay up to date. What are you doing as a developer in order to maintain up to date and continue learning? Please share!

How to Build a Rails 5 API Only and Ember Application

Comments

A few days ago, following long discussions, Rails API was merged into Rails master branch.

Because of that, in our latest post we discussed how to build an API only application. We’ve also shown how to integrate it with a client-side application implemented using Backbone. If you’ve missed this post, check it out and learn more about how to integrate Rails API with an Backbone application.

In this post, we are going to show how a very similar client-side Ember application can be integrated with the same backend application implemented using Rails API. Like in our previous post, we are going to use the TodoMVC application.

In addition, we are going to comment about some issues that were fixed in Rails and Active Model Serializers in order to make the integration easier. These improvements were the result of testing Rails API with an Ember application, as part of our efforts to make it work properly with some of the most popular JavaScript frameworks.

How to Build a Rails 5 API Only and Backbone Application

Comments

A few weeks ago, an announcement was made referring to the imminent inclusion of Rails API into Rails core. Until now, Rails API has been a separated project and people have been using it through the rails-api gem.

Santiago Pastorino and I have been working on bringing Rails API into Rails for a while. After some further discussion, bug fixes and last-minute changes, the corresponding pull request was finally merged. We’re happy to confirm that all Rails API capabilities will be available once Rails 5 is released!

Rails API goal is to facilitate the implementation of API only Rails projects, where only a subset of Rails features are available. A Rails API application counts with lightweight controllers, a reduced middleware stack and customized generators. All these features were conceived looking for a better experience at the moment of building an API only application.

For more detailed information about the Rails API project, you can take a look at this Santiago Pastorino’s article about the project.