lib/verdict.rb in verdict-0.6.1 vs lib/verdict.rb in verdict-0.6.2
- old
+ new
@@ -9,19 +9,20 @@
def [](handle)
Verdict.repository[handle.to_s]
end
def repository
- if @repository.nil?
- @repository = {}
- discovery
- end
-
+ discovery if @repository.nil?
@repository
end
def discovery
- Dir[File.join(Verdict.directory, '**', '*.rb')].each { |f| require f } if @directory
+ @repository = {}
+ Dir[File.join(Verdict.directory, '**', '*.rb')].each { |f| load f } if @directory
+ end
+
+ def clear_repository_cache
+ @repository = nil
end
class Error < StandardError; end
class SegmentationError < Verdict::Error; end
class InvalidSubject < Verdict::Error; end