Category Archives: Ruby

Comments and notes about developing using Ruby

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

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

Functional tests with Carrierwave

Carrierwave is a really nice gem to use when you want to upload and save a file within a ruby object. But how do you test it, if you don’t use anything more that test/unit or minitest? Most of the … Continue reading

Posted in Ruby | Comments Off on Functional tests with Carrierwave

Adding a console shell to your ruby apps

Using Rails Engines is a really nice way to introduce yourself to creating gems. It provides an environment to create and test code that is very similar to that used when creating a full rails app. There are couple of … Continue reading

Posted in Ruby | Comments Off on Adding a console shell to your ruby apps