diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-05-16 14:45:08 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-05 07:32:42 +0900 |
commit | 3660d14de60ac4a2b420601db5b16c104a0c7858 (patch) | |
tree | e461e2adcc5a5ef2fd6a0e138069dad0978f2723 | |
parent | f7d3522a54627b6d2fec0606fff5612ba52f2731 (diff) |
[rubygems/rubygems] Make `rake package` log messages to stdout by default
The logging to $stderr is only happening due to a bug in `FileUtils`.
Logging messages are not errors.
https://github.com/rubygems/rubygems/commit/4d1b6659e6
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3184
-rw-r--r-- | lib/rubygems/package_task.rb | 1 | ||||
-rw-r--r-- | test/rubygems/test_gem_package_task.rb | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/rubygems/package_task.rb b/lib/rubygems/package_task.rb index a11d09fb21..b355c2b5dd 100644 --- a/lib/rubygems/package_task.rb +++ b/lib/rubygems/package_task.rb @@ -88,6 +88,7 @@ class Gem::PackageTask < Rake::PackageTask super gem.full_name, :noversion @gem_spec = gem @package_files += gem_spec.files if gem_spec.files + @fileutils_output = $stdout end ## diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb index 56d574d9a3..9d87db88ae 100644 --- a/test/rubygems/test_gem_package_task.rb +++ b/test/rubygems/test_gem_package_task.rb @@ -47,6 +47,34 @@ class TestGemPackageTask < Gem::TestCase end end + def test_gem_package_prints_to_stdout_by_default + gem = Gem::Specification.new do |g| + g.name = "pkgr" + g.version = "1.2.3" + + g.authors = %w[author] + g.files = %w[x] + g.summary = 'summary' + end + + pkg = Gem::PackageTask.new(gem) do |p| + p.package_files << "y" + end + + assert_equal %w[x y], pkg.package_files + + Dir.chdir @tempdir do + FileUtils.touch 'x' + FileUtils.touch 'y' + + _, err = capture_io do + Rake.application['package'].invoke + end + + assert_empty err + end + end + def test_gem_package_with_current_platform RakeFileUtils.verbose_flag = false |