Skip to content
Browse files

Fix "coding:" detection for release notes

The regular expression used would capture the first "=" of the first
history entry which contained the latest release notes.  This has been
corrected to not consume anything beyond the header text.

Fixes #814
  • Loading branch information...
1 parent 98828a1 commit f235c4a5f1e27369f9cf800b01092adc68216a53 @drbrain drbrain committed Feb 12, 2014
Showing with 9 additions and 1 deletion.
  1. +2 −0 History.txt
  2. +1 −1 lib/rubygems/commands/setup_command.rb
  3. +6 −0 test/rubygems/test_gem_commands_setup_command.rb
View
2 History.txt
@@ -28,6 +28,8 @@ Bug fixes:
Pull requests #809, #812 by Aaron Patterson.
* Reduced requests when fetching gems with the bundler API. Pull request #773
by Charlie Somerville.
+* RubyGems now prints release notes from the current release. Bug #814 by
+ André Arko.
=== 2.2.2 / 2014-02-05
View
2 lib/rubygems/commands/setup_command.rb
@@ -446,7 +446,7 @@ def show_release_notes
history.force_encoding Encoding::UTF_8 if
Object.const_defined? :Encoding
- history = history.sub(/^# coding:.*?^=/m, '')
+ history = history.sub(/^# coding:.*?(?=^=)/m, '')
text = history.split(HISTORY_HEADER)
text.shift # correct an off-by-one generated by split
View
6 test/rubygems/test_gem_commands_setup_command.rb
@@ -111,6 +111,12 @@ def test_show_release_notes
end
expected = <<-EXPECTED
+=== #{Gem::VERSION} / 2013-03-26
+
+* Bug fixes:
+ * Fixed release note display for LANG=C when installing rubygems
+ * π is tasty
+
=== 2.0.2 / 2013-03-06
* Bug fixes:

0 comments on commit f235c4a

Please sign in to comment.
Something went wrong with that request. Please try again.