Project

General

Profile

Plugin Tutorial » History » Version 1

Jean-Philippe Lang, 2008-08-08 20:33

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
Edit @vendor/plugins/redmine_pools/init.rb@ too adjust plugin information (name, author, description and version).
28
For example:
29
30
<pre><code class="ruby">
31
require 'redmine'
32
33
Redmine::Plugin.register :redmine_pools do
34
  name 'Pools plugin'
35
  author 'John Smith'
36
  description 'A plugin for managing pools'
37
  version '0.0.1'
38
end
39
</code></pre>
40
41
Then start the application and point your browser to http://localhost:3000/admin/info.
42
After logging in, you should see your new plugin in the plugins list: