Module: Zfben_libjs

Defined in:
lib/zfben_libjs.rb,
lib/zfben_libjs/source.rb,
lib/zfben_libjs/railtie.rb

Defined Under Namespace

Modules: Helpers Classes: Coffee, Collection, Compile, Css, Js, Libjs, Railtie, Rb, Sass, Scss, Source

Class Method Summary collapse

Class Method Details

.get_source(filepath, *options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/zfben_libjs/source.rb', line 3

def self.get_source filepath, *options
  type = File.extname(filepath).delete('.').capitalize

  if Zfben_libjs.const_defined?(type, false)
    source_class = Zfben_libjs.const_get(type)
  else
    raise Exception.new(type + ' isn\'t exists!')
  end

  return source_class.new :filepath => filepath, :options => options[0]
end