Sha256: 9f90777f1ad724e89e9694aabad22a706ce3099646eecf9e6bbb4b3df7470145

Contents?: true

Size: 560 Bytes

Versions: 54

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true

####
# This exists in CRuby, but not in JRuby, so add it
#
# Taken from: https://github.com/ruby/ruby/blob/c5eb24349a4535948514fe765c3ddb0628d81004/ext/coverage/lib/coverage.rb
####
module Coverage
  def self.line_stub(file)
    lines = File.foreach(file).map { nil }
    iseqs = [RubyVM::InstructionSequence.compile_file(file)]
    until iseqs.empty?
      iseq = iseqs.pop
      iseq.trace_points.each { |n, type| lines[n - 1] = 0 if type == :line }
      iseq.each_child { |child| iseqs << child }
    end
    lines
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
coverband-6.1.4 lib/coverband/utils/jruby_ext.rb
coverband-6.1.3 lib/coverband/utils/jruby_ext.rb
coverband-6.1.2 lib/coverband/utils/jruby_ext.rb
coverband-6.1.2.rc.1 lib/coverband/utils/jruby_ext.rb
coverband-6.1.1 lib/coverband/utils/jruby_ext.rb
coverband-6.1.0 lib/coverband/utils/jruby_ext.rb
coverband-6.0.3.rc.4 lib/coverband/utils/jruby_ext.rb
coverband-6.0.3.rc.3 lib/coverband/utils/jruby_ext.rb
coverband-6.0.3.rc.2 lib/coverband/utils/jruby_ext.rb
coverband-6.0.3.rc.1 lib/coverband/utils/jruby_ext.rb
coverband-6.0.2 lib/coverband/utils/jruby_ext.rb
coverband-6.0.1 lib/coverband/utils/jruby_ext.rb
coverband-6.0.1.rc.1 lib/coverband/utils/jruby_ext.rb
coverband-6.0.0 lib/coverband/utils/jruby_ext.rb
coverband-5.2.6.rc.6 lib/coverband/utils/jruby_ext.rb
coverband-5.2.3.2 lib/coverband/utils/jruby_ext.rb
coverband-5.2.6.rc.5 lib/coverband/utils/jruby_ext.rb
coverband-5.2.3.1 lib/coverband/utils/jruby_ext.rb
coverband-5.2.6.rc.4 lib/coverband/utils/jruby_ext.rb
coverband-5.2.6.rc.3 lib/coverband/utils/jruby_ext.rb