Module: Cacert

Defined in:
lib/cacert.rb,
lib/cacert/version.rb

Constant Summary collapse

VERSION =
"0.8.0"

Class Method Summary collapse

Class Method Details

.pemObject

Returns the path of the embedded cacert.pem SSL certificates file.



10
11
12
# File 'lib/cacert.rb', line 10

def self.pem
  File.join(share_dir, 'cacert.pem')
end

.set_in_envObject

Sets the SSL_CERT_FILE environment variable to the location of the cacert.pem file.



15
16
17
# File 'lib/cacert.rb', line 15

def self.set_in_env
  ENV['SSL_CERT_FILE'] = self.pem.to_s
end

.share_dirObject

Returns the directory containing the cacert.pem file.



5
6
7
# File 'lib/cacert.rb', line 5

def self.share_dir
  File.expand_path('../share', __dir__)
end

.sourceObject

The link which cacert.pem can be downloaded from.



20
21
22
# File 'lib/cacert.rb', line 20

def self.source
  "https://curl.haxx.se/ca/cacert.pem"
end