Class: BetterRobots::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/better_robots.rb

Constant Summary collapse

DEFAULT_DISALLOW_TEXT =
"User-agent: *\nDisallow: /"
ROBOTS_CACHE =
{}

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object



17
18
19
20
# File 'lib/better_robots.rb', line 17

def call(env)
  res = cached_robots_txt_for(env['SERVER_NAME'])
  [ 200, headers_for(res), [ res.txt ] ]
end

.configObject



11
12
13
14
15
# File 'lib/better_robots.rb', line 11

def config
  @config ||= {
    :robots_txt_path => ((Rails.root.join("public") if defined? Rails) || ".")
  }
end