Sha256: 1fc0078b078c9fb5a4f64b3540be6ffaaa9d7d27e0883f67cf901c5f11fe4b6d

Contents?: true

Size: 799 Bytes

Versions: 66

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

require "rake/testtask"

task default: %i[test rubocop]

Rake::TestTask.new do |t|
  t.pattern = "./test/**/*_test.rb"
end

if RUBY_VERSION >= "2.7.0"
  require "rubocop/rake_task"
  RuboCop::RakeTask.new
end

desc "Update bundled certs"
task :update_certs do
  require "net/http"
  require "uri"

  fetch_file "https://curl.haxx.se/ca/cacert.pem",
             File.expand_path("lib/data/ca-certificates.crt", __dir__)
end

#
# helpers
#

def fetch_file(uri, dest)
  File.open(dest, "w") do |file|
    resp = Net::HTTP.get_response(URI.parse(uri))
    unless resp.code.to_i == 200
      abort("bad response when fetching: #{uri}\n" \
            "Status #{resp.code}: #{resp.body}")
    end
    file.write(resp.body)
    puts "Successfully fetched: #{uri}"
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
stripe-13.3.0.pre.beta.1 Rakefile
stripe-13.2.0 Rakefile
stripe-13.1.2 Rakefile
stripe-13.2.0.pre.beta.3 Rakefile
stripe-13.2.0.pre.beta.2 Rakefile
stripe-13.1.1 Rakefile
stripe-13.2.0.pre.beta.1 Rakefile
stripe-13.1.0 Rakefile
stripe-13.0.2 Rakefile
stripe-13.1.0.pre.beta.3 Rakefile
stripe-13.0.1 Rakefile
stripe-13.1.0.pre.beta.2 Rakefile
stripe-13.0.0 Rakefile
stripe-12.7.0.pre.beta.2 Rakefile
stripe-12.7.0.pre.beta.1 Rakefile
stripe-12.6.0 Rakefile
stripe-12.6.0.pre.beta.1 Rakefile
stripe-12.5.0 Rakefile
stripe-12.5.0.pre.beta.2 Rakefile
stripe-12.5.0.pre.beta.1 Rakefile