Class: UatDirector::RackApp
- Inherits:
-
Object
- Object
- UatDirector::RackApp
- Defined in:
- lib/uat_director/rack_app.rb
Constant Summary collapse
- PT =
PivotalTracker
Instance Method Summary collapse
- #call(env) ⇒ Object
- #config ⇒ Object
- #haml(file_name, options = {}) ⇒ Object
- #index ⇒ Object
-
#initialize(app) ⇒ RackApp
constructor
A new instance of RackApp.
- #template_root ⇒ Object
Constructor Details
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/uat_director/rack_app.rb', line 14 def call(env) if env["PATH_INFO"] =~ /^\/uat_director/ index else @app.call(env) end end |
#config ⇒ Object
37 38 39 |
# File 'lib/uat_director/rack_app.rb', line 37 def config UatDirector.configuration end |
#haml(file_name, options = {}) ⇒ Object
28 29 30 31 |
# File 'lib/uat_director/rack_app.rb', line 28 def haml(file_name, ={}) template = (template_root + "#{file_name}.haml").read [200, {"Content-Type" => "text/html"}, [Haml::Engine.new(template).render(self)]] end |
#index ⇒ Object
22 23 24 25 26 |
# File 'lib/uat_director/rack_app.rb', line 22 def index @project = PT::Project.find(config.pivotal_tracker_project) @stories = @project.stories.all(:current_state => "delivered") haml "index" end |
#template_root ⇒ Object
33 34 35 |
# File 'lib/uat_director/rack_app.rb', line 33 def template_root Pathname.new(__FILE__).parent + "templates" end |