Sha256: 72333e7eb31ac74584d62fd12008424dd20f987733f813dca6faed75860e4225

Contents?: true

Size: 936 Bytes

Versions: 7

Compression:

Stored size: 936 Bytes

Contents

# frozen_string_literal: true

namespace :rspec_tracer do
  namespace :remote_cache do
    desc 'Download cache'
    task :download do
      unless system('git', 'rev-parse', 'HEAD', out: File::NULL, err: File::NULL)
        puts 'Not a git repository'

        exit
      end

      require 'rspec_tracer'

      RSpecTracer::RemoteCache::Cache.new.download
    end

    desc 'Upload cache'
    task :upload do
      unless system('git', 'rev-parse', 'HEAD', out: File::NULL, err: File::NULL)
        puts 'Not a git repository'

        exit
      end

      unless ENV.fetch('CI', 'false') == 'true' || ENV.fetch('RSPEC_TRACER_UPLOAD_LOCAL_CACHE', 'false') == 'true'
        puts 'Skipping upload from local development environment'
        puts 'Use RSPEC_TRACER_UPLOAD_LOCAL_CACHE=true to upload local cache'

        exit
      end

      require 'rspec_tracer'

      RSpecTracer::RemoteCache::Cache.new.upload
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec-tracer-1.0.0 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.9.3 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.9.2 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.9.1 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.9.0 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.8.0 lib/rspec_tracer/remote_cache/Rakefile
rspec-tracer-0.7.0 lib/rspec_tracer/remote_cache/Rakefile