Skip to content

Commit

Permalink
Only recompile outdated reps
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jul 2, 2016
1 parent 1ff6310 commit 2bc362e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 2 additions & 1 deletion lib/nanoc/base/compilation/compiler.rb
Expand Up @@ -191,7 +191,8 @@ def compile_reps
end

# Find item reps to compile and compile them
selector = Nanoc::Int::ItemRepSelector.new(@reps)
outdated_reps = @reps.select { |r| outdatedness_checker.outdated?(r) }
selector = Nanoc::Int::ItemRepSelector.new(outdated_reps)
selector.each do |rep|
@stack = []
compile_rep(rep)
Expand Down
15 changes: 0 additions & 15 deletions test/base/test_compiler.rb
Expand Up @@ -208,21 +208,6 @@ def test_disallow_duplicate_routes
end
end

def test_compile_should_recompile_all_reps
Nanoc::CLI.run %w(create_site bar)

FileUtils.cd('bar') do
Nanoc::CLI.run %w(compile)

site = Nanoc::Int::SiteLoader.new.new_from_cwd
site.compile

# At this point, even the already compiled items in the previous pass
# should have their compiled content assigned, so this should work:
site.compiler.reps[site.items['/index.*']][0].compiled_content
end
end

def test_disallow_multiple_snapshots_with_the_same_name
# Create site
Nanoc::CLI.run %w(create_site bar)
Expand Down

0 comments on commit 2bc362e

Please sign in to comment.