lib/middleman-robots/extension.rb in middleman-robots-1.3.1 vs lib/middleman-robots/extension.rb in middleman-robots-1.3.2

- old
+ new

@@ -7,18 +7,19 @@ class Extension < ::Middleman::Extension option :rules, [], 'List of rules about sitemap.xml' option :sitemap, false, 'URI of sitemap.xml' def manipulate_resource_list(resources) - tf = Tempfile.open('middleman-robots') - tf.puts(Generator.new(options.rules, options.sitemap).process) + tmp_path = File.expand_path('../../../tmp/robots/robots.txt', __FILE__) + File.open(tmp_path, 'w+') do |f| + f.puts(Generator.new(options.rules, options.sitemap).process) + end robots = Middleman::Sitemap::Resource.new( app.sitemap, 'robots.txt', - tf.path + tmp_path ) - tf.close logger.info '== middleman-robots: robots.txt added to resources ==' resources << robots end end