Properly avert NameError when requiring gem in non-rails environments

When attempting to use this gem in a sinatra project, due to the fact that ActionController is not defined `require 'truncate_html'` raises a `NameError`. This change fixes it by only attempting to send ActionController::Base a helper message if ActionController is defined.