aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/plugins.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-24 00:56:51 +0100
committerXavier Noria <fxn@hashref.com>2010-02-24 00:56:51 +0100
commitcadd5937fe186abf3b4b0964aa9d2d53ae4b609b (patch)
tree99658e710e88dc1893f9172854fba097ae0b5114 /railties/guides/source/plugins.textile
parent17596beb894dfdf8da1dc338a452176d1c58cf38 (diff)
downloadrails-cadd5937fe186abf3b4b0964aa9d2d53ae4b609b.tar.gz
rails-cadd5937fe186abf3b4b0964aa9d2d53ae4b609b.tar.bz2
rails-cadd5937fe186abf3b4b0964aa9d2d53ae4b609b.zip
plugins guide: rewords a paragraph and revises some typography
Diffstat (limited to 'railties/guides/source/plugins.textile')
-rw-r--r--railties/guides/source/plugins.textile10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/guides/source/plugins.textile b/railties/guides/source/plugins.textile
index 71e1a7e3d3..95b06c41a0 100644
--- a/railties/guides/source/plugins.textile
+++ b/railties/guides/source/plugins.textile
@@ -1333,15 +1333,15 @@ yaffle:squawk # Prints out the word 'Yaffle'
You can add as many files as you want in the tasks directory, and if they end in .rake Rails will pick them up.
-Note that tasks from 'vendor/plugins/yaffle/Rakefile' are not available to the main app.
+Note that tasks from +vendor/plugins/yaffle/Rakefile+ are not available to the main app.
-h3. PluginGems
+h3. Plugins as Gems
Turning your rails plugin into a gem is a simple and straightforward task. This section will cover how to turn your plugin into a gem. It will not cover how to distribute that gem.
-Historically rails plugins loaded the plugin's 'init.rb' file. In fact some plugins contain all of their code in that one file. To be compatible with plugins, 'init.rb' was moved to 'rails/init.rb'.
+The initialization file has to be called +rails/init.rb+, the root +init.rb+ file, if any, is ignored by Rails. Also, the name of the plugin now is relevant since +config.gem+ tries to load it. Either name the main file after your gem, or document that users should use the +:lib+ option.
-It's common practice to put any developer-centric rake tasks (such as tests, rdoc and gem package tasks) in 'Rakefile'. A rake task that packages the gem might look like this:
+It's common practice to put any developer-centric rake tasks (such as tests, rdoc and gem package tasks) in +Rakefile+. A rake task that packages the gem might look like this:
* *vendor/plugins/yaffle/Rakefile:*
@@ -1383,7 +1383,7 @@ rake gem
sudo gem install pkg/yaffle-0.0.1.gem
</shell>
-To test this, create a new rails app, add 'config.gem "yaffle"' to environment.rb and all of your plugin's functionality will be available to you.
+To test this, create a new rails app, add +config.gem "yaffle"+ to +config/environment.rb+ and all of your plugin's functionality will be available to you.
h3. RDoc Documentation