Module: MnoEnterprise::Frontend::AssetsUtil
- Defined in:
- lib/mno_enterprise/frontend/assets_util.rb
Class Method Summary collapse
- .assets_url ⇒ Object
- .config ⇒ Object
-
.engine_root_path ⇒ Object
Return the engine root path.
- .images ⇒ Object
-
.root_path ⇒ Object
Return the application root path.
- .server_host ⇒ Object
- .templates ⇒ Object
Class Method Details
.assets_url ⇒ Object
6 7 8 |
# File 'lib/mno_enterprise/frontend/assets_util.rb', line 6 def self.assets_url self.config["environments"][Rails.env]["assets"] end |
.config ⇒ Object
14 15 16 17 18 |
# 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 ⇒ Object
Return the engine root path
26 27 28 |
# File 'lib/mno_enterprise/frontend/assets_util.rb', line 26 def self.engine_root_path MnoEnterprise::Frontend::Engine.root end |
.images ⇒ Object
30 31 32 33 34 35 36 |
# 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 ⇒ Object
Return the application root path
21 22 23 |
# File 'lib/mno_enterprise/frontend/assets_util.rb', line 21 def self.root_path Rails.root end |
.server_host ⇒ Object
10 11 12 |
# File 'lib/mno_enterprise/frontend/assets_util.rb', line 10 def self.server_host self.config["environments"][Rails.env]["host"] end |
.templates ⇒ Object
38 39 40 41 42 43 44 |
# 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 |