wrapt 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,7 @@ class Wrapt
|
|
9
9
|
@wrapt = wrapt
|
10
10
|
@request = Rack::Request.new(@env)
|
11
11
|
@content_for = Hashie::Mash.new
|
12
|
+
@ignore_layout = nil
|
12
13
|
end
|
13
14
|
|
14
15
|
# Is the wrapt instance that created this layouter set as a master?
|
@@ -27,6 +28,12 @@ class Wrapt
|
|
27
28
|
@format ||= @wrapt.default_format
|
28
29
|
end
|
29
30
|
|
31
|
+
# allows you to set the ignore_layout block for just this request (and anythin downstream)
|
32
|
+
#
|
33
|
+
def ignore_layout(&block)
|
34
|
+
@ignore_layout = block
|
35
|
+
end
|
36
|
+
|
30
37
|
# Gets the template name that this layouter has.
|
31
38
|
# Defaults to the wrapts instances default_template
|
32
39
|
#
|
@@ -113,7 +120,13 @@ class Wrapt
|
|
113
120
|
# The interface for rack.
|
114
121
|
# @api public
|
115
122
|
def each
|
116
|
-
|
123
|
+
ignore = if @ignore_layout
|
124
|
+
@ignore_layout.call(env)
|
125
|
+
else
|
126
|
+
@wrapt.ignore_layout?(env)
|
127
|
+
end
|
128
|
+
|
129
|
+
result = render_layout(ignore)
|
117
130
|
yield result
|
118
131
|
result
|
119
132
|
end
|
Binary file
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Neighman
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- /Users/dneighman/Projects/wrapt/spec/wrapt_spec.rb
|
85
85
|
- /Users/dneighman/Projects/wrapt/VERSION
|
86
86
|
- /Users/dneighman/Projects/wrapt/wrapt-0.1.0.gem
|
87
|
+
- /Users/dneighman/Projects/wrapt/wrapt-0.1.1.gem
|
87
88
|
- /Users/dneighman/Projects/wrapt/wrapt.gemspec
|
88
89
|
has_rdoc: true
|
89
90
|
homepage: http://github.com/hassox/wrapt
|