Skip to content

Commit 518891f

Browse files
anildigitaljeremy
authored andcommitted
Use correct RUBY_PLATFORM regex for Windows env [rails#4385 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
1 parent 8116a2b commit 518891f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

actionpack/test/controller/layout_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def test_layout_status_is_rendered
209209
end
210210
end
211211

212-
unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
212+
unless RUBY_PLATFORM =~ /mswin|mingw/
213213
class LayoutSymlinkedTest < LayoutTest
214214
layout "symlinked/symlinked_layout"
215215
end

railties/guides/source/initialization.textile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2636,7 +2636,7 @@ The method +find_with_root_flag+ is defined on +Rails::Engine+ (the superclass o
26362636
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
26372637
raise "Could not find root path for #{self}" unless root
26382638

2639-
RUBY_PLATFORM =~ /(:?mswin|mingw)/ ?
2639+
RUBY_PLATFORM =~ /mswin|mingw/ ?
26402640
Pathname.new(root).expand_path : Pathname.new(root).realpath
26412641
end
26422642
</ruby>

railties/lib/rails/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def find_root_with_flag(flag, default=nil)
119119
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
120120
raise "Could not find root path for #{self}" unless root
121121

122-
RUBY_PLATFORM =~ /(:?mswin|mingw)/ ?
122+
RUBY_PLATFORM =~ /mswin|mingw/ ?
123123
Pathname.new(root).expand_path : Pathname.new(root).realpath
124124
end
125125
end

railties/lib/rails/generators/rails/app/app_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def mysql_socket
265265
"/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
266266
"/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5
267267
"/opt/lampp/var/mysql/mysql.sock" # xampp for linux
268-
].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
268+
].find { |f| File.exist?(f) } unless RUBY_PLATFORM =~ /mswin|mingw/
269269
end
270270

271271
def empty_directory_with_gitkeep(destination, config = {})

railties/lib/rails/test_unit/testing.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
module Kernel
3131
def silence_stderr
3232
old_stderr = STDERR.dup
33-
STDERR.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null')
33+
STDERR.reopen(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
3434
STDERR.sync = true
3535
yield
3636
ensure

0 commit comments

Comments
 (0)