Skip to content

Commit 721215c

Browse files
committed
Fix Linux System module and add documentation.
1 parent 222ad2d commit 721215c

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/localhost/system.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# Copyright, 2025, by Samuel Williams.
55

66
module Localhost
7+
# @namespace
78
module System
9+
# @return [Class] The best system class for the current platform.
810
def self.current
911
case RUBY_PLATFORM
1012
when /darwin/

lib/localhost/system/darwin.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
module Localhost
77
module System
8+
# Darwin specific system operations.
89
module Darwin
10+
# Install a certificate into the system trust store.
11+
#
12+
# @parameter certificate [String] The path to the certificate file.
913
def self.install(certificate)
1014
login_keychain = File.expand_path("~/Library/Keychains/login.keychain-db")
1115

lib/localhost/system/linux.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Released under the MIT License.
44
# Copyright, 2025, by Samuel Williams.
55

6-
require "etc"
7-
86
module Localhost
97
module System
10-
module Darwin
8+
# Linux specific system operations.
9+
module Linux
10+
# Install a certificate into the system trust store.
11+
#
12+
# @parameter certificate [String] The path to the certificate file.
1113
def self.install(certificate)
1214
filename = File.basename(certificate)
1315
destination = "/usr/local/share/ca-certificates/localhost-#{filename}"

0 commit comments

Comments
 (0)