Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
b9888373
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,体验更适合开发者的 AI 搜索 >>
提交
b9888373
编写于
12月 03, 2013
作者:
C
Charlie Somerville
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
load definitions from a marshalled file
上级
890aff3b
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
182 addition
and
121 deletion
+182
-121
activesupport/build_marshalled_tzinfo_data.rb
activesupport/build_marshalled_tzinfo_data.rb
+30
-0
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb
...support/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb
+4
-3
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.dump
...tive_support/vendor/tzinfo-0.3.12/tzinfo/definitions.dump
+0
-0
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.rb
...active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.rb
+30
-0
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb
...ib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb
+118
-118
未找到文件。
activesupport/build_marshalled_tzinfo_data.rb
0 → 100644
浏览文件 @
b9888373
#!/usr/bin/env ruby
Dir
.
chdir
(
File
.
expand_path
(
".."
,
__FILE__
))
$:
<<
File
.
expand_path
(
"../lib"
,
__FILE__
)
require
"active_support"
ActiveSupport
::
TimeZone
.
all
def
flatten_constants
(
mod
,
ary
=
[])
ary
<<
mod
mod
.
constants
.
each
do
|
const
|
flatten_constants
(
mod
.
const_get
(
const
),
ary
)
end
ary
end
defns
=
flatten_constants
(
TZInfo
::
Definitions
).
select
{
|
mod
|
defined?
(
mod
.
get
)
}.
map
{
|
tz
|
tz
.
get
}
file
=
"lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.dump"
data
=
Marshal
.
dump
(
defns
)
Marshal
.
load
(
data
)
File
.
open
(
file
,
"wb"
)
do
|
f
|
require
"pry"
pry
binding
f
.
write
(
data
)
end
puts
"Wrote
#{
data
.
size
}
bytes to
#{
file
}
"
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb
浏览文件 @
b9888373
#--
# Copyright (c) 2005-2006 Philip Ross
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
...
...
@@ -30,4 +30,5 @@
# require 'tzinfo/tzdataparser'
# require 'tzinfo/timezone_proxy'
require
'tzinfo/data_timezone'
require
'tzinfo/linked_timezone'
\ No newline at end of file
require
'tzinfo/linked_timezone'
require
'tzinfo/definitions'
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.dump
0 → 100644
浏览文件 @
b9888373
文件已添加
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions.rb
0 → 100644
浏览文件 @
b9888373
require
"tzinfo/data_timezone_info"
require
"tzinfo/linked_timezone_info"
require
"tzinfo/timezone_definition"
module
TZInfo
module
Definitions
def
self
.
load_all!
return
true
if
@loaded
@loaded
=
true
defns
=
Marshal
.
load
(
File
.
read
(
File
.
expand_path
(
"../definitions.dump"
,
__FILE__
)))
defns
.
each
do
|
defn
|
tz_mod
=
defn
.
instance_variable_get
(
:@identifier
).
split
(
"/"
).
reduce
(
TZInfo
::
Definitions
)
{
|
mod
,
name
|
if
mod
.
const_defined?
(
name
)
mod
.
const_get
(
name
)
else
mod
.
const_set
(
name
,
Module
.
new
)
end
}
def
tz_mod
.
get
@timezone
end
tz_mod
.
instance_variable_set
(
:@timezone
,
defn
)
end
end
end
end
activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb
浏览文件 @
b9888373
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录