diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 22:41:03 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-08 22:41:03 +0000 |
commit | 7083cebeaea83096128fc5ccb5f60bfbe5bcc939 (patch) | |
tree | fb25c12a6cc01a1a8de5221d64da632418e194a3 /lib/rubygems/commands/setup_command.rb | |
parent | fa343a796fd256fc9098db7fdddf226fe5cbd181 (diff) |
* lib/rubygems: Update to RubyGems 2.0.4. See
https://github.com/rubygems/rubygems/blob/2.0/History.txt for changes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/setup_command.rb')
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 1cdc9f4c57..face77fae9 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -159,29 +159,7 @@ By default, this RubyGems will install gem as: options[:previous_version] = Gem::Version.new(options[:previous_version]) - release_notes = File.join Dir.pwd, 'History.txt' - - release_notes = if File.exist? release_notes then - history = File.read release_notes - history = history.sub(/^# coding:.*?^=/m, '') - - text = history.split(HISTORY_HEADER) - text.shift # correct an off-by-one generated by split - version_lines = history.scan(HISTORY_HEADER) - versions = history.scan(VERSION_MATCHER).flatten.map { |x| Gem::Version.new(x) } - - history_string = "" - - until versions.length == 0 or versions.shift < options[:previous_version] - history_string += version_lines.shift + text.shift - end - - history_string - else - "Oh-no! Unable to find release notes!" - end - - say release_notes + show_release_notes say say "-" * 78 @@ -458,6 +436,40 @@ abort "#{deprecation_message}" end end + def show_release_notes + release_notes = File.join Dir.pwd, 'History.txt' + + release_notes = + if File.exist? release_notes then + history = File.read release_notes + + history.force_encoding Encoding::UTF_8 if + Object.const_defined? :Encoding + + history = history.sub(/^# coding:.*?^=/m, '') + + text = history.split(HISTORY_HEADER) + text.shift # correct an off-by-one generated by split + version_lines = history.scan(HISTORY_HEADER) + versions = history.scan(VERSION_MATCHER).flatten.map do |x| + Gem::Version.new(x) + end + + history_string = "" + + until versions.length == 0 or + versions.shift < options[:previous_version] do + history_string += version_lines.shift + text.shift + end + + history_string + else + "Oh-no! Unable to find release notes!" + end + + say release_notes + end + def uninstall_old_gemcutter require 'rubygems/uninstaller' |