url_helper.rb
document_url
/builds/sdk-developer-website/developer-website-fe/app/helpers/url_helper.rb
in
document_url
path = File.join '/', path
return 'active' if request.path_info == path
end
''
end
def document_url(uid, fallback)
if uid.empty?
return url fallback
end
url %(/document/#{uid})
end
def api_host
case ENV['NODE_ENV']
/builds/sdk-developer-website/developer-website-fe/app/views/share/sdk/sub-nav.slim
in
block in singleton class
.sub-nav data-offset-top='60' data-spy='affix'
.container
nav
a class=active_url("#{@sdk_slug}") href=url("#{@sdk_slug}") == t('sub_nav.overview')
- if @sdk_slug != 'ux-sdk'
a class=active_url("#{@sdk_slug}/documentation") href=document_url(@document, "#{@sdk_slug}/documentation") == t('sub_nav.documentation')
- if @sdk_slug == 'ux-sdk'
a class=active_url('mobile-sdk/documentation/introduction/ux_sdk_introduction.html') href=document_url(@document, 'mobile-sdk/documentation/introduction/ux_sdk_introduction.html') == t('sub_nav.documentation')
- if @sdk_slug == 'mobile-sdk'
span.hovedown.menu-item
==t('sub_nav.api_reference')
span.caret
ul.hovedown-menu
/usr/local/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
call
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
locals_keys = locals.keys
locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
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/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
evaluate
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
locals_keys = locals.keys
locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
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/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
render
# 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=nil, locals={}, &block)
scope ||= Object.new
current_template = Thread.current[:tilt_current_template]
Thread.current[:tilt_current_template] = self
evaluate(scope, locals || {}, &block)
ensure
Thread.current[:tilt_current_template] = current_template
end
# The basename of the template file.
def basename(suffix='')
File.basename(file, suffix) if file
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
render
options[:default_encoding] ||= settings.default_encoding
# 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/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
slim
def nokogiri(template = nil, options = {}, locals = {}, &block)
options[:default_content_type] = :xml
render_ruby(:nokogiri, template, options, locals, &block)
end
def slim(template, options = {}, locals = {}, &block)
render(:slim, template, options, locals, &block)
end
def creole(template, options = {}, locals = {})
render :creole, template, options, locals
end
def mediawiki(template, options = {}, locals = {})
/builds/sdk-developer-website/developer-website-fe/app/views/guidance-sdk/downloads.slim
in
block in singleton class
.sdk-page.sdk-downloads-page
== slim :'share/sdk/sub-nav'
.container
section.section-software
.section-head
h2.title Guidance SDK
- if @downloads['software']['note']
.desc == @downloads['software']['note']
.content.row
/usr/local/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
call
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
locals_keys = locals.keys
locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
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/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
evaluate
#
# This method is only used by source generating templates. Subclasses that
# override render() may not support all features.
def evaluate(scope, locals, &block)
locals_keys = locals.keys
locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
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/bundle/gems/tilt-2.0.9/lib/tilt/template.rb
in
render
# 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=nil, locals={}, &block)
scope ||= Object.new
current_template = Thread.current[:tilt_current_template]
Thread.current[:tilt_current_template] = self
evaluate(scope, locals || {}, &block)
ensure
Thread.current[:tilt_current_template] = current_template
end
# The basename of the template file.
def basename(suffix='')
File.basename(file, suffix) if file
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
render
options[:default_encoding] ||= settings.default_encoding
# 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/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
slim
def nokogiri(template = nil, options = {}, locals = {}, &block)
options[:default_content_type] = :xml
render_ruby(:nokogiri, template, options, locals, &block)
end
def slim(template, options = {}, locals = {}, &block)
render(:slim, template, options, locals, &block)
end
def creole(template, options = {}, locals = {})
render :creole, template, options, locals
end
def mediawiki(template, options = {}, locals = {})
/builds/sdk-developer-website/developer-website-fe/app.rb
in
block in <class:App>
@sdk_slug = 'guidance-sdk'
slim :'guidance-sdk/index'
end
get '/guidance-sdk/downloads' do
@sdk_slug = 'guidance-sdk'
@downloads = DownloadsController.find(@sdk_slug)
slim :'guidance-sdk/downloads'
end
get '/payload-sdk/downloads' do
@sdk_slug = 'payload-sdk'
@document = DocumentsController.find(@settings.DOCUMENT_ENV, @sdk_slug)
@downloads = DownloadsController.find(@sdk_slug)
slim :'user/payload-sdk-download/index'
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
pattern, keys = compile path
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
wrapper.instance_variable_set(:@route_name, method_name)
[ pattern, keys, conditions, wrapper ]
end
def compile(path)
if path.respond_to? :to_str
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in compile!
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
pattern, keys = compile path
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
wrapper.instance_variable_set(:@route_name, method_name)
[ pattern, keys, conditions, wrapper ]
end
def compile(path)
if path.respond_to? :to_str
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block (3 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/usr/local/bundle/gems/sinatra-1.4.8/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/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block (2 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in process_route
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
# No matching route was found or all routes passed. The default
# implementation is to forward the request downstream when running
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
catch
values += match.captures.map! { |v| force_encoding URI_INSTANCE.unescape(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
process_route
values += match.captures.map! { |v| force_encoding URI_INSTANCE.unescape(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in route!
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
each
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
route!
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in dispatch!
end
# Dispatch a request with error handling.
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => boom
/usr/local/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
dispatch!
body res
end
nil # avoid double setting the same response tuple twice
end
# Dispatch a request with error handling.
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
/usr/local/bundle/gems/sinatra-1.4.8/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 @env['sinatra.error']
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/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/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 Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/usr/local/bundle/gems/sinatra-1.4.8/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 @env['sinatra.error']
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/bundle/gems/sinatra-1.4.8/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
def call!(env) # :nodoc:
@env = env
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/xss_header.rb
in
call
#
# Options:
# xss_mode:: How the browser should prevent the attack (default: :block)
class XSSHeader < Base
default_options :xss_mode => :block, :nosniff => true
def call(env)
status, headers, body = @app.call(env)
headers['X-XSS-Protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
headers['X-Content-Type-Options'] ||= 'nosniff' if options[:nosniff]
[status, headers, body]
end
end
end
end
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/path_traversal.rb
in
call
#
# Unescapes '/' and '.', expands +path_info+.
# Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
class PathTraversal < Base
def call(env)
path_was = env["PATH_INFO"]
env["PATH_INFO"] = cleanup path_was if path_was && !path_was.empty?
app.call env
ensure
env["PATH_INFO"] = path_was
end
def cleanup(path)
if path.respond_to?(:encoding)
# Ruby 1.9+ M17N
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/json_csrf.rb
in
call
# Array prototype has been patched to track data. Checks the referrer
# even on GET requests if the content type is JSON.
class JsonCsrf < Base
alias react deny
def call(env)
request = Request.new(env)
status, headers, body = app.call(env)
if has_vector? request, headers
warn env, "attack prevented by #{self.class}"
react(env) or [status, headers, body]
else
[status, headers, body]
end
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/usr/local/bundle/gems/rack-protection-1.5.5/lib/rack/protection/frame_options.rb
in
call
frame_options = options[:frame_options]
frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
frame_options.to_str
end
end
def call(env)
status, headers, body = @app.call(env)
headers['X-Frame-Options'] ||= frame_options if html? headers
[status, headers, body]
end
end
end
end
/usr/local/bundle/gems/rack-1.6.11/lib/rack/nulllogger.rb
in
call
class NullLogger
def initialize(app)
@app = app
end
def call(env)
env['rack.logger'] = self
@app.call(env)
end
def info(progname = nil, &block); end
def debug(progname = nil, &block); end
def warn(progname = nil, &block); end
def error(progname = nil, &block); end
def fatal(progname = nil, &block); end
/usr/local/bundle/gems/rack-1.6.11/lib/rack/head.rb
in
call
# Rack::Head returns an empty body for all HEAD requests. It leaves
# all other requests unchanged.
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
status, headers, Rack::BodyProxy.new([]) do
body.close if body.respond_to? :close
end
]
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.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 prefers_plain_text?(env)
content_type = "text/plain"
exception = dump_exception(e)
else
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
# Some Rack handlers (Thin, Rainbows!) implement an extended body object protocol, however,
# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
# This middleware will detect an extended body object and will make sure it reaches the
# handler directly. We do this here, so our middleware and middleware set up by the app will
# still be able to run.
class ExtendedRack < Struct.new(:app)
def call(env)
result, callback = app.call(env), env['async.callback']
return result unless callback and async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
private
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
end
def helpers
@instance
end
def call(env)
@stack.call(env)
end
def inspect
"#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
end
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
synchronize
end
@@mutex = Mutex.new
def synchronize(&block)
if lock?
@@mutex.synchronize(&block)
else
yield
end
end
# used for deprecation warnings
def warn(message)
super message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/usr/local/bundle/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
setup_default_middleware builder
setup_middleware builder
builder.run app
builder
end
def call(env)
synchronize { prototype.call(env) }
end
# Like Kernel#caller but excluding certain magic entries and without
# line / method information; the resulting array contains filenames only.
def caller_files
cleaned_caller(1).flatten
end
/usr/local/bundle/gems/rack-1.6.11/lib/rack/mock.rb
in
request
if opts[:lint]
app = Rack::Lint.new(@app)
else
app = @app
end
errors = env["rack.errors"]
status, headers, body = app.call(env)
MockResponse.new(status, headers, body, errors)
ensure
body.close if body.respond_to?(:close)
end
# For historical reasons, we're pinning to RFC 2396. It's easier for users
# and we get support from ruby 1.8 to 2.2 using this method.
/usr/local/bundle/gems/rack-1.6.11/lib/rack/mock.rb
in
get
"rack.run_once" => false,
}
def initialize(app)
@app = app
end
def get(uri, opts={}) request("GET", uri, opts) end
def post(uri, opts={}) request("POST", uri, opts) end
def put(uri, opts={}) request("PUT", uri, opts) end
def patch(uri, opts={}) request("PATCH", uri, opts) end
def delete(uri, opts={}) request("DELETE", uri, opts) end
def head(uri, opts={}) request("HEAD", uri, opts) end
def options(uri, opts={}) request("OPTIONS", uri, opts) end
build.rb
in
url2html
locales.each do |lang|
yield File.join '/', lang, url
end
end
end
def url2html(url)
html = Rack::MockRequest.new(App).get(url).body
file = File.join './build', url, 'index.html'
FileUtils.mkdir_p File.dirname(file)
open file, 'w' do |f|
f << html
end
end
build.rb
in
block in build_html
p "Build url #{url}"
if /\(\[\^\/\?#\]\+\)/.match url
urls = dymanic_urls url
urls.each do |url|
url2html url
end
else
url2html url
end
end
end
def scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
build.rb
in
block (2 levels) in scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
url = unescape(route[0].to_s)
.sub(/^\(\?\-mix\:A/, '')
.sub(/z\)$/, '')
.gsub(/\(\?\:\-\|%2\[Dd\]\)/, '-')
locales.each do |lang|
yield File.join '/', lang, url
end
end
end
def url2html(url)
html = Rack::MockRequest.new(App).get(url).body
file = File.join './build', url, 'index.html'
build.rb
in
each
def scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
url = unescape(route[0].to_s)
.sub(/^\(\?\-mix\:A/, '')
.sub(/z\)$/, '')
.gsub(/\(\?\:\-\|%2\[Dd\]\)/, '-')
locales.each do |lang|
yield File.join '/', lang, url
end
end
end
def url2html(url)
html = Rack::MockRequest.new(App).get(url).body
build.rb
in
block in scan_url
def scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
url = unescape(route[0].to_s)
.sub(/^\(\?\-mix\:A/, '')
.sub(/z\)$/, '')
.gsub(/\(\?\:\-\|%2\[Dd\]\)/, '-')
locales.each do |lang|
yield File.join '/', lang, url
end
end
end
def url2html(url)
html = Rack::MockRequest.new(App).get(url).body
build.rb
in
each
url2html url
end
end
end
def scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
url = unescape(route[0].to_s)
.sub(/^\(\?\-mix\:A/, '')
.sub(/z\)$/, '')
.gsub(/\(\?\:\-\|%2\[Dd\]\)/, '-')
locales.each do |lang|
yield File.join '/', lang, url
end
build.rb
in
scan_url
url2html url
end
end
end
def scan_url
locales = App.settings.LOCALES.map { |lang| lang == 'en' ? '' : lang }
App.routes['GET'].each do |route|
url = unescape(route[0].to_s)
.sub(/^\(\?\-mix\:A/, '')
.sub(/z\)$/, '')
.gsub(/\(\?\:\-\|%2\[Dd\]\)/, '-')
locales.each do |lang|
yield File.join '/', lang, url
end
build.rb
in
build_html
require_relative 'app'
require 'fileutils'
def build_html
scan_url do |url|
p "Build url #{url}"
if /\(\[\^\/\?#\]\+\)/.match url
urls = dymanic_urls url
urls.each do |url|
url2html url
end
else
build.rb
in
<main>
def unescape(src)
String.class_eval(%("#{src}"))
end
# App.run
App.run
FileUtils.rm_rf('build')
build_html
No GET data.
No POST data.
Variable | Value |
---|---|
CONTENT_LENGTH | 0 |
HTTPS | off |
PATH_INFO | /guidance-sdk/downloads |
QUERY_STRING | |
REQUEST_METHOD | GET |
SCRIPT_NAME | |
SERVER_NAME | example.org |
SERVER_PORT | 80 |
rack.errors | #<Object:0x00000001c4a490> |
rack.input | #<StringIO:0x00000002b5abd8> |
rack.logger | #<Rack::NullLogger:0x00000002525d58 @app=#<Rack::Protection::FrameOptions:0x00000002525e48 @app=#<Rack::Protection::HttpOrigin:0x00000002525ee8 @app=#<Rack::Protection::IPSpoofing:0x00000002525f88 @app=#<Rack::Protection::JsonCsrf:0x00000002526028 @app=#<Rack::Protection::PathTraversal:0x000000025260c8 @app=#<Rack::Protection::XSSHeader:0x000000025261b8 @app=#<App:0x000000025d1428 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x000000025d13d8 @cache={[:slim, :"guidance-sdk/downloads", {:outvar=>"@_out_buf", :default_encoding=>"utf-8"}, "/builds/sdk-developer-website/developer-website-fe/app/views"]=>#<Slim::Template:0x00000002b044b8 @options={:outvar=>"@_out_buf"}, @line=1, @file="/builds/sdk-developer-website/developer-website-fe/app/views/guidance-sdk/downloads.slim", @compiled_method={[]=>#<UnboundMethod: Tilt::CompiledTemplates#__tilt_12677000>}, @default_encoding="utf-8", @reader=#<Proc:0x00000002b04378@/usr/local/bundle/gems/tilt-2.0.9/lib/tilt/template.rb:85 (lambda)>, @data=".sdk-page.sdk-downloads-page\n == slim :'share/sdk/sub-nav'\n .container\n section.section-software\n .section-head\n h2.title Guidance SDK\n - if @downloads['software']['note']\n .desc == @downloads['software']['note']\n .content.row\n .col-xs-6\n .group\n - @downloads['software']['sdk'].each_with_index do |item, idx|\n - if idx == 0\n .main\n a.btn-main.br-6 href=\"\#{item['sdk']}\" target=\"_blank\" data-sdk=\"guidance\" data-ga=\"Guidance SDK \#{item['version']} \#{item['date']} \#{I18n.locale}\"\n span\n == t('sdk-common.downloads.download')\n | Guidance SDK \n == item['version']\n .sub\n - if item['release-note']\n a.btn-learn-more href=\"\#{item['release-note']}\" target=\"_blank\" data-sdk=\"guidance\" data-ga=\"Release Note \#{item['version']} \#{item['date']} \#{I18n.locale}\"\n == t('downloads.release_note')\n - if item['sample-code']\n a.btn-learn-more href=\"\#{item['sample-code']}\" target=\"_blank\" data-sdk=\"guidance\" data-ga=\"Sample Code \#{item['version']} \#{item['date']} \#{I18n.locale}\"\n == t('downloads.smaple_code')\n .col-xs-6\n .group\n - @downloads['software']['ros'].each_with_index do |item, idx|\n - if idx == 0\n .main\n a.btn-main.br-6 href=\"\#{item['sdk']}\" target=\"_blank\" data-sdk=\"guidance\" data-ga=\"Guidance SDK ROS \#{item['version']} \#{item['date']} \#{I18n.locale}\"\n span\n == t('sdk-common.downloads.download')\n | Guidance SDK ROS \n == item['version']\n section.section-tools\n .section-head\n h2.title == t('downloads.tools')\n .content\n - @downloads['tools'].each do |item|\n .tools-item\n .row\n .col-xs-6\n span.name == item['name']\n .col-xs-2\n span.version == item['version']\n .col-xs-2\n span.date == item['date']\n .col-xs-2\n span.download.pull-right\n a.btn-download.br-3 href=\"\#{item['link']}\" target=\"_blank\" data-sdk=\"guidance\" data-ga=\"\#{item['name']} \#{item['version']} \#{item['date']} \#{I18n.locale}\"\n == item['type']\n\n", @src="begin; _temple_generators_stringbuffer1 = @_out_buf if defined?(@_out_buf); @_out_buf = ''; @_out_buf << (\"<div class=\\\"sdk-page sdk-downloads-page\\\">\".freeze); \n; @_out_buf << ((slim :'share/sdk/sub-nav').to_s); \n; @_out_buf << (\"<div class=\\\"container\\\"><section class=\\\"section-software\\\"><div class=\\\"section-head\\\"><h2 class=\\\"title\\\">Guidance SDK</h2>\".freeze); \n; \n; \n; \n; if @downloads['software']['note']; \n; @_out_buf << (\"<div class=\\\"desc\\\">\".freeze); @_out_buf << ((@downloads['software']['note']).to_s); \n; @_out_buf << (\"</div>\".freeze); end; @_out_buf << (\"</div><div class=\\\"content row\\\"><div class=\\\"col-xs-6\\\"><div class=\\\"group\\\">\".freeze); \n; \n; \n; @downloads['software']['sdk'].each_with_index do |item, idx|; \n; if idx == 0; \n; @_out_buf << (\"<div class=\\\"main\\\"><a class=\\\"btn-main br-6\\\" data-ga=\\\"Guidance SDK \".freeze); \n; @_out_buf << ((::Temple::Utils.escape_html((item['version']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['date']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((I18n.locale))).to_s); @_out_buf << (\"\\\" data-sdk=\\\"guidance\\\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['sdk']))).to_s); @_out_buf << (\"\\\" target=\\\"_blank\\\"><span>\".freeze); \n; \n; @_out_buf << ((t('sdk-common.downloads.download')).to_s); \n; @_out_buf << (\" Guidance SDK \".freeze); \n; @_out_buf << ((item['version']).to_s); \n; @_out_buf << (\"</span></a><div class=\\\"sub\\\">\".freeze); \n; if item['release-note']; \n; @_out_buf << (\"<a class=\\\"btn-learn-more\\\" data-ga=\\\"Release Note \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['version']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['date']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((I18n.locale))).to_s); @_out_buf << (\"\\\" data-sdk=\\\"guidance\\\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['release-note']))).to_s); @_out_buf << (\"\\\" target=\\\"_blank\\\">\".freeze); \n; @_out_buf << ((t('downloads.release_note')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if item['sample-code']; \n; @_out_buf << (\"<a class=\\\"btn-learn-more\\\" data-ga=\\\"Sample Code \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['version']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['date']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((I18n.locale))).to_s); @_out_buf << (\"\\\" data-sdk=\\\"guidance\\\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['sample-code']))).to_s); @_out_buf << (\"\\\" target=\\\"_blank\\\">\".freeze); \n; @_out_buf << ((t('downloads.smaple_code')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; @_out_buf << (\"</div></div>\".freeze); end; end; @_out_buf << (\"</div></div><div class=\\\"col-xs-6\\\"><div class=\\\"group\\\">\".freeze); \n; \n; @downloads['software']['ros'].each_with_index do |item, idx|; \n; if idx == 0; \n; @_out_buf << (\"<div class=\\\"main\\\"><a class=\\\"btn-main br-6\\\" data-ga=\\\"Guidance SDK ROS \".freeze); \n; @_out_buf << ((::Temple::Utils.escape_html((item['version']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['date']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((I18n.locale))).to_s); @_out_buf << (\"\\\" data-sdk=\\\"guidance\\\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['sdk']))).to_s); @_out_buf << (\"\\\" target=\\\"_blank\\\"><span>\".freeze); \n; \n; @_out_buf << ((t('sdk-common.downloads.download')).to_s); \n; @_out_buf << (\" Guidance SDK ROS \".freeze); \n; @_out_buf << ((item['version']).to_s); \n; @_out_buf << (\"</span></a></div>\".freeze); end; end; @_out_buf << (\"</div></div></div></section><section class=\\\"section-tools\\\"><div class=\\\"section-head\\\"><h2 class=\\\"title\\\">\".freeze); \n; \n; @_out_buf << ((t('downloads.tools')).to_s); \n; @_out_buf << (\"</h2></div><div class=\\\"content\\\">\".freeze); \n; @downloads['tools'].each do |item|; \n; @_out_buf << (\"<div class=\\\"tools-item\\\"><div class=\\\"row\\\"><div class=\\\"col-xs-6\\\"><span class=\\\"name\\\">\".freeze); \n; \n; \n; @_out_buf << ((item['name']).to_s); \n; @_out_buf << (\"</span></div><div class=\\\"col-xs-2\\\"><span class=\\\"version\\\">\".freeze); \n; @_out_buf << ((item['version']).to_s); \n; @_out_buf << (\"</span></div><div class=\\\"col-xs-2\\\"><span class=\\\"date\\\">\".freeze); \n; @_out_buf << ((item['date']).to_s); \n; @_out_buf << (\"</span></div><div class=\\\"col-xs-2\\\"><span class=\\\"download pull-right\\\"><a class=\\\"btn-download br-3\\\" data-ga=\\\"\".freeze); \n; \n; @_out_buf << ((::Temple::Utils.escape_html((item['name']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['version']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['date']))).to_s); @_out_buf << (\" \".freeze); @_out_buf << ((::Temple::Utils.escape_html((I18n.locale))).to_s); @_out_buf << (\"\\\" data-sdk=\\\"guidance\\\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((item['link']))).to_s); @_out_buf << (\"\\\" target=\\\"_blank\\\">\".freeze); \n; @_out_buf << ((item['type']).to_s); \n; @_out_buf << (\"</a></span></div></div></div>\".freeze); end; @_out_buf << (\"</div></section></div></div>\".freeze); @_out_buf; ensure; @_out_buf = _temple_generators_stringbuffer1; end">, [:slim, :"share/sdk/sub-nav", {:outvar=>"@_out_buf", :default_encoding=>"utf-8"}, "/builds/sdk-developer-website/developer-website-fe/app/views"]=>#<Slim::Template:0x00000002f1f2f0 @options={:outvar=>"@_out_buf"}, @line=1, @file="/builds/sdk-developer-website/developer-website-fe/app/views/share/sdk/sub-nav.slim", @compiled_method={[]=>#<UnboundMethod: Tilt::CompiledTemplates#__tilt_12677000>}, @default_encoding="utf-8", @reader=#<Proc:0x00000002f1f1b0@/usr/local/bundle/gems/tilt-2.0.9/lib/tilt/template.rb:85 (lambda)>, @data=".sub-nav data-offset-top='60' data-spy='affix'\n .container\n nav\n a class=active_url(\"\#{@sdk_slug}\") href=url(\"\#{@sdk_slug}\") == t('sub_nav.overview')\n - if @sdk_slug != 'ux-sdk'\n a class=active_url(\"\#{@sdk_slug}/documentation\") href=document_url(@document, \"\#{@sdk_slug}/documentation\") == t('sub_nav.documentation')\n - if @sdk_slug == 'ux-sdk'\n a class=active_url('mobile-sdk/documentation/introduction/ux_sdk_introduction.html') href=document_url(@document, 'mobile-sdk/documentation/introduction/ux_sdk_introduction.html') == t('sub_nav.documentation')\n - if @sdk_slug == 'mobile-sdk'\n span.hovedown.menu-item\n ==t('sub_nav.api_reference')\n span.caret\n ul.hovedown-menu\n li\n a href='/api-reference/ios-api/index.html' == t('sub_nav.ios_reference')\n li\n a href='/api-reference/android-api/index.html' == t('sub_nav.android_reference')\n - if @sdk_slug == 'ux-sdk'\n span.hovedown.menu-item\n ==t('sub_nav.api_reference')\n span.caret\n ul.hovedown-menu\n li\n a href='/api-reference/ios-uilib-api/index.html' == t('sub_nav.ios_uilib')\n li\n a href='/api-reference/android-uilib-api/index.html' == t('sub_nav.android_uilib')\n - if @sdk_slug == 'onboard-sdk'\n a target='_blank' href='/onboard-api-reference/index.html' == t('sub_nav.api_reference')\n - if @sdk_slug == 'payload-sdk'\n a target='_blank' href=url('/payload-api-reference/introduction/index.html') == t('sub_nav.api_reference')\n - if @sdk_slug == 'windows-sdk'\n a href='/api-reference/windows-api/index.html' == t('sub_nav.api_reference')\n - if @sdk_slug != 'payload-sdk'\n a class=active_url(\"\#{@sdk_slug}/downloads\") href=url(\"\#{@sdk_slug}/downloads\") == t('sub_nav.downloads')\n / - if @sdk_slug == 'windows-sdk'\n / a class=active_url(\"\#{@sdk_slug}/beta\") href=url(\"\#{@sdk_slug}/beta\") == t('sub_nav.beta')\n - if @sdk_slug == 'mobile-sdk' || @sdk_slug == 'ux-sdk' || @sdk_slug == 'onboard-sdk' || @sdk_slug == 'windows-sdk' ||@sdk_slug == 'payload-sdk'\n a class=active_url(\"\#{@sdk_slug}/support\") href=url(\"\#{@sdk_slug}/support\") == t('sub_nav.support')\n", @src="begin; _temple_generators_stringbuffer1 = @_out_buf if defined?(@_out_buf); @_out_buf = ''; @_out_buf << (\"<div class=\\\"sub-nav\\\" data-offset-top=\\\"60\\\" data-spy=\\\"affix\\\"><div class=\\\"container\\\"><nav><a\".freeze); \n; \n; \n; _temple_html_attributeremover1 = ''; _slim_codeattributes1 = active_url(\"\#{@sdk_slug}\"); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << ((::Temple::Utils.escape_html((_slim_codeattributes1.join(\" \")))).to_s); else; _temple_html_attributeremover1 << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); end; _temple_html_attributeremover1; if !_temple_html_attributeremover1.empty?; @_out_buf << (\" class=\\\"\".freeze); @_out_buf << ((_temple_html_attributeremover1).to_s); @_out_buf << (\"\\\"\".freeze); end; _slim_codeattributes2 = url(\"\#{@sdk_slug}\"); if _slim_codeattributes2; if _slim_codeattributes2 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes2))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\">\".freeze); @_out_buf << ((t('sub_nav.overview')).to_s); \n; @_out_buf << (\"</a>\".freeze); if @sdk_slug != 'ux-sdk'; \n; @_out_buf << (\"<a\".freeze); _temple_html_attributeremover2 = ''; _slim_codeattributes3 = active_url(\"\#{@sdk_slug}/documentation\"); if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << ((::Temple::Utils.escape_html((_slim_codeattributes3.join(\" \")))).to_s); else; _temple_html_attributeremover2 << ((::Temple::Utils.escape_html((_slim_codeattributes3))).to_s); end; _temple_html_attributeremover2; if !_temple_html_attributeremover2.empty?; @_out_buf << (\" class=\\\"\".freeze); @_out_buf << ((_temple_html_attributeremover2).to_s); @_out_buf << (\"\\\"\".freeze); end; _slim_codeattributes4 = document_url(@document, \"\#{@sdk_slug}/documentation\"); if _slim_codeattributes4; if _slim_codeattributes4 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes4))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\">\".freeze); @_out_buf << ((t('sub_nav.documentation')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if @sdk_slug == 'ux-sdk'; \n; @_out_buf << (\"<a\".freeze); _temple_html_attributeremover3 = ''; _slim_codeattributes5 = active_url('mobile-sdk/documentation/introduction/ux_sdk_introduction.html'); if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover3 << ((::Temple::Utils.escape_html((_slim_codeattributes5.join(\" \")))).to_s); else; _temple_html_attributeremover3 << ((::Temple::Utils.escape_html((_slim_codeattributes5))).to_s); end; _temple_html_attributeremover3; if !_temple_html_attributeremover3.empty?; @_out_buf << (\" class=\\\"\".freeze); @_out_buf << ((_temple_html_attributeremover3).to_s); @_out_buf << (\"\\\"\".freeze); end; _slim_codeattributes6 = document_url(@document, 'mobile-sdk/documentation/introduction/ux_sdk_introduction.html'); if _slim_codeattributes6; if _slim_codeattributes6 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes6))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\">\".freeze); @_out_buf << ((t('sub_nav.documentation')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if @sdk_slug == 'mobile-sdk'; \n; @_out_buf << (\"<span class=\\\"hovedown menu-item\\\">\".freeze); \n; @_out_buf << ((t('sub_nav.api_reference')).to_s); \n; @_out_buf << (\"<span class=\\\"caret\\\"></span><ul class=\\\"hovedown-menu\\\"><li><a href=\\\"/api-reference/ios-api/index.html\\\">\".freeze); \n; \n; \n; @_out_buf << ((t('sub_nav.ios_reference')).to_s); \n; @_out_buf << (\"</a></li><li><a href=\\\"/api-reference/android-api/index.html\\\">\".freeze); \n; @_out_buf << ((t('sub_nav.android_reference')).to_s); \n; @_out_buf << (\"</a></li></ul></span>\".freeze); end; if @sdk_slug == 'ux-sdk'; \n; @_out_buf << (\"<span class=\\\"hovedown menu-item\\\">\".freeze); \n; @_out_buf << ((t('sub_nav.api_reference')).to_s); \n; @_out_buf << (\"<span class=\\\"caret\\\"></span><ul class=\\\"hovedown-menu\\\"><li><a href=\\\"/api-reference/ios-uilib-api/index.html\\\">\".freeze); \n; \n; \n; @_out_buf << ((t('sub_nav.ios_uilib')).to_s); \n; @_out_buf << (\"</a></li><li><a href=\\\"/api-reference/android-uilib-api/index.html\\\">\".freeze); \n; @_out_buf << ((t('sub_nav.android_uilib')).to_s); \n; @_out_buf << (\"</a></li></ul></span>\".freeze); end; if @sdk_slug == 'onboard-sdk'; \n; @_out_buf << (\"<a href=\\\"/onboard-api-reference/index.html\\\" target=\\\"_blank\\\">\".freeze); @_out_buf << ((t('sub_nav.api_reference')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if @sdk_slug == 'payload-sdk'; \n; @_out_buf << (\"<a\".freeze); _slim_codeattributes7 = url('/payload-api-reference/introduction/index.html'); if _slim_codeattributes7; if _slim_codeattributes7 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes7))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" target=\\\"_blank\\\">\".freeze); @_out_buf << ((t('sub_nav.api_reference')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if @sdk_slug == 'windows-sdk'; \n; @_out_buf << (\"<a href=\\\"/api-reference/windows-api/index.html\\\">\".freeze); @_out_buf << ((t('sub_nav.api_reference')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; if @sdk_slug != 'payload-sdk'; \n; @_out_buf << (\"<a\".freeze); _temple_html_attributeremover4 = ''; _slim_codeattributes8 = active_url(\"\#{@sdk_slug}/downloads\"); if Array === _slim_codeattributes8; _slim_codeattributes8 = _slim_codeattributes8.flatten; _slim_codeattributes8.map!(&:to_s); _slim_codeattributes8.reject!(&:empty?); _temple_html_attributeremover4 << ((::Temple::Utils.escape_html((_slim_codeattributes8.join(\" \")))).to_s); else; _temple_html_attributeremover4 << ((::Temple::Utils.escape_html((_slim_codeattributes8))).to_s); end; _temple_html_attributeremover4; if !_temple_html_attributeremover4.empty?; @_out_buf << (\" class=\\\"\".freeze); @_out_buf << ((_temple_html_attributeremover4).to_s); @_out_buf << (\"\\\"\".freeze); end; _slim_codeattributes9 = url(\"\#{@sdk_slug}/downloads\"); if _slim_codeattributes9; if _slim_codeattributes9 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes9))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\">\".freeze); @_out_buf << ((t('sub_nav.downloads')).to_s); \n; @_out_buf << (\"</a>\".freeze); \n; \n; end; if @sdk_slug == 'mobile-sdk' || @sdk_slug == 'ux-sdk' || @sdk_slug == 'onboard-sdk' || @sdk_slug == 'windows-sdk' ||@sdk_slug == 'payload-sdk'; \n; @_out_buf << (\"<a\".freeze); _temple_html_attributeremover5 = ''; _slim_codeattributes10 = active_url(\"\#{@sdk_slug}/support\"); if Array === _slim_codeattributes10; _slim_codeattributes10 = _slim_codeattributes10.flatten; _slim_codeattributes10.map!(&:to_s); _slim_codeattributes10.reject!(&:empty?); _temple_html_attributeremover5 << ((::Temple::Utils.escape_html((_slim_codeattributes10.join(\" \")))).to_s); else; _temple_html_attributeremover5 << ((::Temple::Utils.escape_html((_slim_codeattributes10))).to_s); end; _temple_html_attributeremover5; if !_temple_html_attributeremover5.empty?; @_out_buf << (\" class=\\\"\".freeze); @_out_buf << ((_temple_html_attributeremover5).to_s); @_out_buf << (\"\\\"\".freeze); end; _slim_codeattributes11 = url(\"\#{@sdk_slug}/support\"); if _slim_codeattributes11; if _slim_codeattributes11 == true; @_out_buf << (\" href=\\\"\\\"\".freeze); else; @_out_buf << (\" href=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes11))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\">\".freeze); @_out_buf << ((t('sub_nav.support')).to_s); \n; @_out_buf << (\"</a>\".freeze); end; @_out_buf << (\"</nav></div></div>\".freeze); @_out_buf; ensure; @_out_buf = _temple_generators_stringbuffer1; end">}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :xss_mode=>:block, :nosniff=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :except=>[:session_hijacking, :remote_token]}, @frame_options="SAMEORIGIN">> |
rack.multiprocess | true |
rack.multithread | true |
rack.request.cookie_hash | {} |
rack.request.query_hash | {} |
rack.request.query_string | |
rack.run_once | false |
rack.url_scheme | http |
rack.version | [1, 3] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x00000002d3a3e0 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<NoMethodError: undefined method `empty?' for nil:NilClass> |
sinatra.route | GET /guidance-sdk/downloads |
You're seeing this error because you have
enabled the show_exceptions
setting.