module MnoEnterprise::Frontend::AssetsUtil
Public Class Methods
assets_url()
click to toggle source
# File lib/mno_enterprise/frontend/assets_util.rb, line 6 def self.assets_url self.config["environments"][Rails.env]["assets"] end
config()
click to toggle source
# File lib/mno_enterprise/frontend/assets_util.rb, line 14 def self.config @@config ||= YAML.load_file(File.join(Rails.root, 'config', 'assets.yml')) @@config end
engine_root_path()
click to toggle source
Return the engine root path
# File lib/mno_enterprise/frontend/assets_util.rb, line 26 def self.engine_root_path MnoEnterprise::Frontend::Engine.root end
images()
click to toggle source
# File lib/mno_enterprise/frontend/assets_util.rb, line 30 def self.images [self.root_path, self.engine_root_path].map do |base_path| Dir.glob(base_path.join("app/assets/images/**/*.*")).map do |path| path.gsub(base_path.join("app/assets/images/").to_s, "") end end.flatten.uniq end
root_path()
click to toggle source
Return the application root path
# File lib/mno_enterprise/frontend/assets_util.rb, line 21 def self.root_path Rails.root end
server_host()
click to toggle source
# File lib/mno_enterprise/frontend/assets_util.rb, line 10 def self.server_host self.config["environments"][Rails.env]["host"] end
templates()
click to toggle source
# File lib/mno_enterprise/frontend/assets_util.rb, line 38 def self.templates [self.root_path, self.engine_root_path].map do |base_path| Dir.glob(base_path.join("app/assets/templates/**/*.*")).map do |path| path.gsub(base_path.join("app/assets/templates/").to_s, "") end end.flatten.uniq end