Sha256: d6aacc5097557404bfbd46a1999d2a8103f1489ad544ea3446dd7e975cd6232d
Contents?: true
Size: 1.86 KB
Versions: 2
Compression:
Stored size: 1.86 KB
Contents
require "express_admin/menu" require "express_admin/version" require "express_templates" require "jquery-rails" require "foundation_apps_styles" require "bourbon" require "gravatar_image_tag" require "kaminari" require "responders" require 'inherited_resources' # should be a way to add this folder to rails' autoload paths components = Dir.glob(File.join(File.dirname(__FILE__), '..', '..', 'app', 'components', '**', '*.rb')) components.each {|component| require component } module ExpressAdmin class Engine < ::Rails::Engine initializer :assets do |config| engine_assets_path = File.join(File.dirname(__FILE__), '..', '..', 'app', 'assets') all_assets = Dir.glob File.join(engine_assets_path, 'stylesheets', '**', '*.css*') all_assets += Dir.glob File.join(engine_assets_path, 'javascripts', '**', '*.js*') all_assets.each {|path| path.gsub!("#{engine_assets_path}/stylesheets/", '')} all_assets.each {|path| path.gsub!("#{engine_assets_path}/javascripts/", '')} all_assets.each {|path| path.gsub!("#{engine_assets_path}/fonts/", '')} all_assets.each {|path| path.gsub!(/.(scss|coffee)$/, '')} Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'fonts') Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/ Rails.application.config.assets.precompile << /\.(?:png)$/ Rails.application.config.assets.precompile += all_assets end def all_rails_engines Rails.application.eager_load! @all_engines ||= ::Rails::Engine.descendants end # Find all the rails engines that have # :addon_name presumably from including # ExpressAdmin::Menu::Loader def all_addons @all_addons ||= all_rails_engines.select do |engine| engine.methods.include?(:addon_name) end end end class Railtie < ::Rails::Railtie config.app_generators.template_engine :et end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
express_admin-1.2.1 | lib/express_admin/engine.rb |
express_admin-1.2.0 | lib/express_admin/engine.rb |