Author Archives: Rob Nichols

Enabling PostCSS with Rails 6

PostCSS is a tool for transforming CSS with JavaScript. To enable it in a Rails application, I needed to make the following changes to my app. Please note that my app does not use turbolinks. /app/views/layouts/application.html.erb Update so that the style … Continue reading

Posted in Uncategorized | Comments Off on Enabling PostCSS with Rails 6

Private methods in Ruby

I think the way private methods are defined, is one of Ruby’s few weaknesses. The main problem being that they separate the private methods from the methods that use them. For example, I prefer this: def one   internal_method(1) end … Continue reading

Posted in Ruby | Comments Off on Private methods in Ruby

Downgrading the ElasticSearch version in SemaphoreCI

In our current project, we are using Elasticsearch for rapid search (it is the best search engine I’ve used to date), and are using Semaphore CI for continuous integration (Semaphore is new to me, but so far it looks very good). … Continue reading

Posted in Ruby | Tagged , | Comments Off on Downgrading the ElasticSearch version in SemaphoreCI

The How, When and Why of Ruby

One common question asked when people start using Ruby, is which books should I read. For me there are three essential Ruby books. However, I don’t think anyone should just read all three at once, and certainly not if they … Continue reading

Posted in Ruby | 2 Comments

In praise of the super user: The problem with the admin/user paradigm

I am coming to the end of my longest ruby contract so far – building web applications for Warwickshire County Council. It’s been a wonderfully productive couple of years, and I’ve gained a lot from working with the team at … Continue reading

Posted in Blog, Ruby | Comments Off on In praise of the super user: The problem with the admin/user paradigm

The £1.01 coin

The Monster Raving Loony Party in the Kenilworth area have released their Manickfesto described here: This is the “Manickfesto” that came through the post from our local Monster Raving Loony Party MP. Excellent, lol. pic.twitter.com/Y1EErxCPtt — Snozzeltoff (@Snozzeltoff) April 23, … Continue reading

Posted in Brilliant Ideas | 1 Comment

Using Jasmine with Rails 4.1

I had a few problem getting fixtures to work within a Jasmine environment. I was getting the error “ReferenceError: loadFixtures is not defined” The fixture was an html pages at spec/javascripts/fixtures/form.html, and this was my initial test code: describe("Rollback prompt", … Continue reading

Posted in JavaScript, Ruby | Comments Off on Using Jasmine with Rails 4.1

The lows and highs of SAML

I’ve been working on a number of OAUTH based authentication systems recently as part of the work I’m doing for Warwickshire County Council on the Alpha Identify project. This has led me to also look at SAML. I’ve been building … Continue reading

Posted in Ruby | Tagged , , , | Comments Off on The lows and highs of SAML

Using Exceptions to help separate functionality

I have recently had to split a class into two and found raising exceptions via a new error class was key to the success of this process. I’ve been working on Geminabox. The goal was to add the facility for … Continue reading

Posted in Ruby | Comments Off on Using Exceptions to help separate functionality

Intercepting Ruby exceptions

The way some Ruby applications catch exceptions makes it more difficult to debug the underlying issue. That is because a common pattern for handling an exception is this: begin   do_something_that_fails rescue SomeError   raise MyAppError.new "Something went wrong" end … Continue reading

Posted in Ruby | Tagged | Comments Off on Intercepting Ruby exceptions