Skip to content

Commit

Permalink
module/class documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed May 3, 2024
1 parent 85fb2ed commit fbe3672
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/launchy/argv.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module Launchy
# Internal: Ecapsulate the commandline argumens passed to Launchy
#
class Argv
attr_reader :argv
def initialize(*args)
Expand Down
2 changes: 2 additions & 0 deletions lib/launchy/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "optparse"

module Launchy
# Internal: Command line interface for Launchy
#
class Cli

attr_reader :options
Expand Down
2 changes: 2 additions & 0 deletions lib/launchy/detect.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

module Launchy
# Internal: Namespace for detecting the environment that Launchy is running in
#
module Detect
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/launchy/detect/host_os.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "rbconfig"

module Launchy::Detect
# Internal: Determine the host operating system that Launchy is running on
#
class HostOs

attr_reader :host_os
Expand Down
3 changes: 3 additions & 0 deletions lib/launchy/detect/host_os_family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,23 @@ def self.matching_regex
def app_list(app) app.windows_app_list; end
end

# Mac OS X family
class Darwin < HostOsFamily
def self.matching_regex
/(darwin|mac os)/i
end
def app_list(app) app.darwin_app_list; end
end

# All the *nix family of operating systems, and BSDs
class Nix < HostOsFamily
def self.matching_regex
/(linux|bsd|aix|solaris|sunos|dragonfly)/i
end
def app_list(app) app.nix_app_list; end
end

# Cygwin - if anyone is still using that
class Cygwin < HostOsFamily
def self.matching_regex
/cygwin/i
Expand Down
3 changes: 3 additions & 0 deletions lib/launchy/detect/nix_desktop_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def self.browsers
# The list of known desktop environments
#---------------------------------------

# KDE desktop environment
class Kde < NixDesktopEnvironment
def self.is_current_desktop_environment?
ENV["KDE_FULL_SESSION"] &&
Expand All @@ -43,6 +44,7 @@ def self.browser
end
end

# Gnome desktop environment
class Gnome < NixDesktopEnvironment
def self.is_current_desktop_environment?
ENV["GNOME_DESKTOP_SESSION_ID"] &&
Expand All @@ -54,6 +56,7 @@ def self.browser
end
end

# Xfce desktop environment
class Xfce < NixDesktopEnvironment
def self.is_current_desktop_environment?
if Launchy::Application.find_executable("xprop") then
Expand Down
2 changes: 2 additions & 0 deletions lib/launchy/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require "childprocess"
module Launchy
# Internal: Run a command in a child process
#
class Runner
def run(cmd, *args)
raise Launchy::CommandNotFoundError, "No command found to run with args '#{args.join(' ')}'. If this is unexpected, #{Launchy.bug_report_message}" unless cmd
Expand Down
1 change: 1 addition & 0 deletions lib/launchy/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Launchy
VERSION = "3.0.0"

# Internal: Version number of Launchy
module Version

MAJOR = Integer(VERSION.split(".")[0])
Expand Down

0 comments on commit fbe3672

Please sign in to comment.