common.rb
parse
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/3.2.0/json/common.rb
in
parse
# ---
#
# Raises an exception if +source+ is not valid JSON:
# # Raises JSON::ParserError (783: unexpected token at ''):
# JSON.parse('')
#
def parse(source, opts = {})
Parser.new(source, **(opts||{})).parse
end
# :call-seq:
# JSON.parse!(source, opts) -> object
#
# Calls
# parse(source, opts)
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/3.2.0/json/common.rb
in
parse
# ---
#
# Raises an exception if +source+ is not valid JSON:
# # Raises JSON::ParserError (783: unexpected token at ''):
# JSON.parse('')
#
def parse(source, opts = {})
Parser.new(source, **(opts||{})).parse
end
# :call-seq:
# JSON.parse!(source, opts) -> object
#
# Calls
# parse(source, opts)
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/3.2.0/json/common.rb
in
load
source = source.to_io.read
elsif source.respond_to?(:read)
source = source.read
end
if opts[:allow_blank] && (source.nil? || source.empty?)
source = 'null'
end
result = parse(source, opts)
recurse_proc(result, &proc) if proc
result
end
# Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
def recurse_proc(result, &proc) # :nodoc:
case result
/home/ubuntu/chip-atlas/lib/pj/sra.rb
in
get_uid
end
def esearch_url
esearch_base + "?db=sra&term=#{@expid}&retmode=json"
end
def get_uid
uid = JSON.load(URI.open(esearch_url).read)["esearchresult"]["idlist"]
if uid.size == 1
uid.first
end
rescue OpenURI::HTTPError
nil
end
/home/ubuntu/chip-atlas/lib/pj/sra.rb
in
initialize
require 'nokogiri'
require 'json'
module PJ
class SRA
def initialize(expid)
@expid = expid
@uid = get_uid
@experiment = ncbi_experiment_data
end
def eutils_base
"https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
end
/home/ubuntu/chip-atlas/app.rb
in
new
get "/view" do
@expid = params[:id].upcase
if @expid =~ /^GSM/
redirect "/view?id=#{settings.gsm_to_srx[@expid]}"
end
redirect "not_found", 404 if !PJ::Experiment.id_valid?(@expid)
@ncbi = PJ::SRA.new(@expid).fetch
haml :experiment
end
#
# Colocalization analysis
#
/home/ubuntu/chip-atlas/app.rb
in
block in <class:PeakJohn>
get "/view" do
@expid = params[:id].upcase
if @expid =~ /^GSM/
redirect "/view?id=#{settings.gsm_to_srx[@expid]}"
end
redirect "not_found", 404 if !PJ::Experiment.id_valid?(@expid)
@ncbi = PJ::SRA.new(@expid).fetch
haml :experiment
end
#
# Colocalization analysis
#
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
call
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions = @conditions
@conditions = []
wrapper = block.arity.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block in compile!
pattern = compile(path, route_mustermann_opts)
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
conditions = @conditions
@conditions = []
wrapper = block.arity.zero? ?
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
[pattern, conditions, wrapper]
end
def compile(path, route_mustermann_opts = {})
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block (3 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
# Run routes defined in superclass.
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/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.
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block (2 levels) in route!
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
# Run routes defined in superclass.
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block in process_route
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
params ||= {}
params.each { |k, _| @params.delete(k) } unless @env['sinatra.error.params']
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
catch
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
process_route
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue StandardError
@env['sinatra.error.params'] = @params
raise
ensure
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
each
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
route!
end
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
routes = base.routes[@request.request_method]
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
route_eval { block[*args] }
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block in dispatch!
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['content-type'].nil?
end
route!
end
rescue ::Exception => e
invoke { handle_exception!(e) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => e
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
dispatch!
@params.merge!(@request.params).each do |key, val|
next unless val.respond_to?(:force_encoding)
val = val.dup if val.frozen?
@params[key] = force_encoding(val)
end
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before do
@pinned_response = !response['content-type'].nil?
end
route!
end
rescue ::Exception => e
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
block in call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['content-type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
catch
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
invoke
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(disposition: nil)
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke(&block)
res = catch(:halt, &block)
res = [res] if (Integer === res) || (String === res)
if (Array === res) && (Integer === res.first)
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
call!
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
@pinned_response = nil
template_cache.clear if settings.reload_templates
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['content-type']
if Array === body && body[0].respond_to?(:content_type)
content_type body[0].content_type
elsif (default = settings.default_content_type)
content_type default
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
call
@template_cache = TemplateCache.new
@pinned_response = nil # whether a before! filter pinned the content-type
yield self if block_given?
end
# Rack call interface.
def call(env)
dup.call!(env)
end
def call!(env) # :nodoc:
@env = env
@params = IndifferentHash.new
@request = Request.new(env)
@response = Response.new
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/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)
encoding = path.encoding
dot = '.'.encode(encoding)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/lib/rack/protection/json_csrf.rb
in
call
class JsonCsrf < Base
default_options allow_if: nil
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_and_close(env, body) or [status, headers, body]
else
[status, headers, body]
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/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) && (result.size == 3)
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/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) && (result.size == 3)
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-protection-4.0.0/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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/null_logger.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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/head.rb
in
call
# all other requests unchanged.
class Head
def initialize(app)
@app = app
end
def call(env)
_, _, body = response = @app.call(env)
if env[REQUEST_METHOD] == HEAD
response[2] = Rack::BodyProxy.new([]) do
body.close if body.respond_to? :close
end
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/show_exceptions.rb
in
call
def @@eats_errors.puts(*) end
def initialize(app)
@app = app
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'
body = dump_exception(e)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
call
# Some Rack handlers 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 = app.call(env)
callback = env['async.callback']
return result unless callback && async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/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_for_deprecation(message)
warn message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/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
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/rewindable_input.rb
in
call
class Middleware
def initialize(app)
@app = app
end
def call(env)
env[RACK_INPUT] = RewindableInput.new(env[RACK_INPUT])
@app.call(env)
end
end
def initialize(io)
@io = io
@rewindable_io = nil
@unlinked = false
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/tempfile_reaper.rb
in
call
@app = app
end
def call(env)
env[RACK_TEMPFILES] ||= []
begin
_, _, body = response = @app.call(env)
rescue Exception
env[RACK_TEMPFILES]&.each(&:close!)
raise
end
response[2] = BodyProxy.new(body) do
env[RACK_TEMPFILES]&.each(&:close!)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/lint.rb
in
response
raise LintError, "No env given" unless @env
check_environment(@env)
@env[RACK_INPUT] = InputWrapper.new(@env[RACK_INPUT])
@env[RACK_ERRORS] = ErrorWrapper.new(@env[RACK_ERRORS])
## and returns a non-frozen Array of exactly three values:
@response = @app.call(@env)
raise LintError, "response is not an Array, but #{@response.class}" unless @response.kind_of? Array
raise LintError, "response is frozen" if @response.frozen?
raise LintError, "response array has #{@response.size} elements instead of 3" unless @response.size == 3
@status, @headers, @body = @response
## The *status*,
check_status(@status)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/lint.rb
in
call
## after to catch all mistakes.
##
## = Rack applications
##
## A Rack application is a Ruby object (not a class) that
## responds to +call+.
def call(env = nil)
Wrapper.new(@app, env).response
end
class Wrapper
def initialize(app, env)
@app = app
@env = env
@response = nil
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/show_exceptions.rb
in
call
CONTEXT = 7
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
rescue StandardError, LoadError, SyntaxError => e
exception_string = dump_exception(e)
env[RACK_ERRORS].puts(exception_string)
env[RACK_ERRORS].flush
if accepts_html?(env)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/common_logger.rb
in
call
# will not be logged, so if exception handling middleware are used,
# they should be loaded after this middleware. Additionally, because
# the logging happens after the request body has been fully sent, any
# exceptions raised during the sending of the response body will
# cause the request not to be logged.
def call(env)
began_at = Utils.clock_time
status, headers, body = response = @app.call(env)
response[2] = BodyProxy.new(body) { log(env, status, headers, began_at) }
response
end
private
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
call
env['sinatra.commonlogger'] ? @app.call(env) : super
end
superclass.class_eval do
alias_method :call_without_check, :call unless method_defined? :call_without_check
def call(env)
env['sinatra.commonlogger'] = true
call_without_check(env)
end
end
end
class Error < StandardError # :nodoc:
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/chunked.rb
in
call
end
end
# If the rack app returns a response that should have a body,
# but does not have content-length or transfer-encoding headers,
# modify the response to use chunked transfer-encoding.
def call(env)
status, headers, body = response = @app.call(env)
if chunkable_version?(env[SERVER_PROTOCOL]) &&
!STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) &&
!headers[CONTENT_LENGTH] &&
!headers[TRANSFER_ENCODING]
headers[TRANSFER_ENCODING] = 'chunked'
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/content_length.rb
in
call
include Rack::Utils
def initialize(app)
@app = app
end
def call(env)
status, headers, body = response = @app.call(env)
if !STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) &&
!headers[CONTENT_LENGTH] &&
!headers[TRANSFER_ENCODING] &&
body.respond_to?(:to_ary)
response[2] = body = body.to_ary
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
process_client
env["rack.early_hints"] = lambda do |headers|
e103_response_write(client, headers)
end
end
env["rack.after_reply"] = []
status, headers, body = @app.call(env)
begin
return if @request.hijacked?
if 100 == status.to_i
e100_response_write(client, env)
status, headers, body = @app.call(env)
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
worker_loop
begin
reopen = reopen_worker_logs(worker.nr) if reopen
worker.tick = time_now.to_i
while sock = ready.shift
# Unicorn::Worker#kgio_tryaccept is not like accept(2) at all,
# but that will return false
if client = sock.kgio_tryaccept
process_client(client)
worker.tick = time_now.to_i
end
break if reopen
end
# timeout so we can .tick and keep parent from SIGKILL-ing us
worker.tick = time_now.to_i
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
spawn_missing_workers
worker = Unicorn::Worker.new(worker_nr)
before_fork.call(self, worker)
pid = @worker_exec ? worker_spawn(worker) : fork
unless pid
after_fork_internal
worker_loop(worker)
exit
end
@workers[pid] = worker
worker.atfork_parent
end
rescue => e
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
maintain_worker_count
rescue => e
@logger.error(e) rescue nil
exit!
end
def maintain_worker_count
(off = @workers.size - worker_processes) == 0 and return
off < 0 and return spawn_missing_workers
@workers.each_value { |w| w.nr >= worker_processes and w.soft_kill(:QUIT) }
end
# if we get any error, try to write something back to the client
# assuming we haven't closed the socket, but don't get hung up
# if the socket is already closed or broken. We'll always ensure
# the socket is closed at the end of this function
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/lib/unicorn/http_server.rb
in
join
# machine) comes out of suspend/hibernation
if (last_check + @timeout) >= (last_check = time_now)
sleep_time = murder_lazy_workers
else
sleep_time = @timeout/2.0 + 1
@logger.debug("waiting #{sleep_time}s after suspend/hibernation")
end
maintain_worker_count if respawn
master_sleep(sleep_time)
when :QUIT # graceful shutdown
break
when :TERM, :INT # immediate shutdown
stop(false)
break
when :USR1 # rotate logs
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/unicorn-6.1.0/bin/unicorn
in
<top (required)>
:unicorn_options => options,
:app => app,
:daemonize => rackup_opts[:daemonize],
})
end
Unicorn::Launcher.daemonize!(options) if rackup_opts[:daemonize]
Unicorn::HttpServer.new(app, options).start.join
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/bin/unicorn
in
load
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/bin/unicorn
in
<top (required)>
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb
in
load
def kernel_load(file, *args)
args.pop if args.last.is_a?(Hash)
ARGV.replace(args)
$0 = file
Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
require_relative "../setup"
TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
Kernel.load(file)
rescue SystemExit, SignalException
raise
rescue Exception # rubocop:disable Lint/RescueException
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
Bundler::FriendlyErrors.disable!
raise
end
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb
in
kernel_load
def kernel_load(file, *args)
args.pop if args.last.is_a?(Hash)
ARGV.replace(args)
$0 = file
Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
require_relative "../setup"
TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
Kernel.load(file)
rescue SystemExit, SignalException
raise
rescue Exception # rubocop:disable Lint/RescueException
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
Bundler::FriendlyErrors.disable!
raise
end
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli/exec.rb
in
run
end
def run
validate_cmd!
SharedHelpers.set_bundle_environment
if bin_path = Bundler.which(cmd)
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
return kernel_load(bin_path, *args)
end
kernel_exec(bin_path, *args)
else
# exec using the given command
kernel_exec(cmd, *args)
end
end
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli.rb
in
exec
D
def exec(*args)
if ARGV.include?("--no-keep-file-descriptors")
SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
end
require_relative "cli/exec"
Exec.new(options, args).run
end
map aliases_for("exec")
desc "config NAME [VALUE]", "Retrieve or set a configuration value"
long_desc <<-D
Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/command.rb
in
run
def run(instance, args = [])
arity = nil
if private_method?(instance)
instance.class.handle_no_command_error(name)
elsif public_method?(instance)
arity = instance.method(name).arity
instance.__send__(name, *args)
elsif local_method?(instance, :method_missing)
instance.__send__(:method_missing, name.to_sym, *args)
else
instance.class.handle_no_command_error(name)
end
rescue ArgumentError => e
handle_argument_error?(instance, e, caller) ? instance.class.handle_argument_error(self, e, args, arity) : (raise e)
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/invocation.rb
in
invoke_command
# Invoke the given command if the given args.
def invoke_command(command, *args) #:nodoc:
current = @_invocations[self.class]
unless current.include?(command.name)
current << command.name
command.run(self, *args)
end
end
alias_method :invoke_task, :invoke_command
# Invoke all commands for the current instance.
def invoke_all #:nodoc:
self.class.all_commands.map { |_, command| invoke_command(command) }
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor.rb
in
dispatch
config[:current_command] = command
config[:command_options] = command.options
instance = new(args, opts, config)
yield instance if block_given?
args = instance.args
trailing = args[Range.new(arguments.size, -1)]
instance.invoke_command(command, trailing || [])
end
# The banner for this class. You can customize it if you are invoking the
# thor class by another ways which is not the Bundler::Thor::Runner. It receives
# the command that is going to be invoked and a boolean which indicates if
# the namespace should be displayed as arguments.
#
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli.rb
in
dispatch
super
ensure
Bundler::SharedHelpers.print_major_deprecations!
end
def self.dispatch(*)
super do |i|
i.send(:print_command)
i.send(:warn_on_outdated_bundler)
end
end
def self.all_aliases
@all_aliases ||= begin
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/vendor/thor/lib/thor/base.rb
in
start
# can simply initialize it:
#
# script = MyScript.new(args, options, config)
# script.invoke(:command, first_arg, second_arg, third_arg)
#
def start(given_args = ARGV, config = {})
config[:shell] ||= Bundler::Thor::Base.shell.new
dispatch(nil, given_args.dup, nil, config)
rescue Bundler::Thor::Error => e
config[:debug] || ENV["THOR_DEBUG"] == "1" ? (raise e) : config[:shell].error(e.message)
exit(false) if exit_on_failure?
rescue Errno::EPIPE
# This happens if a thor command is piped to something like `head`,
# which closes the pipe when it's done reading. This will also
# mean that if the pipe is closed, further unnecessary
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/cli.rb
in
start
"cache" => ["package", "pack"],
"version" => ["-v", "--version"],
}.freeze
def self.start(*)
check_deprecated_ext_option(ARGV) if ARGV.include?("--ext")
super
ensure
Bundler::SharedHelpers.print_major_deprecations!
end
def self.dispatch(*)
super do |i|
i.send(:print_command)
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/exe/bundle
in
block in <top (required)>
require "bundler/cli"
# Allow any command to use --help flag to show help for that command
help_flags = %w[--help -h]
help_flag_used = ARGV.any? {|a| help_flags.include? a }
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
Bundler::CLI.start(args, :debug => true)
end
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler/friendly_errors.rb
in
with_friendly_errors
def new_issue_url
"https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md"
end
end
def self.with_friendly_errors
FriendlyErrors.enable!
yield
rescue SignalException
raise
rescue Exception => e # rubocop:disable Lint/RescueException
raise if FriendlyErrors.disabled?
FriendlyErrors.log_error(e)
exit FriendlyErrors.exit_status(e)
/home/ubuntu/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/exe/bundle
in
<top (required)>
"`gem install bundler` will break as soon as Bundler drops support for " \
"your Ruby version. Please upgrade RubyGems to avoid future breakage " \
"and silence this warning by running `gem update --system 3.2.3`"
end
require "bundler/friendly_errors"
Bundler.with_friendly_errors do
require "bundler/cli"
# Allow any command to use --help flag to show help for that command
help_flags = %w[--help -h]
help_flag_used = ARGV.any? {|a| help_flags.include? a }
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
/home/ubuntu/.rbenv/versions/3.2.2/bin/bundle
in
load
ENV['BUNDLER_VERSION'] = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('bundler', 'bundle', version)
else
gem "bundler", version
load Gem.bin_path("bundler", "bundle", version)
end
/home/ubuntu/.rbenv/versions/3.2.2/bin/bundle
in
<main>
ENV['BUNDLER_VERSION'] = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('bundler', 'bundle', version)
else
gem "bundler", version
load Gem.bin_path("bundler", "bundle", version)
end
Variable | Value |
---|---|
id | "SRX4367193" |
No POST data.
Variable | Value |
---|---|
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_HOST | chip-atlas.org |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.0 |
HTTP_X_AMZN_TRACE_ID | Root=1-660686d9-24d14f0a58eeeb9f6807f1ae |
HTTP_X_FORWARDED_FOR | 54.172.95.106, 10.1.1.103 |
HTTP_X_FORWARDED_PORT | 80 |
HTTP_X_FORWARDED_PROTO | http |
PATH_INFO | /view |
QUERY_STRING | id=SRX4367193 |
REMOTE_ADDR | 127.0.0.1 |
REQUEST_METHOD | GET |
REQUEST_PATH | /view |
REQUEST_URI | /view?id=SRX4367193 |
SCRIPT_NAME | |
SERVER_NAME | chip-atlas.org |
SERVER_PORT | 80 |
SERVER_PROTOCOL | HTTP/1.0 |
SERVER_SOFTWARE | Unicorn 6.1.0 |
rack.after_reply | [] |
rack.errors | #<Object:0x000079befc918ec8> |
rack.hijack | #<Proc:0x000079bece4278e8 /home/ubuntu/chip-atlas/vendor/bundle/ruby/3.2.0/gems/rack-3.0.10/lib/rack/lint.rb:556> |
rack.hijack? | true |
rack.input | #<Rack::RewindableInput:0x000079bece427780 @io=#<Rack::Lint::Wrapper::InputWrapper:0x000079bece4277f8 @input=#<StringIO:0x000079befcc96438>>, @rewindable_io=#<Tempfile:/tmp/RackRewindableInput20240329-102642-849k4u>, @unlinked=true> |
rack.logger | #<Rack::NullLogger:0x000079bedc1f1110 @app=#<Rack::Protection::FrameOptions:0x000079bedc1f1250 @app=#<Rack::Protection::HttpOrigin:0x000079bedc1f1390 @app=#<Rack::Protection::IPSpoofing:0x000079bedc1f14a8 @app=#<Rack::Protection::JsonCsrf:0x000079bedc1f15e8 @app=#<Rack::Protection::PathTraversal:0x000079bedc1f1700 @app=#<Rack::Protection::XSSHeader:0x000079bedc1f1890 @app=#<PeakJohn:0x000079bedc1fdca8 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Sinatra::TemplateCache:0x000079bedc1fdb68 @cache={}>, @pinned_response=nil>, @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", "text/xml", "application/xml"], :xss_mode=>:block, :nosniff=>true, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @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", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @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", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @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", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @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", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @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", "text/xml", "application/xml"], :frame_options=>:sameorigin, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}, @frame_options="SAMEORIGIN">> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.form_hash | {} |
rack.request.form_input | #<Rack::RewindableInput:0x000079bece427780 @io=#<Rack::Lint::Wrapper::InputWrapper:0x000079bece4277f8 @input=#<StringIO:0x000079befcc96438>>, @rewindable_io=#<Tempfile:/tmp/RackRewindableInput20240329-102642-849k4u>, @unlinked=true> |
rack.request.query_hash | {"id"=>"SRX4367193"} |
rack.request.query_string | id=SRX4367193 |
rack.run_once | false |
rack.tempfiles | [] |
rack.url_scheme | http |
rack.version | [1, 2] |
sinatra.accept | [#<Sinatra::Request::AcceptEntry:0x000079bece6553e0 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
sinatra.commonlogger | true |
sinatra.error | #<JSON::ParserError:"unexpected token at '{\"header\":{\"type\":\"esearch\",\"version\":\"0.3\"},\"esearchresult\":{\"ERROR\":\"Search Backend failed: \t\t\n\"}}\n'"> |
sinatra.error.params | {"id"=>"SRX4367193"} |
sinatra.route | GET /view |
unicorn.socket | #<Kgio::Socket:fd 7> |
You're seeing this error because you have
enabled the show_exceptions
setting.