summaryrefslogtreecommitdiff
blob: 88f03d10eeedf4b14b1d4e4774f1f04b00dcdf7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
diff --git a/Rakefile b/Rakefile
index 51a7e4e..08592c2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -68,6 +68,8 @@ task :prerelease => [:clobber, :sanity_check, :test, :test_functional]
 
 task :postrelease => [:tag, :publish_docs]
 
+# don't assume it's always defined, as it requires OpenSSL
+if defined? Hoe::RubyForge
 Rake::Task[:release_to_rubyforge].clear_actions
 
 task :release_to_rubyforge do
@@ -76,6 +78,7 @@ task :release_to_rubyforge do
   rf.login
   rf.add_file hoe.rubyforge_name, hoe.rubyforge_name, hoe.version, files.first
 end
+end
 
 pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
 task pkg_dir_path do
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index 7eb755a..6154fac 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -46,6 +46,9 @@ class Gem::ConfigFile
   PLATFORM_DEFAULTS = {}
 
   system_config_path =
+    if Gem.respond_to? :system_config_path
+      Gem::system_config_path
+    else
     begin
       require 'Win32API'
 
@@ -65,6 +68,7 @@ class Gem::ConfigFile
     rescue LoadError
       '/etc'
     end
+    end
 
   SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
 
diff --git a/test/gemutilities.rb b/test/gemutilities.rb
index 63c9510..2c75319 100644
--- a/test/gemutilities.rb
+++ b/test/gemutilities.rb
@@ -469,6 +469,14 @@ Also, a list:
     RUBY_PLATFORM.match('mswin')
   end
 
+  def self.jruby?
+    RUBY_PLATFORM == "java"
+  end
+
+  def jruby?
+    RUBY_PLATFORM == "java"
+  end
+
   # Returns the make command for the current platform. For versions of Ruby
   # built on MS Windows with VC++ or Borland it will return 'nmake'. On all
   # other platforms, including Cygwin, it will return 'make'.
diff --git a/test/test_gem_ext_ext_conf_builder.rb b/test/test_gem_ext_ext_conf_builder.rb
index bc95fb1..c4a778b 100644
--- a/test/test_gem_ext_ext_conf_builder.rb
+++ b/test/test_gem_ext_ext_conf_builder.rb
@@ -14,6 +14,8 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
   end
 
   def test_class_build
+    skip("test_class_build skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_build skipped - nmake not found")
     end
@@ -50,6 +52,8 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
   end
 
   def test_class_build_extconf_fail
+    skip("test_class_build_extconf_fail skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_build_extconf_fail skipped - nmake not found")
     end
@@ -77,6 +81,8 @@ checking for main\(\) in .*?nonexistent/m, error.message)
   end
 
   def test_class_make
+    skip("test_class_make skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     if vc_windows? && !nmake_found?
       skip("test_class_make skipped - nmake not found")
     end
@@ -108,6 +114,8 @@ install:
   end
 
   def test_class_make_no_Makefile
+    skip("test_class_make_no_Makefile skipped - mkmf/extconf not supported on JRuby") if jruby?
+
     error = assert_raises Gem::InstallError do
       Dir.chdir @ext do
         Gem::Ext::ExtConfBuilder.make @ext, ['output']
diff --git a/test/test_gem_remote_fetcher.rb b/test/test_gem_remote_fetcher.rb
index 570d2b4..c94112b 100644
--- a/test/test_gem_remote_fetcher.rb
+++ b/test/test_gem_remote_fetcher.rb
@@ -695,7 +695,6 @@ gems:
     private
 
     def start_server(port, data)
-      Thread.new do
         begin
           null_logger = NilLog.new
           s = WEBrick::HTTPServer.new(
@@ -726,7 +725,9 @@ gems:
               res['Content-Type'] = 'text/html'
             end
           }
+        Thread.new do
           s.start
+        end
         rescue Exception => ex
           abort ex.message
           puts "ERROR during server thread: #{ex.message}"
@@ -734,7 +735,6 @@ gems:
       end
       sleep 0.2                 # Give the servers time to startup
     end
-  end
 
 end