Class: Rubinius::Coverage

Inherits:
Object
  • Object
show all
Defined in:
lib/rubinius/coverage.rb,
lib/rubinius/coverage/version.rb

Constant Summary collapse

VERSION =
"2.0.3"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCoverage

Returns a new instance of Coverage.



24
25
26
# File 'lib/rubinius/coverage.rb', line 24

def initialize
  self.class.load
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



22
23
24
# File 'lib/rubinius/coverage.rb', line 22

def results
  @results
end

Class Method Details

.loadObject



13
14
15
16
17
18
19
20
# File 'lib/rubinius/coverage.rb', line 13

def self.load
  return if loaded?

  Rubinius::Tooling.load File.expand_path('../coverage/coverage', __FILE__)
  loaded true

  self
end

.loaded(flag) ⇒ Object



5
6
7
# File 'lib/rubinius/coverage.rb', line 5

def self.loaded(flag)
  @loaded = flag
end

.loaded?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rubinius/coverage.rb', line 9

def self.loaded?
  @loaded == true
end

Instance Method Details

#startObject



28
29
30
31
32
# File 'lib/rubinius/coverage.rb', line 28

def start
  Rubinius::Tooling.enable

  self
end

#stopObject



34
35
36
37
38
# File 'lib/rubinius/coverage.rb', line 34

def stop
  @results = Rubinius::Tooling.disable

  self
end