mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use match?
This commit is contained in:
parent
3a3a3d607e
commit
01b0ccce32
2 changed files with 4 additions and 4 deletions
|
@ -378,7 +378,7 @@ module ActionView
|
||||||
# This regex match does double duty of finding only files which match
|
# This regex match does double duty of finding only files which match
|
||||||
# details (instead of just matching the prefix) and also filtering for
|
# details (instead of just matching the prefix) and also filtering for
|
||||||
# case-insensitive file systems.
|
# case-insensitive file systems.
|
||||||
!filename.match(regex) ||
|
!regex.match?(filename) ||
|
||||||
File.directory?(filename)
|
File.directory?(filename)
|
||||||
end.sort_by do |filename|
|
end.sort_by do |filename|
|
||||||
# Because we scanned the directory, instead of checking for files
|
# Because we scanned the directory, instead of checking for files
|
||||||
|
|
|
@ -98,15 +98,15 @@ module ActiveModel
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_integer?(raw_value)
|
def is_integer?(raw_value)
|
||||||
INTEGER_REGEX === raw_value.to_s
|
INTEGER_REGEX.match? raw_value.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_decimal?(raw_value)
|
def is_decimal?(raw_value)
|
||||||
DECIMAL_REGEX === raw_value.to_s
|
DECIMAL_REGEX.match? raw_value.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_hexadecimal_literal?(raw_value)
|
def is_hexadecimal_literal?(raw_value)
|
||||||
/\A0[xX]/ === raw_value
|
/\A0[xX]/.match? raw_value
|
||||||
end
|
end
|
||||||
|
|
||||||
def filtered_options(value)
|
def filtered_options(value)
|
||||||
|
|
Loading…
Reference in a new issue