Sha256: 5c17dde1dd8dfdfac53b7783a8284fc33a91e416941850ac3e58c67ddf309d39
Contents?: true
Size: 1.28 KB
Versions: 2
Compression:
Stored size: 1.28 KB
Contents
# -*- encoding : utf-8 -*- require 'ext/all' require 'rainbow' module Phrase autoload :Config, 'phrase/config' CLIENT_VERSION = "0.1" API_VERSION = "v1" class << self def config Thread.current[:phrase_config] ||= Phrase::Config.new end def config=(value) Thread.current[:phrase_config] = value end %w(enabled backend prefix suffix auth_token client_version js_host js_use_ssl cache_key_segments_initial cache_lifetime ignored_keys).each do |method| module_eval <<-DELEGATORS, __FILE__, __LINE__ + 1 def #{method} config.#{method} end DELEGATORS module_eval <<-DELEGATORS, __FILE__, __LINE__ + 1 def #{method}=(value) config.#{method} = (value) end DELEGATORS end def enabled? enabled end def disabled? !enabled end end def self.configure yield(self.config) end autoload :ViewHelpers, 'phrase/view_helpers' require 'phrase/api' require 'phrase/formats' require 'phrase/version' require 'phrase/engine' require 'phrase/backend' require 'phrase/delegate' end # Only load adapters directly if non-rails app, otherwise use engine unless defined? Rails require 'phrase/adapters/i18n' require 'phrase/adapters/fast_gettext' end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
phrase-0.4.33 | lib/phrase.rb |
phrase-0.4.32 | lib/phrase.rb |