governor 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- governor (0.4.0)
4
+ governor (0.5.1)
5
5
  rails (~> 3.0.5)
6
6
 
7
7
  GEM
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -1,7 +1,9 @@
1
1
  module GovernorHelper
2
2
  def render_plugin_partial(where, options = {})
3
3
  output = ''
4
- Governor::PluginManager.plugins.map{|p| p.partial_for(where) }.compact.each do |partial|
4
+ partials = Governor::ViewManager.flashes.delete(where) || []
5
+ partials |= Governor::PluginManager.plugins.map{|p| p.partial_for(where) }.compact
6
+ partials.each do |partial|
5
7
  opts = options.merge( {:partial => "governor/#{partial}"} )
6
8
  output << render(opts)
7
9
  end
@@ -1,5 +1,6 @@
1
1
  <% if resources.blank? %><%= (@blank_msg or "There are no articles for this time period.") %><% end %>
2
- <%= render :partial => 'article', :collection => resources %>
2
+ <%= render_plugin_partial :before_articles %>
3
+ <%= render :partial => '/governor/articles/article', :collection => resources %>
3
4
 
4
5
  <p>
5
6
  <%= will_paginate(resources) if respond_to?(:will_paginate) %>
data/governor.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
12
- s.date = %q{2011-05-05}
12
+ s.date = %q{2011-05-08}
13
13
  s.description = %q{Because Blogojevich would be too tough to remember. It's a pluggable blogging system for Rails 3.}
14
14
  s.email = %q{liam@carpeliam.com}
15
15
  s.extra_rdoc_files = [
@@ -54,6 +54,7 @@ Gem::Specification.new do |s|
54
54
  "lib/governor/plugin_manager.rb",
55
55
  "lib/governor/rails.rb",
56
56
  "lib/governor/rails/routes.rb",
57
+ "lib/governor/view_manager.rb",
57
58
  "lib/tasks/.gitkeep",
58
59
  "script/rails",
59
60
  "spec/action_dispatch/routing/mapper_spec.rb",
data/lib/governor.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'governor/plugin'
2
2
  require 'governor/plugin_manager'
3
+ require 'governor/view_manager'
3
4
  require 'governor/article'
4
5
  require 'governor/formatters'
5
6
  require 'governor/mapping'
@@ -1,7 +1,6 @@
1
1
  module Governor
2
2
  class PluginManager
3
3
  cattr_reader :plugins
4
- cattr_reader :view_hooks
5
4
 
6
5
  class << self
7
6
  @@plugins = []
@@ -0,0 +1,21 @@
1
+ module Governor
2
+ class ViewManager
3
+ cattr_reader :flashes
4
+
5
+ class << self
6
+ @@flashes = {}
7
+
8
+ # Registers a given partial type at the given path to be displayed a
9
+ # single time.
10
+ #
11
+ # Example:
12
+ #
13
+ # Governor::ViewManager.flash(:bottom_of_form, 'articles/single_use')
14
+ #
15
+ def flash(type, path)
16
+ @@flashes[type] ||= []
17
+ @@flashes[type] << path
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- governor (0.4.0)
4
+ governor (0.5.1)
5
5
  rails (~> 3.0.5)
6
6
 
7
7
  GEM
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-05 00:00:00 -04:00
18
+ date: 2011-05-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -256,6 +256,7 @@ files:
256
256
  - lib/governor/plugin_manager.rb
257
257
  - lib/governor/rails.rb
258
258
  - lib/governor/rails/routes.rb
259
+ - lib/governor/view_manager.rb
259
260
  - lib/tasks/.gitkeep
260
261
  - script/rails
261
262
  - spec/action_dispatch/routing/mapper_spec.rb