Plugin Tutorial » History » Version 2
Jean-Philippe Lang, 2008-08-08 21:31
| 1 | 1 | Jean-Philippe Lang | h1. Plugin Tutorial |
|---|---|---|---|
| 2 | |||
| 3 | h2. Creating a new Plugin |
||
| 4 | |||
| 5 | Open up a command prompt and "cd" to your redmine directory, then execute the following command: |
||
| 6 | |||
| 7 | % ruby script/generate redmine_plugin pools |
||
| 8 | |||
| 9 | The plugin structure is created in @vendor/plugins/redmine_pools@: |
||
| 10 | |||
| 11 | <pre> |
||
| 12 | create vendor/plugins/redmine_pools/app/controllers |
||
| 13 | create vendor/plugins/redmine_pools/app/helpers |
||
| 14 | create vendor/plugins/redmine_pools/app/models |
||
| 15 | create vendor/plugins/redmine_pools/app/views |
||
| 16 | create vendor/plugins/redmine_pools/db/migrate |
||
| 17 | create vendor/plugins/redmine_pools/lib/tasks |
||
| 18 | create vendor/plugins/redmine_pools/assets/images |
||
| 19 | create vendor/plugins/redmine_pools/assets/javascripts |
||
| 20 | create vendor/plugins/redmine_pools/assets/stylesheets |
||
| 21 | create vendor/plugins/redmine_pools/lang |
||
| 22 | create vendor/plugins/redmine_pools/README |
||
| 23 | create vendor/plugins/redmine_pools/init.rb |
||
| 24 | create vendor/plugins/redmine_pools/lang/en.yml |
||
| 25 | </pre> |
||
| 26 | |||
| 27 | 2 | Jean-Philippe Lang | Edit @vendor/plugins/redmine_pools/init.rb@ too adjust plugin information (name, author, description and version): |
| 28 | 1 | Jean-Philippe Lang | |
| 29 | <pre><code class="ruby"> |
||
| 30 | require 'redmine' |
||
| 31 | |||
| 32 | Redmine::Plugin.register :redmine_pools do |
||
| 33 | name 'Pools plugin' |
||
| 34 | author 'John Smith' |
||
| 35 | description 'A plugin for managing pools' |
||
| 36 | version '0.0.1' |
||
| 37 | end |
||
| 38 | </code></pre> |
||
| 39 | |||
| 40 | 2 | Jean-Philippe Lang | Then restart the application and point your browser to http://localhost:3000/admin/info. |
| 41 | 1 | Jean-Philippe Lang | After logging in, you should see your new plugin in the plugins list: |
| 42 | 2 | Jean-Philippe Lang | |
| 43 | !plugins_list1.png! |
||
| 44 | |||
| 45 | h2. Generating a controller |
||
| 46 | |||
| 47 | TODO |