public this repo is viewable by everyone
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 !
initial commit to engines branch
svenfuchs (author)
2 months ago
commit  1ad1b56b4a6c9284534b0afbb9d5d87715ae4312
tree    adc435b61f05728a991fd314188bc3e75cfb6038
parent  2772ec18227b04b3cb618748a2900a7b93b84d94
...
2
3
4
5
 
6
7
8
...
19
20
21
22
 
23
24
25
...
2
3
4
 
5
6
7
8
...
19
20
21
 
22
23
24
25
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 = Mephisto.plugins
0
   end
0
   
0
   def update
0
@@ -19,6 +19,6 @@ class Admin::PluginsController < Admin::BaseController
0
   
0
   protected
0
     def find_plugin
0
- @plugin = Mephisto::Plugin[params[:id]]
0
+ @plugin = Mephisto.plugins[params[:id]]
0
     end
0
 end
0
\ No newline at end of file
...
1
2
3
4
 
5
6
 
7
8
9
 
10
...
1
2
3
 
4
5
 
6
7
8
 
9
10
0
@@ -1,10 +1,10 @@
0
 <tr class="published" >
0
   <td class="published">
0
   <% if plugin.configurable? -%>
0
-    <%= link_to plugin.path, :action => 'show', :id => plugin.path %>
0
+    <%= link_to plugin.mephisto_name, :action => 'show', :id => plugin.name %>
0
   <% else -%>
0
-    <%=h plugin.path %>
0
+    <%=h plugin.mephisto_name %>
0
   <% end -%>
0
 </td>
0
- <td class="published"><%= plugin.configurable? ? link_to(image_tag('/images/mephisto/icons/8-em-check.png', :style => 'vertical-align: middle'), :action => "show", :id => plugin.path) : '&nbsp;' %></span> </td>
0
+ <td class="published"><%= plugin.configurable? ? link_to(image_tag('/images/mephisto/icons/8-em-check.png', :style => 'vertical-align: middle'), :action => "show", :id => plugin.name) : '&nbsp;' %></span> </td>
0
  </tr>
...
23
24
25
26
 
27
28
29
...
33
34
35
36
 
37
38
39
...
23
24
25
 
26
27
28
29
...
33
34
35
 
36
37
38
39
0
@@ -23,7 +23,7 @@
0
 <div id="page-nav">
0
   <ul id="act-nav" class="clear">
0
   <li>
0
-      <%= link_to 'Restore Defaults', :action => 'destroy', :id => @plugin.plugin_name %>
0
+      <%= link_to 'Restore Defaults', :action => 'destroy', :id => @plugin.name %>
0
   </li>
0
   <li>
0
       <%= link_to 'Index', :action => 'index' %>
0
@@ -33,7 +33,7 @@
0
 <% end %>
0
 
0
 <% content_for :form do -%>
0
-  <%= form_tag({:action => 'update', :id => @plugin.plugin_name}, {:id => 'plugin-config-form'}) %>
0
+  <%= form_tag({:action => 'update', :id => @plugin.name}, {:id => 'plugin-config-form'}) %>
0
 <% end -%>
0
 
0
 <% if @plugin.default_options.any? -%>
...
10
11
12
 
 
13
14
15
...
10
11
12
13
14
15
16
17
0
@@ -10,6 +10,8 @@
0
 
0
 # Bootstrap the Rails environment, frameworks, and default configuration
0
 require File.join(File.dirname(__FILE__), 'boot')
0
+require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
0
+require File.join(File.dirname(__FILE__), '../lib/mephisto/plugin')
0
 
0
 # requires vendor-loaded redcloth
0
 require 'RedCloth-3.0.4/lib/redcloth' unless Object.const_defined?(:RedCloth)
...
12
13
14
 
 
15
16
17
...
36
37
38
 
 
39
40
41
...
12
13
14
15
16
17
18
19
...
38
39
40
41
42
43
44
45
0
@@ -12,6 +12,8 @@ ActiveRecord::Base.observers = [:article_observer, :comment_observer]
0
 # it's loaded before all other plugins
0
 # Object::RAILS_PATH = Pathname.new(File.expand_path(RAILS_ROOT))
0
 
0
+require 'mephisto'
0
+
0
 class ActionController::Dispatcher
0
   def self.register_liquid_tags
0
     Mephisto.liquid_filters.each { |mod| Liquid::Template.register_filter mod }
0
@@ -36,5 +38,7 @@ Inflector.inflections do |inflect|
0
   inflect.uncountable %w( audio )
0
 end
0
 
0
+Engines::Plugin::Config.set_table_name 'mephisto_plugins'
0
+
0
 Dependencies.autoloaded_constants.delete "Mephisto"
0
 Dependencies.autoloaded_constants.delete "Mephisto::Plugin"
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
 
 
 
 
 
 
 
 
 
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
 
 
 
 
 
 
 
 
180
181
182
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
185
 
186
187
188
 
 
 
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
14
15
16
17
18
19
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
44
45
 
46
47
48
49
50
0
@@ -1,187 +1,49 @@
0
-module Mephisto
0
- # This module assists with general Mephisto plugins.
0
- class Plugin < ActiveRecord::Base
0
- set_table_name 'mephisto_plugins'
0
- serialize :options, Hash
0
-
0
- @@custom_routes = []
0
- @@view_paths = {}
0
- @@tabs = []
0
- @@admin_tabs = []
0
- cattr_reader :custom_routes, :view_paths, :tabs, :admin_tabs
0
-
0
- class << self
0
- expiring_attr_reader :plugin_name, 'name.demodulize.underscore'
0
- expiring_attr_reader :plugin_path, "RAILS_PATH + 'vendor/plugins' + ('mephisto_' + plugin_name)"
0
-
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
- @#{property}
0
- end
0
- END
0
- end
0
- eval plugin_property_source * "\n"
0
-
0
- # Finds or initializes a new plugin record from the database by the plugin name
0
- def find_or_initialize
0
- find_or_initialize_by_name(plugin_name)
0
- end
0
-
0
- #
0
- # Matches key to sub classes of Mephisto::Plugin in the namespace Mephisto::Plugins.
0
- # In other words, your plugin needs to subclass the former and be within the latter.
0
- #
0
- def find_class(key)
0
- klass_name = key.to_s.camelize
0
- klass = Mephisto::Plugins.const_get klass_name
0
- if klass < Mephisto::Plugin
0
- klass
0
- else
0
- raise NameError, "Plugin class must subclass Mephisto::Plugin"
0
- end
0
- end
0
-
0
- def [](key)
0
- find_class(key).find_or_initialize
0
- end
0
-
0
- def load(plugin_list)
0
- returning find_all_by_name(plugin_list).index_by(&:name) do |plugins|
0
- plugin_list.each do |name|
0
- if plugin_class = plugins[name].nil? && self[name]
0
- plugins[name] ||= plugin_class.new(:name => name)
0
- end
0
- end
0
- end
0
- end
0
-
0
- def default_options
0
- @default_options ||= {}
0
- end
0
-
0
- def option(property, default, field_type = :text_field)
0
- class_eval <<-END, __FILE__, __LINE__
0
- def #{property}
0
- write_attribute(:options, {}) if read_attribute(:options).nil?
0
- options[#{property.inspect}].blank? ? #{default.inspect} : options[#{property.inspect}]
0
- end
0
-
0
- def #{property}=(value)
0
- write_attribute(:options, {}) if read_attribute(:options).nil?
0
- options[#{property.inspect}] = value
0
- end
0
- END
0
- default_options[property] = field_type
0
- end
0
-
0
- # Installs the plugin's tables using the schema file in lib/#{plugin_name}/schema.rb
0
- #
0
- # script/runner -e production 'Mephisto::Plugins::Foo.install'
0
- # => installs the mephisto_foo plugin.
0
- #
0
- def 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
- 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
- # They will be the last routes before the Mephisto Dispatcher catch-all route.
0
- def add_route(*args)
0
- custom_routes << args
0
- end
0
-
0
- # Keeps track of custom adminstration tabs. Each item is an array of arguments to be passed to link_to.
0
- #
0
- # module Mephisto
0
- # module Plugins
0
- # class Foo < Mephisto::Plugin
0
- # add_tab 'Foo', :controller => 'foo'
0
- # end
0
- # end
0
- # end
0
- def add_tab(*args)
0
- tabs << args
0
- end
0
-
0
- # Keeps track of custom adminstration tabs for ADMIN users only. Each item is an array of arguments to be passed to link_to.
0
- #
0
- # module Mephisto
0
- # module Plugins
0
- # class Foo < Mephisto::Plugin
0
- # add_admin_tab 'Foo', :controller => 'foo'
0
- # end
0
- # end
0
- # end
0
- def add_admin_tab(*args)
0
- admin_tabs << args
0
- end
0
-
0
- # Sets up a custom public controller for this plugin. It adds the plugin's lib directory to the controller paths directory and
0
- # saves the view path. Call this from your plugin's init.rb file.
0
- #
0
- # # #underscore will be called on the title parameter, so the 4th parameter 'foo' is unnecessary here.
0
- # module Mephisto
0
- # module Plugins
0
- # class Foo < Mephisto::Plugin
0
- # public_controller 'Foo', 'foo'
0
- # end
0
- # end
0
- # end
0
- #
0
- # Once set, create your controller in #{YOUR_PLUGIN}/lib/foo_controller.rb.
0
- #
0
- # class FooController < ApplicationController
0
- # self.template_root = Mephisto::Plugin.view_paths[:foo]
0
- # ...
0
- # end
0
- #
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').to_s
0
- end
0
- end
0
+require File.join(File.dirname(__FILE__), 'plugin_about_patch')
0
+
0
+# needs to be loaded before or at beginning of plugin init stage because it
0
+# allows to use add_tab and add_admin_tab from plugin init.rb
0
+
0
+module Mephisto
0
+ def self.plugins
0
+ @@plugins ||= Engines::Plugin::List.new Engines.plugins.select{ |plugin| plugin.mephisto_plugin? }
0
+ end
0
   
0
- # Sets up a custom admin controller. Mephisto::Plugin.public_controller is used for the basic setup. This also automatically
0
- # adds a tab for you, and symlinks Mephisto's core app/views/layouts path. Like Mephisto::Plugin.public_controller, this should be
0
- # called from your plugin's init.rb file.
0
- #
0
- # module Mephisto
0
- # module Plugins
0
- # class Foo < Mephisto::Plugin
0
- # admin_controller 'Foo', 'foo'
0
- # end
0
- # end
0
- # end
0
- #
0
- # module Admin
0
- # class FooController < Admin::BaseController
0
- # self.template_root = Mephisto::Plugin.view_paths[:foo]
0
- # ...
0
- # end
0
- # end
0
- #
0
- # Your views will then be stored in #{YOUR_PLUGIN}/views/admin/foo/*.rhtml.
0
- def admin_controller(title, name = nil, options = {})
0
- returning public_controller(title, name) do |controller_name|
0
- add_tab title, {:controller => "admin/#{controller_name}"}.update(options)
0
- unless File.exists?(File.join(view_paths[controller_name], 'layouts'))
0
- FileUtils.mkdir_p view_paths[controller_name]
0
- FileUtils.symlink(RAILS_PATH + 'app/views/layouts', File.join(view_paths[controller_name], 'layouts'))
0
- end
0
- end
0
- end
0
+ module Plugin
0
+ @@tabs = []
0
+ @@admin_tabs = []
0
+ mattr_reader :tabs, :admin_tabs
0
+
0
+ # delegate read access to about info
0
+ %w(author homepage version notes).each do |property|
0
+ module_eval "def #{property}; about['#{property}'] end", __FILE__, __LINE__
0
     end
0
-
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
+
0
+ # Keeps track of custom adminstration tabs. Each item is an array of arguments to be passed to link_to.
0
+ def add_tab(*args)
0
+ args.push(:controller => args.first.to_s.downcase) if (args.size == 1)
0
+ Mephisto::Plugin.tabs << args
0
+ end
0
+
0
+ # Keeps track of custom adminstration tabs for ADMIN users only. Each item is an array of arguments to be passed to link_to.
0
+ def add_admin_tab(*args)
0
+ args.push(:controller => args.first.to_s.downcase) if (args.size == 1)
0
+ Mephisto::Plugin.admin_tabs << args
0
+ end
0
+
0
+ def mephisto_plugin?
0
+ name =~ /^mephisto_(\w+)$/
0
+ end
0
+
0
+ def configurable?
0
+ not default_options.empty?
0
+ end
0
+
0
+ def mephisto_name
0
+ name.sub /^mephisto_/, ''
0
     end
0
- eval plugin_property_source * "\n"
0
+ alias :conf_name :mephisto_name
0
   end
0
-end
0
\ No newline at end of file
0
+end
0
+
0
+Engines::Plugin.send :include, Mephisto::Plugin
0
+
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -0,0 +1,26 @@
0
+# separately patching Rails::Plugin assuming that this patch will be accepted:
0
+# http://dev.rubyonrails.org/ticket/10979
0
+
0
+unless Rails::Plugin.respond_to?(:directory)
0
+ Rails::Plugin.class_eval do
0
+ attr_reader :directory, :name, :about
0
+
0
+ alias :initialize_without_about_info :initialize
0
+ def initialize(directory)
0
+ initialize_without_about_info(directory)
0
+ load_about_information
0
+ end
0
+
0
+ private
0
+
0
+ def load_about_information
0
+ begin
0
+ about_yml_path = File.join(@directory, "about.yml")
0
+ parsed_yml = File.exist?(about_yml_path) ? YAML.load(File.read(about_yml_path)) : {}
0
+ @about = parsed_yml || {}
0
+ rescue Exception
0
+ @about = {}
0
+ end
0
+ end
0
+ end
0
+end
0
\ No newline at end of file
...
33
34
35
36
37
38
 
 
39
40
41
...
45
46
47
 
 
 
 
48
49
50
...
33
34
35
 
 
 
36
37
38
39
40
...
44
45
46
47
48
49
50
51
52
53
0
@@ -33,9 +33,8 @@ module Mephisto
0
       map.connect ':controller/:action/:id/:version', :version => nil, :controller => /routing_navigator|account|(admin\/\w+)/, :id => /[^\/]*/
0
 
0
       yield if block_given?
0
- Mephisto::Plugin.custom_routes.each do |path, options|
0
- map.connect path, options
0
- end
0
+
0
+ map_from_plugins(map)
0
       
0
       map.dispatch '*path', :controller => 'mephisto', :action => 'dispatch'
0
       map.home '', :controller => 'mephisto', :action => 'dispatch'
0
@@ -45,6 +44,10 @@ module Mephisto
0
       expiring_attr_reader :redirections, '{}'
0
     end
0
     
0
+ def self.map_from_plugins(map)
0
+ Engines.plugins.each { |plugin| map.from_plugin(plugin.name) }
0
+ end
0
+
0
     def self.deny(*paths)
0
       paths.each do |path|
0
         redirections[convert_redirection_to_regex(path)] = :deny
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0
@@ -0,0 +1,18 @@
0
+# cant get this working with autotest for some reason
0
+# invoking the spec manually will work though
0
+
0
+# require File.join(File.dirname(__FILE__), '/../../config/boot')
0
+#
0
+# Rails::Configuration.send(:define_method, :plugin_paths) do
0
+# ["#{RAILS_ROOT}/vendor/plugins", "#{RAILS_ROOT}/vendor/plugins/engines_config/test/plugins"]
0
+# end
0
+#
0
+# require File.dirname(__FILE__) + '/../spec_helper'
0
+#
0
+# describe "Mephisto::Plugin routing" do
0
+# controller_name 'mephisto'
0
+#
0
+# it "should work" do
0
+# route_for(:controller => "somethings", :action => "index").should == "/something"
0
+# end
0
+# end
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
0
@@ -0,0 +1,41 @@
0
+# cant get this working with autotest for some reason
0
+# invoking the spec manually will work though
0
+
0
+require File.join(File.dirname(__FILE__), '/../../config/boot')
0
+
0
+Rails::Configuration.send(:define_method, :plugin_paths) do
0
+ ["#{RAILS_ROOT}/vendor/plugins", "#{RAILS_ROOT}/vendor/plugins/engines_config/test/plugins"]
0
+end
0
+
0
+require File.dirname(__FILE__) + '/../spec_helper'
0
+
0
+describe Mephisto::Plugin do
0
+ def plugin_alpha
0
+ Engines.plugins['plugin_alpha']
0
+ end
0
+
0
+ it "should filter plugin list and return mephisto plugins" do
0
+ Engines.plugins.size.should > Mephisto.plugins.size
0
+ end
0
+
0
+ it "should be a mephisto plugin when its name starts with 'mephisto_'" do
0
+ Mephisto.plugins.each {|p| p.name.should =~ /^mephisto_/ }
0
+ end
0
+
0
+ it "should be configurable when at least one option is defined" do
0
+ plugin_alpha.configurable?.should be_true
0
+ Engines.plugins['engines'].configurable?.should be_false
0
+ end
0
+
0
+ it "should allow to add tabs" do
0
+ Mephisto::Plugin.tabs.clear
0
+ plugin_alpha.add_tab :something
0
+ Mephisto::Plugin.tabs.first.first.should == :something
0
+ end
0
+
0
+ it "should allow to add admin tabs" do
0
+ Mephisto::Plugin.admin_tabs.clear
0
+ plugin_alpha.add_admin_tab :something
0
+ Mephisto::Plugin.admin_tabs.first.first.should == :something
0
+ end
0
+end
0
\ No newline at end of file
...
1
 
2
3
4
...
1
2
3
4
5
0
@@ -1,4 +1,5 @@
0
 ENV["RAILS_ENV"] = "test"
0
+
0
 require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
0
 require 'spec'
0
 require 'spec/rails'
...
63
64
65
66
67
 
 
 
 
...
63
64
65
 
66
67
68
69
70
0
@@ -63,4 +63,7 @@ Class.class_eval do
0
   end
0
   
0
   alias_method_chain :inherited, :mixins
0
-end
0
\ No newline at end of file
0
+end
0
+
0
+require 'mephisto/plugin'
0
+
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
0
@@ -0,0 +1,258 @@
0
+= 2.0.0 - (ANOTHER) MASSIVE INTERNAL REFACTORING
0
+
0
+* Engines now conforms to the new plugin loading mechanism, delegating plugin load order and lots of other things to Rails itself.
0
+
0
+
0
+
0
+= 1.2.2
0
+
0
+* Added the ability to code mix different types of files, cleaning up the existing code-mixing implementation slightly (Ticket #271)
0
+
0
+
0
+= 1.2.1
0
+
0
+* Added documentation to clarify some of the issues with Rails unloading classes that aren't required using "require_dependency" (Ticket #266)
0
+
0
+* Fixed a bug where test_help was being loaded when it wasn't needed, and was actually causing problems (Ticket #265)
0
+
0
+
0
+= 1.2.0 - MASSIVE INTERNAL REFACTORING
0
+
0
+* !!!Support for Rails < 1.2 has been dropped!!!; if you are using Rails =< 1.1.6, please use Engines 1.1.6, available from http://svn.rails-engines.org/engines/tags/rel_1.1.6
0
+
0
+* Engines are dead! Long live plugins! There is now no meaningful notion of an engine - all plugins can take advantage of the more powerful features that the engines plugin provides by including app directories, etc.
0
+
0
+* Init_engine.rb is no longer used; please use the plugin-standard init.rb instead.
0
+
0
+* Engines.start is no longer required; please use the config.plugins array provided by Rails instead
0
+
0
+* To get the most benefit from Engines, set config.plugins to ["engines", "*"] to load the engines plugin first, and then all other plugins in their normal order after.
0
+
0
+* Access all loaded plugins via the new Rails.plugins array, and by name using Rails.plugins[:plugin_name].
0
+
0
+* Access plugin metadata loaded automatically from about.yml: Rails.plugins[:name].about. Plugin#version is provided directly, for easy access.
0
+
0
+* Module.config is has been removed - use mattr_accessor instead, and initialize your default values via the init.rb mechanism.
0
+
0
+* Public asset helpers have been rewritten; instead of engine_stylesheet, now use stylesheet_link_tag :name, :plugin => "plugin_name"
0
+
0
+* Plugin migrations have been reworked to integrate into the main migration stream. Please run script/generate plugin_migration to create plugin migrations in your main application.
0
+
0
+* The fixture method for loading fixtures against any class has been removed; instead, engines will now provide a mechanism for loading fixtures from all plugins, by mirroring fixtures into a common location.
0
+
0
+* All references to engines have been removed; For example, any rake tasks which applied to engines now apply to all plugins. The default Rails rake tasks for plugins are overridden where necessary.
0
+
0
+* Layouts can now be shared via plugins - inspiration gratefully taken from PluginAWeek's plugin_routing :)
0
+
0
+* Actual routing from plugins is now possible, by including routes.rb in your plugin directory and using the from_plugin method in config/routes.rb (Ticket #182)
0
+
0
+* Controllers are no longer loaded twice if they're not present in the normal app/ directory (Ticket #177)
0
+
0
+* The preferred location for javascripts/stylesheets/etc is now 'assets' rather than 'public'
0
+
0
+* Ensure that plugins started before routing have their controllers appropriately added to config.controller_paths (Ticket #258)
0
+
0
+* Removed Engines.version - it's not longer relevant, now we're loading version information from about.yml files.
0
+
0
+* Added a huge amount of documentation to all new modules.
0
+
0
+* Added new warning message if installation of engines 1.2.x is attempted in a Rails 1.1.x application
0
+
0
+* Added details of the removal of the config method to UPGRADING
0
+
0
+* Removed the plugins:info rake task in favour of adding information to script/about via the Rails::Info module (Ticket #261)
0
+
0
+* Improved handling of testing and documentation tasks for plugins
0
+
0
+
0
+
0
+= 1.1.4
0
+
0
+* Fixed creation of multipart emails (Ticket #190)
0
+
0
+* Added a temporary fix to the code-mixing issue. In your engine's test/test_helper.rb, please add the following lines:
0
+
0
+ # Ensure that the code mixing and view loading from the application is disabled
0
+ Engines.disable_app_views_loading = true
0
+ Engines.disable_app_code_mixing = true
0
+
0
+ which will prevent code mixing for controllers and helpers, and loading views from the application. One thing to remember is to load any controllers/helpers using 'require_or_load' in your tests, to ensure that the engine behaviour is respected (Ticket #135)
0
+
0
+* Added tasks to easily test engines individually (Ticket #120)
0
+
0
+* Fixture extensions will now fail with an exception if the corresponding class cannot be loaded (Ticket #138)
0
+
0
+* Patch for new routing/controller loading in Rails 1.1.6. The routing code is now replaced with the contents of config.controller_paths, along with controller paths from any started engines (Ticket #196)
0
+
0
+* Rails' Configuration instance is now stored, and available from all engines and plugins.
0
+
0
+
0
+
0
+= 1.1.3
0
+
0
+* Fixed README to show 'models' rather than 'model' class (Ticket #167)
0
+* Fixed dependency loading to work with Rails 1.1.4 (Ticket #180)
0
+
0
+
0
+
0
+= 1.1.2
0
+
0
+* Added better fix to version checking (Ticket #130, jdell@gbdev.com).
0
+
0
+* Fixed generated init_engine.rb so that VERSION module doesn't cause probems (Ticket #131, japgolly@gmail.com)
0
+
0
+* Fixed error with Rails 1.0 when trying to ignore the engine_schema_info table (Ticket #132, snowblink@gmail.com)
0
+
0
+* Re-added old style rake tasks (Ticket #133)
0
+
0
+* No longer adding all subdirectories of <engine>/app or <engine>/lib, as this can cause issues when files are grouped in modules (Ticket #149, kasatani@gmail.com)
0
+
0
+* Fixed engine precidence ordering for Rails 1.1 (Ticket #146)
0
+
0
+* Added new Engines.each method to assist in processing the engines in the desired order (Ticket #146)
0
+
0
+* Fixed annoying error message at appears when starting the console in development mode (Ticket #134)
0
+
0
+* Engines is now super-careful about loading the correct version of Rails from vendor (Ticket #154)
0
+
0
+
0
+
0
+= 1.1.1
0
+
0
+* Fixed migration rake task failing when given a specific version (Ticket #115)
0
+
0
+* Added new rake task "test:engines" which will test engines (and other plugins) but ensure that the test database is cloned from development beforehand (Ticket #125)
0
+
0
+* Fixed issue where 'engine_schema_info' table was included in schema dumps (Ticket #87)
0
+
0
+* Fixed multi-part emails (Ticket #121)
0
+
0
+* Added an 'install.rb' file to new engines created by the bundled generator, which installs the engines plugin automatically if it doesn't already exist (Ticket #122)
0
+
0
+* Added a default VERSION module to generated engines (Ticket #123)
0
+
0
+* Refactored copying of engine's public files to a method of an Engine instance. You can now call Engines.get(:engine_name).copy_public_files (Ticket #108)
0
+
0
+* Changed engine generator templates from .rb files to .erb files (Ticket #106)
0
+
0
+* Fixed the test_helper.erb file to use the correct testing extensions and not load any schema - the schema will be cloned automatically via rake test:engines<