<pre style='margin:0'>
kimura wataru (kimuraw) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/265477388ea22ea4c0e512cf170baba6509c0680">https://github.com/macports/macports-ports/commit/265477388ea22ea4c0e512cf170baba6509c0680</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 265477388ea22ea4c0e512cf170baba6509c0680
</span>Author: kimura wataru <kimuraw@macports.org>
AuthorDate: Sat Sep 16 00:23:53 2017 +0900
<span style='display:block; white-space:pre;color:#404040;'> lang/ruby24: update to 2.4.2
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> add a patch to fix build problem with variant +gmp or +jemalloc.
</span><span style='display:block; white-space:pre;color:#404040;'> see https://bugs.ruby-lang.org/issues/1389
</span><span style='display:block; white-space:pre;color:#404040;'> this problem will be solved in next release (version 2.4.2).
</span><span style='display:block; white-space:pre;color:#404040;'> - patch-configure.diff
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> delete patch files merged in this release.
</span><span style='display:block; white-space:pre;color:#404040;'> - lang/ruby24/files/patch-legacy_mac.diff
</span><span style='display:block; white-space:pre;color:#404040;'> - lang/ruby24/files/patch-leopard.diff
</span><span style='display:block; white-space:pre;color:#404040;'> - lang/ruby24/files/rubygems-2612-ruby24.patch
</span><span style='display:block; white-space:pre;color:#404040;'> - lang/ruby24/files/rubygems-2613-ruby24.patch
</span>---
lang/ruby24/Portfile | 23 +-
lang/ruby24/files/patch-configure.diff | 18 ++
lang/ruby24/files/patch-legacy_mac.diff | 25 --
lang/ruby24/files/patch-leopard.diff | 39 ---
lang/ruby24/files/rubygems-2612-ruby24.patch | 437 ---------------------------
lang/ruby24/files/rubygems-2613-ruby24.patch | 355 ----------------------
6 files changed, 29 insertions(+), 868 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/Portfile b/lang/ruby24/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 29d3218..ba20856 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/ruby24/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/ruby24/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,8 +4,8 @@ PortSystem 1.0
</span> PortGroup select 1.0
name ruby24
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version 2.4.1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 2.4.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 0
</span>
categories lang ruby
maintainers kimuraw openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,17 +26,15 @@ use_bzip2 yes
</span> distname ruby-${version}
dist_subdir ruby24
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# 10.7 or earlier cannot compile ruby-2.4.0, upstream ruby-trunk's r57180 fixes this error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-legacy_mac.diff \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-leopard.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# ruby-2.4.2 cannot link libgmp nor jemalloc (will be fixed in 2.4.3)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://bugs.ruby-lang.org/issues/13402
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://bugs.ruby-lang.org/issues/13899
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles patch-configure.diff
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles-append rubygems-2612-ruby24.patch \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rubygems-2613-ruby24.patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums md5 07b2ae5d2f46321c95b37066c8415900 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rmd160 02f0be92b3fb3fbb4bd1f945359c0d45297cefc6 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha1 b0bec75c260dcb81ca386fafef27bd718f8c28ad \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 ccfb2d0a61e2a9c374d51e099b0d833b09241ee78fc17e1fe38e3b282160237c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums md5 5ff3ad6ec816bcce8806a55090936ab6 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rmd160 0e44cf9b76d01be568049a634eba8a0959a69ff2 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha1 a8a50a9297ff656e5230bf0f945acd69cc02a097 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 08e72d0cbe870ed1317493600fbbad5995ea3af2d0166585e7ecc85d04cc50dc
</span>
use_parallel_build no
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,6 +100,7 @@ variant gmp description "use gmp" {
</span>
variant jemalloc description "use jemalloc" {
configure.args-delete --without-jemalloc
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-append --with-jemalloc
</span> depends_lib-append port:jemalloc
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/files/patch-configure.diff b/lang/ruby24/files/patch-configure.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..3d63e91
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/ruby24/files/patch-configure.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- configure.orig 2017-09-15 23:26:41.000000000 +0900
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ configure 2017-09-15 23:26:59.000000000 +0900
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -10614,6 +10614,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_res=$ac_cv_search___gmpz_init
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if test "$ac_res" != no; then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ $as_echo "#define HAVE_LIBGMP 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -10683,6 +10684,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ac_res=$ac_cv_search_malloc_conf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if test "$ac_res" != no; then :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ $as_echo "#define HAVE_LIBJEMALLOC 1" >>confdefs.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ with_jemalloc=no
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/files/patch-legacy_mac.diff b/lang/ruby24/files/patch-legacy_mac.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 65059d9..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/ruby24/files/patch-legacy_mac.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,25 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- ext/-test-/memory_status/memory_status.c.orig 2016-12-26 00:27:26.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ext/-test-/memory_status/memory_status.c 2016-12-26 00:27:48.000000000 +0900
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -17,12 +17,19 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined __APPLE__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- VALUE rss;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- kern_return_t error;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- mach_msg_type_number_t out_count;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# if defined MACH_TASK_BASIC_INFO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const task_flavor_t flavor = MACH_TASK_BASIC_INFO;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ mach_msg_type_number_t out_count = MACH_TASK_BASIC_INFO_COUNT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mach_task_basic_info_data_t taskinfo;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const task_flavor_t flavor = TASK_BASIC_INFO;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ mach_msg_type_number_t out_count = TASK_BASIC_INFO_COUNT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ task_basic_info_data_t taskinfo;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- taskinfo.virtual_size = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- out_count = MACH_TASK_BASIC_INFO_COUNT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- error = task_info(mach_task_self(), MACH_TASK_BASIC_INFO,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ taskinfo.resident_size = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error = task_info(mach_task_self(), flavor,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (task_info_t)&taskinfo, &out_count);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (error != KERN_SUCCESS) return Qnil;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size = ULL2NUM(taskinfo.virtual_size);
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/files/patch-leopard.diff b/lang/ruby24/files/patch-leopard.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index fa349f0..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/ruby24/files/patch-leopard.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,39 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- dir.c.orig 2017-07-02 09:10:28.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ dir.c 2017-07-02 10:18:19.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1516,8 +1516,14 @@ join_path(const char *path, long len, in
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef HAVE_GETATTRLIST
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# if defined HAVE_FGETATTRLIST
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# define is_case_sensitive(dirp, path) is_case_sensitive(dirp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# define is_case_sensitive(dirp, path) is_case_sensitive(path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--is_case_sensitive(DIR *dirp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+is_case_sensitive(DIR *dirp, const char *path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- struct {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- u_int32_t length;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1528,7 +1534,11 @@ is_case_sensitive(DIR *dirp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const int idx = VOL_CAPABILITIES_FORMAT;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const uint32_t mask = VOL_CAP_FMT_CASE_SENSITIVE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+# if defined HAVE_FGETATTRLIST
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!(cap->valid[idx] & mask))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1824,7 +1834,7 @@ glob_helper(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # ifdef HAVE_GETATTRLIST
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (is_case_sensitive(dirp) == 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (is_case_sensitive(dirp, (*path ? path : ".")) == 0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flags |= FNM_CASEFOLD;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- while ((dp = READDIR(dirp, enc)) != NULL) {
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/files/rubygems-2612-ruby24.patch b/lang/ruby24/files/rubygems-2612-ruby24.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index af66e45..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/ruby24/files/rubygems-2612-ruby24.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,437 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems.rb lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 5cd1a4c47a..bc5bf9b4c2 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -10,7 +10,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- require 'thread'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- module Gem
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- VERSION = "2.6.11"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VERSION = "2.6.12"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Must be first since it unloads the prelude from 1.9.2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -234,6 +234,7 @@ def self.needs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def self.finish_resolve(request_set=Gem::RequestSet.new)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- request_set.import Gem::Specification.unresolved_deps.values
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ request_set.import Gem.loaded_specs.values.map {|s| Gem::Dependency.new(s.name, s.version) }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- request_set.resolve_current.each do |s|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- s.full_spec.activate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/commands/open_command.rb lib/rubygems/commands/open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index a89b7421e3..059635e835 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/commands/open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/commands/open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -72,7 +72,7 @@ def open_editor path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def spec_for name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- spec = Gem::Specification.find_all_by_name(name, @version).last
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec = Gem::Specification.find_all_by_name(name, @version).first
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return spec if spec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/commands/query_command.rb lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index f25d120b88..70f8127292 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -86,7 +86,7 @@ def execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name = Array(options[:name])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- args = options[:args].to_a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- name = options[:exact] ? args : args.map{|arg| /#{arg}/i }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ name = options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- prerelease = options[:prerelease]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/commands/sources_command.rb lib/rubygems/commands/sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 9832afd214..7e46963a4c 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/commands/sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/commands/sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -44,7 +44,7 @@ def add_source source_uri # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- source = Gem::Source.new source_uri
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- begin
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if Gem.sources.include? source_uri then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if Gem.sources.include? source then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- say "source #{source_uri} already present in the cache"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- source.load_specs :released
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/dependency_list.rb lib/rubygems/dependency_list.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 35fe7c4c1a..d8314eaf60 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/dependency_list.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/dependency_list.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -104,7 +104,7 @@ def find_name(full_name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def inspect # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "#<%s:0x%x %p>" % [self.class, object_id, map { |s| s.full_name }]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "%s %p>" % [super[0..-2], map { |s| s.full_name }]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/installer.rb lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index f4d3e728de..967543c2d1 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -214,7 +214,7 @@ def check_executable_overwrite filename # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby_executable = true
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- existing = io.read.slice(%r{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ^(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ^\s*(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- gem \s |
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- load \s Gem\.bin_path\( |
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- load \s Gem\.activate_bin_path\(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -701,6 +701,8 @@ def verify_gem_home(unpack = false) # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Return the text for an application file.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def app_script_text(bin_file_name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # note that the `load` lines cannot be indented, as old RG versions match
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # against the beginning of the line
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return <<-TEXT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #{shebang bin_file_name}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -723,7 +725,12 @@ def app_script_text(bin_file_name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+if Gem.respond_to?(:activate_bin_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- load Gem.activate_bin_path('#{spec.name}', '#{bin_file_name}', version)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+gem #{spec.name.dump}, version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+load Gem.bin_path(#{spec.name.dump}, #{bin_file_name.dump}, version)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TEXT
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/platform.rb lib/rubygems/platform.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index d22d91ae54..2dd9ed5782 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/platform.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/platform.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -112,7 +112,7 @@ def initialize(arch)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def inspect
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "#<%s:0x%x @cpu=%p, @os=%p, @version=%p>" % [self.class, object_id, *to_a]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "%s @cpu=%p, @os=%p, @version=%p>" % [super[0..-2], *to_a]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def to_a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/security.rb lib/rubygems/security.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 119d6d56f7..6963ca156f 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/security.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/security.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -455,7 +455,7 @@ def self.create_cert_self_signed subject, key, age = ONE_YEAR,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Creates a new key pair of the specified +length+ and +algorithm+. The
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # default is a 2048 bit RSA key.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # default is a 3072 bit RSA key.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def self.create_key length = KEY_LENGTH, algorithm = KEY_ALGORITHM
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- algorithm.new length
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/server.rb lib/rubygems/server.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 81df0e608e..df4eb566d3 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/server.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/server.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -657,7 +657,7 @@ def root(req, res)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "only_one_executable" => true,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "full_name" => "rubygems-#{Gem::VERSION}",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "has_deps" => false,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "homepage" => "http://docs.rubygems.org/",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "homepage" => "http://guides.rubygems.org/",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "name" => 'rubygems',
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "ri_installed" => true,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "summary" => "RubyGems itself",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index a2f289d162..500f0af768 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2105,7 +2105,7 @@ def inspect # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if $DEBUG
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- super
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "#<#{self.class}:0x#{__id__.to_s(16)} #{full_name}>"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "#{super[0..-2]} #{full_name}>"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/test_case.rb lib/rubygems/test_case.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 86b68e1efb..4e48f1eb4c 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/test_case.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/test_case.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -484,7 +484,7 @@ def git_gem name = 'a', version = 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- system @git, 'add', gemspec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- system @git, 'commit', '-a', '-m', 'a non-empty commit message', '--quiet'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- head = Gem::Util.popen('git', 'rev-parse', 'master').strip
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ head = Gem::Util.popen(@git, 'rev-parse', 'master').strip
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return name, git_spec.version, directory, head
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1498,6 +1498,8 @@ def self.key_path key_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- begin
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- gem 'rdoc'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- require 'rdoc'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ require 'rubygems/rdoc'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rescue LoadError, Gem::LoadError
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1514,3 +1516,4 @@ def self.key_path key_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pid = $$
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- END {tmpdirs.each {|dir| Dir.rmdir(dir)} if $$ == pid}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Gem.clear_paths
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+Gem.loaded_specs.clear
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem.rb test/rubygems/test_gem.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index a605f9cdfe..62b36dfd41 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -75,6 +75,29 @@ def test_self_finish_resolve_wtf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_self_finish_resolve_respects_loaded_specs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ save_loaded_features do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ a1 = new_spec "a", "1", "b" => "> 0"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ b1 = new_spec "b", "1", "c" => ">= 1"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ b2 = new_spec "b", "2", "c" => ">= 2"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ c1 = new_spec "c", "1"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ c2 = new_spec "c", "2"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ install_specs c1, c2, b1, b2, a1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ a1.activate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ c1.activate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal %w(a-1 c-1), loaded_spec_names
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal ["b (> 0)"], unresolved_names
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Gem.finish_resolve
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal %w(a-1 b-1 c-1), loaded_spec_names
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal [], unresolved_names
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_self_install
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- spec_fetcher do |f|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- f.gem 'a', 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -492,7 +515,7 @@ def test_self_find_files_with_gemfile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- skip if RUBY_VERSION <= "1.8.7"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cwd = File.expand_path("test/rubygems", @@project_dir)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- $LOAD_PATH.unshift cwd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ actual_load_path = $LOAD_PATH.unshift(cwd).dup
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- discover_path = File.join 'lib', 'sff', 'discover.rb'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -518,12 +541,12 @@ def test_self_find_files_with_gemfile
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- expected = [
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- File.expand_path('test/rubygems/sff/discover.rb', @@project_dir),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- File.join(foo1.full_gem_path, discover_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ].sort
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- assert_equal expected, Gem.find_files('sff/discover')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- assert_equal expected, Gem.find_files('sff/**.rb'), '[ruby-core:31730]'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, Gem.find_files('sff/discover').sort
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, Gem.find_files('sff/**.rb').sort, '[ruby-core:31730]'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ensure
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- assert_equal cwd, $LOAD_PATH.shift unless RUBY_VERSION <= "1.8.7"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal cwd, actual_load_path.shift unless RUBY_VERSION <= "1.8.7"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_self_find_latest_files
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_commands_open_command.rb test/rubygems/test_gem_commands_open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 3ec38972e6..a96fa6ea23 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_commands_open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_commands_open_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -24,7 +24,8 @@ def test_execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- @cmd.options[:args] = %w[foo]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- @cmd.options[:editor] = "#{Gem.ruby} -e0 --"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- spec = gem 'foo'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ gem 'foo', '1.0.0'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec = gem 'foo', '1.0.1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mock = MiniTest::Mock.new
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mock.expect(:call, true, [spec.full_gem_path])
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_commands_query_command.rb test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 223f205b2d..d8d682b136 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -642,7 +642,7 @@ def test_execute_local_details
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- def test_execute_exact
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_exact_remote
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- spec_fetcher do |fetcher|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fetcher.spec 'coolgem-omg', 3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fetcher.spec 'coolgem', '4.2.1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -665,6 +665,60 @@ def test_execute_exact
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_exact_local
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec_fetcher do |fetcher|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'coolgem-omg', 3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'coolgem', '4.2.1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'wow_coolgem', 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %w[--exact coolgem]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+*** LOCAL GEMS ***
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+coolgem (4.2.1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_exact_multiple
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec_fetcher do |fetcher|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'coolgem-omg', 3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'coolgem', '4.2.1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'wow_coolgem', 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'othergem-omg', 3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'othergem', '1.2.3'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'wow_othergem', 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %w[--exact coolgem othergem]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+*** LOCAL GEMS ***
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+coolgem (4.2.1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+*** LOCAL GEMS ***
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+othergem (1.2.3)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- private
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def add_gems_to_fetcher
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_commands_sources_command.rb test/rubygems/test_gem_commands_sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 014b4b4c12..d5b6d99419 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_commands_sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_commands_sources_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,6 +108,58 @@ def test_execute_add_redundant_source
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_add_redundant_source_trailing_slash
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Remove pre-existing gem source (w/ slash)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ repo_with_slash = "http://gems.example.com/"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %W[--remove #{repo_with_slash}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ source = Gem::Source.new repo_with_slash
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal false, Gem.sources.include?(source)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#{repo_with_slash} removed from sources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Re-add pre-existing gem source (w/o slash)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ repo_without_slash = "http://gems.example.com"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %W[--add #{repo_without_slash}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ source = Gem::Source.new repo_without_slash
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal true, Gem.sources.include?(source)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+http://gems.example.com/ removed from sources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+http://gems.example.com added to sources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Re-add original gem source (w/ slash)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %W[--add #{repo_with_slash}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ source = Gem::Source.new repo_with_slash
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal true, Gem.sources.include?(source)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+http://gems.example.com/ removed from sources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+http://gems.example.com added to sources
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+source http://gems.example.com/ already present in the cache
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_execute_add_http_rubygems_org
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- http_rubygems_org = 'http://rubygems.org'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_installer.rb test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 6ceb2c6dfc..882981d344 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -62,7 +62,12 @@ def test_app_script_text
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+if Gem.respond_to?(:activate_bin_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- load Gem.activate_bin_path('a', 'executable', version)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+gem "a", version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+load Gem.bin_path("a", "executable", version)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- wrapper = @installer.app_script_text 'executable'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_require.rb test/rubygems/test_require.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index dd606e44d4..936f78fb2a 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_require.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_require.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -301,6 +301,17 @@ def test_default_gem_only
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal %w(default-2.0.0.0), loaded_spec_names
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_realworld_default_gem
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ skip "no default gems on ruby < 2.0" unless RUBY_VERSION >= "2"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cmd = <<-RUBY
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ $stderr = $stdout
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ require "json"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ puts Gem.loaded_specs["json"].default_gem?
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ RUBY
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ output = Gem::Util.popen(Gem.ruby, "-e", cmd).strip
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "true", output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_default_gem_and_normal_gem
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default_gem_spec = new_default_spec("default", "2.0.0.0",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- nil, "default/gem.rb")
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/ruby24/files/rubygems-2613-ruby24.patch b/lang/ruby24/files/rubygems-2613-ruby24.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 5b7a547..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/ruby24/files/rubygems-2613-ruby24.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,355 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems.rb lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index bc5bf9b4c2..55aa85b8b2 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -10,7 +10,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- require 'thread'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- module Gem
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- VERSION = "2.6.12"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VERSION = "2.6.13"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Must be first since it unloads the prelude from 1.9.2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/commands/query_command.rb lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 70f8127292..44144203e0 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/commands/query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -226,7 +226,7 @@ def output_versions output, versions
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- output << make_entry(matching_tuples, platforms)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ output << clean_text(make_entry(matching_tuples, platforms))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -353,7 +353,8 @@ def spec_platforms entry, platforms
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def spec_summary entry, spec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- entry << "\n\n" << format_text(spec.summary, 68, 4)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ summary = truncate_text(spec.summary, "the summary for #{spec.full_name}")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ entry << "\n\n" << format_text(summary, 68, 4)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/installer.rb lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 967543c2d1..6fd3399dd4 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -697,6 +697,11 @@ def verify_gem_home(unpack = false) # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unpack or File.writable?(gem_home)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def verify_spec_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return if spec.name =~ Gem::Specification::VALID_NAME_PATTERN
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ raise Gem::InstallError, "#{spec} has an invalid name"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Return the text for an application file.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -823,6 +828,8 @@ def pre_install_checks
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ensure_loadable_spec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ verify_spec_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if options[:install_as_default]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Gem.ensure_default_gem_subdirectories gem_home
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/remote_fetcher.rb lib/rubygems/remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index e6a13d4b8c..8f0cf0b402 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -110,7 +110,7 @@ def api_endpoint(uri)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- target = res.target.to_s.strip
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if /\.#{Regexp.quote(host)}\z/ =~ target
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if URI("http://" + target).host.end_with?(".#{host}")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return URI.parse "#{uri.scheme}://#{target}#{uri.path}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 500f0af768..88e320c05a 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,6 +108,8 @@ class Gem::Specification < Gem::BasicSpecification
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- private_constant :LOAD_CACHE if defined? private_constant
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # :startdoc:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2671,9 +2673,15 @@ def validate packaging = true
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- unless String === name then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if !name.is_a?(String) then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- raise Gem::InvalidSpecificationException,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- "invalid value for attribute name: \"#{name.inspect}\""
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "invalid value for attribute name: \"#{name.inspect}\" must be a string"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ elsif name !~ /[a-zA-Z]/ then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ raise Gem::InvalidSpecificationException,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "invalid value for attribute name: #{name.dump} must include at least one letter"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ elsif name !~ VALID_NAME_PATTERN then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ raise Gem::InvalidSpecificationException,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if raw_require_paths.empty? then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib/rubygems/text.rb lib/rubygems/text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 732f1b99f2..b944b62c27 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib/rubygems/text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib/rubygems/text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6,13 +6,26 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- module Gem::Text
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # Remove any non-printable characters and make the text suitable for
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ # printing.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def clean_text(text)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".".freeze)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def truncate_text(text, description, max_length = 100_000)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ raise ArgumentError, "max_length must be positive" unless max_length > 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return text if text.size <= max_length
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "Truncating #{description} to #{max_length.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse} characters:\n" + text[0, max_length]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ##
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Wraps +text+ to +wrap+ characters and optionally indents by +indent+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # characters
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def format_text(text, wrap, indent=0)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- result = []
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- work = text.dup
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ work = clean_text(text)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- while work.length > wrap do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if work =~ /^(.{0,#{wrap}})[ \n]/ then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_commands_query_command.rb test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index d8d682b136..469223c6c0 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_commands_query_command.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -116,6 +116,86 @@ def test_execute_details
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- This is a lot of text. This is a lot of text. This is a lot of text.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- This is a lot of text.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+pl (1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Platform: i386-linux
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Author: A User
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Homepage: http://example.com
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this is a summary
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_details_cleans_text
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec_fetcher do |fetcher|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'a', 2 do |s|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.summary = 'This is a lot of text. ' * 4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.authors = ["Abraham Lincoln \x01", "\x02 Hirohito"]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.homepage = "http://a.example.com/\x03"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.legacy_platform
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %w[-r -d]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+*** REMOTE GEMS ***
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+a (2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Authors: Abraham Lincoln ., . Hirohito
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Homepage: http://a.example.com/.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ This is a lot of text. This is a lot of text. This is a lot of text.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ This is a lot of text.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+pl (1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Platform: i386-linux
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Author: A User
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Homepage: http://example.com
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this is a summary
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal expected, @ui.output
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '', @ui.error
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_execute_details_truncates_summary
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec_fetcher do |fetcher|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.spec 'a', 2 do |s|
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.summary = 'This is a lot of text. ' * 10_000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.authors = ["Abraham Lincoln \x01", "\x02 Hirohito"]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s.homepage = "http://a.example.com/\x03"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetcher.legacy_platform
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.handle_options %w[-r -d]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @cmd.execute
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ expected = <<-EOF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+*** REMOTE GEMS ***
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+a (2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Authors: Abraham Lincoln ., . Hirohito
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Homepage: http://a.example.com/.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Truncating the summary for a-2 to 100,000 characters:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#{" This is a lot of text. This is a lot of text. This is a lot of text.\n" * 1449} This is a lot of te
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pl (1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Platform: i386-linux
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Author: A User
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_installer.rb test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 882981d344..dd049214fb 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_installer.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1448,6 +1448,26 @@ def test_pre_install_checks_wrong_rubygems_version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_pre_install_checks_malicious_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ spec = util_spec '../malicious', '1'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def spec.full_name # so the spec is buildable
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "malicious-1"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def spec.validate; end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ util_build_gem spec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ gem = File.join(@gemhome, 'cache', spec.file_name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ use_ui @ui do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @installer = Gem::Installer.at gem
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InstallError do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @installer.pre_install_checks
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal '#<Gem::Specification name=../malicious version=1> has an invalid name', e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_shebang
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- util_make_exec @spec, "#!/usr/bin/ruby"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_remote_fetcher.rb test/rubygems/test_gem_remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index cb994462cd..fbb7d89019 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_remote_fetcher.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -241,6 +241,21 @@ def test_api_endpoint_ignores_trans_domain_values_that_end_with_original
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- dns.verify
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_api_endpoint_ignores_trans_domain_values_that_end_with_original_in_path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uri = URI.parse "http://example.com/foo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ target = MiniTest::Mock.new
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ target.expect :target, "evil.com/a.example.com"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ dns = MiniTest::Mock.new
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ dns.expect :getresource, target, [String, Object]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ fetch = Gem::RemoteFetcher.new nil, dns
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal URI.parse("http://example.com/foo"), fetch.api_endpoint(uri)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ target.verify
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ dns.verify
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_api_endpoint_timeout_warning
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uri = URI.parse "http://gems.example.com/foo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_specification.rb test/rubygems/test_gem_specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index d43289d745..0fcc11e78f 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_specification.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2985,7 +2985,37 @@ def test_validate_name
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- assert_equal 'invalid value for attribute name: ":json"', e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal 'invalid value for attribute name: ":json" must be a string', e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.name = []
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InvalidSpecificationException do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "invalid value for attribute name: \"[]\" must be a string", e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.name = ""
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InvalidSpecificationException do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "invalid value for attribute name: \"\" must include at least one letter", e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.name = "12345"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InvalidSpecificationException do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "invalid value for attribute name: \"12345\" must include at least one letter", e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.name = "../malicious"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InvalidSpecificationException do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "invalid value for attribute name: \"../malicious\" can only include letters, numbers, dashes, and underscores", e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.name = "\ba\t"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ e = assert_raises Gem::InvalidSpecificationException do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ @a1.validate
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "invalid value for attribute name: \"\\ba\\t\" can only include letters, numbers, dashes, and underscores", e.message
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_validate_non_nil
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git test/rubygems/test_gem_text.rb test/rubygems/test_gem_text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index a6e22e04da..04f3f605e8 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- test/rubygems/test_gem_text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ test/rubygems/test_gem_text.rb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -36,6 +36,10 @@ def test_format_text_trailing # for two spaces after .
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal expected, format_text(text, 78)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_format_removes_nonprintable_characters
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "text with weird .. stuff .", format_text("text with weird \x1b\x02 stuff \x7f", 40)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- def test_min3
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal 1, min3(1, 1, 1)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal 1, min3(1, 1, 2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -74,4 +78,11 @@ def test_levenshtein_distance_replace
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal 7, levenshtein_distance("xxxxxxx", "ZenTest")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- assert_equal 7, levenshtein_distance("zentest", "xxxxxxx")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ def test_truncate_text
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "abc", truncate_text("abc", "desc")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "Truncating desc to 2 characters:\nab", truncate_text("abc", "desc", 2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ s = "ab" * 500_001
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ assert_equal "Truncating desc to 1,000,000 characters:\n#{s[0, 1_000_000]}", truncate_text(s, "desc", 1_000_000)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ end
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- end
</span></pre><pre style='margin:0'>
</pre>