Use ::File instead of File

This commit is contained in:
Olivier Bellone 2018-08-27 15:32:10 +02:00
parent 2b2c2c3cd6
commit 21db64fe0e
No known key found for this signature in database
GPG Key ID: 11E77E3AA0C40303
69 changed files with 75 additions and 75 deletions

View File

@ -16,7 +16,7 @@ task :update_certs do
require "faraday"
fetch_file "https://curl.haxx.se/ca/cacert.pem",
File.expand_path("../lib/data/ca-certificates.crt", __FILE__)
::File.expand_path("../lib/data/ca-certificates.crt", __FILE__)
end
#
@ -24,7 +24,7 @@ end
#
def fetch_file(url, dest)
File.open(dest, "w") do |file|
::File.open(dest, "w") do |file|
resp = Faraday.get(url)
unless resp.status == 200
abort("bad response when fetching: #{url}\n" \

View File

@ -5,7 +5,7 @@
require "irb"
require "irb/completion"
require "#{File.dirname(__FILE__)}/../lib/stripe"
require "#{::File.dirname(__FILE__)}/../lib/stripe"
# Config IRB to enable --simple-prompt and auto indent
IRB.conf[:PROMPT_MODE] = :SIMPLE

View File

@ -94,7 +94,7 @@ require "stripe/usage_record"
require "stripe/oauth"
module Stripe
DEFAULT_CA_BUNDLE_PATH = File.dirname(__FILE__) + "/data/ca-certificates.crt"
DEFAULT_CA_BUNDLE_PATH = ::File.dirname(__FILE__) + "/data/ca-certificates.crt"
@app_info = nil

View File

@ -544,8 +544,8 @@ module Stripe
# integrations.
class SystemProfiler
def self.uname
if File.exist?("/proc/version")
File.read("/proc/version").strip
if ::File.exist?("/proc/version")
::File.read("/proc/version").strip
else
case RbConfig::CONFIG["host_os"]
when /linux|darwin|bsd|sunos|solaris|cygwin/i

View File

@ -154,7 +154,7 @@ module Stripe
# report incorrect results on some more oddball filesystems
# (such as AFS)
File.open(file) { |f| }
::File.open(file) { |f| }
rescue StandardError
false
else

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
$LOAD_PATH.unshift(::File.join(::File.dirname(__FILE__), "lib"))
require "stripe/version"
@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- test/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| ::File.basename(f) }
s.require_paths = ["lib"]
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class AccountExternalAccountsOperationsTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class AccountLoginLinksOperationsTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class AccountTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class AlipayAccountTest < Test::Unit::TestCase

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApiOperationsTest < Test::Unit::TestCase

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApiResourceTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApplePayDomainTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApplicationFeeRefundTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApplicationFeeRefundsOperationsTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ApplicationFeeTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class BalanceTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class BankAccountTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ChargeTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class CountrySpecTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class CouponTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class CustomerCardTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class CustomerSourcesOperationsTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class CustomerTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class DisputeTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class EphemeralKeyTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class StripeErrorTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ExchangeRateTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class FileLinkTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class FileUploadTest < Test::Unit::TestCase
@ -18,7 +18,7 @@ module Stripe
should "be creatable with a File" do
file = Stripe::FileUpload.create(
purpose: "dispute_evidence",
file: File.new(__FILE__)
file: ::File.new(__FILE__)
)
assert file.is_a?(Stripe::FileUpload)
end
@ -38,7 +38,7 @@ module Stripe
should "be creatable with Faraday::UploadIO" do
file = Stripe::FileUpload.create(
purpose: "dispute_evidence",
file: Faraday::UploadIO.new(File.new(__FILE__), nil)
file: Faraday::UploadIO.new(::File.new(__FILE__), nil)
)
assert file.is_a?(Stripe::FileUpload)
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class InvoiceItemTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class InvoiceLineItemTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class InvoiceTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class IssuerFraudRecordTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ListObjectTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class LoginLinkTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class OAuthTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class OrderReturnTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class OrderTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
TEST_RESOURCE_ID = "pi_123".freeze

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class PayoutTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class PlanTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ProductTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class RecipientTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class RefundTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ReversalTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../../test_helper", __FILE__)
require ::File.expand_path("../../../test_helper", __FILE__)
module Stripe
module Issuing

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class SKUTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class SourceTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class SourceTransactionTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class StripeClientTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class StripeObjectTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class StripeResponseTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class SubscriptionItemTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class SubscriptionTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class ThreeDSecureTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class TopupTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class TransferReversalsOperationsTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class TransferTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class UsageRecordTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class UtilTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../../test_helper", __FILE__)
require ::File.expand_path("../../test_helper", __FILE__)
module Stripe
class WebhookTest < Test::Unit::TestCase

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../test_helper", __FILE__)
require ::File.expand_path("../test_helper", __FILE__)
class StripeTest < Test::Unit::TestCase
should "warn that #refresh_from is deprecated" do

View File

@ -11,9 +11,9 @@ require "shoulda/context"
require "timecop"
require "webmock/test_unit"
PROJECT_ROOT = File.expand_path("../../", __FILE__)
PROJECT_ROOT = ::File.expand_path("../../", __FILE__)
require File.expand_path("../test_data", __FILE__)
require ::File.expand_path("../test_data", __FILE__)
# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.25.0".freeze