aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/rubygems/source_index.rb2
-rw-r--r--lib/rubygems/validator.rb6
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e8c8d7ae9..fbbdf160d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Wed Dec 30 14:13:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Dec 30 17:45:53 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rubygems/source_index.rb (Gem#load_specification): don't use
+ RUBY_VERSION to branch.
+
+ * lib/rubygems/validator.rb (Gem::TestRunner, Gem#alien): ditto.
* lib/rubygems.rb: Kernel#gem is already defined, and workaround
for home directory and custom_require are no longer needed.
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb
index d033fd40fe..8caf7b2e35 100644
--- a/lib/rubygems/source_index.rb
+++ b/lib/rubygems/source_index.rb
@@ -85,7 +85,7 @@ class Gem::SourceIndex
def load_specification(file_name)
return nil unless file_name and File.exist? file_name
- spec_code = if RUBY_VERSION < '1.9' then
+ spec_code = if !defined?(Encoding) then
File.read file_name
else
File.read file_name, :encoding => 'UTF-8'
diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb
index f568227b9a..c8384f1586 100644
--- a/lib/rubygems/validator.rb
+++ b/lib/rubygems/validator.rb
@@ -167,6 +167,7 @@ class Gem::Validator
errors
end
+=begin
if RUBY_VERSION < '1.9' then
class TestRunner
def initialize(suite, ui)
@@ -194,6 +195,7 @@ class Gem::Validator
autoload :TestRunner, 'test/unit/ui/testrunnerutilities'
end
+=end
##
# Runs unit tests for a given gem specification
@@ -214,6 +216,7 @@ class Gem::Validator
test_files.each do |f| require f end
+=begin
if RUBY_VERSION < '1.9' then
suite = Test::Unit::TestSuite.new("#{gem_spec.name}-#{gem_spec.version}")
@@ -228,6 +231,9 @@ class Gem::Validator
result = MiniTest::Unit.new
result.run
end
+=end
+ result = MiniTest::Unit.new
+ result.run
result
ensure