bhm-admin 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/bhm-admin.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bhm-admin}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darcy Laycock"]
12
- s.date = %q{2010-07-27}
12
+ s.date = %q{2010-07-29}
13
13
  s.description = %q{Provides a reasonably dynamic and simple to use admin area for Rails 3 application. Built on a bunch of open source libraries.}
14
14
  s.email = %q{sutto@sutto.net}
15
15
  s.extra_rdoc_files = [
@@ -45,7 +45,7 @@ module BHM
45
45
  end
46
46
 
47
47
  def parent_sidebar_content
48
- returning ActiveSupport::SafeBuffer.new do |content|
48
+ with_safe_buffer do |content|
49
49
  if respond_to?(:parent?) && parent?
50
50
  parent_name = current_parent_name
51
51
  content << ml("View #{parent_name}", parent_url)
@@ -55,14 +55,14 @@ module BHM
55
55
  end
56
56
 
57
57
  def resources_sidebar_content(name = current_resource_name)
58
- returning ActiveSupport::SafeBuffer.new do |content|
58
+ with_safe_buffer do |content|
59
59
  content << ml("All #{name.pluralize}", collection_url)
60
60
  content << ml("Add #{name}", new_resource_url)
61
61
  end
62
62
  end
63
63
 
64
64
  def resource_sidebar_content(name = current_resource_name)
65
- returning ActiveSupport::SafeBuffer.new do |content|
65
+ with_safe_buffer do |content|
66
66
  content << ml("View #{name}", resource_url)
67
67
  content << ml("Edit #{name}", edit_resource_url)
68
68
  content << ml("Remove #{name}", resource_url, :method => :delete,
@@ -70,6 +70,10 @@ module BHM
70
70
  end
71
71
  end
72
72
 
73
+ def with_safe_buffer(&blk)
74
+ ActiveSupport::SafeBuffer.new.tap(&blk)
75
+ end
76
+
73
77
  end
74
78
  end
75
79
  end
data/lib/bhm/admin.rb CHANGED
@@ -3,7 +3,7 @@ require 'active_support'
3
3
  module BHM
4
4
  module Admin
5
5
 
6
- VERSION = "0.2.0".freeze
6
+ VERSION = "0.2.1".freeze
7
7
 
8
8
  # Helpers for use in the admin area.
9
9
  autoload :SidebarHelper, 'bhm/admin/sidebar_helper'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhm-admin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darcy Laycock
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 +08:00
18
+ date: 2010-07-29 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency