ruhl 1.0.0 → 1.1.0

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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -9,11 +9,11 @@ module Ruhl
9
9
  end
10
10
 
11
11
  def render(template, options = {})
12
- layout = @action_view.controller.send(:active_layout)
12
+ layout_template = @action_view.controller.active_layout(options[:layout])
13
13
 
14
- if layout
15
- options[:layout] = layout.filename
16
- options[:layout_source] = layout.source
14
+ if layout_template
15
+ options[:layout] = layout_template.filename
16
+ options[:layout_source] = layout_template.source
17
17
  end
18
18
 
19
19
  Ruhl::Engine.new(template.source, options).render(@action_view)
@@ -46,11 +46,16 @@ module ActionController
46
46
 
47
47
  protected
48
48
 
49
- def present(action_sym = action_name, object = nil)
50
- object_sym = object || controller_name.singularize
49
+ def present(options = {})
50
+ action_sym = options[:action] || action_name
51
+ object_sym = options[:object] || controller_name.singularize
51
52
 
52
- render :template => "#{controller_name}/#{action_sym}",
53
- :locals => {:object => presenter_for(object_sym) }
53
+ params = { :template => "#{controller_name}/#{action_sym}",
54
+ :locals => {:object => presenter_for(object_sym) } }
55
+
56
+ params[:layout] = options[:layout] if options.has_key?(:layout)
57
+
58
+ render params
54
59
  end
55
60
 
56
61
  def presenter_for(object)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruhl}
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Stone"]
12
- s.date = %q{2010-01-21}
12
+ s.date = %q{2010-01-30}
13
13
  s.description = %q{Make your HTML dynamic with the addition of a data-ruhl attribute.}
14
14
  s.email = %q{andy@stonean.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruhl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-21 00:00:00 -05:00
12
+ date: 2010-01-30 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency