Jldrill Git C0 Coverage Information - RCov

lib/jldrill/contexts/LoadReferenceContext.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/jldrill/contexts/LoadReferenceContext.rb 67 52
100.00%
100.00%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 require 'Context/Context'
2 require 'Context/Bridge'
3 require 'jldrill/model/Config'
4 require 'jldrill/contexts/LoadFileContext'
5 
6 module JLDrill
7 
8     # Load the reference dictionary
9 	class LoadReferenceContext < Context::Context
10 		
11 		def initialize(viewBridge)
12 			super(viewBridge)
13             @loadFileContext = LoadFileContext.new(@viewBridge)
14 		end
15 
16         def createViews
17             @mainView =  @viewBridge.VBoxView.new(self)
18         end
19 
20         def destroyViews
21             @mainView = nil
22         end
23 
24         def dictionaryName(options)
25             if !options.nil? && !options.dictionary.nil?
26                 return options.dictionary
27             else
28                 return Config::DICTIONARY_NAME
29             end
30         end
31 
32         # Returns the filename of the dictionary including the path
33         def getFilename(options)
34             return File.expand_path(dictionaryName(options), 
35                                     Config::DICTIONARY_DIR)
36         end
37 
38         def getDeinflectionFilename
39             return File.expand_path(Config::DEINFLECTION_NAME,
40                                     Config::DEINFLECTION_DIR)
41         end
42 
43         def loadDeinflection(deinflect, filename)
44             @loadFileContext.onExit do
45                 exitLoadReferenceContext
46             end
47             @loadFileContext.enter(self, deinflect, filename)
48         end
49 
50         def loadReference(reference, deinflect, filename)
51             @loadFileContext.onExit do
52                loadDeinflection(deinflect, getDeinflectionFilename) 
53             end
54             @loadFileContext.enter(self, reference, filename)
55         end
56 
57         def exitLoadReferenceContext
58             self.exit
59         end
60 
61         def enter(parent, reference, deinflect, options)
62             super(parent)
63             loadReference(reference, deinflect, getFilename(options))
64         end
65 
66     end
67 end

Generated on Mon May 23 16:17:45 +0900 2011 with rcov 0.9.8