Angel Ruiz
grails, how-to, javascript, json

How to render JSON properly (without escaping quotes) inside a GSP script tag

Angel Ruiz grails, how-to, javascript, json

Grails logo

This issue was encountered while using Grails version 2.3.11

In theory it should be as simple as:

  1. Return JSON in your model from your controller
def index() = {
	[data: data as JSON]
  1. Render the model attribute without encoding using the raw() method
	var data = ${raw(data)};

Unfortunately this does not work, at least when you are using the resources plugin.

Read More
Angel Ruiz
ubuntu, rabbitvcs, nautilus, integration, git

How to integrate RabbitVCS with Nautilus file manager in Ubuntu 14.04 Trusty Tahr

Angel Ruiz ubuntu, rabbitvcs, nautilus, integration, git

RabbitVCS Git client in Ubuntu

There are still some instances of very nice applications that do not work straight away after installing them via the apt package manager and unfortunately RabbitVCS is one of them.

RabbitVCS is for Linux what TortoiseGit and TortoiseSVN are for the Windows platform. It is a SCM client that integrates itself with the OS file manager to manage local Git or SVN repositories.

Read More
Angel Ruiz
vagrant, ubuntu, devops, virtualization, virtualbox

Steps to create a Vagrant Base Box with Ubuntu 14.04 Desktop (GUI) and VirtualBox

Angel Ruiz vagrant, ubuntu, devops, virtualization, virtualbox

Vagrant + VirtualBox + Ubuntu = Ubuntu Boxes

Since the advent of the IaaS and PaaS providers, the decline in usage of monolithic architectures (e.g.: application server + relational DB) and the need for distributed and automatically scalable applications, as software developers we have to be increasingly more aware and skilled in the tools and techniques used to orchestrate and automate the deployment of all the different components that our architecture might end up with.

Among these tools, normally encompassed in the DevOps space, I am currently very interested in Vagrant, Docker, Ansible and Ubuntu JuJu. Although I already use Vagrant, today I decided I wanted to know how to create my own Base Boxes that I can reuse. My idea is to have two Linux Base Boxes with Ubuntu Server and Ubuntu Desktop respectively and then another two with Windows 7 and 8. Once Vagrant is covered I want to get deeper with Docker because I see a lot of potential in lightweight containers instead of using heavy virtual machines.

Read More
Angel Ruiz
grails, plugins, how-to

How to reference a file inside a Grails plugin

Angel Ruiz grails, plugins, how-to

Grails logo

Recently I had to creat a Groovy script that copies some files from my plugin to the host application. The problem is I did not know how to reference those files inside my plugin.

String yourPluginDir = GrailsPluginUtils.pluginInfos.find { == 'your-plugin-name' }.pluginDir
Read More
Angel Ruiz
grails, migration, groovy

Migrating from Grails 2.2 to 2.3

Angel Ruiz grails, migration, groovy

Grails logo

I am writing this post to record all the things I have done in order to migrate an existing Grails 2.2.x app to 2.3.x.

The reasons for me to upgrade are:

  • Project progress is at an early stage where is not very risky to do that. We also have a considerable amount of automatic tests. You have also need to take into consideration that the more major versions you skip, the harder it gets to migrate to the latest version.
  • Switched dependency resolution engine from Ivy to Aether. I have had problems with Ivy resolving transitive dependencies and snapshots of my own plugin dependencies.
  • "Forked Execution" and the "Test Runner Daemon" should speed up the tests execution and therefore speed up
    the tests development. This is one of the mayor caveats I have found in Grails so far. We'll see if they have fixed it with this two new features.
Read More