Class: Cup::Server::App
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Cup::Server::App
- Defined in:
- lib/cup/server/app.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
- #gem_root_path(*params) ⇒ Object
- #view(template, options = {}) ⇒ Object
- #view_scope(javascripts_scheme = :debug) ⇒ Object
- #visuals ⇒ Object
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.(File.join('../../../..', *params), __FILE__) end |
Instance Method Details
#build ⇒ Object
39 40 41 |
# File 'lib/cup/server/app.rb', line 39 def build @build_result ||= Cup.build end |
#gem_root_path(*params) ⇒ Object
62 63 64 |
# File 'lib/cup/server/app.rb', line 62 def gem_root_path *params self.class.gem_root_path *params end |
#view(template, options = {}) ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cup/server/app.rb', line 47 def view (template, ={}) build = { :scope => view_scope(.delete(:javascripts_scheme) || :debug), :layout => true }.merge slim template, end |
#view_scope(javascripts_scheme = :debug) ⇒ Object
43 44 45 |
# File 'lib/cup/server/app.rb', line 43 def view_scope(javascripts_scheme=:debug) @view_scope = ViewScope.new self, @build_result, javascripts_scheme end |
#visuals ⇒ Object
58 59 60 |
# File 'lib/cup/server/app.rb', line 58 def visuals @visuals ||= VisualSpecs.get end |