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
# Configuration of SCM executable command.
#
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
# On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
#
# On Windows + JRuby 1.6.2, path which contains spaces does not work.
# For example, "C:\Program Files\TortoiseHg\hg.exe".
# If you want to this feature, you need to install to the path which does not contains spaces.
# For example, "C:\TortoiseHg\hg.exe".
# On Windows, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
#
# Examples:
# scm_subversion_command: svn # (default: svn)
extra/svn/reposman.rb
end
def mswin?
(RUBY_PLATFORM =~ /(:?mswin|mingw)/) || (RUBY_PLATFORM == 'java' && (ENV['OS'] || ENV['os']) =~ /windows/i)
RUBY_PLATFORM =~ /(:?mswin|mingw)/
end
projects.each do |project|
lib/redmine/platform.rb
module Platform
class << self
def mswin?
(/(:?mswin|mingw)/.match?(RUBY_PLATFORM)) ||
(RUBY_PLATFORM == 'java' && /windows/i.match?(ENV['OS'] || ENV['os']))
(/(:?mswin|mingw)/.match?(RUBY_PLATFORM))
end
def osx?
lib/redmine/scm/adapters/abstract_adapter.rb
end
def parse_xml(xml)
if RUBY_PLATFORM == 'java'
xml = xml.sub(%r{<\?xml[^>]*\?>}, '')
end
ActiveSupport::XmlMini.parse(xml)
end
end
lib/redmine/utils/shell.rb
end
def shell_quote_command(command)
if Redmine::Platform.mswin? && RUBY_PLATFORM == 'java'
command
else
shell_quote(command)
end
shell_quote(command)
end
end
end
lib/tasks/ci.rake
end
test_conf = dev_conf.merge('database' => test_db_name)
when /sqlite3/
dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ?
'jdbcsqlite3' : 'sqlite3'),
dev_conf = {'adapter' => 'sqlite3',
'database' => "db/#{dev_db_name}.sqlite3"}
test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
when 'sqlserver'
test/test_helper.rb
# Returns the path to the test +vendor+ repository
def self.repository_path(vendor)
path = Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
# Unlike ruby, JRuby returns Rails.root with backslashes under Windows
path.tr("\\", "/")
Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
end
# Returns the url of the subversion test repository
test/unit/lib/redmine/export/pdf_test.rb
def test_rdm_pdf_iconv_invalid_utf8_should_be_replaced_ja
str1 = "Texte encod\xE9 en ISO-8859-1"
str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test".b
encoding = (RUBY_PLATFORM == 'java' ? "SJIS" : "CP932")
encoding = "CP932"
txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str1, encoding)
txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_from_utf8(str2, encoding)
assert_equal "ASCII-8BIT", txt_1.encoding.to_s
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
class GitAdapterTest < ActiveSupport::TestCase
REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s
## Git, Mercurial and CVS path encodings are binary.
## Subversion supports URL encoding for path.
## Redmine Mercurial adapter and extension use URL encoding.
## Git accepts only binary path in command line parameter.
## So, there is no way to use binary command line parameter in JRuby.
JRUBY_SKIP = (RUBY_PLATFORM == 'java')
JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
if File.directory?(REPOSITORY_PATH)
## Ruby uses ANSI api to fork a process on Windows.
## Japanese Shift_JIS and Traditional Chinese Big5 have 0x5c(backslash) problem
......
def test_revisions_latin_1_identifier
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
revs1 = []
@adapter.revisions(
......
def test_annotate_latin_1_identifier
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
annotate = @adapter.annotate('sources/watchers_controller.rb',
"latin-1-branch-#{@char_1}-02")
......
def test_latin_1_path
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
p2 = "latin-1-dir/test-#{@char_1}-2.txt"
['4fc55c43bf3d3dc2efb66145365ddc17639ce81e', '4fc55c43bf3'].each do |r1|
......
def test_entries_latin_1_dir
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
entries1 = @adapter.entries("latin-1-dir/test-#{@char_1}-subdir",
'1ca7f5ed')
......
def test_entries_latin_1_identifier
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
entries1 = @adapter.entries(nil,
"latin-1-branch-#{@char_1}-02")
......
def test_cat_latin_1_identifier
if WINDOWS_PASS
puts WINDOWS_SKIP_STR
elsif JRUBY_SKIP
puts JRUBY_SKIP_STR
else
assert @adapter.cat('sources/watchers_controller.rb',
"latin-1-branch-#{@char_1}-02")
test/unit/repository_bazaar_test.rb
# On Windows, because it is too hard to change system locale,
# you cannot run Bazaar non ASCII path tests.
#
RUN_LATIN1_OUTPUT_TEST = (RUBY_PLATFORM != 'java' &&
Encoding.locale_charmap == "ISO-8859-1")
RUN_LATIN1_OUTPUT_TEST = (Encoding.locale_charmap == "ISO-8859-1")
CHAR_1_UTF8_HEX = 'Ü'
CHAR_1_LATIN1_HEX = "\xdc".b
    (1-1/1)