Class: AssetManager

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/mcms_authentication/templates/asset_manager.rb

Overview

@File Name :asset_manager.rb

@Company Name :Mindfire Solutions Pvt. Ltd.

@Creator Name :Indranil Mukherjee

@Date Created :2012-06-04

@Date Modified                        :2012-06-15

@Last Modification Details            :Making it as mcms project standard

@Purpose                              :Dynamically include assets

Class Method Summary collapse

Class Method Details

.get_cssObject

get_css method return css_includes array gloabal varibale



71
72
73
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 71

def self.get_css
  return @@css_includes
end

.get_librariesObject

get_libraries method return all javscripts included array



64
65
66
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 64

def self.get_libraries
  return @@js_includes
end

.include_contrib_library(library) ⇒ Object

include_contrib_library includes the javascripts in contrib folder those are the mandatory libraries



37
38
39
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 37

def self.include_contrib_library library
  include_js_library library, :contrib
end

.include_css(file) ⇒ Object

include_css checking the file type if array then loop to include neither simple includes



25
26
27
28
29
30
31
32
33
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 25

def self.include_css file
  if file.class == Array
    file.each do |f|
      include_css_file_individual f
    end
  else
    include_css_file_individual file
  end
end

.include_js_library(library, type = :local) ⇒ Object

include_js_library method includes the javascripts those are localy added



50
51
52
53
54
55
56
57
58
59
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 50

def self.include_js_library library, type = :local
  Rails.logger.debug library.inspect
  if library.class == Array
    library.each do |l|
      include_js_library_individual l, type
    end
  else
    include_js_library_individual library, type
  end
end

.include_local_library(library) ⇒ Object

include_local_library method includes the javascripts those are localy added



44
45
46
# File 'lib/generators/mcms_authentication/templates/asset_manager.rb', line 44

def self.include_local_library library
  include_js_library library, :local
end