mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
create: add --ruby option
This commit is contained in:
parent
252bdc2f26
commit
a3eefda0f9
@ -31,6 +31,8 @@ module Homebrew
|
||||
description: "Create a basic template for a Perl build."
|
||||
switch "--python",
|
||||
description: "Create a basic template for a Python build."
|
||||
switch "--ruby",
|
||||
description: "Create a basic template for a Ruby build."
|
||||
switch "--rust",
|
||||
description: "Create a basic template for a Rust build."
|
||||
switch "--no-fetch",
|
||||
@ -86,6 +88,8 @@ module Homebrew
|
||||
:perl
|
||||
elsif args.python?
|
||||
:python
|
||||
elsif args.ruby?
|
||||
:ruby
|
||||
elsif args.rust?
|
||||
:rust
|
||||
end
|
||||
|
@ -112,6 +112,8 @@ module Homebrew
|
||||
uses_from_macos "perl"
|
||||
<% elsif mode == :python %>
|
||||
depends_on "python"
|
||||
<% elsif mode == :ruby %>
|
||||
uses_from_macos "ruby"
|
||||
<% elsif mode == :rust %>
|
||||
depends_on "rust" => :build
|
||||
<% elsif mode.nil? %>
|
||||
@ -166,6 +168,12 @@ module Homebrew
|
||||
bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
|
||||
<% elsif mode == :python %>
|
||||
virtualenv_install_with_resources
|
||||
<% elsif mode == :ruby %>
|
||||
ENV["GEM_HOME"] = libexec
|
||||
system "gem", "build", "\#{name}.gemspec"
|
||||
system "gem", "install", "\#{name}-\#{version}.gem"
|
||||
bin.install libexec/"bin/\#{name}"
|
||||
bin.env_script_all_files(libexec/"bin", :GEM_HOME => ENV["GEM_HOME"])
|
||||
<% elsif mode == :rust %>
|
||||
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
|
||||
<% else %>
|
||||
|
@ -813,6 +813,8 @@ a simple example. For the complete API, see:
|
||||
Create a basic template for a Perl build.
|
||||
* `--python`:
|
||||
Create a basic template for a Python build.
|
||||
* `--ruby`:
|
||||
Create a basic template for a Ruby build.
|
||||
* `--rust`:
|
||||
Create a basic template for a Rust build.
|
||||
* `--no-fetch`:
|
||||
|
@ -1044,6 +1044,10 @@ Create a basic template for a Perl build\.
|
||||
Create a basic template for a Python build\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-ruby\fR
|
||||
Create a basic template for a Ruby build\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-rust\fR
|
||||
Create a basic template for a Rust build\.
|
||||
.
|
||||
|
Loading…
x
Reference in New Issue
Block a user