Sha256: fa845e6b15a8bbb8872633e074a2796191306e683b8c5efdea697f20f21783a1

Contents?: true

Size: 500 Bytes

Versions: 12

Compression:

Stored size: 500 Bytes

Contents

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)
      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

12 entries across 12 versions & 5 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
simplecov-0.15.1 lib/simplecov/last_run.rb
simplecov-0.15.0 lib/simplecov/last_run.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/lib/simplecov/last_run.rb
simplecov-patched-0.14.3 lib/simplecov/last_run.rb
simplecov-patched-0.14.2 lib/simplecov/last_run.rb
simplecov-0.14.1 lib/simplecov/last_run.rb
simplecov-0.14.0 lib/simplecov/last_run.rb