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/index.slim
in
block in singleton class
.sdk-page.sdk-overview-page.guidance-sdk-page.guidance-sdk-overview-page
== slim :'share/sdk/sub-nav'
section.section-deprecated
.container
h3.title == t('guidance-sdk.deprecated')
.banner
.container
.content
h1.slogan == t('guidance-sdk.overview.banner.slogan')
/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>
@document = DocumentsController.find(@settings.DOCUMENT_ENV, @sdk_slug)
slim :'onboard-sdk/support'
end
get '/guidance-sdk' do
@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
/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 |
QUERY_STRING | |
REQUEST_METHOD | GET |
SCRIPT_NAME | |
SERVER_NAME | example.org |
SERVER_PORT | 80 |
rack.errors | #<Object:0x00000001c4a490> |
rack.input | #<StringIO:0x000000018566b8> |
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/index", {:outvar=>"@_out_buf", :default_encoding=>"utf-8"}, "/builds/sdk-developer-website/developer-website-fe/app/views"]=>#<Slim::Template:0x0000000181ecb8 @options={:outvar=>"@_out_buf"}, @line=1, @file="/builds/sdk-developer-website/developer-website-fe/app/views/guidance-sdk/index.slim", @compiled_method={[]=>#<UnboundMethod: Tilt::CompiledTemplates#__tilt_12677000>}, @default_encoding="utf-8", @reader=#<Proc:0x0000000181e448@/usr/local/bundle/gems/tilt-2.0.9/lib/tilt/template.rb:85 (lambda)>, @data=".sdk-page.sdk-overview-page.guidance-sdk-page.guidance-sdk-overview-page\n == slim :'share/sdk/sub-nav'\n section.section-deprecated\n .container\n h3.title == t('guidance-sdk.deprecated')\n .banner\n .container\n .content\n h1.slogan == t('guidance-sdk.overview.banner.slogan')\n p.desc == t('guidance-sdk.overview.banner.desc')\n section.section-platform\n .container\n h2.section-title == t('sdk-common.overview.platform')\n .content\n .row\n .col-xs-4\n .item\n img.logo src=image_path('onboard-sdk/windows.png')\n h4.title == t('onboard-sdk.overview.platform.windows')\n p.desc == t('guidance-sdk.overview.platform.windows-desc')\n a.btn-learn-more href=\"https://github.com/dji-sdk/Guidance-SDK\" target=\"_blank\" == t('btn.view-more')\n .col-xs-4\n .item\n img.logo src=image_path('onboard-sdk/linux.png')\n h4.title == t('onboard-sdk.overview.platform.linux')\n p.desc == t('guidance-sdk.overview.platform.linux-desc')\n a.btn-learn-more href=\"https://github.com/dji-sdk/Guidance-SDK-ROS\" target=\"_blank\" == t('btn.view-more')\n .col-xs-4\n .item\n img.logo src=image_path('guidance-sdk/arm.png')\n h4.title == t('onboard-sdk.overview.platform.embedded-systems')\n p.desc == t('guidance-sdk.overview.platform.embedded-systems-desc')\n a.btn-learn-more href=\"https://github.com/dji-sdk/Guidance-SDK\" target=\"_blank\" == t('btn.view-more')\n\n\n section.section-functions\n .container\n h2.section-title == t('sdk-common.overview.features')\n .group\n .category == t('guidance-sdk.overview.features.body-frame-status')\n .item\n img.icon src=image_path('guidance-sdk/features/3d-velocity.png')\n p.desc == t('guidance-sdk.overview.features.3d-velocity')\n .item\n img.icon src=image_path('guidance-sdk/features/3d-position.png')\n p.desc == t('guidance-sdk.overview.features.3d-position')\n .item\n img.icon src=image_path('guidance-sdk/features/outputs-distance.png')\n p.desc == t('guidance-sdk.overview.features.outputs-distance')\n .group\n .category == t('guidance-sdk.overview.features.sensor-data')\n .item\n img.icon src=image_path('guidance-sdk/features/outputs-imu.png')\n p.desc == t('guidance-sdk.overview.features.outputs-imu')\n .item\n img.icon src=image_path('guidance-sdk/features/outputs-ultrasonic.png')\n p.desc == t('guidance-sdk.overview.features.outputs-ultrasonic')\n .item\n .group\n .category == t('guidance-sdk.overview.features.images')\n .item\n img.icon src=image_path('guidance-sdk/features/outputs-images.png')\n p.desc == t('guidance-sdk.overview.features.outputs-images')\n .item\n img.icon src=image_path('guidance-sdk/features/outputs-depth-images.png')\n p.desc == t('guidance-sdk.overview.features.outputs-depth-images')\n .item\n .group\n .category == t('guidance-sdk.overview.features.camera-settings')\n .item\n img.icon src=image_path('guidance-sdk/features/access-cameras.png')\n p.desc == t('guidance-sdk.overview.features.access-cameras')\n .item\n img.icon src=image_path('guidance-sdk/features/access-exposure.png')\n p.desc == t('guidance-sdk.overview.features.access-exposure')\n .item\n section.section-supported\n .container\n .section-title == t('sdk-common.overview.api-functions')\n .content\n .row\n .col-xs-6\n .item \n img.logo src=image_path('guidance-sdk/usb.png')\n h4.name == t('guidance-sdk.overview.functions.usb')\n p.desc == t('guidance-sdk.overview.functions.usb-desc')\n .col-xs-6\n .item \n img.logo src=image_path('guidance-sdk/uart.png')\n h4.name == t('guidance-sdk.overview.functions.uart')\n p.desc == t('guidance-sdk.overview.functions.uart-desc')\n", @src="begin; _temple_generators_stringbuffer1 = @_out_buf if defined?(@_out_buf); @_out_buf = ''; @_out_buf << (\"<div class=\\\"sdk-page sdk-overview-page guidance-sdk-page guidance-sdk-overview-page\\\">\".freeze); \n; @_out_buf << ((slim :'share/sdk/sub-nav').to_s); \n; @_out_buf << (\"<section class=\\\"section-deprecated\\\"><div class=\\\"container\\\"><h3 class=\\\"title\\\">\".freeze); \n; \n; @_out_buf << ((t('guidance-sdk.deprecated')).to_s); \n; @_out_buf << (\"</h3></div></section><div class=\\\"banner\\\"><div class=\\\"container\\\"><div class=\\\"content\\\"><h1 class=\\\"slogan\\\">\".freeze); \n; \n; \n; @_out_buf << ((t('guidance-sdk.overview.banner.slogan')).to_s); \n; @_out_buf << (\"</h1><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.banner.desc')).to_s); \n; @_out_buf << (\"</p></div></div></div><section class=\\\"section-platform\\\"><div class=\\\"container\\\"><h2 class=\\\"section-title\\\">\".freeze); \n; \n; @_out_buf << ((t('sdk-common.overview.platform')).to_s); \n; @_out_buf << (\"</h2><div class=\\\"content\\\"><div class=\\\"row\\\"><div class=\\\"col-xs-4\\\"><div class=\\\"item\\\"><img class=\\\"logo\\\"\".freeze); \n; \n; \n; \n; _slim_codeattributes1 = image_path('onboard-sdk/windows.png'); if _slim_codeattributes1; if _slim_codeattributes1 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes1))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><h4 class=\\\"title\\\">\".freeze); \n; @_out_buf << ((t('onboard-sdk.overview.platform.windows')).to_s); \n; @_out_buf << (\"</h4><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.platform.windows-desc')).to_s); \n; @_out_buf << (\"</p><a class=\\\"btn-learn-more\\\" href=\\\"https://github.com/dji-sdk/Guidance-SDK\\\" target=\\\"_blank\\\">\".freeze); @_out_buf << ((t('btn.view-more')).to_s); \n; @_out_buf << (\"</a></div></div><div class=\\\"col-xs-4\\\"><div class=\\\"item\\\"><img class=\\\"logo\\\"\".freeze); \n; \n; _slim_codeattributes2 = image_path('onboard-sdk/linux.png'); if _slim_codeattributes2; if _slim_codeattributes2 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes2))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><h4 class=\\\"title\\\">\".freeze); \n; @_out_buf << ((t('onboard-sdk.overview.platform.linux')).to_s); \n; @_out_buf << (\"</h4><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.platform.linux-desc')).to_s); \n; @_out_buf << (\"</p><a class=\\\"btn-learn-more\\\" href=\\\"https://github.com/dji-sdk/Guidance-SDK-ROS\\\" target=\\\"_blank\\\">\".freeze); @_out_buf << ((t('btn.view-more')).to_s); \n; @_out_buf << (\"</a></div></div><div class=\\\"col-xs-4\\\"><div class=\\\"item\\\"><img class=\\\"logo\\\"\".freeze); \n; \n; _slim_codeattributes3 = image_path('guidance-sdk/arm.png'); if _slim_codeattributes3; if _slim_codeattributes3 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes3))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><h4 class=\\\"title\\\">\".freeze); \n; @_out_buf << ((t('onboard-sdk.overview.platform.embedded-systems')).to_s); \n; @_out_buf << (\"</h4><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.platform.embedded-systems-desc')).to_s); \n; @_out_buf << (\"</p><a class=\\\"btn-learn-more\\\" href=\\\"https://github.com/dji-sdk/Guidance-SDK\\\" target=\\\"_blank\\\">\".freeze); @_out_buf << ((t('btn.view-more')).to_s); \n; \n; \n; @_out_buf << (\"</a></div></div></div></div></div></section><section class=\\\"section-functions\\\"><div class=\\\"container\\\"><h2 class=\\\"section-title\\\">\".freeze); \n; \n; @_out_buf << ((t('sdk-common.overview.features')).to_s); \n; @_out_buf << (\"</h2><div class=\\\"group\\\"><div class=\\\"category\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.body-frame-status')).to_s); \n; @_out_buf << (\"</div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes4 = image_path('guidance-sdk/features/3d-velocity.png'); if _slim_codeattributes4; if _slim_codeattributes4 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes4))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.3d-velocity')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes5 = image_path('guidance-sdk/features/3d-position.png'); if _slim_codeattributes5; if _slim_codeattributes5 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes5))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.3d-position')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes6 = image_path('guidance-sdk/features/outputs-distance.png'); if _slim_codeattributes6; if _slim_codeattributes6 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes6))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.outputs-distance')).to_s); \n; @_out_buf << (\"</p></div></div><div class=\\\"group\\\"><div class=\\\"category\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.sensor-data')).to_s); \n; @_out_buf << (\"</div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes7 = image_path('guidance-sdk/features/outputs-imu.png'); if _slim_codeattributes7; if _slim_codeattributes7 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes7))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.outputs-imu')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes8 = image_path('guidance-sdk/features/outputs-ultrasonic.png'); if _slim_codeattributes8; if _slim_codeattributes8 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes8))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.outputs-ultrasonic')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"></div></div><div class=\\\"group\\\"><div class=\\\"category\\\">\".freeze); \n; \n; @_out_buf << ((t('guidance-sdk.overview.features.images')).to_s); \n; @_out_buf << (\"</div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes9 = image_path('guidance-sdk/features/outputs-images.png'); if _slim_codeattributes9; if _slim_codeattributes9 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes9))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.outputs-images')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes10 = image_path('guidance-sdk/features/outputs-depth-images.png'); if _slim_codeattributes10; if _slim_codeattributes10 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes10))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.outputs-depth-images')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"></div></div><div class=\\\"group\\\"><div class=\\\"category\\\">\".freeze); \n; \n; @_out_buf << ((t('guidance-sdk.overview.features.camera-settings')).to_s); \n; @_out_buf << (\"</div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes11 = image_path('guidance-sdk/features/access-cameras.png'); if _slim_codeattributes11; if _slim_codeattributes11 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes11))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.access-cameras')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"><img class=\\\"icon\\\"\".freeze); \n; _slim_codeattributes12 = image_path('guidance-sdk/features/access-exposure.png'); if _slim_codeattributes12; if _slim_codeattributes12 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes12))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><p class=\\\"desc\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.features.access-exposure')).to_s); \n; @_out_buf << (\"</p></div><div class=\\\"item\\\"></div></div></div></section><section class=\\\"section-supported\\\"><div class=\\\"container\\\"><div class=\\\"section-title\\\">\".freeze); \n; \n; \n; @_out_buf << ((t('sdk-common.overview.api-functions')).to_s); \n; @_out_buf << (\"</div><div class=\\\"content\\\"><div class=\\\"row\\\"><div class=\\\"col-xs-6\\\"><div class=\\\"item\\\"><img class=\\\"logo\\\"\".freeze); \n; \n; \n; \n; _slim_codeattributes13 = image_path('guidance-sdk/usb.png'); if _slim_codeattributes13; if _slim_codeattributes13 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes13))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><h4 class=\\\"name\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.functions.usb')).to_s); \n; @_out_buf << (\"</h4><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.functions.usb-desc')).to_s); \n; @_out_buf << (\"</p></div></div><div class=\\\"col-xs-6\\\"><div class=\\\"item\\\"><img class=\\\"logo\\\"\".freeze); \n; \n; _slim_codeattributes14 = image_path('guidance-sdk/uart.png'); if _slim_codeattributes14; if _slim_codeattributes14 == true; @_out_buf << (\" src=\\\"\\\"\".freeze); else; @_out_buf << (\" src=\\\"\".freeze); @_out_buf << ((::Temple::Utils.escape_html((_slim_codeattributes14))).to_s); @_out_buf << (\"\\\"\".freeze); end; end; @_out_buf << (\" /><h4 class=\\\"name\\\">\".freeze); \n; @_out_buf << ((t('guidance-sdk.overview.functions.uart')).to_s); \n; @_out_buf << (\"</h4><p class=\\\"desc\\\">\".freeze); @_out_buf << ((t('guidance-sdk.overview.functions.uart-desc')).to_s); \n; @_out_buf << (\"</p></div></div></div></div></div></section></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:0x00000002635658 @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:0x00000002635518@/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:0x00000001cd56d0 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.error | #<NoMethodError: undefined method `empty?' for nil:NilClass> |
sinatra.route | GET /guidance-sdk |
You're seeing this error because you have
enabled the show_exceptions
setting.