зеркало из https://github.com/github/ruby.git
Import remaining changes
The "sync with commits" scripts failed to properly import these for some reason.
This commit is contained in:
Родитель
0c8d90b526
Коммит
5783d0dbfc
|
@ -136,14 +136,10 @@ module Bundler
|
|||
end
|
||||
|
||||
def inflate(obj)
|
||||
require "rubygems/util"
|
||||
|
||||
Gem::Util.inflate(obj)
|
||||
end
|
||||
|
||||
def correct_for_windows_path(path)
|
||||
require "rubygems/util"
|
||||
|
||||
if Gem::Util.respond_to?(:correct_for_windows_path)
|
||||
Gem::Util.correct_for_windows_path(path)
|
||||
elsif path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
|
||||
|
|
|
@ -194,7 +194,7 @@ module Bundler
|
|||
return @md5_available if defined?(@md5_available)
|
||||
@md5_available = begin
|
||||
require "openssl"
|
||||
OpenSSL::Digest::MD5.digest("")
|
||||
OpenSSL::Digest.digest("MD5", "")
|
||||
true
|
||||
rescue LoadError
|
||||
true
|
||||
|
|
|
@ -344,13 +344,6 @@ class Bundler::Thor
|
|||
command && disable_required_check.include?(command.name.to_sym)
|
||||
end
|
||||
|
||||
def deprecation_warning(message) #:nodoc:
|
||||
unless ENV['THOR_SILENCE_DEPRECATION']
|
||||
warn "Deprecation warning: #{message}\n" +
|
||||
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def stop_on_unknown_option #:nodoc:
|
||||
|
|
|
@ -33,7 +33,8 @@ class Bundler::Thor
|
|||
# Boolean:: true if it is identical, false otherwise.
|
||||
#
|
||||
def identical?
|
||||
exists? && File.identical?(render, destination)
|
||||
source = File.expand_path(render, File.dirname(destination))
|
||||
exists? && File.identical?(source, destination)
|
||||
end
|
||||
|
||||
def invoke!
|
||||
|
|
|
@ -22,6 +22,15 @@ class Bundler::Thor
|
|||
|
||||
TEMPLATE_EXTNAME = ".tt"
|
||||
|
||||
class << self
|
||||
def deprecation_warning(message) #:nodoc:
|
||||
unless ENV['THOR_SILENCE_DEPRECATION']
|
||||
warn "Deprecation warning: #{message}\n" +
|
||||
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module Base
|
||||
attr_accessor :options, :parent_options, :args
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
class Bundler::Thor
|
||||
VERSION = "1.0.0"
|
||||
VERSION = "1.0.1"
|
||||
end
|
||||
|
|
|
@ -65,7 +65,7 @@ RSpec.describe Bundler::Fetcher::CompactIndex do
|
|||
|
||||
context "when FIPS-mode is active" do
|
||||
before do
|
||||
allow(OpenSSL::Digest::MD5).to receive(:digest).
|
||||
allow(OpenSSL::Digest).to receive(:digest).with("MD5", "").
|
||||
and_raise(OpenSSL::Digest::DigestError)
|
||||
end
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
G
|
||||
|
||||
install_gems "activesupport-2.3.5"
|
||||
system_gems "activesupport-2.3.5"
|
||||
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => :default
|
||||
end
|
||||
|
@ -618,7 +618,7 @@ RSpec.describe "Bundler.setup" do
|
|||
end
|
||||
G
|
||||
|
||||
install_gems "activesupport-2.3.5"
|
||||
system_gems "activesupport-2.3.5"
|
||||
|
||||
expect(the_bundle).to include_gems "activesupport 2.3.2"
|
||||
end
|
||||
|
@ -765,7 +765,7 @@ end
|
|||
full_gem_name = gem_name + "-1.0"
|
||||
ext_dir = File.join(tmp("extensions", full_gem_name))
|
||||
|
||||
install_gems full_gem_name
|
||||
system_gems full_gem_name
|
||||
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
|
|
|
@ -99,14 +99,11 @@ RSpec.configure do |config|
|
|||
FileUtils.cp_r pristine_system_gem_path, system_gem_path
|
||||
|
||||
with_gem_path_as(system_gem_path) do
|
||||
@command_executions = []
|
||||
|
||||
Bundler.ui.silence { example.run }
|
||||
|
||||
all_output = @command_executions.map(&:to_s_verbose).join("\n\n")
|
||||
all_output = all_commands_output
|
||||
if example.exception && !all_output.empty?
|
||||
warn all_output unless config.formatters.grep(RSpec::Core::Formatters::DocumentationFormatter).empty?
|
||||
message = example.exception.message + "\n\nCommands:\n#{all_output}"
|
||||
message = example.exception.message + all_output
|
||||
(class << example.exception; self; end).send(:define_method, :message) do
|
||||
message
|
||||
end
|
||||
|
|
|
@ -27,8 +27,12 @@ module Spec
|
|||
TheBundle.new(*args)
|
||||
end
|
||||
|
||||
def command_executions
|
||||
@command_executions ||= []
|
||||
end
|
||||
|
||||
def last_command
|
||||
@command_executions.last || raise("There is no last command")
|
||||
command_executions.last || raise("There is no last command")
|
||||
end
|
||||
|
||||
def out
|
||||
|
@ -189,18 +193,36 @@ module Spec
|
|||
stderr_read_thread = Thread.new { stderr.read }
|
||||
command_execution.stdout = stdout_read_thread.value.strip
|
||||
command_execution.stderr = stderr_read_thread.value.strip
|
||||
command_execution.exitstatus = wait_thr && wait_thr.value.exitstatus
|
||||
end
|
||||
|
||||
(@command_executions ||= []) << command_execution
|
||||
status = wait_thr.value
|
||||
command_execution.exitstatus = if status.exited?
|
||||
status.exitstatus
|
||||
elsif status.signaled?
|
||||
128 + status.termsig
|
||||
end
|
||||
end
|
||||
|
||||
unless options[:raise_on_error] == false || command_execution.success?
|
||||
raise "Invoking #{cmd} failed!"
|
||||
raise <<~ERROR
|
||||
|
||||
Invoking `#{cmd}` failed with output:
|
||||
----------------------------------------------------------------------
|
||||
#{command_execution.stdboth}
|
||||
----------------------------------------------------------------------
|
||||
ERROR
|
||||
end
|
||||
|
||||
command_executions << command_execution
|
||||
|
||||
command_execution.stdout
|
||||
end
|
||||
|
||||
def all_commands_output
|
||||
return [] if command_executions.empty?
|
||||
|
||||
"\n\nCommands:\n#{command_executions.map(&:to_s_verbose).join("\n\n")}"
|
||||
end
|
||||
|
||||
def config(config = nil, path = bundled_app(".bundle/config"))
|
||||
return YAML.load_file(path) unless config
|
||||
FileUtils.mkdir_p(File.dirname(path))
|
||||
|
@ -264,18 +286,22 @@ module Spec
|
|||
bundle :lock, opts
|
||||
end
|
||||
|
||||
def install_gems(*gems)
|
||||
def system_gems(*gems)
|
||||
gems = gems.flatten
|
||||
options = gems.last.is_a?(Hash) ? gems.pop : {}
|
||||
gem_repo = options.fetch(:gem_repo) { gem_repo1 }
|
||||
gems.each do |g|
|
||||
gem_name = g.to_s
|
||||
if gem_name.start_with?("bundler")
|
||||
version = gem_name.match(/\Abundler-(?<version>.*)\z/)[:version] if gem_name != "bundler"
|
||||
with_built_bundler(version) {|gem_path| install_gem(gem_path) }
|
||||
elsif gem_name =~ %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}
|
||||
install_gem(gem_name)
|
||||
else
|
||||
install_gem("#{gem_repo}/gems/#{gem_name}.gem")
|
||||
path = options.fetch(:path, system_gem_path)
|
||||
with_gem_path_as(path) do
|
||||
gem_repo = options.fetch(:gem_repo, gem_repo1)
|
||||
gems.each do |g|
|
||||
gem_name = g.to_s
|
||||
if gem_name.start_with?("bundler")
|
||||
version = gem_name.match(/\Abundler-(?<version>.*)\z/)[:version] if gem_name != "bundler"
|
||||
with_built_bundler(version) {|gem_path| install_gem(gem_path) }
|
||||
elsif gem_name =~ %r{\A(?:[a-zA-Z]:)?/.*\.gem\z}
|
||||
install_gem(gem_name)
|
||||
else
|
||||
install_gem("#{gem_repo}/gems/#{gem_name}.gem")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -384,20 +410,12 @@ module Spec
|
|||
system_gems(*gems)
|
||||
end
|
||||
|
||||
def system_gems(*gems)
|
||||
opts = gems.last.is_a?(Hash) ? gems.last : {}
|
||||
path = opts.fetch(:path, system_gem_path)
|
||||
gems = gems.flatten
|
||||
|
||||
with_gem_path_as(path) do
|
||||
install_gems(*gems)
|
||||
end
|
||||
end
|
||||
|
||||
def realworld_system_gems(*gems)
|
||||
gems = gems.flatten
|
||||
opts = gems.last.is_a?(Hash) ? gems.pop : {}
|
||||
path = opts.fetch(:path, system_gem_path)
|
||||
|
||||
with_gem_path_as(system_gem_path) do
|
||||
with_gem_path_as(path) do
|
||||
gems.each do |gem|
|
||||
gem_command "install --no-document #{gem}"
|
||||
end
|
||||
|
@ -494,11 +512,11 @@ module Spec
|
|||
process_file(pathname) do |line|
|
||||
case line
|
||||
when /spec\.metadata\["(?:allowed_push_host|homepage_uri|source_code_uri|changelog_uri)"\]/, /spec\.homepage/
|
||||
line.gsub(/\=.*$/, "= 'http://example.org'")
|
||||
line.gsub(/\=.*$/, '= "http://example.org"')
|
||||
when /spec\.summary/
|
||||
line.gsub(/\=.*$/, "= %q{A short summary of my new gem.}")
|
||||
line.gsub(/\=.*$/, '= "A short summary of my new gem."')
|
||||
when /spec\.description/
|
||||
line.gsub(/\=.*$/, "= %q{A longer description of my new gem.}")
|
||||
line.gsub(/\=.*$/, '= "A longer description of my new gem."')
|
||||
else
|
||||
line
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче