Class: Cup::Server::App

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/cup/server/app.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.gem_root_path(*params) ⇒ Object



30
31
32
33
# File 'lib/cup/server/app.rb', line 30

def self.gem_root_path *params
  # uses a file relative version so that it points to the live files during development
  File.expand_path(File.join('../../../..', *params), __FILE__)
end

Instance Method Details

#gem_root_path(*params) ⇒ Object



57
58
59
# File 'lib/cup/server/app.rb', line 57

def gem_root_path *params
  self.class.gem_root_path *params
end

#view(template, options = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/cup/server/app.rb', line 43

def view (template, options={})

  options = {
    :scope => view_scope(options.delete(:javascripts_scheme) || :debug),
    :layout => true
  }.merge options

  slim template, options
end

#view_scope(javascripts_scheme = :debug) ⇒ Object



39
40
41
# File 'lib/cup/server/app.rb', line 39

def view_scope(javascripts_scheme=:debug)
  @view_scope = ViewScope.new self, javascripts_scheme
end

#visualsObject



53
54
55
# File 'lib/cup/server/app.rb', line 53

def visuals
  @visuals ||= VisualSpecs.get
end