lib/nanoc/extra/auto_compiler.rb in nanoc-3.7.4 vs lib/nanoc/extra/auto_compiler.rb in nanoc-3.7.5
- old
+ new
@@ -1,13 +1,11 @@
# encoding: utf-8
module Nanoc::Extra
-
# A web server that will automatically compile items as they are requested.
# It also serves static files such as stylesheets and images.
class AutoCompiler
-
# @return [Nanoc::Site] The site this autocompiler belongs to
attr_reader :site
# Creates a new autocompiler for the given site.
#
@@ -36,14 +34,14 @@
# Start with a new site
build_site
# Find rep
path = Rack::Utils.unescape(env['PATH_INFO'])
- reps = site.items.map { |i| i.reps }.flatten
+ reps = site.items.map(&:reps).flatten
rep = reps.find do |r|
r.path == path ||
- r.raw_path == site.config[:output_dir] + path
+ r.raw_path == site.config[:output_dir] + path
end
# Recompile
site.compile if rep
@@ -95,9 +93,7 @@
end
def stack
site.compiler.stack
end
-
end
-
end