Enforcing coding guidelines using CircleCI and Rubocop

Siva talks about how to enforce coding guidelines using CircleCI and Rubocop

rails learning

Being a rubyist we don’t just write code, we write beautiful code. But sometimes, in a hurry to complete the requirement some developers, especially new comer, might not follow the coding guidelines which would become headache later. Rubocop is here to rescue us from this scenario.

Let’s see how to integrate rubocop:

1. Add rubocop and generate config file:

Here is the file where you can find list of cops that rubocop uses.

2. Run rubocop or through CircleCI:

where -R option make rubocop to run rails cops as well.

This would run rubocop upon every commit on CircleCI. Though your test cases have been passed but if rubocop fails then your build fails.

Now let’s see how rubocop enforces you write to better & clean code:

Scenario-1: Using else with unless:

As a matter of fact, using else with if would make more sense than using with unless

View original post 75 more words

Designing Rails API using Rabl and Devise

Most of us are aware that enabling API access for rails application is easy as Rails provides RESTful APIs by default. However, a little complexity arises when some responses are expected in xml format (maybe for some legacy system) and JSON format. Complexity increases when these API calls need authentication. The initial obvious thought that … Continue reading Designing Rails API using Rabl and Devise

Want to increase user registrations using all available social networks? Gigya widgets are quick and easy!

Do you already have a web-portal running for years and you want to use different social networks to increase user registrations? Can you afford to keep integrating newer social networks and deprecate older ones? Gigya register widget eases all this -- its quick and simple to use!

Integrate Gigya Register Widget into your Application

Updated post with source code available here. In today's world, with everyone managing multiple online accounts, it painful for users to create and remember yet another set of new credential just for your application. To overcome this issue we can use social networking API but this too has other drawbacks. For example, how many social … Continue reading Integrate Gigya Register Widget into your Application