Sha256: 6a8580383a1b27aca18556facf61e1f3cdf2375aac482b29dfa77e29643624df

Contents?: true

Size: 989 Bytes

Versions: 15

Compression:

Stored size: 989 Bytes

Contents

require 'rake/testtask'

task :default => [:test]

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

desc "Update bundled certs"
task :update_certs do
  require "faraday"

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

desc "Update OpenAPI specification"
task :update_openapi do
  require "faraday"

  ["fixtures.json", "fixtures.yaml", "spec2.json", "spec2.yaml"].map { |file|
    Thread.new do
      fetch_file "https://raw.githubusercontent.com/stripe/openapi/master/openapi/#{file}",
        File.expand_path("../openapi/#{file}", __FILE__)
    end
  }.map { |t| t.join }
end

#
# helpers
#

def fetch_file(url, dest)
  File.open(dest, 'w') do |file|
    resp = Faraday.get(url)
    unless resp.status == 200
      abort("bad response when fetching: #{url}\n" \
        "Status #{resp.status}: #{resp.body}")
    end
    file.write(resp.body)
    puts "Successfully fetched: #{url}"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
stripe-3.0.3 Rakefile
stripe-3.0.1 Rakefile
stripe-3.0.0 Rakefile
stripe-2.12.0 Rakefile
stripe-2.11.0 Rakefile
stripe-2.10.0 Rakefile
stripe-2.9.0 Rakefile
stripe-2.8.0 Rakefile
stripe-2.7.0 Rakefile
stripe-2.6.0 Rakefile
stripe-2.5.0 Rakefile
stripe-2.4.0 Rakefile
stripe-2.3.0 Rakefile
stripe-2.2.1 Rakefile
stripe-2.2.0 Rakefile