Files
gollum/lib/gollum.rb
T
Benjamin Willems f3e17bb6a6 Configure I18n
- Locale files will be kept in `lib/gollum/locales/[lang].yml`
- The available locales, to start, will be English (`en`).
2021-06-26 13:37:11 -07:00

40 lines
818 B
Ruby

# ~*~ encoding: utf-8 ~*~
# stdlib
require 'digest/md5'
require 'digest/sha1'
require 'ostruct'
# external
require 'i18n'
require 'github/markup'
require 'rhino' if RUBY_PLATFORM == 'java'
# internal
require File.expand_path('../gollum/uri_encode_component', __FILE__)
module Gollum
VERSION = '5.2.3'
::I18n.available_locales = [:en]
::I18n.load_path = Dir[File.expand_path("lib/gollum/locales") + "/*.yml"]
def self.assets_path
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
end
class TemplateFilter
@@filters = {}
def self.add_filter(pattern, &replacement)
@@filters[pattern] = replacement
end
def self.apply_filters(data)
@@filters.each do |pattern, replacement|
data.gsub!(pattern, replacement.call)
end
data
end
end
end