Module: Coverage::Autostart

Defined in:
lib/covered/autostart.rb

Class Method Summary collapse

Class Method Details

.autostart!Object

Start recording coverage information. Usage: RUBYOPT=-rcovered/autostart ruby my_script.rb



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/covered/autostart.rb', line 12

def self.autostart!
	config = Covered::Config.load
	config.start
	
	pid = Process.pid
	
	at_exit do
		# Don't break forked children:
		if Process.pid == pid
			config.finish
			
			if config.report?
				config.call($stderr)
			end
		end
	end
end