rails / rails-new

Create Rails projects with Ruby installed
MIT License
103 stars 8 forks source link

Homebrew formula #17

Open yahonda opened 3 weeks ago

yahonda commented 3 weeks ago

I want the rails-new can be installed via Homebrew for macOS users.

Expected behavior

macOS users can create a new Rails application as follows.

% brew install rails-new
% rails-new myapp
bweis commented 1 week ago

Took a crack at adding a formula and ran into a myriad of problems. :/

ruby

class RailsNew < Formula
  desc "Create Rails projects with Ruby installed"
  homepage "https://github.com/rails/rails-new"
  url "https://github.com/rails/rails-new/archive/refs/tags/v0.3.0.tar.gz"
  sha256 "a03c3f1530a28817d0989390be87ebc6a644f3eaa1a98dbb7420f7de3995c3f8"
  license "MIT"

  depends_on "rust" => :build
  depends_on :macos
  depends_on "docker" => :test
  depends_on "docker-credential-helper" => :test

  # Because of limitations with docker, use an alternative container runtime
  depends_on "colima" => :test

  def install
    system "cargo", "install", *std_cargo_args
  end

  test do
    assert_match version.to_s, shell_output(bin/"rails-new -V")
  end
end

If anyone want's to continue where I left off and hack away at it.