radiant-layouts-extension 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/haml_layouts/models/layout.rb +10 -13
- data/lib/haml_layouts/models/page.rb +4 -2
- data/radiant-layouts-extension.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
@@ -5,26 +5,23 @@ module HamlLayouts
|
|
5
5
|
def self.included(base)
|
6
6
|
base.class_eval do
|
7
7
|
|
8
|
-
|
8
|
+
# Will render html from haml if necessary
|
9
|
+
def rendered_content
|
9
10
|
if is_haml?
|
10
|
-
Haml::Engine.new(
|
11
|
+
Haml::Engine.new(content).render
|
11
12
|
else
|
12
|
-
|
13
|
+
content
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
17
|
+
# Returns 'text/html' to the browser (if haml)
|
18
|
+
def content_type
|
19
|
+
self[:content_type] == 'haml' ? 'text/html' : self[:content_type]
|
20
|
+
end
|
21
|
+
|
16
22
|
# Overwrites the standard Radiant Render and pumps out haml if necessary
|
17
23
|
def is_haml?
|
18
|
-
|
19
|
-
|
20
|
-
if File.extname(name) == '.haml'
|
21
|
-
result = true
|
22
|
-
elsif content_type == 'haml'
|
23
|
-
warn 'DEPRECATED: Set HAML layout filename to end in `.haml`. Content/Type support to be removed in 1.1.0'
|
24
|
-
result = true
|
25
|
-
end
|
26
|
-
|
27
|
-
result
|
24
|
+
self[:content_type] == 'haml'
|
28
25
|
end
|
29
26
|
|
30
27
|
end
|
@@ -6,9 +6,11 @@ module HamlLayouts
|
|
6
6
|
base.class_eval do
|
7
7
|
|
8
8
|
def parse_object(object)
|
9
|
-
|
9
|
+
# We don't want to return the haml on a layout by default
|
10
|
+
text = object.is_a?(Layout) ? object.rendered_content : object.content
|
11
|
+
|
10
12
|
if object.respond_to? :filter_id
|
11
|
-
if object.filter_id
|
13
|
+
if object.filter_id == 'Haml'
|
12
14
|
# We want to render the tags as html/radius before passing them
|
13
15
|
text = object.filter.filter(text)
|
14
16
|
text = parse(text)
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{radiant-layouts-extension}
|
8
|
-
s.version = "1.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 = ["Michael Klett", "Jim Gay", "William Ross", "Tony Issakov", "Dirk Kelly"]
|
12
|
-
s.date = %q{2010-11-
|
12
|
+
s.date = %q{2010-11-26}
|
13
13
|
s.description = %q{Extends Radiant Layouts to support nesting, sharing with Rails Controllers and rendering HAML}
|
14
14
|
s.email = %q{dk@dirkkelly.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-layouts-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.4
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Klett
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-11-
|
22
|
+
date: 2010-11-26 00:00:00 +08:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|