[rubygems/rubygems] [rebuild_command] Add --diff flag to try using diffoscope.
https://github.com/rubygems/rubygems/commit/3e9545193a
This commit is contained in:
parent
cd12dfd388
commit
a28087affc
@ -11,6 +11,10 @@ class Gem::Commands::RebuildCommand < Gem::Command
|
|||||||
def initialize
|
def initialize
|
||||||
super "rebuild", "Attempt to reproduce a build of a gem."
|
super "rebuild", "Attempt to reproduce a build of a gem."
|
||||||
|
|
||||||
|
add_option "--diff", "If the files don't match, compare them using diffoscope." do |_value, options|
|
||||||
|
options[:diff] = true
|
||||||
|
end
|
||||||
|
|
||||||
add_option "--force", "Skip validation of the spec." do |_value, options|
|
add_option "--force", "Skip validation of the spec." do |_value, options|
|
||||||
options[:force] = true
|
options[:force] = true
|
||||||
end
|
end
|
||||||
@ -150,6 +154,14 @@ An example of reproducing a gem build:
|
|||||||
say "SUCCESS - original and rebuild hashes matched"
|
say "SUCCESS - original and rebuild hashes matched"
|
||||||
else
|
else
|
||||||
say "FAILURE - original and rebuild hashes did not match"
|
say "FAILURE - original and rebuild hashes did not match"
|
||||||
|
|
||||||
|
if options[:diff]
|
||||||
|
say
|
||||||
|
if system("diffoscope", old_file, new_file).nil?
|
||||||
|
alert_error "error: could not find `diffoscope` executable"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
terminate_interaction 1
|
terminate_interaction 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user