Skip to content

Commit 47d1147

Browse files
committed
Add --add-requirement
1 parent c03510c commit 47d1147

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

lib/rubygems/commands/build_binary_command.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55

66
class Gem::Commands::BuildBinaryCommand < Gem::Command
77
def initialize
8-
super("build_binary", "Build a binary gem for the current platform")
8+
super("build_binary",
9+
"Build a binary gem for the current platform",
10+
requirements: [])
11+
12+
add_option("--add-requirement=REQUIREMENT",
13+
"Add REQUIREMENT to spec.requirements",
14+
"You can specify this option multiple times",
15+
"to add multiples requirements") do |value, options|
16+
options[:requirements] << value
17+
end
918
end
1019

1120
def arguments
@@ -81,6 +90,11 @@ def adjust_spec(spec, dist_dir)
8190
spec.platform = Gem::Platform.local
8291
# Available only for the current Ruby.
8392
spec.required_ruby_version = required_ruby_version
93+
94+
pp @options
95+
@options[:requirements].each do |requirement|
96+
spec.requirements << requirement
97+
end
8498
end
8599

86100
def required_ruby_version

0 commit comments

Comments
 (0)