_units.haml
block (4 levels) in singletonclass
/var/www/eaur/app/views/units/_units.haml
in
block (4 levels) in singletonclass
- @odd = !@odd
- cache "index unit-#{unit.id}" do
- doc_text = unit.text
%tr.item{ :class => @odd || 'odd' }
%td
= cache "index unit-#{unit.id}" do
.fund ф. #{unit.fund.name}
.inventory оп. #{unit.inventory.name}
.unit д. #{unit.name}
%td.text
= doc_text
%td.date= unit.show_date
%td.files
- links = []
- if unit.restricted
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
call
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
captured = captured.split(/^/)
min_tabs = nil
captured.each do |line|
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
block in capture_haml
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
captured = captured.split(/^/)
min_tabs = nil
captured.each do |line|
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
with_haml_buffer
#
# @param buffer [Haml::Buffer] The Haml buffer to use temporarily
# @yield A block in which the given buffer should be used
def with_haml_buffer(buffer)
@haml_buffer, old_buffer = buffer, @haml_buffer
old_buffer.active, old_was_active = false, old_buffer.active? if old_buffer
@haml_buffer.active, was_active = true, @haml_buffer.active?
yield
ensure
@haml_buffer.active = was_active
old_buffer.active = old_was_active if old_buffer
@haml_buffer = old_buffer
end
# The current {Haml::Buffer} object.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
capture_haml
# the local variable `foo` would be assigned to `"<p>13</p>\n"`.
#
# @param args [Array] Arguments to pass into the block
# @yield [args] A block of Haml code that will be converted to a string
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers/haml_handler.rb
in
capture_from_template
# Captures the html from a block of template code for this handler
#
# @example
# @handler.capture_from_template(&block) => "...html..."
#
def capture_from_template(*args, &block)
eval("_hamlout ||= @haml_buffer", block.binding) # this is for rbx
template.capture_haml(*args, &block)
end
##
# Outputs the given text to the templates buffer directly
#
# @example
# @handler.concat_to_template("This will be output to the template buffer")
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers.rb
in
capture_html
# capture_html(object_for_block, &block) => "...html..."
#
# @api semipublic
def capture_html(*args, &block)
handler = find_proper_handler
captured_html = ""
if handler && handler.is_type? && handler.block_is_type?(block)
captured_html = handler.capture_from_template(*args, &block)
end
# invoking the block directly if there was no template
captured_html = block_given? && block.call(*args) if captured_html.blank?
captured_html
end
alias :capture :capture_html
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-cache-0.10.7/lib/padrino-cache/helpers/fragment.rb
in
cache
else
value = capture_html(&block)
settings.cache.set(key.to_s, value, opts)
logger.debug "SET Fragment", began_at, key.to_s if defined?(logger)
concat_content(value)
end
else
value = capture_html(&block)
concat_content(value)
end
end
end # Fragment
end # Helpers
end # Cache
end # Padrino
/var/www/eaur/app/views/units/_units.haml
in
block (3 levels) in singletonclass
%tbody
- @units.each do |unit|
- @odd = !@odd
- cache "index unit-#{unit.id}" do
- doc_text = unit.text
%tr.item{ :class => @odd || 'odd' }
%td
= cache "index unit-#{unit.id}" do
.fund ф. #{unit.fund.name}
.inventory оп. #{unit.inventory.name}
.unit д. #{unit.name}
%td.text
= doc_text
%td.date= unit.show_date
%td.files
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
call
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
captured = captured.split(/^/)
min_tabs = nil
captured.each do |line|
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
block in capture_haml
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
captured = captured.split(/^/)
min_tabs = nil
captured.each do |line|
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
with_haml_buffer
#
# @param buffer [Haml::Buffer] The Haml buffer to use temporarily
# @yield A block in which the given buffer should be used
def with_haml_buffer(buffer)
@haml_buffer, old_buffer = buffer, @haml_buffer
old_buffer.active, old_was_active = false, old_buffer.active? if old_buffer
@haml_buffer.active, was_active = true, @haml_buffer.active?
yield
ensure
@haml_buffer.active = was_active
old_buffer.active = old_was_active if old_buffer
@haml_buffer = old_buffer
end
# The current {Haml::Buffer} object.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/haml-3.1.7/lib/haml/helpers.rb
in
capture_haml
# the local variable `foo` would be assigned to `"<p>13</p>\n"`.
#
# @param args [Array] Arguments to pass into the block
# @yield [args] A block of Haml code that will be converted to a string
# @yieldparam args [Array] `args`
def capture_haml(*args, &block)
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
haml_buffer.capture_position = position
block.call(*args)
captured = haml_buffer.buffer.slice!(position..-1)
return captured if haml_buffer.options[:ugly]
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers/haml_handler.rb
in
capture_from_template
# Captures the html from a block of template code for this handler
#
# @example
# @handler.capture_from_template(&block) => "...html..."
#
def capture_from_template(*args, &block)
eval("_hamlout ||= @haml_buffer", block.binding) # this is for rbx
template.capture_haml(*args, &block)
end
##
# Outputs the given text to the templates buffer directly
#
# @example
# @handler.concat_to_template("This will be output to the template buffer")
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers.rb
in
capture_html
# capture_html(object_for_block, &block) => "...html..."
#
# @api semipublic
def capture_html(*args, &block)
handler = find_proper_handler
captured_html = ""
if handler && handler.is_type? && handler.block_is_type?(block)
captured_html = handler.capture_from_template(*args, &block)
end
# invoking the block directly if there was no template
captured_html = block_given? && block.call(*args) if captured_html.blank?
captured_html
end
alias :capture :capture_html
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-cache-0.10.7/lib/padrino-cache/helpers/fragment.rb
in
cache
else
value = capture_html(&block)
settings.cache.set(key.to_s, value, opts)
logger.debug "SET Fragment", began_at, key.to_s if defined?(logger)
concat_content(value)
end
else
value = capture_html(&block)
concat_content(value)
end
end
end # Fragment
end # Helpers
end # Cache
end # Padrino
/var/www/eaur/app/views/units/_units.haml
in
block (2 levels) in singletonclass
%th Архивный шифр
%th Описание
%th Даты
%th
%tbody
- @units.each do |unit|
- @odd = !@odd
- cache "index unit-#{unit.id}" do
- doc_text = unit.text
%tr.item{ :class => @odd || 'odd' }
%td
= cache "index unit-#{unit.id}" do
.fund ф. #{unit.fund.name}
.inventory оп. #{unit.inventory.name}
.unit д. #{unit.name}
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/dm-core-1.2.0/lib/dm-core/collection.rb
in
block in each
# @return [self]
#
# @api public
def each
super do |resource|
begin
original, resource.collection = resource.collection, self
yield resource
ensure
resource.collection = original
end
end
end
# Invoke the block for each resource and replace it the return value
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/dm-core-1.2.0/lib/dm-core/support/lazy_array.rb
in
block in each
raise ArgumentError, "arguments may be 1 or 2 Integers, or 1 Range object, was: #{args.inspect}", caller(1)
end
def each
lazy_load
if block_given?
@array.each { |entry| yield entry }
self
else
@array.each
end
end
# delegate any not-explicitly-handled methods to @array, if possible.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/dm-core-1.2.0/lib/dm-core/support/lazy_array.rb
in
each
raise ArgumentError, "arguments may be 1 or 2 Integers, or 1 Range object, was: #{args.inspect}", caller(1)
end
def each
lazy_load
if block_given?
@array.each { |entry| yield entry }
self
else
@array.each
end
end
# delegate any not-explicitly-handled methods to @array, if possible.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/dm-core-1.2.0/lib/dm-core/support/lazy_array.rb
in
each
raise ArgumentError, "arguments may be 1 or 2 Integers, or 1 Range object, was: #{args.inspect}", caller(1)
end
def each
lazy_load
if block_given?
@array.each { |entry| yield entry }
self
else
@array.each
end
end
# delegate any not-explicitly-handled methods to @array, if possible.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/dm-core-1.2.0/lib/dm-core/collection.rb
in
each
#
# @yield [Resource] Each resource in the collection
#
# @return [self]
#
# @api public
def each
super do |resource|
begin
original, resource.collection = resource.collection, self
yield resource
ensure
resource.collection = original
end
end
/var/www/eaur/app/views/units/_units.haml
in
block in singletonclass
%thead
%tr
%th Архивный шифр
%th Описание
%th Даты
%th
%tbody
- @units.each do |unit|
- @odd = !@odd
- cache "index unit-#{unit.id}" do
- doc_text = unit.text
%tr.item{ :class => @odd || 'odd' }
%td
= cache "index unit-#{unit.id}" do
.fund ф. #{unit.fund.name}
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
call
# evaluation is guaranteed to be performed in the scope object with the
# locals specified and with support for yielding to the block.
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
method = compiled_method(locals.keys)
method.bind(scope).call(locals, &block)
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
# source is the string containing (Ruby) source code for the template and
# offset is the integer line offset where line reporting should begin.
#
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
evaluate
# evaluation is guaranteed to be performed in the scope object with the
# locals specified and with support for yielding to the block.
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
method = compiled_method(locals.keys)
method.bind(scope).call(locals, &block)
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
# source is the string containing (Ruby) source code for the template and
# offset is the integer line offset where line reporting should begin.
#
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/haml.rb
in
evaluate
def prepare
options = @options.merge(:filename => eval_file, :line => line)
@engine = ::Haml::Engine.new(data, options)
end
def evaluate(scope, locals, &block)
if @engine.respond_to?(:precompiled_method_return_value, true)
super
else
@engine.render(scope, locals, &block)
end
end
# Precompiled Haml source. Taken from the precompiled_with_ambles
# method in Haml::Precompiler:
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
render
prepare
end
# Render the template in the given scope with the locals specified. If a
# block is given, it is typically available within the template via
# +yield+.
def render(scope=Object.new, locals={}, &block)
evaluate scope, locals || {}, &block
end
# The basename of the template file.
def basename(suffix='')
File.basename(file, suffix) if file
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
render
scope = options.delete(:scope) || self
# compile and render template
begin
layout_was = @default_layout
@default_layout = false
template = compile_template(engine, data, options, views)
output = template.render(scope, locals, &block)
ensure
@default_layout = layout_was
end
# render layout
if layout
options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/rendering.rb
in
render
end
# Cleanup the template
@current_engine, engine_was = engine, @current_engine
@_out_buf, _buf_was = "", @_out_buf
# Pass arguments to Sinatra render method
super(engine, data, options.dup, locals, &block)
ensure
@current_engine = engine_was
@_out_buf = _buf_was
end
##
# Returns the located layout tuple to be used for the rendered template
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers.rb
in
render
# Module used to detect the current engine in vanilla sinatra apps.
# @private
module SinatraCurrentEngine
attr_reader :current_engine
def render(engine, *) # @private
@current_engine, engine_was = engine, @current_engine
output = super
@current_engine = engine_was
output
end
end
##
# Captures the html from a block of template code for any available handler.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/render_helpers.rb
in
partial
options[:locals].merge!(object_name => member, "#{object_name}_counter".to_sym => counter)
render(explicit_engine, template_path, options.dup)
}.join("\n")
else
if member = options.delete(:object)
options[:locals].merge!(object_name => member)
end
render(explicit_engine, template_path, options.dup)
end
end
alias :render_partial :partial
end # RenderHelpers
end # Helpers
end # Padrino
/var/www/eaur/app/views/units/index.haml
in
block in singletonclass
-#coding:utf-8
= partial 'units/lefter'
- if @show_documents
= partial 'units/documents'
- if @show_units
= partial 'units/units'
- if params[:text].present?
:javascript
$(function() { highlight('#{CGI.escapeHTML(params[:text]).gsub("'","\\'")}') });
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
call
# evaluation is guaranteed to be performed in the scope object with the
# locals specified and with support for yielding to the block.
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
method = compiled_method(locals.keys)
method.bind(scope).call(locals, &block)
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
# source is the string containing (Ruby) source code for the template and
# offset is the integer line offset where line reporting should begin.
#
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
evaluate
# evaluation is guaranteed to be performed in the scope object with the
# locals specified and with support for yielding to the block.
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
method = compiled_method(locals.keys)
method.bind(scope).call(locals, &block)
end
# Generates all template source by combining the preamble, template, and
# postamble and returns a two-tuple of the form: [source, offset], where
# source is the string containing (Ruby) source code for the template and
# offset is the integer line offset where line reporting should begin.
#
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/haml.rb
in
evaluate
def prepare
options = @options.merge(:filename => eval_file, :line => line)
@engine = ::Haml::Engine.new(data, options)
end
def evaluate(scope, locals, &block)
if @engine.respond_to?(:precompiled_method_return_value, true)
super
else
@engine.render(scope, locals, &block)
end
end
# Precompiled Haml source. Taken from the precompiled_with_ambles
# method in Haml::Precompiler:
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/tilt-1.3.7/lib/tilt/template.rb
in
render
prepare
end
# Render the template in the given scope with the locals specified. If a
# block is given, it is typically available within the template via
# +yield+.
def render(scope=Object.new, locals={}, &block)
evaluate scope, locals || {}, &block
end
# The basename of the template file.
def basename(suffix='')
File.basename(file, suffix) if file
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
render
scope = options.delete(:scope) || self
# compile and render template
begin
layout_was = @default_layout
@default_layout = false
template = compile_template(engine, data, options, views)
output = template.render(scope, locals, &block)
ensure
@default_layout = layout_was
end
# render layout
if layout
options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/rendering.rb
in
render
end
# Cleanup the template
@current_engine, engine_was = engine, @current_engine
@_out_buf, _buf_was = "", @_out_buf
# Pass arguments to Sinatra render method
super(engine, data, options.dup, locals, &block)
ensure
@current_engine = engine_was
@_out_buf = _buf_was
end
##
# Returns the located layout tuple to be used for the rendered template
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-helpers-0.10.7/lib/padrino-helpers/output_helpers.rb
in
render
# Module used to detect the current engine in vanilla sinatra apps.
# @private
module SinatraCurrentEngine
attr_reader :current_engine
def render(engine, *) # @private
@current_engine, engine_was = engine, @current_engine
output = super
@current_engine = engine_was
output
end
end
##
# Captures the html from a block of template code for any available handler.
/var/www/eaur/app/controllers/units.rb
in
block (2 levels) in <top (required)>
content_for :head_links do
out = ''
out += "<link rel=\"prev\" href=\"#{@prev_link}\" />" if @page > 1
out += "<link rel=\"next\" href=\"#{@next_link}\" />" if @page < @pagenum
out
end
render "units/index#{params[:num]}"
end
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
call
# Sinatra defaults
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
block = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
invoke_hook(:route_added, verb, path, block)
# HTTPRouter route construction
route = router.add(path, route_options)
route.name(name) if name
priority_name = options.delete(:priority) || :normal
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
block in route
# Sinatra defaults
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
block = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
invoke_hook(:route_added, verb, path, block)
# HTTPRouter route construction
route = router.add(path, route_options)
route.name(name) if name
priority_name = options.delete(:priority) || :normal
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
[]
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
@block_params = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
block (3 levels) in process_destination_path
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
@block_params = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
route_eval
route_eval(&pass_block) if pass_block
route_missing
end
# Run a route block and throw :halt with the result.
def route_eval
throw :halt, yield
end
# If the current request matches pattern and conditions, fill params
# with keys and call the given block.
# Revert params afterwards.
#
# Returns pass block.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
block (2 levels) in process_destination_path
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
@block_params = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
catch
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
@block_params = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
block in process_destination_path
successful = false
begin
filter! :before
(@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
@layout = path.route.use_layout if path.route.use_layout
@route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
@block_params = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
halt_response = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
@_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
successful = true
halt halt_response
ensure
(@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
@layout = parent_layout
@params = original_params
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
instance_eval
#
# @private
class HttpRouter
def rewrite_partial_path_info(env, request); end
def rewrite_path_info(env, request); end
def process_destination_path(path, env)
Thread.current['padrino.instance'].instance_eval do
request.route_obj = path.route
@_response_buffer = nil
@route = path.route
@params ||= {}
@params.update(env['router.params'])
@block_params = if path.route.is_a?(HttpRouter::RegexRoute)
params_list = env['router.request'].extra_env['router.regex_match'].to_a
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
process_destination_path
#
# @private
class HttpRouter
def rewrite_partial_path_info(env, request); end
def rewrite_path_info(env, request); end
def process_destination_path(path, env)
Thread.current['padrino.instance'].instance_eval do
request.route_obj = path.route
@_response_buffer = nil
@route = path.route
@params ||= {}
@params.update(env['router.params'])
@block_params = if path.route.is_a?(HttpRouter::RegexRoute)
params_list = env['router.request'].extra_env['router.regex_match'].to_a
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/http_router-0.10.2/lib/http_router.rb
in
block in call
# Rack compatible #call. If matching route is found, and +dest+ value responds to #call, processing will pass to the matched route. Otherwise,
# the default application will be called. The router will be available in the env under the key <tt>router</tt>. And parameters matched will
# be available under the key <tt>router.params</tt>.
def call(env, perform_call = true)
rack_request = ::Rack::Request.new(env)
request = Request.new(rack_request.path_info, rack_request, perform_call)
response = catch(:success) { @root[request] }
if perform_call
response or no_response(env)
else
request.matches.empty? ? nil : request.matches
end
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/http_router-0.10.2/lib/http_router.rb
in
catch
# Rack compatible #call. If matching route is found, and +dest+ value responds to #call, processing will pass to the matched route. Otherwise,
# the default application will be called. The router will be available in the env under the key <tt>router</tt>. And parameters matched will
# be available under the key <tt>router.params</tt>.
def call(env, perform_call = true)
rack_request = ::Rack::Request.new(env)
request = Request.new(rack_request.path_info, rack_request, perform_call)
response = catch(:success) { @root[request] }
if perform_call
response or no_response(env)
else
request.matches.empty? ? nil : request.matches
end
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/http_router-0.10.2/lib/http_router.rb
in
call
# Rack compatible #call. If matching route is found, and +dest+ value responds to #call, processing will pass to the matched route. Otherwise,
# the default application will be called. The router will be available in the env under the key <tt>router</tt>. And parameters matched will
# be available under the key <tt>router.params</tt>.
def call(env, perform_call = true)
rack_request = ::Rack::Request.new(env)
request = Request.new(rack_request.path_info, rack_request, perform_call)
response = catch(:success) { @root[request] }
if perform_call
response or no_response(env)
else
request.matches.empty? ? nil : request.matches
end
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
route!
handle_exception!(boom)
ensure
filter! :after unless env['sinatra.static_file']
end
def route!(base=settings, pass_block=nil)
Thread.current['padrino.instance'] = self
if base.compiled_router and match = base.compiled_router.call(@request.env)
if match.respond_to?(:each)
route_eval do
match[1].each {|k,v| response[k] = v}
status match[0]
route_missing if match[0] == 404
end
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/application/routing.rb
in
dispatch!
private
def filter!(type, base=settings)
base.filters[type].each { |block| instance_eval(&block) }
end
def dispatch!
static! if settings.static? && (request.get? || request.head?)
route!
rescue ::Exception => boom
filter! :before
handle_exception!(boom)
ensure
filter! :after unless env['sinatra.static_file']
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
block in call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) }
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
block in invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
body res
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
catch
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
body res
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
body res
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) }
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
call
@app = app
@template_cache = Tilt::Cache.new
yield self if block_given?
end
# Rack call interface.
def call(env)
dup.call!(env)
end
attr_accessor :env, :request, :response, :params
def call!(env) # :nodoc:
@env = env
@request = Request.new(env)
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.4/lib/rack/head.rb
in
call
class Head
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
if env["REQUEST_METHOD"] == "HEAD"
body.close if body.respond_to? :close
[status, headers, []]
else
[status, headers, body]
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.4/lib/rack/methodoverride.rb
in
call
method = method_override(env)
if HTTP_METHODS.include?(method)
env["rack.methodoverride.original_method"] = env["REQUEST_METHOD"]
env["REQUEST_METHOD"] = method
end
end
@app.call(env)
end
def method_override(env)
req = Request.new(env)
method = req.POST[METHOD_OVERRIDE_PARAM_KEY] ||
env[HTTP_METHOD_OVERRIDE_HEADER]
method.to_s.upcase
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/reloader.rb
in
call
# Invoked in order to perform the reload as part of the request stack.
def call(env)
if @cooldown && Time.now > @last + @cooldown
Thread.list.size > 1 ? Thread.exclusive { Padrino.reload! } : Padrino.reload!
@last = Time.now
end
@app.call(env)
end
end
end # Reloader
end # Padrino
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/logger.rb
in
call
@app = app
@uri_root = uri_root.sub(/\/$/,"")
end
def call(env) # @private
env['rack.logger'] = Padrino.logger
began_at = Time.now
status, header, body = @app.call(env)
log(env, status, header, began_at)
[status, header, body]
end
private
def log(env, status, header, began_at)
return if env['sinatra.static_file'] && (!logger.respond_to?(:log_static) || !logger.log_static)
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/showexceptions.rb
in
call
def initialize(app)
@app = app
@template = ERB.new(TEMPLATE)
end
def call(env)
@app.call(env)
rescue Exception => e
errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
if respond_to?(:prefers_plain_text?) and prefers_plain_text?(env)
content_type = "text/plain"
body = [dump_exception(e)]
else
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.4/lib/rack/session/abstract/id.rb
in
context
def call(env)
context(env)
end
def context(env, app=@app)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
private
def initialize_sid
@sidbits = @default_options[:sidbits]
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.4.4/lib/rack/session/abstract/id.rb
in
call
@default_options = self.class::DEFAULT_OPTIONS.merge(options)
@key = @default_options.delete(:key)
@cookie_only = @default_options.delete(:cookie_only)
initialize_sid
end
def call(env)
context(env)
end
def context(env, app=@app)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
block in call
setup_default_middleware builder
setup_middleware builder
builder.run new!(*args, &bk)
builder
end
def call(env)
synchronize { prototype.call(env) }
end
private
def setup_default_middleware(builder)
builder.use ExtendedRack
builder.use ShowExceptions if show_exceptions?
builder.use Rack::MethodOverride if method_override?
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
synchronize
end
@@mutex = Mutex.new
def synchronize(&block)
if lock?
@@mutex.synchronize(&block)
else
yield
end
end
public
CALLERS_TO_IGNORE = [ # :nodoc:
/\/sinatra(\/(base|main|showexceptions))?\.rb$/, # all sinatra code
/lib\/tilt.*\.rb$/, # all tilt code
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.3.3/lib/sinatra/base.rb
in
call
setup_default_middleware builder
setup_middleware builder
builder.run new!(*args, &bk)
builder
end
def call(env)
synchronize { prototype.call(env) }
end
private
def setup_default_middleware(builder)
builder.use ExtendedRack
builder.use ShowExceptions if show_exceptions?
builder.use Rack::MethodOverride if method_override?
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/router.rb
in
block in call
@mapping.each do |host, path, match, app|
next unless host.nil? || hHost =~ host
next unless rPath =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
return app.call(
env.merge(
'SCRIPT_NAME' => (script_name + path),
'PATH_INFO' => rest))
end
[404, {"Content-Type" => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{rPath}"]]
end
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/router.rb
in
each
# The call handler setup to route a request given the mappings specified.
# @api private
def call(env)
rPath = env["PATH_INFO"].to_s
script_name = env['SCRIPT_NAME']
hHost, sName, sPort = env.values_at('HTTP_HOST','SERVER_NAME','SERVER_PORT')
@mapping.each do |host, path, match, app|
next unless host.nil? || hHost =~ host
next unless rPath =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
return app.call(
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/padrino-core-0.10.7/lib/padrino-core/router.rb
in
call
# The call handler setup to route a request given the mappings specified.
# @api private
def call(env)
rPath = env["PATH_INFO"].to_s
script_name = env['SCRIPT_NAME']
hHost, sName, sPort = env.values_at('HTTP_HOST','SERVER_NAME','SERVER_PORT')
@mapping.each do |host, path, match, app|
next unless host.nil? || hHost =~ host
next unless rPath =~ match && rest = $1
next unless rest.empty? || rest[0] == ?/
rest = "/" if rest.empty?
return app.call(
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.21/lib/phusion_passenger/rack/thread_handler_extension.rb
in
process_request
env[RACK_HIJACK_IO] ||= begin
connection.stop_simulating_eof!
connection
end
end
begin
status, headers, body = @app.call(env)
rescue => e
if should_reraise_app_error?(e, socket_wrapper)
raise e
elsif !should_swallow_app_error?(e, socket_wrapper)
# It's a good idea to catch application exceptions here because
# otherwise maliciously crafted responses can crash the app,
# forcing it to be respawned, and thereby effectively DoSing it.
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.21/lib/phusion_passenger/request_handler/thread_handler.rb
in
accept_and_process_next_request
prepare_request(connection, headers)
begin
if headers[REQUEST_METHOD] == PING
process_ping(headers, connection)
elsif headers[REQUEST_METHOD] == OOBW
process_oobw(headers, connection)
else
process_request(headers, connection, socket_wrapper, @protocol == :http)
end
rescue Exception
has_error = true
raise
ensure
if headers[RACK_HIJACK_IO]
socket_wrapper = nil
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.21/lib/phusion_passenger/request_handler/thread_handler.rb
in
main_loop
channel = MessageChannel.new
buffer = ''
buffer.force_encoding('binary') if buffer.respond_to?(:force_encoding)
begin
finish_callback.call
while true
hijacked = accept_and_process_next_request(socket_wrapper, channel, buffer)
socket_wrapper = Utils::UnseekableSocket.new if hijacked
end
rescue Interrupted
# Do nothing.
end
debug("Thread handler main loop exited normally")
ensure
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.21/lib/phusion_passenger/request_handler.rb
in
block (3 levels) in start_threads
@concurrency.times do |i|
thread = Thread.new(i) do |number|
Thread.current.abort_on_exception = true
begin
Thread.current[:name] = "Worker #{number + 1}"
handler = thread_handler.new(self, main_socket_options)
handler.install
handler.main_loop(set_initialization_state_to_true)
ensure
set_initialization_state.call(false)
unregister_current_thread
end
end
@threads << thread
expected_nthreads += 1
Variable | Value |
---|---|
fund_id | "637" |
id | "28407" |
No POST data.
Variable | Value |
---|---|
DOCUMENT_ROOT | /var/www/eaur/public |
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_HOST | ea.gasur.ru |
HTTP_USER_AGENT | claudebot |
HTTP_X_REAL_IP | 3.224.147.211 |
PASSENGER_APP_TYPE | rack |
PASSENGER_CONNECT_PASSWORD | XygN4ZQeeITYfWiKYbSbmNOKvbpCkLsv2pQqvt7zK5b |
PASSENGER_ENV | development |
PASSENGER_MAX_REQUESTS | 32768 |
PASSENGER_MIN_INSTANCES | 4 |
PATH_INFO | /units |
QUERY_STRING | id=28407&fund_id=637 |
REMOTE_ADDR | 3.224.147.211 |
REMOTE_PORT | |
REQUEST_METHOD | GET |
REQUEST_URI | /units?id=28407&fund_id=637 |
SCGI | 1 |
SCRIPT_NAME | |
SERVER_ADDR | 192.168.2.211 |
SERVER_NAME | ea.gasur.ru |
SERVER_PORT | 80 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | nginx/1.2.8 |
rack.errors | #<Object:0x0000000375d638> |
rack.hijack | #<Proc:0x000000076d1828@/usr/local/rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.21/lib/phusion_passenger/rack/thread_handler_extension.rb:69 (lambda)> |
rack.hijack? | true |
rack.input | #<PhusionPassenger::Utils::TeeInput:0x000000076d1d28> |
rack.logger | #<Padrino::Logger:0x000000034b3ea0> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.query_hash | {"id"=>"28407", "fund_id"=>"637"} |
rack.request.query_string | id=28407&fund_id=637 |
rack.run_once | false |
rack.session | {} |
rack.session.options | {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"fd3a32d61be75844ffaf63deaeff410cd4d686f0de3154f4497a3cab0d493289", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x000000039e1c88>, :id=>nil} |
rack.session.unpacked_cookie_data | {} |
rack.url_scheme | http |
rack.version | [1, 2] |
router.params | {} |
router.request | request path, [] |
sinatra.error | undefined method `name' for nil:NilClass |
You're seeing this error because you RRR have
enabled the show_exceptions
setting.