Showing /home/yaroslav/Learn/Rails/corzinus/app/views/layouts/corzinus/application.html.haml where line #8 raised:
Undefined variable: "$font-size-small".
Extracted source (around line #65):
63
64
65
66
67
68
|
}
.general-nav-mail {
font-size: $font-size-small;
color: $gold-500;
text-align: center;
margin-bottom: 15px;
|
Extracted source (around line #49):
47
48
49
50
51
52
|
def _perform(environment)
val = environment.var(name)
raise Sass::SyntaxError.new("Undefined variable: \"$#{name}\".") unless val
if val.is_a?(Sass::Script::Value::Number) && val.original
val = val.dup
val.original = nil
|
Extracted source (around line #58):
56
57
58
59
60
61
|
# @return [Sass::Script::Value] The SassScript object that is the value of the SassScript
def perform(environment)
_perform(environment)
rescue Sass::SyntaxError => e
e.modify_backtrace(:line => line)
raise e
|
Extracted source (around line #397):
395
396
397
398
399
400
|
def visit_prop(node)
node.resolved_name = run_interp(node.name)
val = node.value.perform(@environment)
node.resolved_value = val.to_s
node.value_source_range = val.source_range if val.source_range
yield
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def visit(node)
if respond_to?(node.class.visit_method, true)
send(node.class.visit_method, node) {visit_children(node)}
else
visit_children(node)
end
|
Extracted source (around line #160):
158
159
160
161
162
163
|
def visit(node)
return super(node.dup) unless @environment
@environment.stack.with_base(node.filename, node.line) {super(node.dup)}
rescue Sass::SyntaxError => e
e.modify_backtrace(:filename => node.filename, :line => node.line)
raise e
|
Extracted source (around line #79):
77
78
79
80
81
82
|
# @yield [] A block in which the new frame is on the stack.
def with_base(filename, line)
with_frame(filename, line, :base) {yield}
end
# Pushes an import frame onto the stack.
|
Extracted source (around line #115):
113
114
115
116
117
118
|
@frames.pop if @frames.last && @frames.last.type == :base
@frames.push(Frame.new(filename, line, type, name))
yield
ensure
@frames.pop unless type == :base && @frames.last && @frames.last.type != :base
end
|
Extracted source (around line #79):
77
78
79
80
81
82
|
# @yield [] A block in which the new frame is on the stack.
def with_base(filename, line)
with_frame(filename, line, :base) {yield}
end
# Pushes an import frame onto the stack.
|
Extracted source (around line #160):
158
159
160
161
162
163
|
def visit(node)
return super(node.dup) unless @environment
@environment.stack.with_base(node.filename, node.line) {super(node.dup)}
rescue Sass::SyntaxError => e
e.modify_backtrace(:filename => node.filename, :line => node.line)
raise e
|
Extracted source (around line #433):
431
432
433
434
435
436
|
with_environment Sass::Environment.new(@environment, node.options) do
@environment.selector = node.resolved_rules
node.children = node.children.map {|c| visit(c)}.flatten
end
node
end
|
Extracted source (around line #433):
431
432
433
434
435
436
|
with_environment Sass::Environment.new(@environment, node.options) do
@environment.selector = node.resolved_rules
node.children = node.children.map {|c| visit(c)}.flatten
end
node
end
|
Extracted source (around line #433):
431
432
433
434
435
436
|
with_environment Sass::Environment.new(@environment, node.options) do
@environment.selector = node.resolved_rules
node.children = node.children.map {|c| visit(c)}.flatten
end
node
end
|
Extracted source (around line #181):
179
180
181
182
183
184
|
def with_environment(env)
old_env, @environment = @environment, env
yield
ensure
@environment = old_env
end
|
Extracted source (around line #431):
429
430
431
432
433
434
|
@environment.selector, !old_at_root_without_rule)
node.stack_trace = @environment.stack.to_s if node.options[:trace_selectors]
with_environment Sass::Environment.new(@environment, node.options) do
@environment.selector = node.resolved_rules
node.children = node.children.map {|c| visit(c)}.flatten
end
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def visit(node)
if respond_to?(node.class.visit_method, true)
send(node.class.visit_method, node) {visit_children(node)}
else
visit_children(node)
end
|
Extracted source (around line #160):
158
159
160
161
162
163
|
def visit(node)
return super(node.dup) unless @environment
@environment.stack.with_base(node.filename, node.line) {super(node.dup)}
rescue Sass::SyntaxError => e
e.modify_backtrace(:filename => node.filename, :line => node.line)
raise e
|
Extracted source (around line #79):
77
78
79
80
81
82
|
# @yield [] A block in which the new frame is on the stack.
def with_base(filename, line)
with_frame(filename, line, :base) {yield}
end
# Pushes an import frame onto the stack.
|
Extracted source (around line #115):
113
114
115
116
117
118
|
@frames.pop if @frames.last && @frames.last.type == :base
@frames.push(Frame.new(filename, line, type, name))
yield
ensure
@frames.pop unless type == :base && @frames.last && @frames.last.type != :base
end
|
Extracted source (around line #79):
77
78
79
80
81
82
|
# @yield [] A block in which the new frame is on the stack.
def with_base(filename, line)
with_frame(filename, line, :base) {yield}
end
# Pushes an import frame onto the stack.
|
Extracted source (around line #160):
158
159
160
161
162
163
|
def visit(node)
return super(node.dup) unless @environment
@environment.stack.with_base(node.filename, node.line) {super(node.dup)}
rescue Sass::SyntaxError => e
e.modify_backtrace(:filename => node.filename, :line => node.line)
raise e
|
Extracted source (around line #52):
50
51
52
53
54
55
|
# @return [Array<Object>] The return values of the `visit_*` methods for the children.
def visit_children(parent)
parent.children.map {|c| visit(c)}
end
# Returns the name of a node as used in the `visit_*` method.
|
Extracted source (around line #52):
50
51
52
53
54
55
|
# @return [Array<Object>] The return values of the `visit_*` methods for the children.
def visit_children(parent)
parent.children.map {|c| visit(c)}
end
# Returns the name of a node as used in the `visit_*` method.
|
Extracted source (around line #52):
50
51
52
53
54
55
|
# @return [Array<Object>] The return values of the `visit_*` methods for the children.
def visit_children(parent)
parent.children.map {|c| visit(c)}
end
# Returns the name of a node as used in the `visit_*` method.
|
Extracted source (around line #169):
167
168
169
170
171
172
|
def visit_children(parent)
with_environment Sass::Environment.new(@environment, parent.options) do
parent.children = super.flatten
parent
end
end
|
Extracted source (around line #181):
179
180
181
182
183
184
|
def with_environment(env)
old_env, @environment = @environment, env
yield
ensure
@environment = old_env
end
|
Extracted source (around line #168):
166
167
168
169
170
171
|
# Keeps track of the current environment.
def visit_children(parent)
with_environment Sass::Environment.new(@environment, parent.options) do
parent.children = super.flatten
parent
end
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def visit(node)
if respond_to?(node.class.visit_method, true)
send(node.class.visit_method, node) {visit_children(node)}
else
visit_children(node)
end
|
Extracted source (around line #188):
186
187
188
189
190
191
|
# Sets the options on the environment if this is the top-level root.
def visit_root(node)
yield
rescue Sass::SyntaxError => e
e.sass_template ||= node.template
raise e
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def visit(node)
if respond_to?(node.class.visit_method, true)
send(node.class.visit_method, node) {visit_children(node)}
else
visit_children(node)
end
|
Extracted source (around line #159):
157
158
159
160
161
162
|
# If an exception is raised, this adds proper metadata to the backtrace.
def visit(node)
return super(node.dup) unless @environment
@environment.stack.with_base(node.filename, node.line) {super(node.dup)}
rescue Sass::SyntaxError => e
e.modify_backtrace(:filename => node.filename, :line => node.line)
|
Extracted source (around line #8):
6
7
8
9
10
11
|
# @return [Tree::Node] The resulting tree of static nodes.
def visit(root, environment = nil)
new(environment).send(:visit, root)
end
# @api private
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def css_tree
Visitors::CheckNesting.visit(self)
result = Visitors::Perform.visit(self)
Visitors::CheckNesting.visit(result) # Check again to validate mixins
result, extends = Visitors::Cssize.visit(result)
Visitors::Extend.visit(result, extends)
|
Extracted source (around line #20):
18
19
20
21
22
23
|
# @return [String] The compiled CSS.
def render
css_tree.css
end
# Runs the dynamic Sass code and computes the CSS for the tree, along with
|
Extracted source (around line #281):
279
280
281
282
283
284
|
# @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
def render
return _to_tree.render unless @options[:quiet]
Sass::Util.silence_sass_warnings {_to_tree.render}
end
|
Extracted source (around line #74):
72
73
74
75
76
77
|
css = Utils.module_include(Autoload::Sass::Script::Functions, @functions) do
engine.render
end
# Track all imported files
|
Extracted source (around line #171):
169
170
171
172
173
174
|
end
yield
ensure
mod.instance_methods.each do |sym|
base.send(:undef_method, sym) if base.method_defined?(sym)
|
Extracted source (around line #73):
71
72
73
74
75
76
|
engine = Autoload::Sass::Engine.new(input[:data], options)
css = Utils.module_include(Autoload::Sass::Script::Functions, @functions) do
engine.render
end
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def self.call(input)
instance.call(input)
end
def self.cache_key
|
Extracted source (around line #75):
73
74
75
76
77
78
|
metadata[:data] = input[:data]
case result = processor.call({data: "", metadata: {}}.merge(input))
when NilClass
metadata
when Hash
|
Extracted source (around line #57):
55
56
57
58
59
60
|
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
end
|
Extracted source (around line #56):
54
55
56
57
58
59
|
metadata = (input[:metadata] || {}).dup
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
|
Extracted source (around line #56):
54
55
56
57
58
59
|
metadata = (input[:metadata] || {}).dup
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
|
Extracted source (around line #134):
132
133
134
135
136
137
|
# Read into memory and process if theres a processor pipeline
if processors.any?
result = call_processors(processors, {
environment: self,
cache: self.cache,
uri: unloaded.uri,
|
Extracted source (around line #60):
58
59
60
61
62
63
|
end
else
load_from_unloaded(unloaded)
end
end
end
|
Extracted source (around line #317):
315
316
317
318
319
320
|
end
asset = yield
deps = asset[:metadata][:dependencies].dup.map! do |uri|
uri.start_with?("file-digest://") ? compress_from_root(uri) : uri
end
|
Extracted source (around line #44):
42
43
44
45
46
47
|
end
else
asset = fetch_asset_from_dependency_cache(unloaded) do |paths|
# When asset is previously generated, its "dependencies" are stored in the cache.
# The presence of `paths` indicates dependencies were stored.
# We can check to see if the dependencies have not changed by "resolving" them and
|
Extracted source (around line #20):
18
19
20
21
22
23
|
@stats = Hash.new { |h, k| h[k] = _stat(k) }
@entries = Hash.new { |h, k| h[k] = _entries(k) }
@uris = Hash.new { |h, k| h[k] = _load(k) }
@processor_cache_keys = Hash.new { |h, k| h[k] = _processor_cache_key(k) }
@resolved_dependencies = Hash.new { |h, k| h[k] = _resolve_dependency(k) }
|
Extracted source (around line #47):
45
46
47
48
49
50
|
alias_method :_load, :load
def load(uri)
@uris[uri]
end
# Internal: Cache Environment#processor_cache_key
|
Extracted source (around line #23):
21
22
23
24
25
26
|
dependencies.merge(deps)
find_required = proc { |uri| env.load(uri).metadata[:required] }
required = Utils.dfs(processed_uri, &find_required)
stubbed = Utils.dfs(env.load(processed_uri).metadata[:stubbed], &find_required)
required.subtract(stubbed)
|
Extracted source (around line #200):
198
199
200
201
202
203
|
seen.add(node)
stack.push(node)
stack.concat(Array(yield node).reverse)
end
end
|
Extracted source (around line #24):
22
23
24
25
26
27
|
find_required = proc { |uri| env.load(uri).metadata[:required] }
required = Utils.dfs(processed_uri, &find_required)
stubbed = Utils.dfs(env.load(processed_uri).metadata[:stubbed], &find_required)
required.subtract(stubbed)
assets = required.map { |uri| env.load(uri) }
|
Extracted source (around line #75):
73
74
75
76
77
78
|
metadata[:data] = input[:data]
case result = processor.call({data: "", metadata: {}}.merge(input))
when NilClass
metadata
when Hash
|
Extracted source (around line #57):
55
56
57
58
59
60
|
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
end
|
Extracted source (around line #56):
54
55
56
57
58
59
|
metadata = (input[:metadata] || {}).dup
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
|
Extracted source (around line #56):
54
55
56
57
58
59
|
metadata = (input[:metadata] || {}).dup
processors.reverse_each do |processor|
result = call_processor(processor, input.merge(data: data, metadata: metadata))
data = result.delete(:data)
metadata.merge!(result)
|
Extracted source (around line #134):
132
133
134
135
136
137
|
# Read into memory and process if theres a processor pipeline
if processors.any?
result = call_processors(processors, {
environment: self,
cache: self.cache,
uri: unloaded.uri,
|
Extracted source (around line #60):
58
59
60
61
62
63
|
end
else
load_from_unloaded(unloaded)
end
end
end
|
Extracted source (around line #317):
315
316
317
318
319
320
|
end
asset = yield
deps = asset[:metadata][:dependencies].dup.map! do |uri|
uri.start_with?("file-digest://") ? compress_from_root(uri) : uri
end
|
Extracted source (around line #44):
42
43
44
45
46
47
|
end
else
asset = fetch_asset_from_dependency_cache(unloaded) do |paths|
# When asset is previously generated, its "dependencies" are stored in the cache.
# The presence of `paths` indicates dependencies were stored.
# We can check to see if the dependencies have not changed by "resolving" them and
|
Extracted source (around line #20):
18
19
20
21
22
23
|
@stats = Hash.new { |h, k| h[k] = _stat(k) }
@entries = Hash.new { |h, k| h[k] = _entries(k) }
@uris = Hash.new { |h, k| h[k] = _load(k) }
@processor_cache_keys = Hash.new { |h, k| h[k] = _processor_cache_key(k) }
@resolved_dependencies = Hash.new { |h, k| h[k] = _resolve_dependency(k) }
|
Extracted source (around line #47):
45
46
47
48
49
50
|
alias_method :_load, :load
def load(uri)
@uris[uri]
end
# Internal: Cache Environment#processor_cache_key
|
Extracted source (around line #66):
64
65
66
67
68
69
|
uri, _ = resolve(path, options.merge(compat: false))
if uri
load(uri)
end
end
|
Extracted source (around line #92):
90
91
92
93
94
95
|
#
def [](*args)
find_asset(*args)
end
# Pretty inspect
|
Extracted source (around line #355):
353
354
355
356
357
358
|
private
def find_asset(path, options = {})
@env[path, options]
end
def precompiled?(path)
|
Extracted source (around line #347):
345
346
347
348
349
350
|
def find_debug_asset(path)
if asset = find_asset(path, pipeline: :debug)
raise_unless_precompiled_asset asset.logical_path.sub('.debug', '')
asset
end
|
Extracted source (around line #229):
227
228
229
230
231
232
|
resolve_asset do |resolver|
resolver.find_debug_asset path
end
end
|
Extracted source (around line #242):
240
241
242
243
244
245
|
def resolve_asset
asset_resolver_strategies.detect do |resolver|
if result = yield(resolver)
break result
end
end
|
Extracted source (around line #241):
239
240
241
242
243
244
|
# Try each asset resolver and return the first non-nil result.
def resolve_asset
asset_resolver_strategies.detect do |resolver|
if result = yield(resolver)
break result
end
|
Extracted source (around line #241):
239
240
241
242
243
244
|
# Try each asset resolver and return the first non-nil result.
def resolve_asset
asset_resolver_strategies.detect do |resolver|
if result = yield(resolver)
break result
end
|
Extracted source (around line #241):
239
240
241
242
243
244
|
# Try each asset resolver and return the first non-nil result.
def resolve_asset
asset_resolver_strategies.detect do |resolver|
if result = yield(resolver)
break result
end
|
Extracted source (around line #228):
226
227
228
229
230
231
|
path = path_with_extname(path, options)
resolve_asset do |resolver|
resolver.find_debug_asset path
end
end
|
Extracted source (around line #170):
168
169
170
171
172
173
|
if options["debug"] != false && request_debug_assets?
sources.map { |source|
if asset = lookup_debug_asset(source, type: :stylesheet)
if asset.respond_to?(:to_a)
asset.to_a.map do |a|
super(path_to_stylesheet(a.logical_path, debug: true), options)
|
Extracted source (around line #169):
167
168
169
170
171
172
|
if options["debug"] != false && request_debug_assets?
sources.map { |source|
if asset = lookup_debug_asset(source, type: :stylesheet)
if asset.respond_to?(:to_a)
asset.to_a.map do |a|
|
Extracted source (around line #169):
167
168
169
170
171
172
|
if options["debug"] != false && request_debug_assets?
sources.map { |source|
if asset = lookup_debug_asset(source, type: :stylesheet)
if asset.respond_to?(:to_a)
asset.to_a.map do |a|
|
Extracted source (around line #8):
6
7
8
9
10
11
|
%meta{ content: 'width=device-width', name: 'viewport' }
= csrf_meta_tags
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
%body
|
Extracted source (around line #159):
157
158
159
160
161
162
|
instrument("!render_template".freeze) do
compile!(view)
view.send(method_name, locals, buffer, &block)
end
rescue => e
handle_render_error(view, e)
|
Extracted source (around line #166):
164
165
166
167
168
169
|
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
end
|
Extracted source (around line #354):
352
353
354
355
356
357
|
case action
when "!render_template".freeze
ActiveSupport::Notifications.instrument("!render_template.action_view".freeze, payload, &block)
else
ActiveSupport::Notifications.instrument("#{action}.action_view".freeze, payload, &block)
end
|
Extracted source (around line #157):
155
156
157
158
159
160
|
# consume this in production. This is only slow if it's being listened to.
def render(view, locals, buffer=nil, &block)
instrument("!render_template".freeze) do
compile!(view)
view.send(method_name, locals, buffer, &block)
end
|
Extracted source (around line #66):
64
65
66
67
68
69
|
view = @view
view.view_flow.set(:layout, content)
layout.render(view, locals){ |*name| view._layout_for(*name) }
else
content
end
|
Extracted source (around line #52):
50
51
52
53
54
55
|
view, locals = @view, locals || {}
render_with_layout(layout_name, locals) do |layout|
instrument(:template, :identifier => template.identifier, :layout => layout.try(:virtual_path)) do
template.render(view, locals) { |*name| view._layout_for(*name) }
end
|
Extracted source (around line #14):
12
13
14
15
16
17
|
@lookup_context.rendered_format ||= (template.formats.first || formats.first)
render_template(template, options[:layout], options[:locals])
end
private
|
Extracted source (around line #42):
40
41
42
43
44
45
|
# Direct access to template rendering.
def render_template(context, options) #:nodoc:
TemplateRenderer.new(@lookup_context).render(context, options)
end
# Direct access to partial rendering.
|
Extracted source (around line #23):
21
22
23
24
25
26
|
render_partial(context, options)
else
render_template(context, options)
end
end
|
Extracted source (around line #103):
101
102
103
104
105
106
|
lookup_context.variants = variant if variant
view_renderer.render(context, options)
end
# Assign the rendered format to look up context.
|
Extracted source (around line #217):
215
216
217
218
219
220
|
Rack::Chunked::Body.new view_renderer.render_body(view_context, options)
else
super
end
end
end
|
Extracted source (around line #83):
81
82
83
84
85
86
|
def render_to_body(options = {})
_process_options(options)
_render_template(options)
end
def rendered_format
|
Extracted source (around line #52):
50
51
52
53
54
55
|
def render_to_body(options = {})
super || _render_in_priorities(options) || ' '
end
private
|
Extracted source (around line #142):
140
141
142
143
144
145
|
# <tt>ActionView::Rendering.render_to_body</tt>, if present.
def render_to_body(options)
_render_to_body_with_renderer(options) || super
end
def _render_to_body_with_renderer(options)
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def render(*args, &block)
options = _normalize_render(*args, &block)
rendered_body = render_to_body(options)
if options[:html]
_set_html_content_type
else
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def render(*args) #:nodoc:
raise ::AbstractController::DoubleRenderError if self.response_body
super
end
# Overwrite render_to_string because body can now be set to a rack body.
|
Extracted source (around line #44):
42
43
44
45
46
47
|
render_output = nil
self.view_runtime = cleanup_view_runtime do
Benchmark.ms { render_output = super }
end
render_output
end
|
Extracted source (around line #12):
10
11
12
13
14
|
# # => 0.074
def ms
1000 * realtime { yield }
end
end
|
Extracted source (around line #308):
306
307
308
309
310
311
|
def realtime # :yield:
r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
end
|
Extracted source (around line #12):
10
11
12
13
14
|
# # => 0.074
def ms
1000 * realtime { yield }
end
end
|
Extracted source (around line #44):
42
43
44
45
46
47
|
render_output = nil
self.view_runtime = cleanup_view_runtime do
Benchmark.ms { render_output = super }
end
render_output
end
|
Extracted source (around line #87):
85
86
87
88
89
90
|
# :api: plugin
def cleanup_view_runtime #:nodoc:
yield
end
# Every time after an action is processed, this method is invoked
|
Extracted source (around line #25):
23
24
25
26
27
28
|
db_rt_before_render = ActiveRecord::LogSubscriber.reset_runtime
self.db_runtime = (db_runtime || 0) + db_rt_before_render
runtime = super
db_rt_after_render = ActiveRecord::LogSubscriber.reset_runtime
self.db_runtime += db_rt_after_render
runtime - db_rt_after_render
|
Extracted source (around line #43):
41
42
43
44
45
46
|
def render(*args)
render_output = nil
self.view_runtime = cleanup_view_runtime do
Benchmark.ms { render_output = super }
end
render_output
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def default_render(*args)
if template_exists?(action_name.to_s, _prefixes, variants: request.variant)
render(*args)
elsif any_templates?(action_name.to_s, _prefixes)
message = "#{self.class.name}\##{action_name} is missing a template " \
"for this request format and variant.\n" \
|
Extracted source (around line #4):
2
3
4
5
6
7
|
module BasicImplicitRender # :nodoc:
def send_action(method, *args)
super.tap { default_render unless performed? }
end
def default_render(*args)
|
Extracted source (around line #4):
2
3
4
5
6
7
|
module BasicImplicitRender # :nodoc:
def send_action(method, *args)
super.tap { default_render unless performed? }
end
def default_render(*args)
|
Extracted source (around line #4):
2
3
4
5
6
7
|
module BasicImplicitRender # :nodoc:
def send_action(method, *args)
super.tap { default_render unless performed? }
end
def default_render(*args)
|
Extracted source (around line #188):
186
187
188
189
190
191
|
# which is *not* necessarily the same as the action name.
def process_action(method_name, *args)
send_action(method_name, *args)
end
# Actually call the method associated with the action. Override
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def process_action(*) #:nodoc:
self.formats = request.formats.map(&:ref).compact
super
end
# Check for double render errors and set the content_type after rendering.
|
Extracted source (around line #20):
18
19
20
21
22
23
|
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #126):
124
125
126
127
128
129
|
def call(env)
block = env.run_block
env.value = !env.halted && (!block || block.call)
env
end
end
|
Extracted source (around line #506):
504
505
506
507
508
509
|
def compile
@callbacks || @mutex.synchronize do
final_sequence = CallbackSequence.new { |env| Filters::ENDING.call(env) }
@callbacks ||= @chain.reverse.inject(final_sequence) do |callback_sequence, callback|
callback.apply callback_sequence
end
|
Extracted source (around line #455):
453
454
455
456
457
458
|
def call(arg)
@before.each { |b| b.call(arg) }
value = @call.call(arg)
@after.each { |a| a.call(arg) }
value
end
|
Extracted source (around line #101):
99
100
101
102
103
104
|
runner = callbacks.compile
e = Filters::Environment.new(self, false, nil, block)
runner.call(e).value
end
end
|
Extracted source (around line #750):
748
749
750
751
752
753
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
def _run_#{name}_callbacks(&block)
__run_callbacks__(_#{name}_callbacks, &block)
end
RUBY
end
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# end
def run_callbacks(kind, &block)
send "_run_#{kind}_callbacks", &block
end
private
|
Extracted source (around line #19):
17
18
19
20
21
22
|
# process_action callbacks around the normal behavior.
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #20):
18
19
20
21
22
23
|
private
def process_action(*args)
super
rescue Exception => exception
request.env['action_dispatch.show_detailed_exceptions'] ||= show_detailed_exceptions?
rescue_with_handler(exception) || raise
|
Extracted source (around line #32):
30
31
32
33
34
35
|
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
begin
result = super
payload[:status] = response.status
result
ensure
|
Extracted source (around line #164):
162
163
164
165
166
167
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #21):
19
20
21
22
23
24
|
listeners_state = start name, payload
begin
yield payload
rescue Exception => e
payload[:exception] = [e.class.name, e.message]
payload[:exception_object] = e
|
Extracted source (around line #164):
162
163
164
165
166
167
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #30):
28
29
30
31
32
33
|
ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
begin
result = super
payload[:status] = response.status
|
Extracted source (around line #248):
246
247
248
249
250
251
|
request.filtered_parameters.merge! wrapped_filtered_hash
end
super
end
private
|
Extracted source (around line #18):
16
17
18
19
20
21
|
# and it won't be cleaned up by the method below.
ActiveRecord::LogSubscriber.reset_runtime
super
end
def cleanup_view_runtime
|
Extracted source (around line #126):
124
125
126
127
128
129
|
@_response_body = nil
process_action(action_name, *args)
end
# Delegates to the class' ::controller_path
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
ensure
I18n.config = old_config
end
|
Extracted source (around line #190):
188
189
190
191
192
193
|
set_request!(request)
set_response!(response)
process(name)
request.commit_flash
to_a
end
|
Extracted source (around line #262):
260
261
262
263
264
265
|
middleware_stack.build(name) { |env| new.dispatch(name, req, res) }.call req.env
else
new.dispatch(name, req, res)
end
end
end
|
Extracted source (around line #50):
48
49
50
51
52
53
|
def dispatch(controller, action, req, res)
controller.dispatch(action, req, res)
end
end
|
Extracted source (around line #32):
30
31
32
33
34
35
|
controller = controller req
res = controller.make_response! req
dispatch(controller, params[:action], req, res)
rescue ActionController::RoutingError
if @raise_on_name_error
raise
|
Extracted source (around line #39):
37
38
39
40
41
42
|
req.path_parameters = set_params.merge parameters
status, headers, body = route.app.serve(req)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #725):
723
724
725
726
727
728
|
req = make_request(env)
req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
@router.serve(req)
end
def recognize_path(path, environment = {})
|
Extracted source (around line #522):
520
521
522
523
524
525
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #193):
191
192
193
194
195
196
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #193):
191
192
193
194
195
196
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #17):
15
16
17
18
19
20
|
SERVE = ->(app, req) { app.serve req }
CALL = ->(app, req) { app.call req.env }
def initialize(app, constraints, strategy)
# Unwrap Constraints objects. I don't actually think it's possible
|
Extracted source (around line #46):
44
45
46
47
48
49
|
return [ 404, {'X-Cascade' => 'pass'}, [] ] unless matches?(req)
@strategy.call @app, req
end
private
|
Extracted source (around line #39):
37
38
39
40
41
42
|
req.path_parameters = set_params.merge parameters
status, headers, body = route.app.serve(req)
if 'pass' == headers['X-Cascade']
req.script_name = script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #725):
723
724
725
726
727
728
|
req = make_request(env)
req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
@router.serve(req)
end
def recognize_path(path, environment = {})
|
Extracted source (around line #25):
23
24
25
26
27
28
|
def call(env)
status, headers, body = @app.call(env)
if etag_status?(status) && etag_body?(body) && !skip_caching?(headers)
original_body = body
|
Extracted source (around line #25):
23
24
25
26
27
28
|
case env[REQUEST_METHOD]
when "GET", "HEAD"
status, headers, body = @app.call(env)
headers = Utils::HeaderHash.new(headers)
if status == 200 && fresh?(env, headers)
status = 304
|
Extracted source (around line #12):
10
11
12
13
14
15
|
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
|
Extracted source (around line #222):
220
221
222
223
224
225
|
req = make_request env
prepare_session(req)
status, headers, body = app.call(req.env)
res = Rack::Response::Raw.new status, headers
commit_session(req, res)
[status, headers, body]
|
Extracted source (around line #216):
214
215
216
217
218
219
|
def call(env)
context(env)
end
def context(env, app=@app)
|
Extracted source (around line #613):
611
612
613
614
615
616
|
request = ActionDispatch::Request.new env
status, headers, body = @app.call(env)
if request.have_cookie_jar?
cookie_jar = request.cookie_jar
|
Extracted source (around line #553):
551
552
553
554
555
556
|
end
end
@app.call(env)
end
private
|
Extracted source (around line #38):
36
37
38
39
40
41
|
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
end
end
|
Extracted source (around line #97):
95
96
97
98
99
100
|
def __run_callbacks__(callbacks, &block)
if callbacks.empty?
yield if block_given?
else
runner = callbacks.compile
e = Filters::Environment.new(self, false, nil, block)
|
Extracted source (around line #750):
748
749
750
751
752
753
|
module_eval <<-RUBY, __FILE__, __LINE__ + 1
def _run_#{name}_callbacks(&block)
__run_callbacks__(_#{name}_callbacks, &block)
end
RUBY
end
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# end
def run_callbacks(kind, &block)
send "_run_#{kind}_callbacks", &block
end
private
|
Extracted source (around line #36):
34
35
36
37
38
39
|
def call(env)
error = nil
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
|
Extracted source (around line #12):
10
11
12
13
14
15
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #79):
77
78
79
80
81
82
|
req = ActionDispatch::Request.new env
req.remote_ip = GetIp.new(req, check_ip, proxies)
@app.call(req.env)
end
# The GetIp class exists as a way to defer processing of the request data
|
Extracted source (around line #49):
47
48
49
50
51
52
|
def call(env)
request = ActionDispatch::Request.new env
_, headers, body = response = @app.call(env)
if headers['X-Cascade'] == 'pass'
body.close if body.respond_to?(:close)
|
Extracted source (around line #31):
29
30
31
32
33
34
|
def call(env)
request = ActionDispatch::Request.new env
@app.call(env)
rescue Exception => exception
if request.show_exceptions?
render_exception(request, exception)
|
Extracted source (around line #36):
34
35
36
37
38
39
|
instrumenter.start 'request.action_dispatch', request: request
logger.info { started_request_message(request) }
resp = @app.call(env)
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
resp
rescue Exception
|
Extracted source (around line #24):
22
23
24
25
26
27
|
if logger.respond_to?(:tagged)
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
|
Extracted source (around line #69):
67
68
69
70
71
72
|
def tagged(*tags)
formatter.tagged(*tags) { yield self }
end
def flush
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def tagged(*tags)
new_tags = push_tags(*tags)
yield self
ensure
pop_tags(new_tags.size)
end
|
Extracted source (around line #69):
67
68
69
70
71
72
|
def tagged(*tags)
formatter.tagged(*tags) { yield self }
end
def flush
|
Extracted source (around line #24):
22
23
24
25
26
27
|
if logger.respond_to?(:tagged)
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
|
Extracted source (around line #13):
11
12
13
14
15
16
|
::Rails.logger.silence { @app.call(env) }
else
@app.call(env)
end
end
end
|
Extracted source (around line #9):
7
8
9
10
11
12
|
def call(env)
RequestStore.begin!
@app.call(env)
ensure
RequestStore.end!
RequestStore.clear!
|
Extracted source (around line #24):
22
23
24
25
26
27
|
req = ActionDispatch::Request.new env
req.request_id = make_request_id(req.x_request_id)
@app.call(env).tap { |_status, headers, _body| headers[X_REQUEST_ID] = req.request_id }
end
private
|
Extracted source (around line #22):
20
21
22
23
24
25
|
end
@app.call(env)
end
def method_override(env)
|
Extracted source (around line #22):
20
21
22
23
24
25
|
def call(env)
start_time = Utils.clock_time
status, headers, body = @app.call(env)
request_time = Utils.clock_time - start_time
unless headers.has_key?(@header_name)
|
Extracted source (around line #28):
26
27
28
29
30
31
|
def call(env)
LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
LocalCacheRegistry.set_cache_for(local_cache_key, nil)
end
|
Extracted source (around line #12):
10
11
12
13
14
15
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #136):
134
135
136
137
138
139
|
end
@app.call(req.env)
end
end
end
|
Extracted source (around line #111):
109
110
111
112
113
114
|
def call(env)
status, headers, body = @app.call(env)
if body.respond_to?(:to_path)
case type = variation(env)
when 'X-Accel-Redirect'
|
Extracted source (around line #522):
520
521
522
523
524
525
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #68):
66
67
68
69
70
71
|
env[PATH_INFO] = rest
return app.call(env)
end
[404, {CONTENT_TYPE => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{path}"]]
|
Extracted source (around line #53):
51
52
53
54
55
56
|
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
|
Extracted source (around line #53):
51
52
53
54
55
56
|
casecmp?(http_host, "#{server_name}:#{server_port}")
@mapping.each do |host, location, match, app|
unless casecmp?(http_host, host) \
|| casecmp?(server_name, host) \
|| (!host && is_same_server)
|
Extracted source (around line #43):
41
42
43
44
45
46
|
@counter.increment
begin
@app.call(env)
rescue *Capybara.server_errors => e
@error = e unless @error
raise e
|
Extracted source (around line #86):
84
85
86
87
88
89
|
env[REQUEST_PATH] ||= [env[SCRIPT_NAME], env[PATH_INFO]].join
status, headers, body = @app.call(env)
begin
res.status = status.to_i
headers.each { |k, vs|
|
Extracted source (around line #140):
138
139
140
141
142
143
|
si = servlet.get_instance(self, *options)
@logger.debug(format("%s is invoked.", si.class.name))
si.service(req, res)
end
##
|
Extracted source (around line #96):
94
95
96
97
98
99
|
callback.call(req, res)
end
server.service(req, res)
rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex
res.set_error(ex)
rescue HTTPStatus::Error => ex
|
Extracted source (around line #296):
294
295
296
297
298
299
|
end
call_callback(:AcceptCallback, sock)
block ? block.call(sock) : run(sock)
rescue Errno::ENOTCONN
@logger.debug "Errno::ENOTCONN raised"
rescue ServerError => ex
|
Rails.root: /home/yaroslav/Learn/Rails/corzinus/spec/dummy
Request
Parameters:
None
_csrf_token: "V6Rz1dHNYNd3r7hToye+aYcAu5AzgMVHqkQEPNFF4mQ="
session_id: "1a8c1821c26f2b54dc1224fd16636f6a"
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
HTTP_ACCEPT_ENCODING: "gzip, deflate, sdch, br"
HTTP_ACCEPT_LANGUAGE: "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4"
HTTP_VERSION: "HTTP/1.1"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "127.0.0.1"
SERVER_NAME: "127.0.0.1"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None