Skip to content

Commit

Permalink
Restyled by standardrb (#1103)
Browse files Browse the repository at this point in the history
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
restyled-io[bot] and restyled-commits authored Dec 7, 2023
1 parent 9a58145 commit 1e63acd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions packaging/homebrew/homebrew.rb
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# frozen_string_literal: true

class Rtx < Formula
desc 'Multi-language runtime manager'
homepage 'https://github.com/jdx/rtx'
license 'MIT'
version '$RTX_VERSION'
desc "Multi-language runtime manager"
homepage "https://github.com/jdx/rtx"
license "MIT"
version "$RTX_VERSION"

on_macos do
if Hardware::CPU.intel?
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz'
sha256 '$RTX_CHECKSUM_MACOS_X86_64'
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-x64.tar.xz"
sha256 "$RTX_CHECKSUM_MACOS_X86_64"
end
if Hardware::CPU.arm?
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz'
sha256 '$RTX_CHECKSUM_MACOS_ARM64'
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-macos-arm64.tar.xz"
sha256 "$RTX_CHECKSUM_MACOS_ARM64"
end
end

on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz'
sha256 '$RTX_CHECKSUM_LINUX_ARM64'
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-arm64.tar.xz"
sha256 "$RTX_CHECKSUM_LINUX_ARM64"
end
if Hardware::CPU.intel?
url 'https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz'
sha256 '$RTX_CHECKSUM_LINUX_X86_64'
url "https://rtx.pub/v$RTX_VERSION/rtx-v$RTX_VERSION-linux-x64.tar.xz"
sha256 "$RTX_CHECKSUM_LINUX_X86_64"
end
end

def install
bin.install 'bin/rtx'
man1.install 'man/man1/rtx.1'
generate_completions_from_executable(bin / 'rtx', 'completion')
bin.install "bin/rtx"
man1.install "man/man1/rtx.1"
generate_completions_from_executable(bin / "rtx", "completion")
lib.mkpath
touch lib / '.disable-self-update'
touch lib / ".disable-self-update"
end

test do
system "#{bin}/rtx --version"
system "#{bin}/rtx", 'install', '[email protected]'
assert_match 'v20.0.0', shell_output("#{bin}/rtx exec [email protected] -- node -v")
system "#{bin}/rtx", "install", "[email protected]"
assert_match "v20.0.0", shell_output("#{bin}/rtx exec [email protected] -- node -v")
end
end
8 changes: 4 additions & 4 deletions src/plugins/core/assets/rubygems_plugin.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# frozen_string_literal: true

def debug?
!!ENV['RTX_DEBUG']
!!ENV["RTX_DEBUG"]
end

def log_debug(msg)
warn "[DEBUG] rtx #{msg}" if debug?
end

def reshim
if `which ruby`.strip != ''
log_debug 'reshim'
if `which ruby`.strip != ""
log_debug "reshim"
`rtx reshim`
else
log_debug 'reshim skipped: ruby not found'
log_debug "reshim skipped: ruby not found"
end
end

Expand Down

0 comments on commit 1e63acd

Please sign in to comment.