From 9760c4a2aa6ab8dfa05611103e897024e670bec8 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 4 May 2025 10:22:59 +0100 Subject: [PATCH] feat(mise/tools): install Ruby gems with mise Also remove various old defunct install_*_global_packages helper shell commands. --- config/mise/config.toml | 15 ++++++++++++++- zsh/nodejs.zsh | 14 -------------- zsh/python.zsh | 18 ------------------ zsh/ruby.zsh | 30 ------------------------------ zsh/rust.zsh | 31 +++---------------------------- 5 files changed, 17 insertions(+), 91 deletions(-) diff --git a/config/mise/config.toml b/config/mise/config.toml index aff8985..a5775f8 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -33,6 +33,19 @@ ruby_install = true "cargo:eza" = "latest" "cargo:kubectl-watch" = "latest" "cargo:paper-terminal" = "latest" +"gem:dotenv" = "latest" +"gem:erb_lint" = "latest" +"gem:foreman" = "latest" +"gem:reek" = "latest" +"gem:rubocop" = "latest" +"gem:ruby-lsp" = "latest" +"gem:ruby-lsp-rails" = "latest" +"gem:solargraph" = "latest" +"gem:solargraph-rails" = "latest" +"gem:syntax_tree" = "latest" +"gem:syntax_tree-haml" = "latest" +"gem:syntax_tree-rbs" = "latest" +"gem:yard" = "latest" "go:github.com/rakyll/hey" = "latest" "go:google.golang.org/grpc/cmd/protoc-gen-go-grpc" = "latest" "go:google.golang.org/protobuf/cmd/protoc-gen-go" = "latest" @@ -118,7 +131,7 @@ rclone = "latest" restish = "latest" ripgrep = "latest" ruby = "latest" -rust = "latest" +rust = { version = "latest", components = "rust-analyzer,rust-src" } sccache = "latest" shellcheck = "latest" shfmt = "latest" diff --git a/zsh/nodejs.zsh b/zsh/nodejs.zsh index 9defe6b..199cfcb 100755 --- a/zsh/nodejs.zsh +++ b/zsh/nodejs.zsh @@ -1,17 +1,3 @@ # # Node.js environment setup. # - -# ============================================================================== -# global node packages -# ============================================================================== - -install_node_global_packages() { - local npm_packages=( - ) - - npm install -g "${npm_packages[@]}" - - # Ensure yarn and pnpm are enabled. - corepack enable -} diff --git a/zsh/python.zsh b/zsh/python.zsh index 33e052c..850fbe6 100644 --- a/zsh/python.zsh +++ b/zsh/python.zsh @@ -9,21 +9,3 @@ alias ap="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ansible-playbook" alias av="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ansible-vault" alias mo="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES molecule" - -# ============================================================================== -# global python package -# ============================================================================== - -install_python_global_packages() { - local packages=( - 'passlib' - ) - - local pipcmd="pip" - if ! command-exists pip && command-exists pip3; then - pipcmd="pip3" - fi - - "$pipcmd" install --upgrade setuptools - "$pipcmd" install --upgrade "${packages[@]}" -} diff --git a/zsh/ruby.zsh b/zsh/ruby.zsh index 9edbb61..b272108 100755 --- a/zsh/ruby.zsh +++ b/zsh/ruby.zsh @@ -39,33 +39,3 @@ alias he="heroku" alias f="foreman" alias fs="foreman start" alias fr="foreman run" - -# ============================================================================== -# global ruby packages -# ============================================================================== - -install_ruby_global_packages() { - local packages=( - 'bundler:~> 1.0' - 'bundler:~> 2.0' - bundler-audit - dotenv - erb_lint - foreman - method_source - pry-doc - reek - rubocop - ruby-lsp - ruby-lsp-rails - solargraph - solargraph-rails - steep - syntax_tree - syntax_tree-haml - syntax_tree-rbs - yard - ) - - gem install --no-document "${packages[@]}" -} diff --git a/zsh/rust.zsh b/zsh/rust.zsh index 2a942dd..e3153ab 100644 --- a/zsh/rust.zsh +++ b/zsh/rust.zsh @@ -23,33 +23,8 @@ fi if command-exists rustup; then setup-completions rustup "$(command-path rustup)" rustup completions zsh - - if command-exists cargo; then - setup-completions cargo "$(command-path cargo)" rustup completions zsh cargo - fi fi -# ============================================================================== -# global rust packages -# ============================================================================== - -install_rust_global_packages() { - ( - set -e - - if ! command-exists rustup; then - read -q "REPLY?Rustup was not found. Install it? [y/N] " && - echo && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - fi - - if ! command-exists rustup; then - echo "Rustup was not found. Aborting." - return 1 - fi - - rustup component add \ - rust-analyzer \ - rust-src - ) -} +if command-exists cargo; then + setup-completions cargo "$(command-path cargo)" rustup completions zsh cargo +fi