提交 518891f4 编写于 作者: A Anil Wadghule 提交者: Jeremy Kemper

Use correct RUBY_PLATFORM regex for Windows env [#4385 state:resolved]

Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
上级 8116a2b9
......@@ -209,7 +209,7 @@ def test_layout_status_is_rendered
end
end
unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
unless RUBY_PLATFORM =~ /mswin|mingw/
class LayoutSymlinkedTest < LayoutTest
layout "symlinked/symlinked_layout"
end
......
......@@ -2636,7 +2636,7 @@ The method +find_with_root_flag+ is defined on +Rails::Engine+ (the superclass o
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
RUBY_PLATFORM =~ /(:?mswin|mingw)/ ?
RUBY_PLATFORM =~ /mswin|mingw/ ?
Pathname.new(root).expand_path : Pathname.new(root).realpath
end
</ruby>
......
......@@ -119,7 +119,7 @@ def find_root_with_flag(flag, default=nil)
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
RUBY_PLATFORM =~ /(:?mswin|mingw)/ ?
RUBY_PLATFORM =~ /mswin|mingw/ ?
Pathname.new(root).expand_path : Pathname.new(root).realpath
end
end
......
......@@ -265,7 +265,7 @@ def mysql_socket
"/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
"/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5
"/opt/lampp/var/mysql/mysql.sock" # xampp for linux
].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /mswin|mingw/
end
def empty_directory_with_gitkeep(destination, config = {})
......
......@@ -30,7 +30,7 @@ end
module Kernel
def silence_stderr
old_stderr = STDERR.dup
STDERR.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null')
STDERR.reopen(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
STDERR.sync = true
yield
ensure
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册