Module: Jscov

Defined in:
lib/jscov.rb,
lib/jscov/bless.rb,
lib/jscov/version.rb,
lib/jscov/coverage.rb,
lib/jscov/collector.rb,
lib/jscov/configuration.rb,
lib/jscov/rack_middleware.rb

Defined Under Namespace

Classes: Bless, Collector, Configuration, Coverage, RackMiddleware

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.clean!Object



16
17
18
19
20
# File 'lib/jscov.rb', line 16

def clean!
  dir_path = configuration.coverage_report_dir_path
  FileUtils.rm_f(Dir.glob(dir_path.join("jscov_*.json")))
  FileUtils.mkdir_p(dir_path)
end

.configurationObject



8
9
10
# File 'lib/jscov.rb', line 8

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



12
13
14
# File 'lib/jscov.rb', line 12

def configure
  yield configuration
end

.save!(session: nil, logs: nil) ⇒ Object



22
23
24
25
# File 'lib/jscov.rb', line 22

def save!(session: nil, logs: nil)
  collector = Collector.new(session, logs)
  collector.coverages.each(&:save)
end