Sha256: 86442269411c4d687b1f6fb33e8f87a614422429899643e0da98b3dff87993fd

Contents?: true

Size: 556 Bytes

Versions: 23

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

require "json"

module SimpleCov
  module LastRun
    class << self
      def last_run_path
        File.join(SimpleCov.coverage_path, ".last_run.json")
      end

      def read
        return nil unless File.exist?(last_run_path)

        json = File.read(last_run_path)
        return nil if json.strip.empty?

        JSON.parse(json, symbolize_names: true)
      end

      def write(json)
        File.open(last_run_path, "w+") do |f|
          f.puts JSON.pretty_generate(json)
        end
      end
    end
  end
end

Version data entries

23 entries across 22 versions & 8 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/simplecov-0.22.0/lib/simplecov/last_run.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/simplecov-0.22.0/lib/simplecov/last_run.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov/last_run.rb
strongmind-simplecov-0.23.0 lib/simplecov/last_run.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov/last_run.rb
simplecov-0.22.0 lib/simplecov/last_run.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/simplecov-0.21.2/lib/simplecov/last_run.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/simplecov-0.21.2/lib/simplecov/last_run.rb
simplecov-0.21.2 lib/simplecov/last_run.rb
simplecov-0.21.1 lib/simplecov/last_run.rb
simplecov-0.21.0 lib/simplecov/last_run.rb
simplecov-0.20.0 lib/simplecov/last_run.rb
simplecov-0.19.1 lib/simplecov/last_run.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/simplecov-0.19.0/lib/simplecov/last_run.rb
simplecov-0.19.0 lib/simplecov/last_run.rb
simplecov-0.18.5 lib/simplecov/last_run.rb
simplecov-0.18.4 lib/simplecov/last_run.rb
simplecov-0.18.3 lib/simplecov/last_run.rb
simplecov-0.18.2 lib/simplecov/last_run.rb
simplecov-0.18.1 lib/simplecov/last_run.rb