Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Don't die when sources are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 30, 2010
1 parent 9637652 commit 2e3cd1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/paste/cache.rb
Expand Up @@ -7,6 +7,8 @@ module Cache
def rebuild
find_sources

@sources.reject!{ |_, parser| !File.exists? parser.file }

@sources.values.each &:copy_if_needed
end

Expand Down
2 changes: 1 addition & 1 deletion lib/paste/parser/sprockets.rb
Expand Up @@ -4,7 +4,7 @@ module Paste
module Parser
class Sprockets

attr_reader :glue, :source
attr_reader :glue, :source, :file

def initialize glue, source
@glue = glue
Expand Down
8 changes: 8 additions & 0 deletions spec/paste/cache_spec.rb
Expand Up @@ -30,4 +30,12 @@
subject.should have_in_result('foo/baz', 'baz2()')
end

it "doesn't explode when one of the files is removed after a rebuild" do
subject.rebuild

Paste::Test.delete_source 'foo'

subject.rebuild
end

end

0 comments on commit 2e3cd1c

Please sign in to comment.