Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
542946a0
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,发现更多精彩内容 >>
提交
542946a0
编写于
4月 06, 2010
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update the documentation for Engine and Railtie.
上级
3b53468a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
29 deletion
+7
-29
railties/lib/rails/engine.rb
railties/lib/rails/engine.rb
+4
-4
railties/lib/rails/railtie.rb
railties/lib/rails/railtie.rb
+3
-25
未找到文件。
railties/lib/rails/engine.rb
浏览文件 @
542946a0
...
...
@@ -20,7 +20,6 @@ module Rails
# # lib/my_engine.rb
# module MyEngine
# class Engine < Rails::Engine
# engine_name :my_engine
# end
# end
#
...
...
@@ -38,11 +37,12 @@ module Rails
# Example:
#
# class MyEngine < Rails::Engine
# # config.middleware is shared configururation
# config.middleware.use MyEngine::Middleware
#
# # Add a load path for this specific Engine
# config.load_paths << File.expand_path("../lib/some/path", __FILE__)
#
# initializer "my_engine.add_middleware" do |app|
# app.middlewares.use MyEngine::Middleware
# end
# end
#
# == Paths
...
...
railties/lib/rails/railtie.rb
浏览文件 @
542946a0
...
...
@@ -39,7 +39,6 @@ module Rails
# # lib/my_gem/railtie.rb
# module MyGem
# class Railtie < Rails::Railtie
# railtie_name :mygem
# end
# end
#
...
...
@@ -51,24 +50,8 @@ module Rails
#
# module MyGem
# class Railtie < Rails::Railtie
# railtie_name :mygem
# end
# end
#
# * Make sure your Gem loads the railtie.rb file if Rails is loaded first, an easy
# way to check is by checking for the Rails constant which will exist if Rails
# has started:
#
# # lib/my_gem.rb
# module MyGem
# require 'lib/my_gem/railtie' if defined?(Rails)
# end
#
# * Or instead of doing the require automatically, you can ask your users to require
# it for you in their Gemfile:
#
# # #{USER_RAILS_ROOT}/Gemfile
# gem "my_gem", :require_as => ["my_gem", "my_gem/railtie"]
#
# == Initializers
#
...
...
@@ -82,13 +65,11 @@ module Rails
# end
#
# If specified, the block can also receive the application object, in case you
# need to access some application specific configuration:
# need to access some application specific configuration
, like middleware
:
#
# class MyRailtie < Rails::Railtie
# initializer "my_railtie.configure_rails_initialization" do |app|
# if app.config.cache_classes
# # some initialization behavior
# end
# app.middlewares.use MyRailtie::Middleware
# end
# end
#
...
...
@@ -104,9 +85,6 @@ module Rails
# # Customize the ORM
# config.generators.orm :my_railtie_orm
#
# # Add a middleware
# config.middlewares.use MyRailtie::Middleware
#
# # Add a to_prepare block which is executed once in production
# # and before which request in development
# config.to_prepare do
...
...
@@ -160,7 +138,7 @@ module Rails
# By registering it:
#
# class MyRailtie < Railtie
# subscriber MyRailtie::Subscriber.new
# subscriber
:my_gem,
MyRailtie::Subscriber.new
# end
#
# Take a look in Rails::Subscriber docs for more information.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录