governor 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/helpers/governor_helper.rb +3 -1
- data/app/views/governor/articles/index.html.erb +2 -1
- data/governor.gemspec +3 -2
- data/lib/governor.rb +1 -0
- data/lib/governor/plugin_manager.rb +0 -1
- data/lib/governor/view_manager.rb +21 -0
- data/spec/rails_app/Gemfile.lock +1 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
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::
|
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
|
-
<%=
|
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.
|
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-
|
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
@@ -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
|
data/spec/rails_app/Gemfile.lock
CHANGED
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
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-
|
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
|