Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
b18f8b9d
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b18f8b9d
编写于
9月 29, 2016
作者:
A
Akira Matsuda
提交者:
GitHub
9月 29, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #26402 from mtsmfm/remove-dead-constants
Remove dead constants
上级
29f88364
293cdece
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
30 deletion
+0
-30
activesupport/lib/active_support/multibyte/unicode.rb
activesupport/lib/active_support/multibyte/unicode.rb
+0
-30
未找到文件。
activesupport/lib/active_support/multibyte/unicode.rb
浏览文件 @
b18f8b9d
...
...
@@ -30,36 +30,6 @@ module Unicode
HANGUL_NCOUNT
=
HANGUL_VCOUNT
*
HANGUL_TCOUNT
HANGUL_SCOUNT
=
11172
HANGUL_SLAST
=
HANGUL_SBASE
+
HANGUL_SCOUNT
HANGUL_JAMO_FIRST
=
0x1100
HANGUL_JAMO_LAST
=
0x11FF
# All the unicode whitespace
WHITESPACE
=
[
(
0x0009
..
0x000D
).
to_a
,
# White_Space # Cc [5] <control-0009>..<control-000D>
0x0020
,
# White_Space # Zs SPACE
0x0085
,
# White_Space # Cc <control-0085>
0x00A0
,
# White_Space # Zs NO-BREAK SPACE
0x1680
,
# White_Space # Zs OGHAM SPACE MARK
(
0x2000
..
0x200A
).
to_a
,
# White_Space # Zs [11] EN QUAD..HAIR SPACE
0x2028
,
# White_Space # Zl LINE SEPARATOR
0x2029
,
# White_Space # Zp PARAGRAPH SEPARATOR
0x202F
,
# White_Space # Zs NARROW NO-BREAK SPACE
0x205F
,
# White_Space # Zs MEDIUM MATHEMATICAL SPACE
0x3000
,
# White_Space # Zs IDEOGRAPHIC SPACE
].
flatten
.
freeze
# BOM (byte order mark) can also be seen as whitespace, it's a
# non-rendering character used to distinguish between little and big
# endian. This is not an issue in utf-8, so it must be ignored.
LEADERS_AND_TRAILERS
=
WHITESPACE
+
[
65279
]
# ZERO-WIDTH NO-BREAK SPACE aka BOM
# Returns a regular expression pattern that matches the passed Unicode
# codepoints.
def
self
.
codepoints_to_pattern
(
array_of_codepoints
)
#:nodoc:
array_of_codepoints
.
collect
{
|
e
|
[
e
].
pack
"U*"
.
freeze
}.
join
(
"|"
.
freeze
)
end
TRAILERS_PAT
=
/(
#{
codepoints_to_pattern
(
LEADERS_AND_TRAILERS
)
}
)+\Z/u
LEADERS_PAT
=
/\A(
#{
codepoints_to_pattern
(
LEADERS_AND_TRAILERS
)
}
)+/u
# Detect whether the codepoint is in a certain character class. Returns
# +true+ when it's in the specified character class and +false+ otherwise.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录