Generally, I think, put them in Gemfile
and just require it if/where needed. My config.rb
file has:
before_build do |builder|
require 'uglifier'
print "Before_build actions... "
print "minifying lazy-retina.js... "
File.open("source/js/_lazy-retina.min.js", "w") do |file|
file.write Uglifier.compile(File.read("source/js/_lazy-retina.js"), :mangle => false, :comments => /Lazy Retina/)
end
puts "done."
end
Uglifier is part of MM install, but it’s not automatically required in config-file, that’s why I manually do it. I also use, for example, this gem in my Gemfile
:
gem 'sort_alphabetical' # https://github.com/grosser/sort_alphabetical
and just use it in template code, without requiring:
<% blog.articles.group_by {|a| a.data.category }.sort_alphabetical.each do |category, articles| %>
That is a general advice regarding gems, not gettext
specifically.