Module: Homebrew::Bundle::VscodeExtensionDumper Private

Defined in:
bundle/vscode_extension_dumper.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Class Method Summary collapse

Class Method Details

.dumpObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



21
22
23
# File 'bundle/vscode_extension_dumper.rb', line 21

def self.dump
  extensions.map { |name| "vscode \"#{name}\"" }.join("\n")
end

.extensionsObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



11
12
13
14
15
16
17
18
19
# File 'bundle/vscode_extension_dumper.rb', line 11

def self.extensions
  @extensions ||= if Bundle.vscode_installed?
    Bundle.exchange_uid_if_needed! do
      `"#{Bundle.which_vscode}" --list-extensions 2>/dev/null`
    end.split("\n").map(&:downcase)
  else
    []
  end
end

.reset!Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



7
8
9
# File 'bundle/vscode_extension_dumper.rb', line 7

def self.reset!
  @extensions = nil
end