Class: Entityjs::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/entityjs/page.rb

Class Method Summary collapse

Class Method Details

.processor_extObject



6
7
8
# File 'lib/entityjs/page.rb', line 6

def self.processor_ext
  return '.js'
end

.render_entityjs_src(path) ⇒ Object



24
25
26
27
28
# File 'lib/entityjs/page.rb', line 24

def self.render_entityjs_src(path)
  path = Entityjs::root+'/src/'+path
  
  return IO.read(path)
end

.render_eunit(path) ⇒ Object



41
42
43
# File 'lib/entityjs/page.rb', line 41

def self.render_eunit(path)
  IO.read(Entityjs::root+"/public/qunit/#{path}")
end

.render_faviconObject



14
15
16
17
18
# File 'lib/entityjs/page.rb', line 14

def self.render_favicon
  path = Entityjs::public_path+'/favicon.ico'
  
  return IO.read(path)
end

.render_play_page(ops = {}) ⇒ Object



10
11
12
# File 'lib/entityjs/page.rb', line 10

def self.render_play_page(ops={})
  self.set_vars("play.html", ops)
end

.render_script(path) ⇒ Object



36
37
38
39
# File 'lib/entityjs/page.rb', line 36

def self.render_script(path)
  file = path.sub(/#{self.processor_ext}$/i, '')
  return Config.preprocess(Compile.script_to_js(file))
end

.render_test(path) ⇒ Object



30
31
32
33
34
# File 'lib/entityjs/page.rb', line 30

def self.render_test(path)
  file = path.sub(/#{self.processor_ext}$/i, '')
  
  return Config.preprocess(Compile.test_to_js(file))
end

.render_test_pageObject



20
21
22
# File 'lib/entityjs/page.rb', line 20

def self.render_test_page
  self.set_vars('test.html', :tests=>true)
end