Angel Ruiz
clean, clean-up, remove, repositories, prune, local, remote, branches

Git housekeeping: remove "obsolete" branches from the remote and your local repositories

Angel Ruiz clean, clean-up, remove, repositories, prune, local, remote, branches

git clean

Recently I was faced with the task of cleaning up a Git repository whose branches were not "pruned" for a few years, so I am talking about several hundreds of branches.

This situation can make using Git through the command line or a GUI front-end client a very cumbersome experiece. That's why I usually recommend, as a general rule, to delete any feature or bugfix branch after it gets merged to a "higher level" branch. Because they became "useless" and only add noise.

Read More
Angel Ruiz
gradle, java, webjars, static resources

Extract Webjars static resources with Gradle for jBake (or anything really...)

Angel Ruiz gradle, java, webjars, static resources


gradle and webjars

For those of you who never heard of it before, WebJars is an open and community driven initiative that tries to leverage the existing Maven based dependecy resolution tools and principles to manage the client side dependencies of your web application. Each WebJar is a standar JAR file that contains a set of curated files (Classic WebJars) for a given library. Recently you can also reference Bower and NPM packages but I would not recommend it.

Read More
Angel Ruiz
linux, elementaryOS, guide

My steps to setup elementaryOS Freya

Angel Ruiz linux, elementaryOS, guide


elementary os

I have decided to give a go to the latest release of the elementaryOS Linux distribution, Freya, and see if it can become my distro of choice for software development. Main reason being that: elementary OS is essentially a Ubuntu (14.04 in this case) based Linux system that just works but wrapped in a really beautiful, smooth and minimalistic interface. All its features make the elementary os usage experience to stand out from all the other Linux distributions I have tried. Even the command line terminal has its own personality, definitely contributing as a differentiation factor.

Read More
Angel Ruiz
elasticsearch, java, json, debug

How to reference a file inside a Grails plugin

Angel Ruiz elasticsearch, java, json, debug


elasticsearch-java-json

It took me long enough time to find out, so I thought I would make a post for anyone else who is after the answer in the future.

In Groovy code:

log.debug("ElasticSearch Query using Java Client API:\n${searchRequestBuilder.internalBuilder()}")

And this in Java:

log.debug("ElasticSearch Query using Java Client API:\n" + searchRequestBuilder.internalBuilder());

The output is prettified by default.

Read More
Angel Ruiz
grails, spock, testing

Integrated vs Functional testing: how to test REST APIs in Grails using Spock

Angel Ruiz grails, spock, testing


Grails and Spock

This guide was written using Grails 2.4.4 although it should work the same for Grails 2.3.x and 3.x (almost the same :-P)

Since current official documentation only covers unit testing for controllers and that it took me a while to to figure them out completely, I thought I would leave it here in case it helps someone else.

The reason for writing these tests was to validate some REST API endpoints implemented using Grails Controllers.

Read More