public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
slight changes to plugin behavior to account for new changes and fixes

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2673 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Jan 14 01:37:40 -0800 2007
commit  e84992e2c6742351e4d396b4aa997dd90019c3c7
tree    f69599422c81efee3ed39b5231b083e112303798
parent  ad8dc6b6916f4489a3fc22b88913183f5cbb2a16
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ class Admin::PluginsController < Admin::BaseController
0
   before_filter :find_plugin, :except => :index
0
 
0
   def index
0
- @plugins = Mephisto::DirectoryPlugin.scan
0
+ @plugins = DirectoryPlugin.scan
0
   end
0
   
0
   def update
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 
0
 <% content_for :sidebar do %>
0
 <div class="sgroup">
0
-Configurable plugins may include modifiable properties, notation, URL, author, and version information.
0
+Configurable plugins may include modifiable properties, notes, homepage, author, and version information.
0
 </div>
0
 <% end %>
0
 
...
2
3
4
5
 
6
7
8
 
9
10
11
 
12
13
14
15
 
 
16
17
 
18
19
20
...
2
3
4
 
5
6
 
 
7
8
9
 
10
11
12
 
 
13
14
15
 
16
17
18
19
0
@@ -2,19 +2,18 @@
0
 <% content_for :sidebar do %>
0
 <div class="sgroup">
0
   <h3>Errata</h3>
0
- <% if @plugin.respond_to?(:notation) -%>
0
+ <% unless @plugin.notes.blank? -%>
0
     <p><b>Notes</b>:</p>
0
- <br/>
0
- <p> <%= simple_format @plugin.notation %> </p>
0
+ <p> <%= simple_format @plugin.notes %> </p>
0
     <br/>
0
   <% end %>
0
- <% if @plugin.respond_to?(:author) -%>
0
+ <% unless @plugin.author.blank? -%>
0
     <p><b>Author</b>: <%=h @plugin.author %></p>
0
   <% end -%>
0
- <% if @plugin.respond_to?(:url) -%>
0
- <p><b>URL</b>: <a href="<%= @plugin.url %>"><%= @plugin.url %></a> </p>
0
+ <% unless @plugin.homepage.blank? -%>
0
+ <p><b>Homepage</b>: <a href="<%= @plugin.homepage %>"><%= @plugin.homepage %></a> </p>
0
   <% end -%>
0
- <% if @plugin.respond_to?(:version) -%>
0
+ <% unless @plugin.version.blank? -%>
0
     <p><b>Ver.</b>: <%= @plugin.version %> </p>
0
   <% end -%>
0
 </div>
...
10
11
12
13
 
14
15
 
16
17
18
...
80
81
82
83
 
84
85
86
87
88
 
89
90
91
...
142
143
144
145
 
146
147
148
...
177
178
179
180
 
181
182
183
...
10
11
12
 
13
14
 
15
16
17
18
...
80
81
82
 
83
84
85
86
87
 
88
89
90
91
...
142
143
144
 
145
146
147
148
...
177
178
179
 
180
181
182
183
0
@@ -10,9 +10,9 @@ class MephistoPlugin < ActiveRecord::Base
0
 
0
   class << self
0
     expiring_attr_reader :plugin_name, 'name.demodulize.underscore'
0
- expiring_attr_reader :plugin_path, "RAILS_PATH + 'vendor/plugins' + plugin_name"
0
+ expiring_attr_reader :plugin_path, "RAILS_PATH + 'vendor/plugins' + ('mephisto_' + plugin_name)"
0
 
0
- plugin_property_source = %w(desc author version homepage).collect! do |property|
0
+ plugin_property_source = %w(author version homepage notes).collect! do |property|
0
       <<-END
0
         def #{property}(value = nil)
0
           @#{property} = value if value
0
@@ -80,12 +80,12 @@ class MephistoPlugin < ActiveRecord::Base
0
     # => installs the mephisto_foo plugin.
0
     #
0
     def install
0
- Schema.install
0
+ self::Schema.install
0
     end
0
     
0
     # Uninstalls the plugin's tables using the schema file in lib/#{plugin_name}/schema.rb
0
     def uninstall
0
- Schema.uninstall
0
+ self::Schema.uninstall
0
     end
0
     
0
     # Adds a custom route to Mephisto from a plugin. These routes are created in the order they are added.
0
@@ -142,7 +142,7 @@ class MephistoPlugin < ActiveRecord::Base
0
     # Your views will then be stored in #{YOUR_PLUGIN}/views/foo/*.rhtml.
0
     def public_controller(title, name = nil)
0
       returning((name || title.underscore).to_sym) do |controller_name|
0
- view_paths[controller_name] = plugin_path + 'views'
0
+ view_paths[controller_name] = (plugin_path + 'views').to_s
0
       end
0
     end
0
 
0
@@ -177,7 +177,7 @@ class MephistoPlugin < ActiveRecord::Base
0
     end
0
   end
0
 
0
- plugin_property_source = %w(desc author version homepage plugin_name plugin_path default_options).collect! do |property|
0
+ plugin_property_source = %w(author version homepage notes plugin_name plugin_path default_options).collect! do |property|
0
     "def #{property}() self.class.#{property} end"
0
   end
0
   eval plugin_property_source * "\n"
...
49
50
51
52
 
53
54
55
...
49
50
51
 
52
53
54
55
0
@@ -49,7 +49,7 @@ class PluginTest < Test::Unit::TestCase
0
   end
0
   
0
   def test_should_get_and_set_plugin_properties
0
- properties = %w(desc author version homepage)
0
+ properties = %w(notes author version homepage)
0
     properties.each do |property|
0
       assert_nil MephistoPlugins::PluginWhammyJammy.send(property)
0
       MephistoPlugins::PluginWhammyJammy.send(property, 'foo')

Comments

    No one has commented yet.