Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
2506e5c9
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,发现更多精彩内容 >>
提交
2506e5c9
编写于
5月 31, 2008
作者:
R
rick
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git@github.com:rails/rails
上级
9c4f0035
f32bceee
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
34 addition
and
19 deletion
+34
-19
actionpack/lib/action_controller/cgi_ext/cookie.rb
actionpack/lib/action_controller/cgi_ext/cookie.rb
+6
-0
activesupport/lib/active_support/multibyte/chars.rb
activesupport/lib/active_support/multibyte/chars.rb
+7
-5
activesupport/lib/active_support/time_with_zone.rb
activesupport/lib/active_support/time_with_zone.rb
+4
-4
railties/environments/environment.rb
railties/environments/environment.rb
+1
-4
railties/lib/commands/dbconsole.rb
railties/lib/commands/dbconsole.rb
+11
-3
railties/lib/rails_generator/commands.rb
railties/lib/rails_generator/commands.rb
+5
-3
未找到文件。
actionpack/lib/action_controller/cgi_ext/cookie.rb
浏览文件 @
2506e5c9
...
...
@@ -78,6 +78,12 @@ def to_s
buf
end
# FIXME: work around broken 1.8.7 DelegateClass#respond_to?
def
respond_to?
(
method
,
include_private
=
false
)
return
true
if
super
(
method
)
return
__getobj__
.
respond_to?
(
method
,
include_private
)
end
# Parses a raw cookie string into a hash of <tt>cookie-name => cookie-object</tt>
# pairs.
#
...
...
activesupport/lib/active_support/multibyte/chars.rb
浏览文件 @
2506e5c9
...
...
@@ -40,13 +40,15 @@ def to_str
# core dumps. Don't go there.
@string
end
# Make duck-typing with String possible
def
respond_to?
(
method
)
super
||
@string
.
respond_to?
(
method
)
||
handler
.
respond_to?
(
method
)
||
(
method
.
to_s
=~
/(.*)!/
&&
handler
.
respond_to?
(
$1
))
||
false
def
respond_to?
(
method
,
include_priv
=
false
)
super
||
@string
.
respond_to?
(
method
,
include_priv
)
||
handler
.
respond_to?
(
method
,
include_priv
)
||
(
method
.
to_s
=~
/(.*)!/
&&
handler
.
respond_to?
(
$1
,
include_priv
))
||
false
end
# Create a new Chars instance.
def
initialize
(
str
)
@string
=
str
.
respond_to?
(
:string
)
?
str
.
string
:
str
...
...
activesupport/lib/active_support/time_with_zone.rb
浏览文件 @
2506e5c9
...
...
@@ -248,14 +248,14 @@ def marshal_dump
def
marshal_load
(
variables
)
initialize
(
variables
[
0
],
::
Time
.
send!
(
:get_zone
,
variables
[
1
]),
variables
[
2
])
end
# Ensure proxy class responds to all methods that underlying time instance responds to.
def
respond_to?
(
sym
)
def
respond_to?
(
sym
,
include_priv
=
false
)
# consistently respond false to acts_like?(:date), regardless of whether #time is a Time or DateTime
return
false
if
sym
.
to_s
==
'acts_like_date?'
super
||
time
.
respond_to?
(
sym
)
super
||
time
.
respond_to?
(
sym
,
include_priv
)
end
# Send the missing method to +time+ instance, and wrap result in a new TimeWithZone with the existing +time_zone+.
def
method_missing
(
sym
,
*
args
,
&
block
)
result
=
time
.
__send__
(
sym
,
*
args
,
&
block
)
...
...
railties/environments/environment.rb
浏览文件 @
2506e5c9
...
...
@@ -64,7 +64,4 @@
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector
# Make ActiveRecord only save the attributes that have changed since the record was loaded.
# config.active_record.partial_updates = true
end
\ No newline at end of file
end
railties/lib/commands/dbconsole.rb
浏览文件 @
2506e5c9
...
...
@@ -2,8 +2,13 @@
require
'yaml'
require
'optparse'
include_password
=
false
OptionParser
.
new
do
|
opt
|
opt
.
banner
=
"Usage: dbconsole [environment]"
opt
.
banner
=
"Usage: dbconsole [options] [environment]"
opt
.
on
(
"-p"
,
"--include-password"
,
"Automatically provide the database from database.yml"
)
do
|
v
|
include_password
=
true
end
opt
.
parse!
(
ARGV
)
abort
opt
.
to_s
unless
(
0
..
1
).
include?
(
ARGV
.
size
)
end
...
...
@@ -31,10 +36,13 @@ def find_cmd(*commands)
'port'
=>
'--port'
,
'socket'
=>
'--socket'
,
'username'
=>
'--user'
,
'password'
=>
'--password'
,
'encoding'
=>
'--default-character-set'
}.
map
{
|
opt
,
arg
|
"
#{
arg
}
=
#{
config
[
opt
]
}
"
if
config
[
opt
]
}.
compact
if
config
[
'password'
]
&&
include_password
args
<<
"--password=
#{
config
[
'password'
]
}
"
end
args
<<
config
[
'database'
]
exec
(
find_cmd
(
'mysql5'
,
'mysql'
),
*
args
)
...
...
@@ -43,7 +51,7 @@ def find_cmd(*commands)
ENV
[
'PGUSER'
]
=
config
[
"username"
]
if
config
[
"username"
]
ENV
[
'PGHOST'
]
=
config
[
"host"
]
if
config
[
"host"
]
ENV
[
'PGPORT'
]
=
config
[
"port"
].
to_s
if
config
[
"port"
]
ENV
[
'PGPASSWORD'
]
=
config
[
"password"
].
to_s
if
config
[
"password"
]
ENV
[
'PGPASSWORD'
]
=
config
[
"password"
].
to_s
if
config
[
"password"
]
&&
include_password
exec
(
find_cmd
(
'psql'
),
config
[
"database"
])
when
"sqlite"
...
...
railties/lib/rails_generator/commands.rb
浏览文件 @
2506e5c9
...
...
@@ -380,12 +380,14 @@ def render_file(path, options = {})
# Thanks to Florian Gross (flgr).
def
raise_class_collision
(
class_name
)
message
=
<<
end_message
The name '
#{
class_name
}
' is reserved by Ruby on Rails.
The name '
#{
class_name
}
' is
either already used in your application or
reserved by Ruby on Rails.
Please choose an alternative and run this generator again.
end_message
if
suggest
=
find_synonyms
(
class_name
)
message
<<
"
\n
Suggestions:
\n\n
"
message
<<
suggest
.
join
(
"
\n
"
)
if
suggest
.
any?
message
<<
"
\n
Suggestions:
\n\n
"
message
<<
suggest
.
join
(
"
\n
"
)
end
end
raise
UsageError
,
message
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录