Skip to content

Commit

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

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

Please sign in to comment.