Sha256: d54d7016707c27b3be69212a8a7e82a7fe7f44db3580888a28ddd94c1dea17fd
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 KB
Contents
module Qbrick class ImageSizeDelegator def method_missing(method, *args, &block) Qbrick::ImageSize.send(method, *args, &block) rescue NoMethodError super end end class Engine < ::Rails::Engine isolate_namespace Qbrick config.i18n.fallbacks = [:de] config.i18n.load_path += Dir[Qbrick::Engine.root.join('config/locales/**/*.{yml}').to_s] # defaults to nil config.sublime_video_token = nil # delegate image size config to ImageSize class config.image_sizes = ImageSizeDelegator.new initializer 'qbrick.initialize_haml_dependency_tracker' do require 'action_view/dependency_tracker' ActionView::DependencyTracker.register_tracker :haml, ActionView::DependencyTracker::ERBTracker end def app_config Rails.application.config end def hosts [Socket.gethostname, 'localhost'].tap do |result| result.concat [app_config.hosts].flatten if app_config.respond_to? :hosts result.concat [app_config.host].flatten if app_config.respond_to? :host result.compact! result.uniq! end end def host return hosts.first unless app_config.respond_to? :host app_config.host end def scheme return 'http' unless app_config.respond_to? :scheme app_config.scheme end def port return 80 unless app_config.respond_to? :port app_config.port end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
qbrick-2.7.1 | lib/qbrick/engine.rb |
qbrick-2.7 | lib/qbrick/engine.rb |
qbrick-2.6.10 | lib/qbrick/engine.rb |