Skip to content

Commit

Permalink
refactor: move default ruby macos installation to gem namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCane committed Aug 17, 2023
1 parent 82736c8 commit 1c2c6ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 0 additions & 7 deletions scripts/core/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,3 @@ platform::is_wsl() {
platform::wsl_home_path() {
wslpath "$(wslvar USERPROFILE 2>/dev/null)"
}

platform::is_default_macos_ruby() {
current_ruby_path=$(command -v ruby)
default_ruby_path="/usr/bin/ruby"

[[ $current_ruby_path == "$default_ruby_path" ]]
}
7 changes: 7 additions & 0 deletions scripts/package/src/package_managers/gem.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
gem::is_macos_default() {
current_ruby_path=$(command -v ruby)
default_ruby_path="/usr/bin/ruby"

platform::is_macos && [[ $current_ruby_path == "$default_ruby_path" ]]
}

gem::update_all() {
outdated=$(gem outdated)

Expand Down
2 changes: 1 addition & 1 deletion scripts/package/update_all
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ platform::command_exists mas && output::h2 '🍎 App Store' && mas::update_all
platform::command_exists brew && output::h2 '🍺 Brew' && brew::update_all
platform::command_exists pip3 && output::h2 '🐍 pip' && pip::update_all
platform::command_exists composer && output::h2 '🐘 Composer' && composer::update_all
platform::command_exists gem && ! platform::is_default_macos_ruby && output::h2 '♦️ gem' && gem::update_all
platform::command_exists gem && ! gem::is_macos_default && output::h2 '♦️ gem' && gem::update_all
platform::command_exists npm && output::h2 '🌈 npm' && npm::update_all
platform::command_exists cargo && output::h2 '📦 cargo' && cargo::update_all

Expand Down

0 comments on commit 1c2c6ab

Please sign in to comment.