forked from carlosbrando/rails21-book
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tradotta parte rimanente (cap. 08 Railties).
- Loading branch information
1 parent
9a0f748
commit 9521648
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
##Ottenere informazioni su un plugin | ||
|
||
This is one of the new Rails 2.0 features which you probably never used. I say "probably", because in some very specific cases it can be useful, for example, to know a plugin version. | ||
Questa è una delle novità di Rails 2.1 che probabilmente non avete mai utilizzato. Dico "probabilmente" perché in alcuni casi molto specifici può essere utile, ad esempio, conoscere la versione di un plugin. | ||
|
||
To test it, we need to create a new file called *about.yml* in the plugin directory, something like this: | ||
Per testarlo, occorre creare un nuovo file chiamato *about.yml* nella directory plgin, contenente qualcosa del genere: | ||
|
||
author: Carlos Brando | ||
version: 1.2.0 | ||
description: A description about the plugin | ||
url: http://www.nomedojogo.com | ||
|
||
We can get this information later this way: | ||
Possiamo accedere a queste informazioni così: | ||
|
||
plugin = Rails::Plugin.new(plugin_directory) | ||
plugin.about["author"] # => “Carlos Brando” | ||
plugin.about["url"] # => “http://www.nomedojogo.com” | ||
|
||
If you find some good use for this feature and want to share with me, maybe i can change my mind about its real need. | ||
Se trovate qualche uso utile di questa feature e vorreste condividerla con noi, forse cambieremmo la nostra opinione sulla sua utilità. |