Skip to content

Commit

Permalink
Change the terminals method to use registered terminal classes
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Aug 18, 2024
1 parent 1b5ec81 commit 76dec09
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/tty/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def self.link?(env: ENV, output: $stdout)
def initialize(env: ENV, output: $stdout)
@env = env
@output = output
@semantic_version = SemanticVersion
end

# Generate terminal hyperlink
Expand Down Expand Up @@ -159,14 +158,13 @@ def link?
# @example
# link.terminals
#
# @return [Array(TTY::Link::Terminals::Iterm, TTY::Link::Terminals::Vte)]
# @return [Array<TTY::Link::Terminals::Abstract>]
#
# @api private
def terminals
@terminals ||= [
Terminals::Iterm.new(@semantic_version, @env),
Terminals::Vte.new(@semantic_version, @env)
]
@terminals ||= Terminals.registered.map do |terminal_class|
terminal_class.new(SemanticVersion, @env)
end
end

# Detect the terminal device
Expand Down

0 comments on commit 76dec09

Please sign in to comment.