Class: Cylon::Rack
- Inherits:
-
Object
- Object
- Cylon::Rack
- Defined in:
- lib/cylon/rack.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app) ⇒ Rack
Returns a new instance of Rack.
4 5 6 |
# File 'lib/cylon/rack.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/cylon/rack.rb', line 8 def call(env) if env["PATH_INFO"] == "/robots.txt" && ENV['RACK_ENV'] != "production" [200, {"Content-Type" => "text/plain"}, ["User-Agent: *\nDisallow: /"]] else @app.call(env) end end |