diff --git a/Formula/r/rails-new.rb b/Formula/r/rails-new.rb new file mode 100644 index 00000000000000..f6dc24c22fdc27 --- /dev/null +++ b/Formula/r/rails-new.rb @@ -0,0 +1,21 @@ +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.5.0.tar.gz" + sha256 "9a309ea0d3f7b7c10327aba30e919bab30efc3bdffc2fcedaa54ce23d9e4ae42" + license "MIT" + head "https://github.com/rails/rails-new.git", branch: "main" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + end + + test do + assert_match version.to_s, shell_output("#{bin}/rails-new --version") + + output = shell_output("#{bin}/rails-new testapp 2>&1", 101) + assert_match "failed to fetch metadata", output + end +end