Sha256: e3bbbdd474e81ca8ecafd21326160b3bf3553e37cc133f04342b2a3a54f7a3a6

Contents?: true

Size: 366 Bytes

Versions: 7

Compression:

Stored size: 366 Bytes

Contents

module Locomotive::Steam
  module Middlewares

    class Robots < Struct.new(:app, :options)

      include Helpers

      def call(env)
        if env['PATH_INFO'] == '/robots.txt'
          site = env['steam.site']
          render_response(site[:robots_txt] || '', 200, 'text/plain')
        else
          app.call(env)
        end
      end

    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
locomotivecms_steam-1.0.0.pre.beta.3 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.beta.2 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.beta.1 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.alpha.3 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.alpha.2 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.alpha.1 lib/locomotive/steam/middlewares/robots.rb
locomotivecms_steam-1.0.0.pre.alpha lib/locomotive/steam/middlewares/robots.rb