diff --git a/lib/thor/runner.rb b/lib/thor/runner.rb index 70c0d618..971e59cc 100644 --- a/lib/thor/runner.rb +++ b/lib/thor/runner.rb @@ -2,7 +2,7 @@ require_relative "group" require "yaml" -require "digest/md5" +require "digest/sha2" require "pathname" class Thor::Runner < Thor #:nodoc: @@ -91,7 +91,7 @@ def install(name) # rubocop:disable Metrics/MethodLength end thor_yaml[as] = { - :filename => Digest::MD5.hexdigest(name + as), + :filename => Digest::SHA256.hexdigest(name + as), :location => location, :namespaces => Thor::Util.namespaces_in_content(contents, base) } diff --git a/spec/runner_spec.rb b/spec/runner_spec.rb index 6a8cc67f..52748fcc 100644 --- a/spec/runner_spec.rb +++ b/spec/runner_spec.rb @@ -219,7 +219,7 @@ def when_no_thorfiles_exist allow(FileUtils).to receive(:touch) allow(Thor::LineEditor).to receive(:readline).and_return("Y") - path = File.join(Thor::Util.thor_root, Digest::MD5.hexdigest(@location + "random")) + path = File.join(Thor::Util.thor_root, Digest::SHA256.hexdigest(@location + "random")) expect(File).to receive(:open).with(path, "w") end