mirror of
https://github.com/lostisland/faraday.git
synced 2025-12-15 00:03:17 -05:00
chore: RuboCop lint Style/Globalvars (#943)
This commit is contained in:
parent
c8c9a0217c
commit
6ff61c0ecc
@ -48,12 +48,6 @@ Style/Documentation:
|
||||
- 'lib/faraday/response/raise_error.rb'
|
||||
- 'lib/faraday/utils.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: AllowedVariables.
|
||||
Style/GlobalVars:
|
||||
Exclude:
|
||||
- 'script/generate_certs'
|
||||
|
||||
# Offense count: 1
|
||||
Style/MultipleComparison:
|
||||
Exclude:
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Usage: generate_certs
|
||||
# Usage: generate_certs [options]
|
||||
# options:
|
||||
# -s Display shell exports that link env variables to filenames
|
||||
# Generate test certs for testing Faraday with SSL
|
||||
|
||||
require 'openssl'
|
||||
require 'fileutils'
|
||||
|
||||
$shell = ARGV.include? '-s'
|
||||
|
||||
# Adapted from WEBrick::Utils. Skips cert extensions so it
|
||||
# can be used as a CA bundle
|
||||
def create_self_signed_cert(bits, cname, _comment)
|
||||
@ -29,7 +29,7 @@ end
|
||||
def write(file, contents, env_var)
|
||||
FileUtils.mkdir_p(File.dirname(file))
|
||||
File.open(file, 'w') { |f| f.puts(contents) }
|
||||
puts %(export #{env_var}="#{file}") if $shell
|
||||
puts %(export #{env_var}="#{file}") if ARGV.include? '-s'
|
||||
end
|
||||
|
||||
# One cert / CA for ease of testing when ignoring verification
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user