Software engineering and personal development

Tag: ruby (Page 1 of 3)

Make testing values easier and prettier with minitest_lucid gem

Writing tests in your projects is really important, especially because you need to make sure that things that have been implemented are already working as expected, and that future changes do not break something that is already working. In your projects, you may need to test that certain values are being assigned as expected, and sometimes trying to fix failing tests, or when writing new ones can be difficult to decipher the issue. Fortunately, a new Ruby gem has been implemented which is developed making this thing a lot easier.

Continue reading

Save code formatting when copying from an IDE/editor to Microsoft Word

If you ever needed to paste a code that you have written in your favorite IDE or editor inside Microsoft Word and do not want to lose your formatting, then PlanetB is a really great tool that gives you that opportunity. It has a really easy-to-use user interface. It comes with the support for several programming languages like: C/C++, C#, CSS, Delphi, Pascal, XML, Java, Javascript, PHP, Python, Ruby, SQL, VB and HTML. Continue reading

Underestimated testing tool for Rails applications: Execute console commands with real data without fearing of losing it

Img source: careerfoundry.com

There can be cases when you need to test something with the actual data, in a production environment, but you do not want to risk anything. You do not want to even think about the possibility for a data loss of the project that you are working it. Luckily, there is a really beneficial feature that is not that much known from Rails developers is a quick tool that you can use to test out some code without changing any data in your real database.

Continue reading

Set up your user roles easily using Rolify gem

Img source: remino.net

User roles are definitions of what users can do while using your applications. For example, when you are developing a marketplace for renting cars, you may need at least two user roles: hosts, who provide their cars, and users, who rent cars. Both of these user types will have different functions that they have at their disposal. Rolify is a Ruby gem that allows you to easily add and manage user roles in your application.

It can be integrated with other Ruby gems that you may need like authentication gems (devise, Authlogic, Clearance) and authorization gems that don’t provide role classes (CanCanCan, authority, Pundit).

You can install it as any other Ruby gem, and fortunately, it comes with a great README walk-through of the setup procedure and usage that you can follow along.

As it is an open source project, you can view its source code, learn how it’s built and also become a contributor to it.

Click here to learn more about it.

Remove all whitespace in your strings with the squish method in your Ruby projects

It is really hard to think about a real world project in which you are not going to have strings. As a result, having pre-existing methods for manipulating strings is really productive, as it saves you time. In today’s article, I want to emphasize a particular method in Ruby on Rails, that’s surprisingly not that much well known, which helps you with the whitespaces. Continue reading

Inform your users about breached passwords using Pwned Passwords API

Img source: dev.to

Passwords one of the most frequent ways that we use to access our digital accounts. Having secure passwords is really crucial, and represents one of the most important aspects that we need to pay attention to. As developers, we also need to make sure that we provide our services with a high level of security. Last year 2017 NIST (National Institute of Standards and Technology) recommended to check user passwords against existing public breaches of data, and fortunately, there exists an API that allows you to do that really easily. Continue reading

« Older posts

© 2024 Fatos Morina

Theme by Anders NorenUp ↑