Skip to content

Distribute CLI via Homebrew #123

@cardmagic

Description

@cardmagic

Summary

Add Homebrew distribution for the classifier CLI to make installation easier for macOS users.

Background

Currently users must install via RubyGems (gem install classifier), which requires Ruby environment setup. A Homebrew formula would provide a simpler installation path.

Tasks

  • Create proper CLI executable (e.g., classifier command with subcommands)
  • Add executables to gemspec
  • Create Homebrew formula
  • Submit formula to homebrew-core or create a tap (homebrew-classifier)

Options

  1. homebrew-core - Submit to main Homebrew repository (requires meeting their criteria)
  2. Custom tap - Create cardmagic/homebrew-classifier for brew tap cardmagic/classifier

Example Formula

class Classifier < Formula
  desc "Text classification with Bayesian and LSI algorithms"
  homepage "https://rubyclassifier.com"
  url "https://rubygems.org/downloads/classifier-2.2.0.gem"
  sha256 "..."
  license "LGPL"

  depends_on "ruby"

  def install
    ENV["GEM_HOME"] = libexec
    system "gem", "install", "--ignore-dependencies", cached_download
    bin.install Dir["#{libexec}/bin/*"]
    bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"])
  end
end

Installation (Goal)

brew install classifier
# or with custom tap
brew tap cardmagic/classifier
brew install classifier

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions