Project

General

Profile

Patch #44598 » 0001-Remove-leftover-JRuby-specific-code-and-comments.patch

Go MAEDA, 2026-10-12 08:29

View differences:

config/configuration.yml.example
86 86
  # Configuration of SCM executable command.
87 87
  #
88 88
  # Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
89
  # On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
90
  #
91
  # On Windows + JRuby 1.6.2, path which contains spaces does not work.
92
  # For example, "C:\Program Files\TortoiseHg\hg.exe".
93
  # If you want to this feature, you need to install to the path which does not contains spaces.
94
  # For example, "C:\TortoiseHg\hg.exe".
89
  # On Windows, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
95 90
  #
96 91
  # Examples:
97 92
  # scm_subversion_command: svn                                       # (default: svn)
extra/svn/reposman.rb
211 211
end
212 212
def mswin?
213
  (RUBY_PLATFORM =~ /(:?mswin|mingw)/) || (RUBY_PLATFORM == 'java' && (ENV['OS'] || ENV['os']) =~ /windows/i)
213
  RUBY_PLATFORM =~ /(:?mswin|mingw)/
214 214
end
215 215
projects.each do |project|
lib/redmine/platform.rb
21 21
  module Platform
22 22
    class << self
23 23
      def mswin?
24
        (/(:?mswin|mingw)/.match?(RUBY_PLATFORM)) ||
25
           (RUBY_PLATFORM == 'java' && /windows/i.match?(ENV['OS'] || ENV['os']))
24
        (/(:?mswin|mingw)/.match?(RUBY_PLATFORM))
26 25
      end
27 26
      def osx?
lib/redmine/scm/adapters/abstract_adapter.rb
299 299
        end
300 300
        def parse_xml(xml)
301
          if RUBY_PLATFORM == 'java'
302
            xml = xml.sub(%r{<\?xml[^>]*\?>}, '')
303
          end
304 301
          ActiveSupport::XmlMini.parse(xml)
305 302
        end
306 303
      end
lib/redmine/utils/shell.rb
31 31
      end
32 32
      def shell_quote_command(command)
33
        if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java'
34
          command
35
        else
36
          shell_quote(command)
37
        end
33
        shell_quote(command)
38 34
      end
39 35
    end
40 36
  end
lib/tasks/ci.rake
96 96
    end
97 97
    test_conf = dev_conf.merge('database' => test_db_name)
98 98
  when /sqlite3/
99
    dev_conf =  {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ?
100
                                 'jdbcsqlite3' : 'sqlite3'),
99
    dev_conf =  {'adapter' => 'sqlite3',
101 100
                 'database' => "db/#{dev_db_name}.sqlite3"}
102 101
    test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
103 102
  when 'sqlserver'
test/test_helper.rb
197 197
  # Returns the path to the test +vendor+ repository
198 198
  def self.repository_path(vendor)
199
    path = Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
200
    # Unlike ruby, JRuby returns Rails.root with backslashes under Windows
201
    path.tr("\\", "/")
199
    Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
202 200
  end
203 201
  # Returns the url of the subversion test repository
test/unit/lib/redmine/export/pdf_test.rb
56 56
  def test_rdm_pdf_iconv_invalid_utf8_should_be_replaced_ja
57 57
    str1 = "Texte encod\xE9 en ISO-8859-1"
58 58
    str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
59
    encoding = (RUBY_PLATFORM == 'java' ? "SJIS" : "CP932")
59
    encoding = "CP932"
60 60
    txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str1, encoding)
61 61
    txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str2, encoding)
62 62
    assert_equal "ASCII-8BIT", txt_1.encoding.to_s
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
22 22
class GitAdapterTest < ActiveSupport::TestCase
23 23
  REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
24
  ## Git, Mercurial and CVS path encodings are binary.
25
  ## Subversion supports URL encoding for path.
26
  ## Redmine Mercurial adapter and extension use URL encoding.
27
  ## Git accepts only binary path in command line parameter.
28
  ## So, there is no way to use binary command line parameter in JRuby.
29
  JRUBY_SKIP     = (RUBY_PLATFORM == 'java')
30
  JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
31

  
32 24
  if File.directory?(REPOSITORY_PATH)
33 25
    ## Ruby uses ANSI api to fork a process on Windows.
34 26
    ## Japanese Shift_JIS and Traditional Chinese Big5 have 0x5c(backslash) problem
......
260 252
    def test_revisions_latin_1_identifier
261 253
      if WINDOWS_PASS
262 254
        puts WINDOWS_SKIP_STR
263
      elsif JRUBY_SKIP
264
        puts JRUBY_SKIP_STR
265 255
      else
266 256
        revs1 = []
267 257
        @adapter.revisions(
......
452 442
    def test_annotate_latin_1_identifier
453 443
      if WINDOWS_PASS
454 444
        puts WINDOWS_SKIP_STR
455
      elsif JRUBY_SKIP
456
        puts JRUBY_SKIP_STR
457 445
      else
458 446
        annotate = @adapter.annotate('sources/watchers_controller.rb',
459 447
                                     "latin-1-branch-#{@char_1}-02")
......
494 482
    def test_latin_1_path
495 483
      if WINDOWS_PASS
496 484
        puts WINDOWS_SKIP_STR
497
      elsif JRUBY_SKIP
498
        puts JRUBY_SKIP_STR
499 485
      else
500 486
        p2 = "latin-1-dir/test-#{@char_1}-2.txt"
501 487
        ['4fc55c43bf3d3dc2efb66145365ddc17639ce81e', '4fc55c43bf3'].each do |r1|
......
588 574
    def test_entries_latin_1_dir
589 575
      if WINDOWS_PASS
590 576
        puts WINDOWS_SKIP_STR
591
      elsif JRUBY_SKIP
592
        puts JRUBY_SKIP_STR
593 577
      else
594 578
        entries1 = @adapter.entries("latin-1-dir/test-#{@char_1}-subdir",
595 579
                                    '1ca7f5ed')
......
605 589
    def test_entries_latin_1_identifier
606 590
      if WINDOWS_PASS
607 591
        puts WINDOWS_SKIP_STR
608
      elsif JRUBY_SKIP
609
        puts JRUBY_SKIP_STR
610 592
      else
611 593
        entries1 = @adapter.entries(nil,
612 594
                                    "latin-1-branch-#{@char_1}-02")
......
670 652
    def test_cat_latin_1_identifier
671 653
      if WINDOWS_PASS
672 654
        puts WINDOWS_SKIP_STR
673
      elsif JRUBY_SKIP
674
        puts JRUBY_SKIP_STR
675 655
      else
676 656
        assert @adapter.cat('sources/watchers_controller.rb',
677 657
                            "latin-1-branch-#{@char_1}-02")
test/unit/repository_bazaar_test.rb
35 35
  # On Windows, because it is too hard to change system locale,
36 36
  # you cannot run Bazaar non ASCII path tests.
37 37
  #
38
  RUN_LATIN1_OUTPUT_TEST = (RUBY_PLATFORM != 'java' &&
39
                             Encoding.locale_charmap == "ISO-8859-1")
38
  RUN_LATIN1_OUTPUT_TEST = (Encoding.locale_charmap == "ISO-8859-1")
40 39
  CHAR_1_UTF8_HEX   = 'Ü'
41 40
  CHAR_1_LATIN1_HEX = "\xdc".b
    (1-1/1)