Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/rubygems/commands/compile_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def initialize
end
end

add_option "-u", "--unsafe", "Remove push restrictions" do |_, options|
options[:remove_gemspec_restrictions] = true
end

add_option "--build-number NUMBER",
"Append build number to compiled Gem version" do |value, options|

Expand Down
5 changes: 5 additions & 0 deletions lib/rubygems/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def adjust_gemspec_files(gemspec, artifacts)
gemspec.files.reject! { |f| !File.exist?("#{target_dir}/#{f}") }
end

if @options[:remove_gemspec_restrictions]
gemspec.metadata.delete 'allowed_push_host'
gemspec.metadata.delete 'rubygems_mfa_required'
end

# add discovered artifacts
artifacts.each do |path|
# path needs to be relative to target_dir
Expand Down