Download coderank/dumps/project_search-model-sinatra.jsonl from paintedwolfcode/bialy-dataset: direct link, hf CLI and curl.
- Browser
- Download file 294 kB
-
https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/dumps/project_search-model-sinatra.jsonl
- Command line
-
hf download hf://datasets/paintedwolfcode/bialy-dataset/coderank/dumps/project_search-model-sinatra.jsonl
-
curl -L -o project_search-model-sinatra.jsonl https://huggingface.co/datasets/paintedwolfcode/bialy-dataset/resolve/main/coderank/dumps/project_search-model-sinatra.jsonl
294 kB
| {"site":"project_search","repo":"sinatra","task":"확장 기능 테스트 코드에서 특정 동작이 제대로 검증되지 않거나 테스트 케이스가 누락된 것 같습니다. 해당 기능의 로직이 의도한 대로 작동하는지 확인하는 테스트를 추가해야 합니다.","query":"extension test","file":"test/extensions_test.rb","symbol":"baz","line":19,"lang":"ko","candidates":[{"text":"File: README.md\nLine 2720: This is especially useful for testing Sinatra extensions or using Sinatra in","file":"README.md","line":2720,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 3: class ExtensionsTest < Minitest::Test","file":"test/extensions_test.rb","line":3,"lexical":0.6000000000000001,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"这个测试里检查的那个查找键值对的方法是怎么实现的?","query":"assoc method","file":"test/indifferent_hash_test.rb","symbol":"test_assoc","line":89,"lang":"zh","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 93: if Hash.method_defined? :assoc","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":93,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 146: end if Hash.method_defined? :assoc","file":"sinatra-contrib/spec/cookies_spec.rb","line":146,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 697: end if Hash.method_defined? :rassoc","file":"sinatra-contrib/spec/cookies_spec.rb","line":697,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"define un método it que ejecute el bloque de prueba para cada servidor asíncrono instalado","query":"integration async helper","file":"test/integration_async_helper.rb","symbol":"IntegrationAsyncHelper","line":3,"lang":"es","candidates":[{"text":"File: test/integration_async_helper.rb\nLine 3: module IntegrationAsyncHelper","file":"test/integration_async_helper.rb","line":3,"lexical":0.65,"target":true},{"text":"File: test/integration_async_test.rb\nLine 2: require File.expand_path('integration_async_helper', __dir__)","file":"test/integration_async_test.rb","line":2,"lexical":0.65,"target":false},{"text":"File: test/integration_async_test.rb\nLine 6: extend IntegrationAsyncHelper","file":"test/integration_async_test.rb","line":6,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"마지막 요청의 세션 데이터 반환","query":"last request session","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","symbol":"session","line":190,"lang":"ko","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 189: # @return [Hash] Session of last request, or the empty Hash","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":189,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 194: last_request.session","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":194,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"クッキーのデータをハッシュ値に変換する処理を探しています。ハッシュ化して比較などに使いたいのですが、どこに定義されていますか?","query":"cookie hash","file":"sinatra-contrib/lib/sinatra/cookies.rb","symbol":"hash","line":170,"lang":"ja","candidates":[{"text":"File: README.md\nLine 1722: request.cookies # hash of browser cookies","file":"README.md","line":1722,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 226: response_cookies.rehash","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":226,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 227: request_cookies.rehash","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":227,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 134: it 'adds a value to the cookies hash' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":134,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 149: it 'removes request cookies from cookies hash' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":149,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 156: it 'does not remove response cookies from cookies hash' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":156,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 185: it 'removes request cookies from cookies hash' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":185,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 192: it 'does not remove response cookies from cookies hash' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":192,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Es scheint ein Problem bei der Prüfung zu geben, ob eine Anfrage mit den definierten Routen übereinstimmt, da die Validierung nicht nur das Muster der URL, sondern auch die zugehörigen Parameter berücksichtigt.","query":"route pattern match","file":"lib/sinatra/base.rb","symbol":"accepts?","line":151,"lang":"de","candidates":[{"text":"File: CHANGELOG.md\nLine 616: * Expose matched pattern as env[\"sinatra.route\"]. (Aman Gupta)","file":"CHANGELOG.md","line":616,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 1634: * Fixed that \".\" in route patterns erroneously matched any character","file":"CHANGELOG.md","line":1634,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 122: In Sinatra, a route is an HTTP method paired with a URL-matching pattern.","file":"README.md","line":122,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 370: patterns and regular expressions as route matches. However, it does not","file":"README.md","line":370,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1112: captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }","file":"lib/sinatra/base.rb","line":1112,"lexical":0.44999999999999996,"target":true},{"text":"File: test/routing_test.rb\nLine 3: # Helper method for easy route pattern matching testing","file":"test/routing_test.rb","line":3,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Je cherche comment l'instance de l'application est initialisée pour les tests. Peux-tu me montrer la méthode qui retourne l'objet de test ou crée un faux environnement si rien n'est défini ?","query":"mock_app DummyApp","file":"rack-protection/spec/support/spec_helpers.rb","symbol":"app","line":11,"lang":"fr","candidates":[{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 41: mock_app DummyAppWithBody do |_e|","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/support/spec_helpers.rb\nLine 13: @app || mock_app(DummyApp)","file":"rack-protection/spec/support/spec_helpers.rb","line":13,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estoy intentando modificar cómo se gestionan los encabezados de la respuesta. ¿Podrías explicarme cómo se está construyendo la cadena del tipo de contenido y cómo se manejan los parámetros adicionales como el charset?","query":"response content-type","file":"lib/sinatra/base.rb","symbol":"content_type","line":384,"lang":"es","candidates":[{"text":"File: README.md\nLine 1983: to <tt>nil</tt> to not set a default Content-Type on every response; when","file":"README.md","line":1983,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 382: # Set the content-type of the response body given a media type or file","file":"lib/sinatra/base.rb","line":382,"lexical":0.39999999999999997,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 385: return response['content-type'] unless type","file":"lib/sinatra/base.rb","line":385,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 403: response['content-type'] = mime_type","file":"lib/sinatra/base.rb","line":403,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 422: content_type(ext) unless response['content-type'] || ext.empty?","file":"lib/sinatra/base.rb","line":422,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 427: if opts[:type] || !response['content-type']","file":"lib/sinatra/base.rb","line":427,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 985: @pinned_response = nil # whether a before! filter pinned the content-type","file":"lib/sinatra/base.rb","line":985,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1005: unless @response['content-type']","file":"lib/sinatra/base.rb","line":1005,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1068: response.delete_header('content-type') unless @pinned_response","file":"lib/sinatra/base.rb","line":1068,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1193: @pinned_response = !response['content-type'].nil?","file":"lib/sinatra/base.rb","line":1193,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1761: response_content_type = response['content-type']","file":"lib/sinatra/base.rb","line":1761,"lexical":0.39999999999999997,"target":false},{"text":"File: test/base_test.rb\nLine 194: assert_equal 'foo/bar;baz=1', response['Content-Type']","file":"test/base_test.rb","line":194,"lexical":0.39999999999999997,"target":false},{"text":"File: test/builder_test.rb\nLine 25: assert_equal \"application/xml;charset=utf-8\", response['Content-Type']","file":"test/builder_test.rb","line":25,"lexical":0.39999999999999997,"target":false},{"text":"File: test/builder_test.rb\nLine 34: assert_equal \"text/html;charset=utf-8\", response['Content-Type']","file":"test/builder_test.rb","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: test/builder_test.rb\nLine 42: assert_equal \"text/html;charset=utf-8\", response['Content-Type']","file":"test/builder_test.rb","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: test/filter_test.rb\nLine 273: assert_equal 'application/json', response.headers['Content-Type']","file":"test/filter_test.rb","line":273,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 626: assert_equal 'text/plain;charset=utf-8', response['Content-Type']","file":"test/helpers_test.rb","line":626,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 640: assert_equal 'text/html;charset=latin1', response['Content-Type']","file":"test/helpers_test.rb","line":640,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 655: assert_equal 'application/foo', response['Content-Type']","file":"test/helpers_test.rb","line":655,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 709: assert_equal 'foo/bar;level=1;charset=utf-8', response['Content-Type']","file":"test/helpers_test.rb","line":709,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 721: assert_equal 'foo/bar;level=1;charset=utf-8;version=1.0', response['Content-Type']","file":"test/helpers_test.rb","line":721,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 733: assert_equal 'text/plain;charset=utf-16', response['Content-Type']","file":"test/helpers_test.rb","line":733,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 752: assert_equal 'image/png;comment=\"Hello, world!\"', response['Content-Type']","file":"test/helpers_test.rb","line":752,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 754: assert_equal 'image/png;comment=\"semi;colon\"', response['Content-Type']","file":"test/helpers_test.rb","line":754,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 756: assert_equal 'image/png;comment=\"\\\"Whatever.\\\"\"', response['Content-Type']","file":"test/helpers_test.rb","line":756,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 770: it 'sets the Content-Type response header' do","file":"test/helpers_test.rb","line":770,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 773: assert_equal 'application/xml;charset=utf-8', response['Content-Type']","file":"test/helpers_test.rb","line":773,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 777: it 'sets the Content-Type response header without extname' do","file":"test/helpers_test.rb","line":777,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 780: assert_equal 'text/html;charset=utf-8', response['Content-Type']","file":"test/helpers_test.rb","line":780,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 784: it 'sets the Content-Type response header with extname' do","file":"test/helpers_test.rb","line":784,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 794: assert_equal 'application/atom+xml', response['Content-Type']","file":"test/helpers_test.rb","line":794,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 839: it 'sets the Content-Type response header if a mime-type can be located' do","file":"test/helpers_test.rb","line":839,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Comment obtenir le jeton d'authenticité à partir de la session actuelle ?","query":"authenticity token session","file":"rack-protection/lib/rack/protection/authenticity_token.rb","symbol":"token","line":111,"lang":"fr","candidates":[{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 84: # <input type=\"hidden\" name=\"authenticity_token\" value=\"#{Rack::Protection::AuthenticityToken.token(env['rack.session'])}\" />","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":84,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 112: new(nil).mask_authenticity_token(session, path: path, method: method)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":112,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 131: def mask_authenticity_token(session, path: nil, method: :post)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":131,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 31: post('/', { 'authenticity_token' => token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":31,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 41: post('/', { 'authenticity_token' => bad_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":41,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 46: token = Rack::Protection::AuthenticityToken.token(session, path: '/foo')","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":46,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 47: post('/foo', { 'authenticity_token' => token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":47,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 52: token = Rack::Protection::AuthenticityToken.token(session, path: '/foo')","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":52,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 53: post('/bar', { 'authenticity_token' => token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":53,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 89: expect(Rack::Protection::AuthenticityToken.token(session)).not_to eq(masked_token)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":89,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 92: it 'sets a session authenticity token if one does not exist' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":92,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 96: Rack::Protection::AuthenticityToken.token(session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":96,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 31: post('/', { 'authenticity_token' => token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":31,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 41: post('/', { 'authenticity_token' => bad_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":41,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"在集成测试中,针对所有已安装的服务运行测试用例时,如果其中一个服务运行失败,会导致整个测试套件的行为异常,或者无法正确区分不同服务环境下失败的具体上下文。","query":"server run_test","file":"test/integration_helper.rb","symbol":"it","line":119,"lang":"zh","candidates":[{"text":"File: test/integration_async_helper.rb\nLine 9: super(\"with #{server.name}: #{message}\") { server.run_test(self, &block) }","file":"test/integration_async_helper.rb","line":9,"lexical":0.39999999999999997,"target":false},{"text":"File: test/integration_helper.rb\nLine 122: super(\"with #{server.name}: #{message}\") { server.run_test(self, &block) }","file":"test/integration_helper.rb","line":122,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Como posso armazenar a saída de um bloco de template em uma variável para reutilizá-la depois? Estou tentando capturar o conteúdo gerado por visualização para manipulá-lo ou combiná-lo com outros idiomas de template.","query":"capture template block","file":"sinatra-contrib/lib/sinatra/capture.rb","symbol":"Sinatra","line":4,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 21: * [`sinatra/capture`][sinatra-capture]: Let's you capture the content of blocks in templates.","file":"sinatra-contrib/README.md","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/content_for.rb\nLine 178: haml? && Tilt[:haml] == Tilt::HamlTemplate && respond_to?(:capture_haml) ? capture_haml(*args, &block) : yield(*args)","file":"sinatra-contrib/lib/sinatra/content_for.rb","line":178,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"erkläre wie server mit dynamischen ports gestartet werden","query":"server run port","file":"test/integration_async_helper.rb","symbol":"extend_object","line":13,"lang":"de","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 60: warn \"#{server} up and running on port #{port}\" if ping","file":"sinatra-contrib/lib/sinatra/runner.rb","line":60,"lexical":0.65,"target":false},{"text":"File: test/integration_async_helper.rb\nLine 20: Server.run(server, base_port+index, async: true)","file":"test/integration_async_helper.rb","line":20,"lexical":0.44999999999999996,"target":true},{"text":"File: test/integration_helper.rb\nLine 24: def self.run(server, port, async: false)","file":"test/integration_helper.rb","line":24,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_helper.rb\nLine 25: new(server, port, async).run","file":"test/integration_helper.rb","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_helper.rb\nLine 143: Server.run(server, base_port+index)","file":"test/integration_helper.rb","line":143,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"创建一个模拟sinatra应用的助手方法","query":"mock sinatra app","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","symbol":"mock_app","line":123,"lang":"zh","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 114: # Instantiate and configure a mock Sinatra app.","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":114,"lexical":0.55,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 122: # @return [Sinatra] Configured mocked app","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":122,"lexical":0.55,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 123: def mock_app(base = Sinatra::Base, &block)","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":123,"lexical":0.55,"target":false},{"text":"File: test/delegator_test.rb\nLine 39: mock_app { Sinatra::Delegator.target = self }","file":"test/delegator_test.rb","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: test/mapped_error_test.rb\nLine 121: mock_app(Sinatra::Application) do","file":"test/mapped_error_test.rb","line":121,"lexical":0.65,"target":false},{"text":"File: test/middleware_test.rb\nLine 5: @app = mock_app(Sinatra::Application) do","file":"test/middleware_test.rb","line":5,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 20: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 41: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":41,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 52: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: test/test_helper.rb\nLine 78: def mock_app(base=Sinatra::Base, &block)","file":"test/test_helper.rb","line":78,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"現在のテンプレートファイルのパスを返すメソッドを実装してください。この値はエラーページをレンダリングする際に使用されます。","query":"show exceptions template","file":"lib/sinatra/show_exceptions.rb","symbol":"template","line":48,"lang":"ja","candidates":[{"text":"File: CHANGELOG.md\nLine 435: * Override Rack::ShowExceptions#pretty to set custom template [#1377](https://github.com/sinatra/sinatra/issues/1377). Fixes [#1376](https://github.com/sinatra/sinatra/issues/1376) by Jordan Owens","file":"CHANGELOG.md","line":435,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 460: * Add Sinatra::ShowExceptions::TEMPLATE and patched Rack::ShowExceptions to prefer Sinatra template by Zachary Scott.","file":"CHANGELOG.md","line":460,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"suche die logik zur erstellung von isolierten routenbereichen mit eigenen einstellungen und vorlagen","query":"route namespace","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"Namespace","line":188,"lang":"de","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 11: # routes within the namespace, and define filters, conditions and error","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":11,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 60: # set of helpers within a namespace, they only affect the routes defined in","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":60,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 470: it 'routes to nested namespaces' do","file":"sinatra-contrib/spec/namespace_spec.rb","line":470,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Wie kann ich in einer Sinatra-Klasse mit dem `stream`-Objekt synchron über eine HTTP-Antwort streamen und es für spätere Sendevorgänge verfügbar machen?","query":"sinatra stream","file":"test/integration/app.rb","symbol":"Subclass","line":64,"lang":"de","candidates":[{"text":"File: CHANGELOG.md\nLine 134: * Fix: Add support to keep open streaming connections with Puma [#1858](https://github.com/sinatra/sinatra/pull/1858) by Jordan Owens","file":"CHANGELOG.md","line":134,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 316: * Use Rainbows instead of thin for async/stream features. Closes [#1624](https://github.com/sinatra/sinatra/issues/1624) [#1627](https://github.com/sinatra/sinatra/pull/1627) by Ryuichi KAWAMATA","file":"CHANGELOG.md","line":316,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/stream.ru\nLine 12: class Stream < Sinatra::Base","file":"examples/stream.ru","line":12,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/README.md\nLine 166: [sinatra-streaming]: http://www.sinatrarb.com/contrib/streaming","file":"sinatra-contrib/README.md","line":166,"lexical":0.5,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib.rb\nLine 23: helpers :Streaming, 'sinatra/streaming'","file":"sinatra-contrib/lib/sinatra/contrib.rb","line":23,"lexical":0.5,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 6: # = Sinatra::Streaming","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":6,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 8: # Sinatra 1.3 introduced the +stream+ helper. This addon improves the","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":8,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 68: # require \"sinatra/streaming\"","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":68,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 73: # require \"sinatra/streaming\"","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":73,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 76: # helpers Sinatra::Streaming","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":76,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 3: RSpec.describe Sinatra::Streaming do","file":"sinatra-contrib/spec/streaming_spec.rb","line":3,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 9: helpers Sinatra::Streaming","file":"sinatra-contrib/spec/streaming_spec.rb","line":9,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 33: expect(out).to be_a(Sinatra::Helpers::Stream)","file":"sinatra-contrib/spec/streaming_spec.rb","line":33,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 49: context Sinatra::Streaming::Stream do","file":"sinatra-contrib/spec/streaming_spec.rb","line":49,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 52: expect(out).to be_a(Sinatra::Streaming::Stream)","file":"sinatra-contrib/spec/streaming_spec.rb","line":52,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 59: expect(out).to be_a(Sinatra::Helpers::Stream)","file":"sinatra-contrib/spec/streaming_spec.rb","line":59,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 60: expect(out).not_to be_a(Sinatra::Streaming::Stream)","file":"sinatra-contrib/spec/streaming_spec.rb","line":60,"lexical":0.6000000000000001,"target":false},{"text":"File: test/streaming_test.rb\nLine 4: Stream = Sinatra::Helpers::Stream","file":"test/streaming_test.rb","line":4,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"심볼이랑 문자열 키를 구분하지 않고 처리하는 해시 클래스 테스트 코드 좀 찾아줘","query":"indifferent hash test","file":"test/indifferent_hash_test.rb","symbol":"TestIndifferentHash","line":67,"lang":"ko","candidates":[{"text":"File: test/indifferent_hash_test.rb\nLine 9: class TestIndifferentHashBasics < Minitest::Test","file":"test/indifferent_hash_test.rb","line":9,"lexical":0.65,"target":true},{"text":"File: test/indifferent_hash_test.rb\nLine 67: class TestIndifferentHash < Minitest::Test","file":"test/indifferent_hash_test.rb","line":67,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"확장 기능이 등록 중인지 확인하는 로직이 어디에 있어?","query":"registering extension","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"registering_extension?","line":409,"lang":"ko","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 344: start_registering_extension","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":344,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 346: stop_registering_extension","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":346,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 399: def start_registering_extension","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":399,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 404: def stop_registering_extension","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":404,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 409: def registering_extension?","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":409,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 425: list.watch(register_path, element) if registering_extension?","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":425,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Est-ce que ce code détermine si la longueur du contenu doit être calculée automatiquement ?","query":"calculate content length","file":"lib/sinatra/base.rb","symbol":"calculate_content_length?","line":207,"lang":"fr","candidates":[{"text":"File: CHANGELOG.md\nLine 741: * Recalculate Content-Length even if hard coded if body is reset. Relevant","file":"CHANGELOG.md","line":741,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 196: if calculate_content_length?","file":"lib/sinatra/base.rb","line":196,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 207: def calculate_content_length?","file":"lib/sinatra/base.rb","line":207,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 49: it 'Calculates the Content-Length using the bytesize of the body' do","file":"test/response_test.rb","line":49,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm trying to implement some custom middleware to handle specific HTTP verbs. How can I check if the current incoming request is using the specific method intended for establishing a relationship between resources?","query":"request method LINK","file":"lib/sinatra/base.rb","symbol":"link?","line":78,"lang":"en","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 79: request_method == 'LINK'","file":"lib/sinatra/base.rb","line":79,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 83: request_method == 'UNLINK'","file":"lib/sinatra/base.rb","line":83,"lexical":0.44999999999999996,"target":false},{"text":"File: test/test_helper.rb\nLine 120: request(uri, env.merge(:method => \"LINK\", :params => params), &block)","file":"test/test_helper.rb","line":120,"lexical":0.44999999999999996,"target":false},{"text":"File: test/test_helper.rb\nLine 124: request(uri, env.merge(:method => \"UNLINK\", :params => params), &block)","file":"test/test_helper.rb","line":124,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estoy revisando cómo se añaden los middlewares automáticamente al cargar la extensión. ¿Dónde se configura la inclusión de este middleware de peticiones HEAD?","query":"Rack::Head middleware","file":"sinatra-contrib/spec/reloader_spec.rb","symbol":"registered","line":282,"lang":"es","candidates":[{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 160: :middlewares => [Rack::Head]","file":"sinatra-contrib/spec/reloader_spec.rb","line":160,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 169: :middlewares => [Rack::Head]","file":"sinatra-contrib/spec/reloader_spec.rb","line":169,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Comment empêcher l'enregistrement de journaux pour les actifs statiques comme les images, CSS et JS dans Sinatra ?","query":"sinatra quiet logger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","symbol":"QuietLogger","line":36,"lang":"fr","candidates":[{"text":"File: CHANGELOG.md\nLine 308: * Add QuietLogger that excludes paths from Rack::CommonLogger [1250](https://github.com/sinatra/sinatra/pull/1250) by Christoph Wagner","file":"CHANGELOG.md","line":308,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/README.md\nLine 72: * `sinatra/quiet_logger`: Extension to exclude specific paths from access log.","file":"sinatra-contrib/README.md","line":72,"lexical":0.55,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 4: # = Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":4,"lexical":0.65,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 18: # require 'sinatra/quiet_logger'","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":18,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 21: # register Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":21,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 28: # require 'sinatra/quiet_logger'","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":28,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 33: # register Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":33,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 2: require 'sinatra/quiet_logger'","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":2,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 5: RSpec.describe Sinatra::QuietLogger do","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":5,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 13: register Sinatra::QuietLogger","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":13,"lexical":0.65,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 29: register Sinatra::QuietLogger","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":29,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"判断当前 HTTP 状态码是否需要丢弃响应体","query":"drop body response","file":"lib/sinatra/base.rb","symbol":"drop_body?","line":215,"lang":"zh","candidates":[{"text":"File: CHANGELOG.md\nLine 419: * Remove status code 205 from drop body response [#1398](https://github.com/sinatra/sinatra/issues/1398) by Shota Iguchi","file":"CHANGELOG.md","line":419,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 172: DROP_BODY_RESPONSES = [204, 304].freeze","file":"lib/sinatra/base.rb","line":172,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 216: DROP_BODY_RESPONSES.include?(status)","file":"lib/sinatra/base.rb","line":216,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm working on a way to trigger file downloads in my routes. How does this framework handle setting the headers and sanitizing the filename for the content disposition?","query":"Content-Disposition filename","file":"lib/sinatra/base.rb","symbol":"attachment","line":415,"lang":"en","candidates":[{"text":"File: CHANGELOG.md\nLine 148: * Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai","file":"CHANGELOG.md","line":148,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 212: * Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai","file":"CHANGELOG.md","line":212,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 413: # Set the Content-Disposition to \"attachment\" with the specified filename,","file":"lib/sinatra/base.rb","line":413,"lexical":0.39999999999999997,"target":true},{"text":"File: test/helpers_test.rb\nLine 798: it 'escapes filename in the Content-Disposition header according to the multipart form data spec in WHATWG living standard' do","file":"test/helpers_test.rb","line":798,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 807: assert_equal 'attachment; filename=\"test.xml%22;%0D%0Aext=.txt\"', response['Content-Disposition']","file":"test/helpers_test.rb","line":807,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 893: assert_equal 'attachment; filename=\"file.txt\"', response['Content-Disposition']","file":"test/helpers_test.rb","line":893,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 905: assert_equal 'inline; filename=\"file.txt\"', response['Content-Disposition']","file":"test/helpers_test.rb","line":905,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 911: assert_equal 'inline; filename=\"file.txt\"', response['Content-Disposition']","file":"test/helpers_test.rb","line":911,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 914: it \"sets the Content-Disposition header when :filename provided\" do","file":"test/helpers_test.rb","line":914,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 917: assert_equal 'attachment; filename=\"foo.txt\"', response['Content-Disposition']","file":"test/helpers_test.rb","line":917,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"고정된 정수 값을 반환하는 메서드 찾아줘","query":"def magic","file":"sinatra-contrib/spec/namespace_spec.rb","symbol":"magic","line":352,"lang":"ko","candidates":[{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 336: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":336,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 352: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":352,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 367: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":367,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 386: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":386,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 405: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":405,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 429: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":429,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 448: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":448,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 454: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":454,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 497: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":497,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 516: def magic","file":"sinatra-contrib/spec/namespace_spec.rb","line":516,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Dans le cadre des tests Sinatra, comment récupérer l'environnement HTTP de la dernière requête simulée ?","query":"last request env","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","symbol":"last_env","line":198,"lang":"fr","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 197: # @return The env of the last request","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":197,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 199: last_request.env","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":199,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"如何设置测试用的 cookie?","query":"cookies helper","file":"sinatra-contrib/spec/cookies_spec.rb","symbol":"cookies","line":17,"lang":"zh","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 28: * [`sinatra/cookies`][sinatra-cookies]: A `cookies` helper for reading and writing cookies.","file":"sinatra-contrib/README.md","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib.rb\nLine 19: helpers :Cookies, 'sinatra/cookies'","file":"sinatra-contrib/lib/sinatra/contrib.rb","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 52: # helpers Sinatra::Cookies","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":52,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 344: helpers Cookies","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":344,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 24: helpers Sinatra::Cookies","file":"sinatra-contrib/spec/cookies_spec.rb","line":24,"lexical":0.6000000000000001,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Comment est-ce que la comparaison de chaînes est sécurisée ici pour éviter les attaques par timing ?","query":"secure compare","file":"rack-protection/lib/rack/protection/base.rb","symbol":"secure_compare","line":166,"lang":"fr","candidates":[{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 210: secure_compare(token, real_token(session))","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":210,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 214: secure_compare(token, global_token(session))","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":214,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 218: secure_compare(token,","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":218,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 166: def secure_compare(a, b)","file":"rack-protection/lib/rack/protection/base.rb","line":166,"lexical":0.39999999999999997,"target":true},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 167: Rack::Utils.secure_compare(a.to_s, b.to_s)","file":"rack-protection/lib/rack/protection/base.rb","line":167,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Wie wird der Status gesetzt, um die Verbindung oder den Schutzmechanismus zu beenden?","query":"set closed true","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","symbol":"close","line":8,"lang":"de","candidates":[{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 316: it 'sets #closed? to true' do","file":"sinatra-contrib/spec/streaming_spec.rb","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 323: it 'sets #closed_write? to true' do","file":"sinatra-contrib/spec/streaming_spec.rb","line":323,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find where the collection iterator is mapped to the underlying all method in the test setup","query":"each all block","file":"test/integration_helper.rb","symbol":"each","line":20,"lang":"en","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 297: def block.each; yield(call) end","file":"lib/sinatra/base.rb","line":297,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1054: # Accepts an optional block to call after each filter is applied.","file":"lib/sinatra/base.rb","line":1054,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_helper.rb\nLine 21: all.each(&block)","file":"test/integration_helper.rb","line":21,"lexical":0.44999999999999996,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"检查当前环境是否为终端","query":"is tty","file":"sinatra-contrib/lib/sinatra/streaming.rb","symbol":"tty?","line":237,"lang":"zh","candidates":[{"text":"File: CHANGELOG.md\nLine 435: * Override Rack::ShowExceptions#pretty to set custom template [#1377](https://github.com/sinatra/sinatra/issues/1377). Fixes [#1376](https://github.com/sinatra/sinatra/issues/1376) by Jordan Owens","file":"CHANGELOG.md","line":435,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 546: * Fix compatibility issue with Rack `pretty` method from ShowExceptions.","file":"CHANGELOG.md","line":546,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 685: * \"Sinatra doesn't know this ditty\" pages now show the app class when running","file":"CHANGELOG.md","line":685,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2065: <h2>Sinatra doesn’t know this ditty.</h2>","file":"lib/sinatra/base.rb","line":2065,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 241: alias isatty tty?","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":241,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"我正在编写关于这个非严格类型哈希容器的单元测试。能帮我找一下目前关于初始化构造函数、默认值设置以及默认块行为的测试用例吗?","query":"indifferent hash test","file":"test/indifferent_hash_test.rb","symbol":"TestIndifferentHashBasics","line":9,"lang":"zh","candidates":[{"text":"File: test/indifferent_hash_test.rb\nLine 9: class TestIndifferentHashBasics < Minitest::Test","file":"test/indifferent_hash_test.rb","line":9,"lexical":0.65,"target":true},{"text":"File: test/indifferent_hash_test.rb\nLine 67: class TestIndifferentHash < Minitest::Test","file":"test/indifferent_hash_test.rb","line":67,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"crée une méthode pour échapper les paramètres de la requête","query":"escape params","file":"rack-protection/lib/rack/protection/escaped_params.rb","symbol":"handle","line":109,"lang":"fr","candidates":[{"text":"File: CHANGELOG.md\nLine 318: * Enable EscapedParams if passed via settings. Closes [#1615](https://github.com/sinatra/sinatra/issues/1615) [#1632](https://github.com/sinatra/sinatra/issues/1632) by Anders Bälter","file":"CHANGELOG.md","line":318,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 112: * [`Rack::Protection::EscapedParams`][escaped-params] (not included by `use Rack::Protection`)","file":"rack-protection/README.md","line":112,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 169: [escaped-params]: http://www.sinatrarb.com/protection/escaped_params","file":"rack-protection/README.md","line":169,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 12: autoload :EscapedParams, 'rack/protection/escaped_params'","file":"rack-protection/lib/rack/protection.rb","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 40: use ::Rack::Protection::EscapedParams, options if use_these.include? :escaped_params","file":"rack-protection/lib/rack/protection.rb","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 19: # Automatically escapes <tt>Rack::Request#params</tt> so they can be embedded in HTML","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":19,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 48: # use Rack::Protection::EscapedParams","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":48,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 52: # use Rack::Protection::EscapedParams, escape: [:html, :url]","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":52,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 68: # use Rack::Protection::EscapedParams, escape: [:html, :url, :javascript],","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":68,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 70: class EscapedParams < Base","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":70,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/escaped_params_spec.rb\nLine 3: RSpec.describe Rack::Protection::EscapedParams do","file":"rack-protection/spec/lib/rack/protection/escaped_params_spec.rb","line":3,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/escaped_params_spec.rb\nLine 49: temp_file = File.open('_escaped_params_tmp_file', 'w')","file":"rack-protection/spec/lib/rack/protection/escaped_params_spec.rb","line":49,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/escaped_params_spec.rb\nLine 55: expect(body).to eq(\"_escaped_params_tmp_file\\nhello world\\n<bar>\")","file":"rack-protection/spec/lib/rack/protection/escaped_params_spec.rb","line":55,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Onde está definida essa implementação que permite iterar sobre o objeto mas não faz nada?","query":"each * end","file":"test/response_test.rb","symbol":"each","line":60,"lang":"pt","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1785: extensions.each { |e| e.send(name, *args) if e.respond_to?(name) }","file":"lib/sinatra/base.rb","line":1785,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1801: options.each_pair { |option, args| send(option, *args) }","file":"lib/sinatra/base.rb","line":1801,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/extension.rb\nLine 76: recorded_methods.each { |m, a, b| object.send(m, *a, &b) }","file":"sinatra-contrib/lib/sinatra/extension.rb","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 258: @extensions.each { |e| e.send(name, *args) if e.respond_to?(name) }","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":258,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 60: def object.each(*) end","file":"test/response_test.rb","line":60,"lexical":0.44999999999999996,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Il semble y avoir un problème avec la gestion des extensions permettant de définir plusieurs chemins ou plusieurs verbes HTTP au sein d'un seul bloc d'exécution. Pourriez-vous vérifier la logique qui permet de grouper ces paramètres ?","query":"multiple routes verbs","file":"sinatra-contrib/lib/sinatra/multi_route.rb","symbol":"Sinatra","line":5,"lang":"fr","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 40: routes and multiple or custom HTTP verbs.","file":"sinatra-contrib/README.md","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/multi_route.rb\nLine 24: # Or for multiple verbs and multiple routes:","file":"sinatra-contrib/lib/sinatra/multi_route.rb","line":24,"lexical":0.44999999999999996,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"我在处理响应格式的处理逻辑。能帮我解释一下这个方法是如何在没有参数的情况下获取支持的媒体类型列表的吗?","query":"respond_to formats","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"respond_to","line":214,"lang":"zh","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 214: def respond_to(*formats)","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":214,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 219: @respond_to.concat formats","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":219,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Wie wird das Authentifizierungstoken im Session-Objekt gespeichert, falls noch keins existiert?","query":"set session token","file":"rack-protection/lib/rack/protection/authenticity_token.rb","symbol":"set_token","line":148,"lang":"de","candidates":[{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 121: set_token(session)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":121,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 132: set_token(session)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":132,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 148: def set_token(session)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":148,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 71: it \"sets a new csrf token for the session in env, even after a 'safe' request\" do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":71,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 92: it 'sets a session authenticity token if one does not exist' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":92,"lexical":0.65,"target":false},{"text":"File: test/settings_test.rb\nLine 622: it 'sets up RemoteToken if sessions are enabled' do","file":"test/settings_test.rb","line":622,"lexical":0.65,"target":false},{"text":"File: test/settings_test.rb\nLine 629: it 'sets up RemoteToken if sessions are enabled with a custom session store' do","file":"test/settings_test.rb","line":629,"lexical":0.65,"target":false},{"text":"File: test/settings_test.rb\nLine 640: it 'does not set up RemoteToken if sessions are disabled' do","file":"test/settings_test.rb","line":640,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find where the routing block for a specific path pattern is initialized","query":"pattern conditions block","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"namespace","line":222,"lang":"en","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1067: routes&.each do |pattern, conditions, block|","file":"lib/sinatra/base.rb","line":1067,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1070: returned_pass_block = process_route(pattern, conditions) do |*args|","file":"lib/sinatra/base.rb","line":1070,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1098: def process_route(pattern, conditions, block = nil, values = [])","file":"lib/sinatra/base.rb","line":1098,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 189: def self.new(base, pattern, conditions = {}, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":189,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 222: def namespace(pattern, conditions = {}, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":222,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 223: Sinatra::Namespace.new(self, pattern, conditions, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":223,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 347: def prefixed(method, pattern = nil, conditions = {}, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":347,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 350: result = base.send(method, pattern, **conditions, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":350,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"目前的逻辑似乎会对路径中的点和斜杠进行解码并展开,这可能会导致目录遍历攻击的风险,请检查拦截路径穿越攻击的实现逻辑是否正确。","query":"path traversal","file":"rack-protection/lib/rack/protection/path_traversal.rb","symbol":"Protection","line":6,"lang":"zh","candidates":[{"text":"File: README.md\nLine 251: By the way, unless you disable the path traversal attack protection (see","file":"README.md","line":251,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 1925: set :protection, :except => :path_traversal","file":"README.md","line":1925,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 1930: set :protection, :except => [:path_traversal, :remote_token]","file":"README.md","line":1930,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 22: use Rack::Protection, :except => :path_traversal","file":"rack-protection/README.md","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 85: except: [:path_traversal, :json_csrf]","file":"rack-protection/README.md","line":85,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 126: * [`Rack::Protection::PathTraversal`][path-traversal]","file":"rack-protection/README.md","line":126,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 176: [path-traversal]: http://www.sinatrarb.com/protection/path_traversal","file":"rack-protection/README.md","line":176,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 19: autoload :PathTraversal, 'rack/protection/path_traversal'","file":"rack-protection/lib/rack/protection.rb","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 52: use ::Rack::Protection::PathTraversal, options unless except.include? :path_traversal","file":"rack-protection/lib/rack/protection.rb","line":52,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/path_traversal.rb\nLine 14: class PathTraversal < Base","file":"rack-protection/lib/rack/protection/path_traversal.rb","line":14,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/spec/lib/rack/protection/path_traversal_spec.rb\nLine 3: RSpec.describe Rack::Protection::PathTraversal do","file":"rack-protection/spec/lib/rack/protection/path_traversal_spec.rb","line":3,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/path_traversal_spec.rb\nLine 24: app = Rack::Protection::PathTraversal.new(proc { 42 })","file":"rack-protection/spec/lib/rack/protection/path_traversal_spec.rb","line":24,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/path_traversal_spec.rb\nLine 31: @app = Rack::Protection::PathTraversal.new(proc { |e| [200, { 'content-type' => 'text/plain' }, [e['PATH_INFO'].encoding.to_s]] })","file":"rack-protection/spec/lib/rack/protection/path_traversal_spec.rb","line":31,"lexical":0.6000000000000001,"target":false},{"text":"File: test/routing_test.rb\nLine 97: set :protection, :except => :path_traversal","file":"test/routing_test.rb","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 607: it 'sets up Rack::Protection::PathTraversal' do","file":"test/settings_test.rb","line":607,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 610: assert_include MiddlewareTracker.used, Rack::Protection::PathTraversal","file":"test/settings_test.rb","line":610,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 614: it 'does not set up Rack::Protection::PathTraversal when disabling it' do","file":"test/settings_test.rb","line":614,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 616: Sinatra.new { set :protection, :except => :path_traversal }.new","file":"test/settings_test.rb","line":616,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 618: assert !MiddlewareTracker.used.include?(Rack::Protection::PathTraversal)","file":"test/settings_test.rb","line":618,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm trying to figure out how to define multiple HTTP methods for the same URL pattern in a single block. Can you show me the logic that handles passing an array of verbs and paths to the underlying routing system?","query":"multiple route verbs","file":"sinatra-contrib/lib/sinatra/multi_route.rb","symbol":"route","line":69,"lang":"en","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 40: routes and multiple or custom HTTP verbs.","file":"sinatra-contrib/README.md","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/multi_route.rb\nLine 24: # Or for multiple verbs and multiple routes:","file":"sinatra-contrib/lib/sinatra/multi_route.rb","line":24,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Es scheint, als würde der Standard-Handler für nicht gefundene Ressourcen nicht korrekt die spezifische Fehlerklasse aufrufen, um den entsprechenden Status zu setzen.","query":"not found error","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"not_found","line":261,"lang":"de","candidates":[{"text":"File: CHANGELOG.md\nLine 456: * Unify `not_found` and `error` 404 behavior [#896](https://github.com/sinatra/sinatra/issues/896) by Jeremy Evans.","file":"CHANGELOG.md","line":456,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 719: * Setting status code to 404 in error handler no longer triggers not_found","file":"CHANGELOG.md","line":719,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 933: `server_error?` and `not_found?` helper methods to ease dealing with status","file":"CHANGELOG.md","line":933,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 1817: * Development error/not_found page cleanup [sr, adamwiggins]","file":"CHANGELOG.md","line":1817,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2225: requests, and special `not_found` and `error` handlers display stack","file":"README.md","line":2225,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2333: Sinatra installs special `not_found` and `error` handlers when","file":"README.md","line":2333,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 281: class NotFound < Error # :nodoc:","file":"lib/sinatra/base.rb","line":281,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2032: error NotFound do","file":"lib/sinatra/base.rb","line":2032,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2118: :template, :layout, :before, :after, :error, :not_found, :configure,","file":"lib/sinatra/base.rb","line":2118,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 262: error(Sinatra::NotFound, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":262,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 567: error(404) { 'not found...' }","file":"sinatra-contrib/spec/namespace_spec.rb","line":567,"lexical":0.44999999999999996,"target":false},{"text":"File: test/asciidoctor_test.rb\nLine 34: it 'raises error if template not found' do","file":"test/asciidoctor_test.rb","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: test/builder_test.rb\nLine 81: it \"raises error if template not found\" do","file":"test/builder_test.rb","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: test/haml_test.rb\nLine 43: it \"raises error if template not found\" do","file":"test/haml_test.rb","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 355: not_found { JSON.dump(\"error\" => \"Not Found\") }","file":"test/helpers_test.rb","line":355,"lexical":0.44999999999999996,"target":false},{"text":"File: test/liquid_test.rb\nLine 43: it \"raises error if template not found\" do","file":"test/liquid_test.rb","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: test/mapped_error_test.rb\nLine 131: error(FooNotFound) { \"foo! not found.\" }","file":"test/mapped_error_test.rb","line":131,"lexical":0.65,"target":false},{"text":"File: test/markaby_test.rb\nLine 64: it \"raises error if template not found\" do","file":"test/markaby_test.rb","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: test/markdown_test.rb\nLine 62: it \"raises error if template not found\" do","file":"test/markdown_test.rb","line":62,"lexical":0.44999999999999996,"target":false},{"text":"File: test/nokogiri_test.rb\nLine 59: it \"raises error if template not found\" do","file":"test/nokogiri_test.rb","line":59,"lexical":0.44999999999999996,"target":false},{"text":"File: test/rabl_test.rb\nLine 48: it \"raises error if template not found\" do","file":"test/rabl_test.rb","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: test/rdoc_test.rb\nLine 28: it \"raises error if template not found\" do","file":"test/rdoc_test.rb","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 152: error Sinatra::NotFound do","file":"test/routing_test.rb","line":152,"lexical":0.44999999999999996,"target":false},{"text":"File: test/sass_test.rb\nLine 57: it \"raises error if template not found\" do","file":"test/sass_test.rb","line":57,"lexical":0.44999999999999996,"target":false},{"text":"File: test/scss_test.rb\nLine 57: it \"raises error if template not found\" do","file":"test/scss_test.rb","line":57,"lexical":0.44999999999999996,"target":false},{"text":"File: test/slim_test.rb\nLine 43: it \"raises error if template not found\" do","file":"test/slim_test.rb","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: test/yajl_test.rb\nLine 27: it 'raises error if template not found' do","file":"test/yajl_test.rb","line":27,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm looking for the extension that provides hash-like access to browser storage via the response headers so I can read and write cookie values in my routes.","query":"cookies helper","file":"sinatra-contrib/lib/sinatra/cookies.rb","symbol":"Sinatra","line":5,"lang":"en","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 28: * [`sinatra/cookies`][sinatra-cookies]: A `cookies` helper for reading and writing cookies.","file":"sinatra-contrib/README.md","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib.rb\nLine 19: helpers :Cookies, 'sinatra/cookies'","file":"sinatra-contrib/lib/sinatra/contrib.rb","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 52: # helpers Sinatra::Cookies","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":52,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 344: helpers Cookies","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":344,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 24: helpers Sinatra::Cookies","file":"sinatra-contrib/spec/cookies_spec.rb","line":24,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"¿Dónde se define este módulo que extiende la funcionalidad de carga?","query":"extend Loader","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","symbol":"Custom","line":38,"lang":"es","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/contrib/setup.rb\nLine 35: extend Loader","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","line":35,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/contrib/setup.rb\nLine 39: extend Loader","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","line":39,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib/setup.rb\nLine 48: extend Loader","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","line":48,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find die sammlung die dateibeobachter verwaltet und mit der app verknüpft","query":"app watcher list","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"List","line":124,"lang":"de","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 283: # +Watcher::List+ for the Sinatra application to watch the defined","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":283,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 299: # tells the +Watcher::List+ for the Sinatra application to watch the","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":299,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 309: # +Watcher::List+ for the Sinatra application to watch the middleware","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":309,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 318: # the +Watcher::List+ for the Sinatra application to watch the defined","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":318,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 329: # +Watcher::List+ for the Sinatra application to watch the defined","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":329,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 414: # tells the Watcher::List for the current application to watch it","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":414,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"테스트 베이스 클래스에서 인자를 초기화하는 부분 어디에 있지?","query":"initialize argument","file":"test/base_test.rb","symbol":"initialize","line":10,"lang":"ko","candidates":[{"text":"File: test/base_test.rb\nLine 9: class TestKeywordArgumentInitializerApp < Sinatra::Base","file":"test/base_test.rb","line":9,"lexical":0.39999999999999997,"target":true},{"text":"File: test/base_test.rb\nLine 10: def initialize(argument:)","file":"test/base_test.rb","line":10,"lexical":0.39999999999999997,"target":false},{"text":"File: test/base_test.rb\nLine 61: app = TestKeywordArgumentInitializerApp.new(argument: \"some argument\")","file":"test/base_test.rb","line":61,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"How does the mechanism for immediately executing all pending deferred actions work?","query":"pop call empty","file":"test/streaming_test.rb","symbol":"defer!","line":74,"lang":"en","candidates":[{"text":"File: test/streaming_test.rb\nLine 73: def schedule!(*) @schedule.pop.call until @schedule.empty? end","file":"test/streaming_test.rb","line":73,"lexical":0.44999999999999996,"target":true},{"text":"File: test/streaming_test.rb\nLine 74: def defer!(*) @defer.pop.call until @defer.empty? end","file":"test/streaming_test.rb","line":74,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"查找对哈希内容进行转义处理的方法","query":"escape hash","file":"rack-protection/lib/rack/protection/escaped_params.rb","symbol":"escape_hash","line":124,"lang":"zh","candidates":[{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 111: hash.replace escape(hash)","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":111,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 117: when Hash then escape_hash(object)","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":117,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 124: def escape_hash(hash)","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":124,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 126: hash.each { |k, v| hash[k] = escape(v) }","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":126,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"보안 관련 미들웨어 모듈들을 자동 로드하는 부분 찾아줘","query":"rack protection autoload","file":"rack-protection/lib/rack/protection.rb","symbol":"Protection","line":7,"lang":"ko","candidates":[{"text":"File: rack-protection/lib/rack/protection.rb\nLine 8: autoload :AuthenticityToken, 'rack/protection/authenticity_token'","file":"rack-protection/lib/rack/protection.rb","line":8,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 9: autoload :Base, 'rack/protection/base'","file":"rack-protection/lib/rack/protection.rb","line":9,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 10: autoload :CookieTossing, 'rack/protection/cookie_tossing'","file":"rack-protection/lib/rack/protection.rb","line":10,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 11: autoload :ContentSecurityPolicy, 'rack/protection/content_security_policy'","file":"rack-protection/lib/rack/protection.rb","line":11,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 12: autoload :EscapedParams, 'rack/protection/escaped_params'","file":"rack-protection/lib/rack/protection.rb","line":12,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 13: autoload :FormToken, 'rack/protection/form_token'","file":"rack-protection/lib/rack/protection.rb","line":13,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 14: autoload :FrameOptions, 'rack/protection/frame_options'","file":"rack-protection/lib/rack/protection.rb","line":14,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 15: autoload :HostAuthorization, 'rack/protection/host_authorization'","file":"rack-protection/lib/rack/protection.rb","line":15,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 16: autoload :HttpOrigin, 'rack/protection/http_origin'","file":"rack-protection/lib/rack/protection.rb","line":16,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 17: autoload :IPSpoofing, 'rack/protection/ip_spoofing'","file":"rack-protection/lib/rack/protection.rb","line":17,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 18: autoload :JsonCsrf, 'rack/protection/json_csrf'","file":"rack-protection/lib/rack/protection.rb","line":18,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 19: autoload :PathTraversal, 'rack/protection/path_traversal'","file":"rack-protection/lib/rack/protection.rb","line":19,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 20: autoload :ReferrerPolicy, 'rack/protection/referrer_policy'","file":"rack-protection/lib/rack/protection.rb","line":20,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 21: autoload :RemoteReferrer, 'rack/protection/remote_referrer'","file":"rack-protection/lib/rack/protection.rb","line":21,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 22: autoload :RemoteToken, 'rack/protection/remote_token'","file":"rack-protection/lib/rack/protection.rb","line":22,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 23: autoload :SessionHijacking, 'rack/protection/session_hijacking'","file":"rack-protection/lib/rack/protection.rb","line":23,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 24: autoload :StrictTransport, 'rack/protection/strict_transport'","file":"rack-protection/lib/rack/protection.rb","line":24,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 25: autoload :XSSHeader, 'rack/protection/xss_header'","file":"rack-protection/lib/rack/protection.rb","line":25,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find where command line arguments are parsed for server settings","query":"optparse params config","file":"lib/sinatra/main.rb","symbol":"Sinatra","line":3,"lang":"en","candidates":[{"text":"File: lib/sinatra/main.rb\nLine 24: PARAMS_CONFIG[:optparse_error] = e","file":"lib/sinatra/main.rb","line":24,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/main.rb\nLine 39: error = PARAMS_CONFIG.delete(:optparse_error)","file":"lib/sinatra/main.rb","line":39,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"trouve la logique qui détecte la falsification d'adresse ip via les headers de proxy","query":"ip spoofing","file":"rack-protection/lib/rack/protection/ip_spoofing.rb","symbol":"Rack","line":5,"lang":"fr","candidates":[{"text":"File: CHANGELOG.md\nLine 152: * Fix: fixed ReDoS for Rack::Protection::IPSpoofing. [#1823](https://github.com/sinatra/sinatra/pull/1823) by @ooooooo-q","file":"CHANGELOG.md","line":152,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 214: * Fix: fixed ReDoS for Rack::Protection::IPSpoofing. [#1823](https://github.com/sinatra/sinatra/pull/1823) by @ooooooo-q","file":"CHANGELOG.md","line":214,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 140: ## IP Spoofing","file":"rack-protection/README.md","line":140,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 144: * [`Rack::Protection::IPSpoofing`][ip-spoofing]","file":"rack-protection/README.md","line":144,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 174: [ip-spoofing]: http://www.sinatrarb.com/protection/ip_spoofing","file":"rack-protection/README.md","line":174,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 17: autoload :IPSpoofing, 'rack/protection/ip_spoofing'","file":"rack-protection/lib/rack/protection.rb","line":17,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 50: use ::Rack::Protection::IPSpoofing, options unless except.include? :ip_spoofing","file":"rack-protection/lib/rack/protection.rb","line":50,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/ip_spoofing.rb\nLine 8: # Prevented attack:: IP spoofing","file":"rack-protection/lib/rack/protection/ip_spoofing.rb","line":8,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/lib/rack/protection/ip_spoofing.rb\nLine 10: # More infos:: http://blog.c22.cc/2011/04/22/surveymonkey-ip-spoofing/","file":"rack-protection/lib/rack/protection/ip_spoofing.rb","line":10,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/ip_spoofing.rb\nLine 12: # Detect (some) IP spoofing attacks.","file":"rack-protection/lib/rack/protection/ip_spoofing.rb","line":12,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/ip_spoofing.rb\nLine 13: class IPSpoofing < Base","file":"rack-protection/lib/rack/protection/ip_spoofing.rb","line":13,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb\nLine 3: RSpec.describe Rack::Protection::IPSpoofing do","file":"rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb","line":3,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"테스트 파일에서 정의된 메서드 찾아줘","query":"def test","file":"test/extensions_test.rb","symbol":"bar","line":14,"lang":"ko","candidates":[{"text":"File: CHANGELOG.md\nLine 23: * Defaults to `.localhost`, `.test` and any IP address in development mode.","file":"CHANGELOG.md","line":23,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 790: * Fix default content type for Sinatra::Response with latest Rack release.","file":"CHANGELOG.md","line":790,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 1993: <dd>Display errors in the log. Enabled by default unless environment is \"test\".</dd>","file":"README.md","line":1993,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2235: You can use predefined methods: `development?`, `test?` and `production?` to","file":"README.md","line":2235,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2378: In the `test` environment, `raise_errors` is set to `true` by default. This","file":"README.md","line":2378,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2446: def test_my_default","file":"README.md","line":2446,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2451: def test_with_params","file":"README.md","line":2451,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2456: def test_with_user_agent","file":"README.md","line":2456,"lexical":0.39999999999999997,"target":false},{"text":"File: Rakefile\nLine 8: task default: :test","file":"Rakefile","line":8,"lexical":0.39999999999999997,"target":false},{"text":"File: Rakefile\nLine 26: Minitest::TestTask.create # Default `test` task","file":"Rakefile","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1575: def test?; environment == :test end","file":"lib/sinatra/base.rb","line":1575,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 22: # requests are made with env { HTTP_HOST => Rack::Test::DEFAULT_HOST }","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: test/contest.rb\nLine 58: def self.test(name, &block)","file":"test/contest.rb","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: test/contest.rb\nLine 59: define_method(test_name(name), &block)","file":"test/contest.rb","line":59,"lexical":0.6000000000000001,"target":false},{"text":"File: test/contest.rb\nLine 75: def self.test_name(name)","file":"test/contest.rb","line":75,"lexical":0.6000000000000001,"target":false},{"text":"File: test/contest.rb\nLine 86: def self.remove_tests(subclass)","file":"test/contest.rb","line":86,"lexical":0.6000000000000001,"target":false},{"text":"File: test/helpers_test.rb\nLine 6: def test_default","file":"test/helpers_test.rb","line":6,"lexical":0.6000000000000001,"target":false},{"text":"File: test/helpers_test.rb\nLine 2018: def my_test","file":"test/helpers_test.rb","line":2018,"lexical":0.6000000000000001,"target":false},{"text":"File: test/helpers_test.rb\nLine 2031: def my_test","file":"test/helpers_test.rb","line":2031,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 5: require 'minitest/autorun' unless defined?(Minitest)","file":"test/indifferent_hash_test.rb","line":5,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 10: def test_flattened_constructor","file":"test/indifferent_hash_test.rb","line":10,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 16: def test_pairs_constructor","file":"test/indifferent_hash_test.rb","line":16,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 22: def test_default_block","file":"test/indifferent_hash_test.rb","line":22,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 28: def test_default_object","file":"test/indifferent_hash_test.rb","line":28,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 34: def test_default_assignment","file":"test/indifferent_hash_test.rb","line":34,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 41: def test_assignment","file":"test/indifferent_hash_test.rb","line":41,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 55: def test_merge!","file":"test/indifferent_hash_test.rb","line":55,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 75: def test_hash_constructor","file":"test/indifferent_hash_test.rb","line":75,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 89: def test_assoc","file":"test/indifferent_hash_test.rb","line":89,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 95: def test_rassoc","file":"test/indifferent_hash_test.rb","line":95,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 102: def test_fetch","file":"test/indifferent_hash_test.rb","line":102,"lexical":0.6000000000000001,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 111: def test_symbolic_retrieval","file":"test/indifferent_hash_test.rb","line":111,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"How do I define a module that adds new settings and routes to a web framework application?","query":"Sinatra extension example","file":"sinatra-contrib/spec/extension_spec.rb","symbol":"ExampleExtension","line":4,"lang":"en","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 97: A single extension (example: sinatra-content-for):","file":"sinatra-contrib/README.md","line":97,"lexical":0.55,"target":false},{"text":"File: sinatra-contrib/README.md\nLine 120: A single extension (example: sinatra-content-for):","file":"sinatra-contrib/README.md","line":120,"lexical":0.55,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"sinatraの標準エラー定義ファイルを見つける","query":"sinatra error class","file":"lib/sinatra/base.rb","symbol":"Error","line":274,"lang":"ja","candidates":[{"text":"File: test/mapped_error_test.rb\nLine 9: class FooSpecialError < Sinatra::Error","file":"test/mapped_error_test.rb","line":9,"lexical":0.65,"target":false},{"text":"File: test/mapped_error_test.rb\nLine 13: class FooStatusOutOfRangeError < Sinatra::Error","file":"test/mapped_error_test.rb","line":13,"lexical":0.65,"target":false},{"text":"File: test/mapped_error_test.rb\nLine 17: class FooWithCode < Sinatra::Error","file":"test/mapped_error_test.rb","line":17,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"테스트 환경을 개발 모드로 고정하는 설정이 어디에 있어?","query":"test environment development","file":"test/integration_helper.rb","symbol":"environment","line":32,"lang":"ko","candidates":[{"text":"File: CHANGELOG.md\nLine 1802: * Top-level environment test predicates: development?, test?, production?","file":"CHANGELOG.md","line":1802,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2017: <li>in the <tt>development</tt> environment, it is set to <tt>.localhost</tt>, <tt>.test</tt> and any IPv4/IPv6 address</li>","file":"README.md","line":2017,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/config_file.rb\nLine 110: # traditional environments: development, test and production.","file":"sinatra-contrib/lib/sinatra/config_file.rb","line":110,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/config_file.rb\nLine 112: base.set :environments, %w[test production development]","file":"sinatra-contrib/lib/sinatra/config_file.rb","line":112,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Como eu pego a versão do projeto lendo o arquivo de texto na raiz?","query":"read VERSION file","file":"Rakefile","symbol":"source_version","line":10,"lang":"pt","candidates":[{"text":"File: Rakefile\nLine 11: @source_version ||= File.read(File.expand_path('VERSION', __dir__)).strip","file":"Rakefile","line":11,"lexical":0.65,"target":true},{"text":"File: Rakefile\nLine 202: File.write(path, File.read(path).sub(/VERSION = '(.+?)'/, \"VERSION = '#{source_version}'\"))","file":"Rakefile","line":202,"lexical":0.65,"target":false},{"text":"File: sinatra.gemspec\nLine 3: version = File.read(File.expand_path('VERSION', __dir__)).strip","file":"sinatra.gemspec","line":3,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"busca la lógica que verifica si un hash contiene claves de entorno reconocidas","query":"hash environment keys","file":"sinatra-contrib/lib/sinatra/config_file.rb","symbol":"environment_keys?","line":165,"lang":"es","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/config_file.rb\nLine 146: return from_environment_key(hash) if environment_keys?(hash)","file":"sinatra-contrib/lib/sinatra/config_file.rb","line":146,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/config_file.rb\nLine 165: def environment_keys?(hash)","file":"sinatra-contrib/lib/sinatra/config_file.rb","line":165,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"在处理流式响应时,中间件会错误地将响应体中的所有字符串全部转换为大写,这会导致原始数据内容被破坏。","query":"body map upcase","file":"sinatra-contrib/spec/streaming_spec.rb","symbol":"call","line":148,"lang":"zh","candidates":[{"text":"File: README.md\nLine 1343: [status, headers, body.map(&:upcase)]","file":"README.md","line":1343,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 38: # body.map! { |e| e.upcase }","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":38,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 57: # body = body.each.map { |s| s.upcase }","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":57,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 150: body.map! { |s| s.upcase }","file":"sinatra-contrib/spec/streaming_spec.rb","line":150,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 175: [status, headers, body.map(&:upcase)]","file":"sinatra-contrib/spec/streaming_spec.rb","line":175,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 189: [status, headers, body.map(&:upcase).map(&:reverse)]","file":"sinatra-contrib/spec/streaming_spec.rb","line":189,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 203: [status, headers, body.each.map(&:upcase)]","file":"sinatra-contrib/spec/streaming_spec.rb","line":203,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 1618: [status, headers, body.each.map(&:upcase)]","file":"test/routing_test.rb","line":1618,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"trouve la méthode qui appelle super avec une clé fixe et des arguments variables","query":"super :foo args","file":"sinatra-contrib/spec/namespace_spec.rb","symbol":"dump_args","line":851,"lang":"fr","candidates":[{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 852: super(:foo, *args)","file":"sinatra-contrib/spec/namespace_spec.rb","line":852,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 861: super(:foo_bar, *args)","file":"sinatra-contrib/spec/namespace_spec.rb","line":861,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estou tentando entender como as extensões do Sinatra são carregadas e configuradas quando um módulo é adicionado ao app. Você pode me mostrar onde as configurações de mapeamento de extensões e os motores de template são inicializados?","query":"set ext_map","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"registered","line":264,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 143: exts = settings.ext_map[type]","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":143,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 265: base.set :ext_map, Hash.new { |h, k| h[k] = [] }","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":265,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"busca la clase que configura la ruta del archivo principal y la ejecución automática","query":"app_file run","file":"lib/sinatra/main.rb","symbol":"Application","line":30,"lang":"es","candidates":[{"text":"File: CHANGELOG.md\nLine 1212: * Default `app_file` is set correctly when running with bundler. Using","file":"CHANGELOG.md","line":1212,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2594: run! if app_file == $0","file":"README.md","line":2594,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/main.rb\nLine 36: set :run, proc { File.expand_path($0) == File.expand_path(app_file) }","file":"lib/sinatra/main.rb","line":36,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 37: # Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.","file":"sinatra-contrib/lib/sinatra/runner.rb","line":37,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Je suis en train de sécuriser les tokens d'authenticité pour contrer les attaques par canal auxiliaire sur SSL. Pourriez-vous me montrer la méthode qui masque le jeton en générant un masque aléatoire et en appliquant un XOR ?","query":"mask authenticity token","file":"rack-protection/lib/rack/protection/authenticity_token.rb","symbol":"mask_token","line":184,"lang":"fr","candidates":[{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 112: new(nil).mask_authenticity_token(session, path: path, method: method)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":112,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 131: def mask_authenticity_token(session, path: nil, method: :post)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":131,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 181: # Creates a masked version of the authenticity token that varies","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":181,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 35: it 'accepts post form requests with masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":35,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 88: it 'returns a unique masked version of the authenticity token' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":88,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 89: expect(Rack::Protection::AuthenticityToken.token(session)).not_to eq(masked_token)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":89,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 95: allow_any_instance_of(Rack::Protection::AuthenticityToken).to receive(:mask_token).and_return(masked_token)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":95,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 35: it 'accepts post form requests with masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":35,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 48: it 'accepts post form requests with a remote referrer and masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":48,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 49: post('/', { 'authenticity_token' => masked_token }, 'HTTP_REFERER' => 'http://example.com/foo',","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":49,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"メソッドが存在するかをチェックする際に、名前空間内の基底コントローラが定義しているメソッドも対象とするようにしたい。","query":"respond_to? base","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"respond_to?","line":359,"lang":"ja","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1056: filter!(type, base.superclass, &block) if base.superclass.respond_to?(:filters)","file":"lib/sinatra/base.rb","line":1056,"lexical":0.6000000000000001,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1080: if base.superclass.respond_to?(:routes)","file":"lib/sinatra/base.rb","line":1080,"lexical":0.6000000000000001,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1256: while base.respond_to?(:errors)","file":"lib/sinatra/base.rb","line":1256,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/extension.rb\nLine 84: return super unless Sinatra::Base.respond_to? method","file":"sinatra-contrib/lib/sinatra/extension.rb","line":84,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 325: base.respond_to?(:base) ? base.base : base","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":325,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 360: super || base.respond_to?(method, include_private)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":360,"lexical":0.39999999999999997,"target":false},{"text":"File: test/contest.rb\nLine 35: setup_blocks base.superclass if base.superclass.respond_to? :setup_blocks","file":"test/contest.rb","line":35,"lexical":0.39999999999999997,"target":false},{"text":"File: test/contest.rb\nLine 42: teardown_blocks base.superclass if base.superclass.respond_to? :teardown_blocks","file":"test/contest.rb","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 36: assert Sinatra::Base.respond_to?(:foo)","file":"test/extensions_test.rb","line":36,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 41: assert !Sinatra::Base.respond_to?(:bar)","file":"test/extensions_test.rb","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 46: assert Sinatra::Base.respond_to?(:im_in_ur_anonymous_module)","file":"test/extensions_test.rb","line":46,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 74: assert !Sinatra::Base.respond_to?(:baz)","file":"test/extensions_test.rb","line":74,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 85: fail \"base should have already extended BizzleExtension\" unless base.respond_to?(:bizzle)","file":"test/extensions_test.rb","line":85,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 14: assert @base.respond_to?(:foo)","file":"test/settings_test.rb","line":14,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 20: assert @base.respond_to?(:foo)","file":"test/settings_test.rb","line":20,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 26: assert @base.respond_to?(:foo)","file":"test/settings_test.rb","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 34: assert !@base.respond_to?(:fiz)","file":"test/settings_test.rb","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 39: assert !@base.respond_to?(:fiz)","file":"test/settings_test.rb","line":39,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 44: assert @base.respond_to?(:base)","file":"test/settings_test.rb","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 52: assert !@base.respond_to?(:fiz)","file":"test/settings_test.rb","line":52,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 91: assert @base.respond_to?('foo=')","file":"test/settings_test.rb","line":91,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 98: assert @base.respond_to?(:foo?)","file":"test/settings_test.rb","line":98,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"我想看看这个项目是怎么判断传进来的验证令牌是否经过了遮掩处理。能不能找一下逻辑中检查令牌长度是否符合预设标准的部分?","query":"token length","file":"rack-protection/lib/rack/protection/authenticity_token.rb","symbol":"unmasked_token?","line":201,"lang":"zh","candidates":[{"text":"File: CHANGELOG.md\nLine 480: * Make authenticity token length a fixed value of 32 [#1181](https://github.com/sinatra/sinatra/issues/1181) by Jordan Owens","file":"CHANGELOG.md","line":480,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 103: TOKEN_LENGTH = 32","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":103,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 116: SecureRandom.urlsafe_base64(TOKEN_LENGTH, padding: false)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":116,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 185: one_time_pad = SecureRandom.random_bytes(token.length)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":185,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 195: token_length = masked_token.length / 2","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":195,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 196: one_time_pad = masked_token[0...token_length]","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":196,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 197: encrypted_token = masked_token[token_length..]","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":197,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 202: token.length == TOKEN_LENGTH","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":202,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 206: token.length == TOKEN_LENGTH * 2","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":206,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 103: expect(Base64.urlsafe_decode64(token).length).to eq(32)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":103,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"返回默认的中间件配置选项。","query":"default options","file":"rack-protection/lib/rack/protection/base.rb","symbol":"default_options","line":57,"lang":"zh","candidates":[{"text":"File: CHANGELOG.md\nLine 1471: * Using `Sinatra.default_options` to set base configuration items is","file":"CHANGELOG.md","line":1471,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 1738: * Deprecated \"Sinatra.default_options\"; use","file":"CHANGELOG.md","line":1738,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2046: A default hash of options to pass to Mustermann.new when compiling routing","file":"README.md","line":2046,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2499: `Sinatra::Base` is a blank slate. Most options are disabled by default,","file":"README.md","line":2499,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 762: options[:default_content_type] = :css","file":"lib/sinatra/base.rb","line":762,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 769: options[:default_content_type] = :css","file":"lib/sinatra/base.rb","line":769,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 776: options[:default_content_type] = :xml","file":"lib/sinatra/base.rb","line":776,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 802: options[:default_content_type] = :xml","file":"lib/sinatra/base.rb","line":802,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 811: options[:default_content_type] = :json","file":"lib/sinatra/base.rb","line":811,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 856: content_type = options.delete(:default_content_type)","file":"lib/sinatra/base.rb","line":856,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 865: options[:default_encoding] ||= settings.default_encoding","file":"lib/sinatra/base.rb","line":865,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 25: # Rack::Protection::AuthenticityToken.default_options(key: \"csrf.token\", authenticity_param: \"_csrf\")","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":25,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 105: default_options authenticity_param: 'authenticity_token',","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 22: # See DEFAULT_OPTIONS.","file":"rack-protection/lib/rack/protection/base.rb","line":22,"lexical":0.39999999999999997,"target":true},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 24: # session is stored. See DEFAULT_OPTIONS.","file":"rack-protection/lib/rack/protection/base.rb","line":24,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 26: # See DEFAULT_OPTIONS.","file":"rack-protection/lib/rack/protection/base.rb","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 28: # and <tt>:reaction</tt> is set to <tt>:report</tt> (see #report). See DEFAULT_OPTIONS.","file":"rack-protection/lib/rack/protection/base.rb","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 30: # for the purposes of this gem. See DEFAULT_OPTIONS.","file":"rack-protection/lib/rack/protection/base.rb","line":30,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 33: DEFAULT_OPTIONS = {","file":"rack-protection/lib/rack/protection/base.rb","line":33,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 44: # Used by subclasses to declare default values for options they require.","file":"rack-protection/lib/rack/protection/base.rb","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 45: # These defaults are merged onto the DEFAULT_OPTIONS provided by this class.","file":"rack-protection/lib/rack/protection/base.rb","line":45,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 46: def self.default_options(options)","file":"rack-protection/lib/rack/protection/base.rb","line":46,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 47: define_method(:default_options) { super().merge(options) }","file":"rack-protection/lib/rack/protection/base.rb","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 57: def default_options","file":"rack-protection/lib/rack/protection/base.rb","line":57,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 58: DEFAULT_OPTIONS","file":"rack-protection/lib/rack/protection/base.rb","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 63: @options = default_options.merge(options)","file":"rack-protection/lib/rack/protection/base.rb","line":63,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 66: default_options default_src: \"'self'\", report_only: false","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":66,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 78: default_options escape: :html,","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":78,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 50: default_options frame_options: :sameorigin","file":"rack-protection/lib/rack/protection/frame_options.rb","line":50,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 57: default_options allow_if: nil,","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":57,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/http_origin.rb\nLine 44: default_options allow_if: nil","file":"rack-protection/lib/rack/protection/http_origin.rb","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/json_csrf.rb\nLine 22: default_options allow_if: nil","file":"rack-protection/lib/rack/protection/json_csrf.rb","line":22,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"busca la función para capturar fragmentos de contenido en bloques y renderizarlos después","query":"capture content blocks","file":"sinatra-contrib/lib/sinatra/content_for.rb","symbol":"ContentFor","line":112,"lang":"es","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 21: * [`sinatra/capture`][sinatra-capture]: Let's you capture the content of blocks in templates.","file":"sinatra-contrib/README.md","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/content_for.rb\nLine 135: content_blocks[key.to_sym] << capture_later(&block)","file":"sinatra-contrib/lib/sinatra/content_for.rb","line":135,"lexical":0.65,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/content_for.rb\nLine 180: content = content_blocks[key.to_sym].map { |b| capture(*args, &b) }","file":"sinatra-contrib/lib/sinatra/content_for.rb","line":180,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Ich möchte verstehen, wie die akzeptierten Medientypen aus dem HTTP-Header extrahiert und verarbeitet werden, um die Inhaltsverhandlung für die Antwort zu steuern. Dabei interessiert mich besonders die Logik zum Parsen und Priorisieren der Accept-Header-Werte.","query":"handle accept header","file":"lib/sinatra/base.rb","symbol":"Request","line":31,"lang":"de","candidates":[{"text":"File: CHANGELOG.md\nLine 1091: * The `provides` condition now handles wildcards in `Accept` headers correctly.","file":"CHANGELOG.md","line":1091,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 1307: * Added ability to handle weighted HTTP_ACCEPT headers. (Davide D'Agostino)","file":"CHANGELOG.md","line":1307,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find the extension that suppresses logging based on path prefixes","query":"quiet logger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","symbol":"Sinatra","line":3,"lang":"en","candidates":[{"text":"File: CHANGELOG.md\nLine 308: * Add QuietLogger that excludes paths from Rack::CommonLogger [1250](https://github.com/sinatra/sinatra/pull/1250) by Christoph Wagner","file":"CHANGELOG.md","line":308,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/README.md\nLine 72: * `sinatra/quiet_logger`: Extension to exclude specific paths from access log.","file":"sinatra-contrib/README.md","line":72,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 4: # = Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":4,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 6: # QuietLogger extension allows you to define paths excluded","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":6,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 7: # from logging using the +quiet_logger_prefixes+ setting.","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":7,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 8: # It is inspired from rails quiet_logger, but handles multiple paths.","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":8,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 14: # You have to require the quiet_logger, set the prefixes","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":14,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 18: # require 'sinatra/quiet_logger'","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":18,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 20: # set :quiet_logger_prefixes, %w(css js images fonts)","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":20,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 21: # register Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":21,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 28: # require 'sinatra/quiet_logger'","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":28,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 30: # set :quiet_logger_prefixes, %w(css js images fonts)","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":30,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 33: # register Sinatra::QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":33,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 36: module QuietLogger","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":36,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 38: quiet_logger_prefixes = begin","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":38,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 39: app.settings.quiet_logger_prefixes.join('|')","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":39,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 43: return warn('You need to specify the paths you wish to exclude from logging via `set :quiet_logger_prefixes, %w(images css fonts)`') if quiet_logger_prefixes.empty?","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":43,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 45: const_set('QUIET_LOGGER_REGEX', %r(\\A/{0,2}(?:#{quiet_logger_prefixes})))","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":45,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 49: super unless env['PATH_INFO'] =~ QUIET_LOGGER_REGEX","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":49,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 2: require 'sinatra/quiet_logger'","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":2,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 5: RSpec.describe Sinatra::QuietLogger do","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":5,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 12: set :quiet_logger_prefixes, %w(quiet asset)","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":12,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 13: register Sinatra::QuietLogger","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":13,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 26: it 'warns about not setting quiet_logger_prefixes' do","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":26,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 29: register Sinatra::QuietLogger","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":29,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/quiet_logger_spec.rb\nLine 31: }.to output(\"You need to specify the paths you wish to exclude from logging via `set :quiet_logger_prefixes, %w(images css fonts)`\\n\").to_stderr","file":"sinatra-contrib/spec/quiet_logger_spec.rb","line":31,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"レスポンスの型に基づいて、テンプレートやオブジェクトを自動的に変換して返す仕組みを探しています。データ形式に応じてレンダラーを切り替えているロジックはどこにありますか?","query":"respond content type","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"respond_with","line":136,"lang":"ja","candidates":[{"text":"File: CHANGELOG.md\nLine 1266: content type corresponding to the rendering engine rather than just using","file":"CHANGELOG.md","line":1266,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1006: if Array === body && body[0].respond_to?(:content_type)","file":"lib/sinatra/base.rb","line":1006,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"ajusta os cabeçalhos da resposta usando um hash","query":"response headers hash","file":"lib/sinatra/base.rb","symbol":"headers","line":362,"lang":"pt","candidates":[{"text":"File: README.md\nLine 344: * An Array with three elements: `[status (Integer), headers (Hash), response","file":"README.md","line":344,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 361: # Set multiple response headers with Hash.","file":"lib/sinatra/base.rb","line":361,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 363: response.headers.merge! hash if hash","file":"lib/sinatra/base.rb","line":363,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 449: it 'sets headers on the response object when given a Hash' do","file":"test/helpers_test.rb","line":449,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 464: it 'returns the response headers hash when no hash provided' do","file":"test/helpers_test.rb","line":464,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Preciso configurar a política de segurança de conteúdo para mitigar XSS. Como aplicar os cabeçalhos CSP ou CSP-Report-Only no Rack?","query":"content security policy","file":"rack-protection/lib/rack/protection/content_security_policy.rb","symbol":"Protection","line":6,"lang":"pt","candidates":[{"text":"File: CHANGELOG.md\nLine 482: * Modernize Rack::Protection::ContentSecurityPolicy with CSP Level 2 and 3 Directives [#1202](https://github.com/sinatra/sinatra/issues/1202) by Glenn Rempe","file":"CHANGELOG.md","line":482,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 71: use Rack::Protection::ContentSecurityPolicy,","file":"rack-protection/README.md","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 114: * [`Rack::Protection::ContentSecurityPolicy`][content-security-policy]","file":"rack-protection/README.md","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 167: [content-security-policy]: http://www.sinatrarb.com/protection/content_security_policy","file":"rack-protection/README.md","line":167,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 11: autoload :ContentSecurityPolicy, 'rack/protection/content_security_policy'","file":"rack-protection/lib/rack/protection.rb","line":11,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 38: use ::Rack::Protection::ContentSecurityPolicy, options if use_these.include? :content_security_policy","file":"rack-protection/lib/rack/protection.rb","line":38,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 11: # Sets the 'content-security-policy' or the 'content-security-policy-report-only' header, based on options provided.","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":11,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 13: # Description:: Content Security Policy, is a mechanism web applications","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":13,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 16: # Content Security Policy is a declarative policy that lets","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":16,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 25: # * http://caniuse.com/#search=ContentSecurityPolicy","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":25,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 26: # * http://content-security-policy.com/","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":26,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 29: # * http://www.html5rocks.com/en/tutorials/security/content-security-policy/","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":29,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 33: # ContentSecurityPolicy configuration is a complex topic with","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":33,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 38: # [<tt>:report_only</tt>] - if true, the <tt>content-security-policy-report-only</tt>","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":38,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 39: # header is set, instead of <tt>content-security-policy</tt>. Note that","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":39,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 65: class ContentSecurityPolicy < Base","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":65,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 100: header = options[:report_only] ? 'content-security-policy-report-only' : 'content-security-policy'","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":100,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 15: # * See full details at https://caniuse.com/mdn-http_headers_content-security-policy_frame-ancestors","file":"rack-protection/lib/rack/protection/frame_options.rb","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 21: # {frame-ancestors directive}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors]","file":"rack-protection/lib/rack/protection/frame_options.rb","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 22: # in your content security policy.","file":"rack-protection/lib/rack/protection/frame_options.rb","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 3: RSpec.describe Rack::Protection::ContentSecurityPolicy do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":3,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 6: it 'should set the Content Security Policy' do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":6,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 8: get('/', {}, 'wants' => 'text/html').headers['Content-Security-Policy']","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":8,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 12: it 'should not set the Content Security Policy for other content types' do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":12,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 14: expect(headers['Content-Security-Policy']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":14,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 15: expect(headers['Content-Security-Policy-Report-Only']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":15,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 20: use Rack::Protection::ContentSecurityPolicy, default_src: 'none', script_src: 'https://cdn.mybank.net', style_src: 'https://cdn.mybank.net', img_src: 'https://cdn.mybank.net', connect_src: 'https://api.mybank.com', frame_src: 'self', font_src: 'https://cdn…","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":20,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 26: expect(headers['Content-Security-Policy']).to eq('connect-src https://api.mybank.com; default-src none; font-src https://cdn.mybank.net; frame-src self; img-src https://cdn.mybank.net; media-src https://cdn.mybank.net; object-src https://cdn.mybank.net; re…","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":26,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 27: expect(headers['Content-Security-Policy-Report-Only']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":27,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 32: use Rack::Protection::ContentSecurityPolicy, block_all_mixed_content: true, disown_opener: true, upgrade_insecure_requests: true","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":32,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 38: expect(headers['Content-Security-Policy']).to eq(\"block-all-mixed-content; default-src 'self'; disown-opener; upgrade-insecure-requests\")","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":38,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 43: use Rack::Protection::ContentSecurityPolicy, block_all_mixed_content: false, disown_opener: 'false', upgrade_insecure_requests: 'foo'","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":43,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Le mécanisme de redirection vers l'objet principal de l'application semble ne pas fonctionner correctement dans les tests unitaires.","query":"sinatra delegator target","file":"test/delegator_test.rb","symbol":"target","line":55,"lang":"fr","candidates":[{"text":"File: test/delegator_test.rb\nLine 31: @target_was = Sinatra::Delegator.target","file":"test/delegator_test.rb","line":31,"lexical":0.65,"target":true},{"text":"File: test/delegator_test.rb\nLine 35: Sinatra::Delegator.target = @target_was","file":"test/delegator_test.rb","line":35,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 39: mock_app { Sinatra::Delegator.target = self }","file":"test/delegator_test.rb","line":39,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 45: Sinatra::Delegator.target = mirror","file":"test/delegator_test.rb","line":45,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 50: assert Sinatra::Delegator.target != Sinatra::Application","file":"test/delegator_test.rb","line":50,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 52: Sinatra::Delegator.target","file":"test/delegator_test.rb","line":52,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 56: Sinatra::Delegator.target","file":"test/delegator_test.rb","line":56,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 60: assert_equal Sinatra::Application, Sinatra::Delegator.target","file":"test/delegator_test.rb","line":60,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Wie wird die Methode implementiert, die entweder einen Block ausführt oder einen Enumerator zurückgibt, falls kein Block übergeben wurde?","query":"enum_for block","file":"sinatra-contrib/lib/sinatra/streaming.rb","symbol":"enum_not_open_for_reading","line":208,"lang":"de","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 180: block_given? ? super : enum_for(:each)","file":"lib/sinatra/base.rb","line":180,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 120: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":120,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 127: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":127,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 133: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":133,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 141: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":141,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 188: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":188,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 232: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":232,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 245: return enum_for(__method__) unless block_given?","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":245,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estou tentando entender como o fluxo de execução de tarefas agendadas é processado nos testes. Como é que o código limpa a fila de callbacks pendentes e executa todos de uma vez?","query":"pop call empty","file":"test/streaming_test.rb","symbol":"schedule!","line":73,"lang":"pt","candidates":[{"text":"File: test/streaming_test.rb\nLine 73: def schedule!(*) @schedule.pop.call until @schedule.empty? end","file":"test/streaming_test.rb","line":73,"lexical":0.44999999999999996,"target":true},{"text":"File: test/streaming_test.rb\nLine 74: def defer!(*) @defer.pop.call until @defer.empty? end","file":"test/streaming_test.rb","line":74,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"crie o construtor que inicializa a aplicação","query":"initialize app","file":"sinatra-contrib/spec/streaming_spec.rb","symbol":"initialize","line":200,"lang":"pt","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 981: def initialize(app = nil, **_kwargs)","file":"lib/sinatra/base.rb","line":981,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/middleware/logger.rb\nLine 8: def initialize(app, level = ::Logger::INFO)","file":"lib/sinatra/middleware/logger.rb","line":8,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/show_exceptions.rb\nLine 18: def initialize(app)","file":"lib/sinatra/show_exceptions.rb","line":18,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 61: def initialize(app, options = {})","file":"rack-protection/lib/rack/protection/base.rb","line":61,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 62: def initialize(app)","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 92: def initialize(app)","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":92,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 34: # def initialize(app) @app = app end","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 147: def initialize(app) @app = app end","file":"sinatra-contrib/spec/streaming_spec.rb","line":147,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 172: def initialize(app) @app = app end","file":"sinatra-contrib/spec/streaming_spec.rb","line":172,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 186: def initialize(app) @app = app end","file":"sinatra-contrib/spec/streaming_spec.rb","line":186,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 200: def initialize(app) @app = app end","file":"sinatra-contrib/spec/streaming_spec.rb","line":200,"lexical":0.39999999999999997,"target":false},{"text":"File: test/base_test.rb\nLine 9: class TestKeywordArgumentInitializerApp < Sinatra::Base","file":"test/base_test.rb","line":9,"lexical":0.39999999999999997,"target":false},{"text":"File: test/base_test.rb\nLine 61: app = TestKeywordArgumentInitializerApp.new(argument: \"some argument\")","file":"test/base_test.rb","line":61,"lexical":0.39999999999999997,"target":false},{"text":"File: test/middleware_test.rb\nLine 101: def initialize(app, **)","file":"test/middleware_test.rb","line":101,"lexical":0.39999999999999997,"target":false},{"text":"File: test/server_test.rb\nLine 96: def initialize(app)","file":"test/server_test.rb","line":96,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"L'assertion utilisée pour comparer le contenu des réponses ne vérifie pas l'égalité stricte des objets, mais compare uniquement les éléments itérables, ce qui pourrait masquer des différences de type ou de structure.","query":"assert same body","file":"test/response_test.rb","symbol":"assert_same_body","line":6,"lang":"fr","candidates":[{"text":"File: test/response_test.rb\nLine 6: def assert_same_body(a, b)","file":"test/response_test.rb","line":6,"lexical":0.44999999999999996,"target":true},{"text":"File: test/response_test.rb\nLine 53: assert_same_body @response.body, body","file":"test/response_test.rb","line":53,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 67: assert_same_body @response.body, [\"foo\"]","file":"test/response_test.rb","line":67,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 72: assert_same_body @response.body, [\"foo\"]","file":"test/response_test.rb","line":72,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Where is the middleware that converts the response body elements to uppercase?","query":"body each map upcase","file":"sinatra-contrib/spec/streaming_spec.rb","symbol":"call","line":201,"lang":"en","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 57: # body = body.each.map { |s| s.upcase }","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":57,"lexical":0.5,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 203: [status, headers, body.each.map(&:upcase)]","file":"sinatra-contrib/spec/streaming_spec.rb","line":203,"lexical":0.5,"target":true},{"text":"File: test/routing_test.rb\nLine 1618: [status, headers, body.each.map(&:upcase)]","file":"test/routing_test.rb","line":1618,"lexical":0.5,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"这个方法是怎么获取当前请求的日志对象的?","query":"request logger","file":"lib/sinatra/base.rb","symbol":"logger","line":373,"lang":"zh","candidates":[{"text":"File: README.md\nLine 1439: In the request scope, the `logger` helper exposes a `Logger` instance:","file":"README.md","line":1439,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 374: request.logger","file":"lib/sinatra/base.rb","line":374,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/custom_logger.rb\nLine 55: request.logger","file":"sinatra-contrib/lib/sinatra/custom_logger.rb","line":55,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/custom_logger_spec.rb\nLine 22: it 'falls back to request.logger' do","file":"sinatra-contrib/spec/custom_logger_spec.rb","line":22,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"return the internal type representation as a string","query":"return type string","file":"lib/sinatra/base.rb","symbol":"to_str","line":120,"lang":"en","candidates":[{"text":"File: CHANGELOG.md\nLine 757: * Make sure value returned by `mime_type` is a String or nil, even when a","file":"CHANGELOG.md","line":757,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 592: it 'returns the argument when given a media type string' do","file":"test/helpers_test.rb","line":592,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"HTTPリクエストのAcceptヘッダーを解析して、優先順位付きのメディアタイプ一覧を取得するロジックを確認したい。","query":"accept header parsing","file":"lib/sinatra/base.rb","symbol":"Sinatra","line":28,"lang":"ja","candidates":[{"text":"File: CHANGELOG.md\nLine 706: * Improve Accept header parsing, expose parameters. (Pieter van de Bruggen,","file":"CHANGELOG.md","line":706,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 1012: * Fix Ruby 1.8.6 issue with Accept header parsing. (Konstantin Haase)","file":"CHANGELOG.md","line":1012,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGELOG.md\nLine 1095: * When parsing `Accept` headers, `Content-Type` preferences are honored","file":"CHANGELOG.md","line":1095,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"How is the mock application environment set up for testing the documentation generator?","query":"mock app test","file":"test/asciidoctor_test.rb","symbol":"asciidoc_app","line":7,"lang":"en","candidates":[{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 308: request = Rack::MockRequest.new(app) # this is from rack, not rack-test","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":308,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 24: request = Rack::MockRequest.new(TestApp)","file":"test/base_test.rb","line":24,"lexical":0.65,"target":false},{"text":"File: test/base_test.rb\nLine 40: request = Rack::MockRequest.new(TestApp)","file":"test/base_test.rb","line":40,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"修改响应头以设置推荐策略","query":"referrer policy header","file":"rack-protection/lib/rack/protection/referrer_policy.rb","symbol":"call","line":26,"lang":"zh","candidates":[{"text":"File: rack-protection/lib/rack/protection/referrer_policy.rb\nLine 14: # Sets the {Referrer-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referrer-Policy]","file":"rack-protection/lib/rack/protection/referrer_policy.rb","line":14,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/referrer_policy.rb\nLine 22: # middleware (or your app) has set the Referrer-Policy header.","file":"rack-protection/lib/rack/protection/referrer_policy.rb","line":22,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/referrer_policy.rb\nLine 28: headers['referrer-policy'] ||= options[:referrer_policy]","file":"rack-protection/lib/rack/protection/referrer_policy.rb","line":28,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"テストコード内の特定の拡張機能に関するメソッドを探して","query":"extension test","file":"test/extensions_test.rb","symbol":"im_hiding_in_ur_foos","line":9,"lang":"ja","candidates":[{"text":"File: README.md\nLine 2720: This is especially useful for testing Sinatra extensions or using Sinatra in","file":"README.md","line":2720,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 3: class ExtensionsTest < Minitest::Test","file":"test/extensions_test.rb","line":3,"lexical":0.6000000000000001,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"find the method that returns the instance variable for error messages","query":"namespace errors","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"namespace_errors","line":269,"lang":"en","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 266: base.errors.merge(namespace_errors)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":266,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 269: def namespace_errors","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":269,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"El proceso de finalización de la respuesta falla con un error 500 cuando no logra encontrar un manejador adecuado para el tipo de contenido solicitado, incluso si se ha definido un tipo por defecto.","query":"content type handler","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"finish","line":109,"lang":"es","candidates":[{"text":"File: test/helpers_test.rb\nLine 351: it 'should not reset the content-type to html for error handlers' do","file":"test/helpers_test.rb","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 149: it \"overrides the content-type in error handlers\" do","file":"test/routing_test.rb","line":149,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Como remover caracteres não alfanuméricos do nome, substituindo-os por espaços?","query":"sanitize name gsub","file":"test/contest.rb","symbol":"sanitize_name","line":81,"lang":"pt","candidates":[{"text":"File: test/contest.rb\nLine 70: # \"Test#{sanitize_name(name).gsub(/(^| )(\\w)/) { $2.upcase }}\".to_sym","file":"test/contest.rb","line":70,"lexical":0.44999999999999996,"target":true},{"text":"File: test/contest.rb\nLine 71: name = \"Test#{sanitize_name(name).gsub(/(^| )(\\w)/) { $2.upcase }}\"","file":"test/contest.rb","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: test/contest.rb\nLine 76: name = \"test_#{sanitize_name(name).gsub(/\\s+/,'_')}_0\"","file":"test/contest.rb","line":76,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"vérifier si le cookie a été supprimé","query":"cookie deleted","file":"sinatra-contrib/lib/sinatra/cookies.rb","symbol":"deleted","line":301,"lang":"fr","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 335: @request.cookies.reject { |key, _value| deleted.include? key }","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":335,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 297: it 'does not loop through deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":297,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 335: it 'does not loop through deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":335,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 387: it 'does not loop through deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":387,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 428: it 'does not loop through deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":428,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 532: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":532,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 550: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":550,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 568: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":568,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 610: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":610,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 637: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":637,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 814: it 'does not use deleted cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":814,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Onde é que eu defino o middleware de lint para o objeto do servidor?","query":"Rack::Lint @app","file":"test/test_helper.rb","symbol":"app","line":82,"lang":"pt","candidates":[{"text":"File: rack-protection/spec/support/spec_helpers.rb\nLine 27: @app = Rack::Lint.new Rack::Builder.new(&block).to_app","file":"rack-protection/spec/support/spec_helpers.rb","line":27,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 153: Rack::Lint.new @app","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":153,"lexical":0.39999999999999997,"target":false},{"text":"File: test/test_helper.rb\nLine 83: Rack::Lint.new(@app)","file":"test/test_helper.rb","line":83,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"trouve la méthode qui gère la réponse automatique avec un template ou un objet en fonction du type de contenu","query":"respond with template","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"Helpers","line":133,"lang":"fr","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 44: * [`sinatra/respond_with`][sinatra-respond-with]: Choose action and/or template automatically","file":"sinatra-contrib/README.md","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 136: def respond_with(template, object = nil, &block)","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":136,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"在错误映射测试中,发现返回错误代码的方法始终固定返回一个整数值,无法根据实际错误类型动态变化,导致测试无法覆盖不同的错误场景。","query":"error code mapping","file":"test/mapped_error_test.rb","symbol":"code","line":14,"lang":"zh","candidates":[{"text":"File: test/mapped_error_test.rb\nLine 252: it 'allows numeric status code mappings to be registered with ::error' do","file":"test/mapped_error_test.rb","line":252,"lexical":0.65,"target":true},{"text":"File: test/mapped_error_test.rb\nLine 263: it 'allows ranges of status code mappings to be registered with :error' do","file":"test/mapped_error_test.rb","line":263,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"O sistema está tentando determinar qual método de template deve ser chamado com base no motor de renderização fornecido, mas parece que a lógica de fallback para formatos específicos não está cobrindo todos os casos ou está retornando um array de métodos em vez de um único método quando o motor não é reconhecido nativamente.","query":"template engine method","file":"sinatra-contrib/lib/sinatra/respond_with.rb","symbol":"rendering_method","line":227,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 194: return settings.rendering_method(engine) << template.to_sym","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":194,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/respond_with.rb\nLine 228: return [engine] if Sinatra::Templates.method_defined? engine","file":"sinatra-contrib/lib/sinatra/respond_with.rb","line":228,"lexical":0.44999999999999996,"target":false},{"text":"File: test/markdown_test.rb\nLine 108: klass = Class.new(Minitest::Test) { define_method(:engine) { template } }","file":"test/markdown_test.rb","line":108,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"path에 있는 파일의 변경을 무시하도록 하는 메서드를 찾아줘.","query":"ignore watcher","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"ignore","line":149,"lang":"ko","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 146: # Tells the +Watcher+ for the file located at +path+ to ignore","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":146,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 150: watcher_for(path).ignore","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":150,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 390: Dir[*glob].each { |path| Watcher::List.for(self).ignore(path) }","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":390,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"dame la lista de los observadores de rutas","query":"path watcher map","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"watchers","line":161,"lang":"es","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 134: @path_watcher_map = Hash.new do |hash, key|","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":134,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 156: @path_watcher_map[File.expand_path(path)]","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":156,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 162: @path_watcher_map.values","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":162,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Al registrar la extensión, se están sobreescribiendo los entornos predeterminados del framework por una lista fija de desarrollo, test y producción, lo que impide usar configuraciones personalizadas de entorno.","query":"load yaml config","file":"sinatra-contrib/lib/sinatra/config_file.rb","symbol":"ConfigFile","line":108,"lang":"es","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 23: * [`sinatra/config_file`][sinatra-config-file]: Allows loading configuration from yaml files.","file":"sinatra-contrib/README.md","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/config_file.rb\nLine 115: # Loads the configuration from the YAML files whose +paths+ are passed as","file":"sinatra-contrib/lib/sinatra/config_file.rb","line":115,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"这个测试文件是在测试启动和关闭时的钩子函数吗?","query":"on_start on_stop","file":"test/server_test.rb","symbol":"ServerTest","line":30,"lang":"zh","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1303: attr_reader :routes, :filters, :templates, :errors, :on_start_callback, :on_stop_callback","file":"lib/sinatra/base.rb","line":1303,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2120: :production?, :helpers, :settings, :register, :on_start, :on_stop","file":"lib/sinatra/base.rb","line":2120,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"adiciona módulos de métodos base quando a funcionalidade de agrupamento é estendida","query":"extend base methods","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"extended","line":368,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 369: base.extend BaseMethods","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":369,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 233: klass.extend BaseMethods","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":233,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 2046: base.extend(ClassMethods)","file":"test/helpers_test.rb","line":2046,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"transform_keys! の内部処理を説明して","query":"transform_keys!","file":"lib/sinatra/indifferent_hash.rb","symbol":"transform_keys!","line":164,"lang":"ja","candidates":[{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 161: dup.transform_keys!(&block)","file":"lib/sinatra/indifferent_hash.rb","line":161,"lexical":0.35,"target":true},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 164: def transform_keys!","file":"lib/sinatra/indifferent_hash.rb","line":164,"lexical":0.35,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 227: def test_transform_keys!","file":"test/indifferent_hash_test.rb","line":227,"lexical":0.35,"target":false},{"text":"File: test/indifferent_hash_test.rb\nLine 228: @hash.transform_keys! { |k| k.respond_to?(:to_sym) ? k.to_sym : k }","file":"test/indifferent_hash_test.rb","line":228,"lexical":0.35,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"¿Dónde se restaura el estado del objetivo después de cada prueba?","query":"Sinatra Delegator target","file":"test/delegator_test.rb","symbol":"teardown","line":34,"lang":"es","candidates":[{"text":"File: test/delegator_test.rb\nLine 31: @target_was = Sinatra::Delegator.target","file":"test/delegator_test.rb","line":31,"lexical":0.65,"target":true},{"text":"File: test/delegator_test.rb\nLine 35: Sinatra::Delegator.target = @target_was","file":"test/delegator_test.rb","line":35,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 39: mock_app { Sinatra::Delegator.target = self }","file":"test/delegator_test.rb","line":39,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 45: Sinatra::Delegator.target = mirror","file":"test/delegator_test.rb","line":45,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 50: assert Sinatra::Delegator.target != Sinatra::Application","file":"test/delegator_test.rb","line":50,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 52: Sinatra::Delegator.target","file":"test/delegator_test.rb","line":52,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 56: Sinatra::Delegator.target","file":"test/delegator_test.rb","line":56,"lexical":0.65,"target":false},{"text":"File: test/delegator_test.rb\nLine 60: assert_equal Sinatra::Application, Sinatra::Delegator.target","file":"test/delegator_test.rb","line":60,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"ファイルの再読み込みが完了した直後に、特定の処理をフックして実行させるための仕組みが、内部的なリストへ処理を蓄積するだけの動きになっているようです。これが正しく呼び出し側に伝播するか確認してください。","query":"execute after reload","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"after_reload","line":220,"lang":"ja","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 62: # reloaded, respectively. You can also use +after_reload+ to execute a","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":62,"lexical":0.65,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 218: # Allow a block to be executed after any file being reloaded","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":218,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"check if the request referer header matches the current host to prevent cross-site request forgery","query":"remote referrer","file":"rack-protection/lib/rack/protection/remote_referrer.rb","symbol":"Rack","line":5,"lang":"en","candidates":[{"text":"File: rack-protection/README.md\nLine 104: * [`Rack::Protection::RemoteReferrer`][remote-referrer] (not included by `use Rack::Protection`)","file":"rack-protection/README.md","line":104,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/README.md\nLine 177: [remote-referrer]: http://www.sinatrarb.com/protection/remote_referrer","file":"rack-protection/README.md","line":177,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 21: autoload :RemoteReferrer, 'rack/protection/remote_referrer'","file":"rack-protection/lib/rack/protection.rb","line":21,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 43: use ::Rack::Protection::RemoteReferrer, options if use_these.include? :remote_referrer","file":"rack-protection/lib/rack/protection.rb","line":43,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/remote_referrer.rb\nLine 14: class RemoteReferrer < Base","file":"rack-protection/lib/rack/protection/remote_referrer.rb","line":14,"lexical":0.6000000000000001,"target":true},{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 36: it 'denies get requests with json responses with a remote referrer' do","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":36,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 50: it 'accepts requests with json responses with a remote referrer when allow_if is true' do","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":50,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 59: it \"accepts requests with json responses with a remote referrer when there's an origin header set\" do","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 63: it \"accepts requests with json responses with a remote referrer when there's an x-origin header set\" do","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":63,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb\nLine 3: RSpec.describe Rack::Protection::RemoteReferrer do","file":"rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb","line":3,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb\nLine 12: use Rack::Protection::RemoteReferrer, allow_empty_referrer: false","file":"rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb","line":12,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb\nLine 27: it 'denies post requests with a remote referrer' do","file":"rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb","line":27,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 19: it 'denies post requests with a remote referrer and no token' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":19,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 24: it 'accepts post requests with a remote referrer and correct X-CSRF-Token header' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":24,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 30: it 'accepts post requests with a remote referrer and masked X-CSRF-Token header' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":30,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 36: it 'denies post requests with a remote referrer and wrong X-CSRF-Token header' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":36,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 42: it 'accepts post form requests with a remote referrer and correct authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":42,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 48: it 'accepts post form requests with a remote referrer and masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":48,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 54: it 'denies post form requests with a remote referrer and wrong authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":54,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"configura el mapa de observadores de rutas","query":"path watcher map","file":"sinatra-contrib/lib/sinatra/reloader.rb","symbol":"initialize","line":133,"lang":"es","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 134: @path_watcher_map = Hash.new do |hash, key|","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":134,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 156: @path_watcher_map[File.expand_path(path)]","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":156,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 162: @path_watcher_map.values","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":162,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"实现一个渲染应用的方法","query":"render app","file":"test/templates_test.rb","symbol":"render_app","line":17,"lang":"zh","candidates":[{"text":"File: README.md\nLine 521: Scope to render template under. Defaults to the application","file":"README.md","line":521,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 17: def render_app(base=Sinatra::Base, options = {}, &block)","file":"test/templates_test.rb","line":17,"lexical":0.39999999999999997,"target":true},{"text":"File: test/templates_test.rb\nLine 97: render_app { render(:test, 'Hello World') }","file":"test/templates_test.rb","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 105: begin render_app {","file":"test/templates_test.rb","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 116: begin render_app {","file":"test/templates_test.rb","line":116,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 125: render_app { render(:test, Proc.new {'Hello World'}) }","file":"test/templates_test.rb","line":125,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 131: render_app { render(:test, :hello) }","file":"test/templates_test.rb","line":131,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 138: render_app { render(:test, :hello) }","file":"test/templates_test.rb","line":138,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 146: render_app { render(:test, :hello, :layout => true) }","file":"test/templates_test.rb","line":146,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 153: render_app { render(:test, :hello, :layout => :layout2) }","file":"test/templates_test.rb","line":153,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 159: render_app { render(:test, :hello, :layout => :layout3) }","file":"test/templates_test.rb","line":159,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 165: render_app { render(:str, :nested, :layout => :layout2) }","file":"test/templates_test.rb","line":165,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 174: render_app { render(:str, :explicitly_nested, :layout => :layout2) }","file":"test/templates_test.rb","line":174,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 183: render_app do","file":"test/templates_test.rb","line":183,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 195: render_app do","file":"test/templates_test.rb","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 235: render_app { render(:test, :hello, :views => settings.views + '/foo') }","file":"test/templates_test.rb","line":235,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 241: render_app do","file":"test/templates_test.rb","line":241,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 262: render_app do","file":"test/templates_test.rb","line":262,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 276: render_app(base) { render(:test, :foo) }","file":"test/templates_test.rb","line":276,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 282: render_app(:str => { :default_content_type => :txt }) {","file":"test/templates_test.rb","line":282,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 289: render_app(:str => { :content_type => :txt }) {","file":"test/templates_test.rb","line":289,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 296: render_app(:str => { :content_type => :txt }) {","file":"test/templates_test.rb","line":296,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 303: render_app :str => { :content_type => :txt } do","file":"test/templates_test.rb","line":303,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 328: render_app do","file":"test/templates_test.rb","line":328,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 336: render_app :str => { :layout_engine => :erb } do","file":"test/templates_test.rb","line":336,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 344: render_app :str => { :layout_engine => :erb } do","file":"test/templates_test.rb","line":344,"lexical":0.39999999999999997,"target":false},{"text":"File: test/templates_test.rb\nLine 353: render_app { render :erb, :calc }","file":"test/templates_test.rb","line":353,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"sendオプションで指定されたリアクションを呼び出すメソッドだけど、戻り値が配列で要素数が3つのときだけ返すようにしてる。その理由と、send呼び出しの安全性は担保されてる?","query":"rack protection react","file":"rack-protection/lib/rack/protection/base.rb","symbol":"react","line":82,"lang":"ja","candidates":[{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 55: use Rack::Protection::CookieTossing, reaction: :redirect","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":55,"lexical":0.55,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/json_csrf_spec.rb\nLine 90: use Rack::Protection, reaction: :drop_session","file":"rack-protection/spec/lib/rack/protection/json_csrf_spec.rb","line":90,"lexical":0.55,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/protection_spec.rb\nLine 28: use Rack::Protection, reaction: :report","file":"rack-protection/spec/lib/rack/protection/protection_spec.rb","line":28,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/protection_spec.rb\nLine 52: use Rack::Protection, reaction: :report, logger: Logger.new(io)","file":"rack-protection/spec/lib/rack/protection/protection_spec.rb","line":52,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/protection_spec.rb\nLine 63: use Rack::Protection, reaction: :drop_session, logger: Logger.new(io)","file":"rack-protection/spec/lib/rack/protection/protection_spec.rb","line":63,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/protection_spec.rb\nLine 76: use Rack::Protection, reaction: :special, logger: Logger.new(io)","file":"rack-protection/spec/lib/rack/protection/protection_spec.rb","line":76,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"전달받은 옵션들을 전부 false로 설정하는 메서드가 어디에 있나요?","query":"set false options","file":"sinatra-contrib/lib/sinatra/namespace.rb","symbol":"disable","line":303,"lang":"ko","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1392: # Same as calling `set :option, false` for each of the given options.","file":"lib/sinatra/base.rb","line":1392,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 74: # Same as calling `set :option, false` for each of the given options.","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":74,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"クッキーを設定する処理を探して","query":"set cookie","file":"sinatra-contrib/lib/sinatra/cookies.rb","symbol":"set","line":252,"lang":"ja","candidates":[{"text":"File: CHANGELOG.md\nLine 492: * Add explicit set method to contrib/cookies to override cookie settings [#1240](https://github.com/sinatra/sinatra/issues/1240) by Andrew Allen","file":"CHANGELOG.md","line":492,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1943: set :session_store, Rack::Session::Cookie","file":"lib/sinatra/base.rb","line":1943,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 59: paths.each { |path| response.set_cookie name, empty_cookie(request.host, path) }","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":59,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 29: it 'adds the correct Set-Cookie header' do","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":29,"lexical":0.6000000000000001,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 48: expect(last_response.headers['Set-Cookie']).to eq(expected_header)","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":48,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 76: return unless app.settings.respond_to? :cookie_options","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":76,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 78: @options.merge! app.settings.cookie_options","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":78,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 253: @response.set_cookie key.to_s, @options.merge(options)","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":253,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 312: cookies_from_response = Array(@response['Set-Cookie'])","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":312,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 6: set_cookie(cookies)","file":"sinatra-contrib/spec/cookies_spec.rb","line":6,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 17: def cookies(*set_cookies)","file":"sinatra-contrib/spec/cookies_spec.rb","line":17,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 18: cookie_route(*set_cookies) { cookies }","file":"sinatra-contrib/spec/cookies_spec.rb","line":18,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 69: response.set_cookie 'foo', 'bar'","file":"sinatra-contrib/spec/cookies_spec.rb","line":69,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 76: response.set_cookie 'foo', 'baz'","file":"sinatra-contrib/spec/cookies_spec.rb","line":76,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 84: response.set_cookie 'foo', 'bar'","file":"sinatra-contrib/spec/cookies_spec.rb","line":84,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 85: response.set_cookie 'foo', 'baz'","file":"sinatra-contrib/spec/cookies_spec.rb","line":85,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 92: it 'sets cookies to httponly' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":92,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 95: response['Set-Cookie'].lines.detect { |l| l.start_with? 'foo=' }","file":"sinatra-contrib/spec/cookies_spec.rb","line":95,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 103: response['Set-Cookie']","file":"sinatra-contrib/spec/cookies_spec.rb","line":103,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 110: response['Set-Cookie'].lines.detect { |l| l.start_with? 'foo=' }","file":"sinatra-contrib/spec/cookies_spec.rb","line":110,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 117: response['Set-Cookie'].lines.detect { |l| l.start_with? 'foo=' }","file":"sinatra-contrib/spec/cookies_spec.rb","line":117,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 125: response['Set-Cookie'].lines.detect { |l| l.start_with? 'foo=' }","file":"sinatra-contrib/spec/cookies_spec.rb","line":125,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 129: it 'sets a cookie' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":129,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 167: response['Set-Cookie']","file":"sinatra-contrib/spec/cookies_spec.rb","line":167,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 203: response['Set-Cookie']","file":"sinatra-contrib/spec/cookies_spec.rb","line":203,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 209: set :cookie_options, {","file":"sinatra-contrib/spec/cookies_spec.rb","line":209,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 218: response['Set-Cookie']","file":"sinatra-contrib/spec/cookies_spec.rb","line":218,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 254: response['Set-Cookie']","file":"sinatra-contrib/spec/cookies_spec.rb","line":254,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 725: it 'sets a cookie' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":725,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 726: cookie_route { cookies.set('foo', value: 'bar') }","file":"sinatra-contrib/spec/cookies_spec.rb","line":726,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 730: it 'sets a cookie with httponly' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":730,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 733: cookies.set('foo', value: 'bar', httponly: true)","file":"sinatra-contrib/spec/cookies_spec.rb","line":733,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"リクエストの処理を開始する際に、共通ログ出力を有効にするフラグが環境変数に設定される挙動を確認してください。","query":"commonlogger env","file":"lib/sinatra/base.rb","symbol":"call","line":267,"lang":"ja","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 262: env['sinatra.commonlogger'] ? @app.call(env) : super","file":"lib/sinatra/base.rb","line":262,"lexical":0.39999999999999997,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 268: env['sinatra.commonlogger'] = true","file":"lib/sinatra/base.rb","line":268,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"如何创建一个用于测试的Sinatra应用程序,并允许通过块传入路由定义?","query":"mock sinatra app","file":"sinatra-contrib/spec/json_spec.rb","symbol":"mock_app","line":33,"lang":"zh","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 114: # Instantiate and configure a mock Sinatra app.","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":114,"lexical":0.55,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 122: # @return [Sinatra] Configured mocked app","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":122,"lexical":0.55,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 123: def mock_app(base = Sinatra::Base, &block)","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":123,"lexical":0.55,"target":false},{"text":"File: test/delegator_test.rb\nLine 39: mock_app { Sinatra::Delegator.target = self }","file":"test/delegator_test.rb","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: test/mapped_error_test.rb\nLine 121: mock_app(Sinatra::Application) do","file":"test/mapped_error_test.rb","line":121,"lexical":0.65,"target":false},{"text":"File: test/middleware_test.rb\nLine 5: @app = mock_app(Sinatra::Application) do","file":"test/middleware_test.rb","line":5,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 20: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 41: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":41,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 52: mock_app(Class.new(Sinatra::Base)) do","file":"test/route_added_hook_test.rb","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: test/test_helper.rb\nLine 78: def mock_app(base=Sinatra::Base, &block)","file":"test/test_helper.rb","line":78,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"新しいルートが追加されたときに通知される仕組みのテストコードはどこ?","query":"route added hook","file":"test/route_added_hook_test.rb","symbol":"RouteAddedHookTest","line":13,"lang":"ja","candidates":[{"text":"File: Rakefile\nLine 32: readme request response result route_added_hook","file":"Rakefile","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1780: invoke_hook(:route_added, verb, path, block)","file":"lib/sinatra/base.rb","line":1780,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 351: invoke_hook :route_added, method.to_s.upcase, pattern, block","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 757: specify 'trigger the route_added hook' do","file":"sinatra-contrib/spec/namespace_spec.rb","line":757,"lexical":0.44999999999999996,"target":false},{"text":"File: test/route_added_hook_test.rb\nLine 13: class RouteAddedHookTest < Minitest::Test","file":"test/route_added_hook_test.rb","line":13,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Je cherche comment désactiver l'affichage des messages d'alerte de Ruby pour une partie spécifique de mes tests. Peux-tu me montrer la méthode qui permet de bloquer ces sorties temporairement avant de les rétablir ?","query":"silence warnings","file":"test/test_helper.rb","symbol":"silence_warnings","line":139,"lang":"fr","candidates":[{"text":"File: test/helpers_test.rb\nLine 552: # Silence warnings since Rack::Session::Cookie complains about the non-present session secret","file":"test/helpers_test.rb","line":552,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 553: silence_warnings do","file":"test/helpers_test.rb","line":553,"lexical":0.39999999999999997,"target":false},{"text":"File: test/test_helper.rb\nLine 139: def silence_warnings","file":"test/test_helper.rb","line":139,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"这个方法是怎么处理响应正文并去除空白字符的?","query":"last_response body","file":"sinatra-contrib/spec/content_for_spec.rb","symbol":"body","line":202,"lang":"zh","candidates":[{"text":"File: README.md\nLine 2448: assert_equal 'Hello World!', last_response.body","file":"README.md","line":2448,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2453: assert_equal 'Hello Frank!', last_response.body","file":"README.md","line":2453,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 2458: assert_equal \"You're using Songbird!\", last_response.body","file":"README.md","line":2458,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 17: expect(last_response.body).to eq('Host not permitted'), fail_message","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":17,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 297: expect(last_response.body).to eq(message)","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":297,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/support/spec_helpers.rb\nLine 7: def_delegators :last_response, :body, :headers, :status, :errors","file":"rack-protection/spec/support/spec_helpers.rb","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 26: # Body of last_response","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 48: def_delegators :last_response, :body, :headers, :status, :errors","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":48,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/content_for_spec.rb\nLine 203: last_response.body.gsub(/\\s/, '')","file":"sinatra-contrib/spec/content_for_spec.rb","line":203,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 546: expect(last_response.body).not_to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":546,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 548: expect(last_response.body).not_to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":548,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 550: expect(last_response.body).to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":550,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 558: expect(last_response.body).not_to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":558,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 560: expect(last_response.body).not_to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":560,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 562: expect(last_response.body).to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":562,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 575: expect(last_response.body).to eq 'not found...' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":575,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 577: expect(last_response.body).to eq 'not found...' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":577,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 579: expect(last_response.body).to eq 'nicht gefunden' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":579,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 610: expect(last_response.body).to eq 'auth failed' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":610,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 612: expect(last_response.body).to eq 'methode nicht erlaubt' unless verb == :head","file":"sinatra-contrib/spec/namespace_spec.rb","line":612,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 793: expect(last_response.body).to eq('ok')","file":"sinatra-contrib/spec/namespace_spec.rb","line":793,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 807: expect(last_response.body).to eq('ok')","file":"sinatra-contrib/spec/namespace_spec.rb","line":807,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 823: expect(last_response.body).to eq('42')","file":"sinatra-contrib/spec/namespace_spec.rb","line":823,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 838: expect(last_response.body).to eq('true')","file":"sinatra-contrib/spec/namespace_spec.rb","line":838,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/namespace_spec.rb\nLine 869: expect(last_response.body).to eq('[:foo_bar]')","file":"sinatra-contrib/spec/namespace_spec.rb","line":869,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"在测试中间件时,我遇到了一个问题:当请求的 PATH_INFO 包含大写字母时,中间件没有正确将其转换为小写,导致后续的路由匹配失败。","query":"downcase path info","file":"test/middleware_test.rb","symbol":"DowncaseMiddleware","line":36,"lang":"zh","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 2037: #{request.request_method.downcase} '#{request.path_info}' do","file":"lib/sinatra/base.rb","line":2037,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2044: #{request.request_method.downcase} '#{request.path_info}' do","file":"lib/sinatra/base.rb","line":2044,"lexical":0.44999999999999996,"target":false},{"text":"File: test/middleware_test.rb\nLine 38: env['PATH_INFO'] = env['PATH_INFO'].downcase","file":"test/middleware_test.rb","line":38,"lexical":0.44999999999999996,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"find die testmethode für die erweitertung","query":"extension test","file":"test/extensions_test.rb","symbol":"foo","line":5,"lang":"de","candidates":[{"text":"File: README.md\nLine 2720: This is especially useful for testing Sinatra extensions or using Sinatra in","file":"README.md","line":2720,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 3: class ExtensionsTest < Minitest::Test","file":"test/extensions_test.rb","line":3,"lexical":0.6000000000000001,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"レスポンスの状態や本体、リダイレクトを制御するメソッドを探して","query":"response status body","file":"lib/sinatra/base.rb","symbol":"Helpers","line":286,"lang":"ja","candidates":[{"text":"File: CHANGELOG.md\nLine 419: * Remove status code 205 from drop body response [#1398](https://github.com/sinatra/sinatra/issues/1398) by Shota Iguchi","file":"CHANGELOG.md","line":419,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 346: * An Array with two elements: `[status (Integer), response body (responds to","file":"README.md","line":346,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 1362: It is possible and recommended to set the status code and response body with","file":"README.md","line":1362,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 216: DROP_BODY_RESPONSES.include?(status)","file":"lib/sinatra/base.rb","line":216,"lexical":0.44999999999999996,"target":true},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 36: response = Rack::Response.new(body, status, headers)","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":36,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/support/spec_helpers.rb\nLine 7: def_delegators :last_response, :body, :headers, :status, :errors","file":"rack-protection/spec/support/spec_helpers.rb","line":7,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 48: def_delegators :last_response, :body, :headers, :status, :errors","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 29: it \"removes the Content-Type header and body when response status is #{status_code}\" do","file":"test/response_test.rb","line":29,"lexical":0.65,"target":false},{"text":"File: test/response_test.rb\nLine 37: it \"will not removes the Content-Type header and body when response status","file":"test/response_test.rb","line":37,"lexical":0.65,"target":false},{"text":"File: test/result_test.rb\nLine 46: it \"sets status, headers, and body when result is a Rack response tuple\" do","file":"test/result_test.rb","line":46,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estou tentando entender como enviar dados diretamente para o corpo da resposta em um fluxo contínuo. Onde está o método que permite concatenar múltiplos argumentos para transmitir conteúdo via stream?","query":"stream print","file":"sinatra-contrib/lib/sinatra/streaming.rb","symbol":"print","line":142,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 253: stream { |out| out.print('hi') }","file":"sinatra-contrib/spec/streaming_spec.rb","line":253,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 258: stream { |out| out.print(1, 2, 3, 4) }","file":"sinatra-contrib/spec/streaming_spec.rb","line":258,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 263: stream { |out| expect(out.print('hi')).to be_nil }","file":"sinatra-contrib/spec/streaming_spec.rb","line":263,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 269: stream { |out| out.printf('hi') }","file":"sinatra-contrib/spec/streaming_spec.rb","line":269,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 274: stream { |out| out.printf(\"%s: %d\", \"answer\", 42) }","file":"sinatra-contrib/spec/streaming_spec.rb","line":274,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 279: stream { |out| expect(out.printf('hi')).to be_nil }","file":"sinatra-contrib/spec/streaming_spec.rb","line":279,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find the logic that converts rfc 4627 tokens into objects or arrays","query":"rfc 4627 parse","file":"sinatra-contrib/spec/okjson.rb","symbol":"valparse","line":71,"lang":"en","candidates":[{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 50: # Parses a \"json text\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":50,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 69: # Parses a \"value\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":69,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 87: # Parses an \"object\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 117: # Parses a \"member\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":117,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 130: # Parses an \"array\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":130,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Je cherche la méthode qui permet de manipuler le code de statut HTTP de la réponse. Est-ce qu'elle peut servir à la fois à définir une nouvelle valeur et à récupérer celle qui est actuellement configurée ?","query":"set response status","file":"lib/sinatra/base.rb","symbol":"status","line":288,"lang":"fr","candidates":[{"text":"File: README.md\nLine 1362: It is possible and recommended to set the status code and response body with","file":"README.md","line":1362,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 287: # Set or retrieve the response status code.","file":"lib/sinatra/base.rb","line":287,"lexical":0.44999999999999996,"target":true},{"text":"File: test/helpers_test.rb\nLine 23: it 'sets the response status code' do","file":"test/helpers_test.rb","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: test/result_test.rb\nLine 46: it \"sets status, headers, and body when result is a Rack response tuple\" do","file":"test/result_test.rb","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 817: it 'sets response.status with halt' do","file":"test/routing_test.rb","line":817,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"mostre a implementação que adiciona o cabeçalho de segurança de transporte estrito","query":"strict-transport-security header","file":"rack-protection/lib/rack/protection/strict_transport.rb","symbol":"StrictTransport","line":26,"lang":"pt","candidates":[{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 12: # Sets the {Strict-Transport-Security}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security]","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":12,"lexical":0.39999999999999997,"target":true},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 16: # Note that if an upstream middleware sets the Strict-Transport-Security header, this middleware will not overwrite","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 40: headers['strict-transport-security'] ||= strict_transport","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 6: it 'should set the Strict-Transport-Security header' do","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 7: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 16: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=16070400')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 25: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; includeSubDomains')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":25,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 34: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; preload')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 43: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; includeSubDomains; preload')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":43,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"find the middleware that invalidates sessions if request headers change","query":"session hijacking protection","file":"rack-protection/lib/rack/protection/session_hijacking.rb","symbol":"Protection","line":6,"lang":"en","candidates":[{"text":"File: CHANGELOG.md\nLine 75: * Breaking change: Disable `session_hijacking` protection by default ([#1984])","file":"CHANGELOG.md","line":75,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 1274: use Rack::Protection::SessionHijacking","file":"README.md","line":1274,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 132: * [`Rack::Protection::SessionHijacking`][session-hijacking] (not included by `use Rack::Protection`)","file":"rack-protection/README.md","line":132,"lexical":0.55,"target":false},{"text":"File: rack-protection/README.md\nLine 179: [session-hijacking]: http://www.sinatrarb.com/protection/session_hijacking","file":"rack-protection/README.md","line":179,"lexical":0.55,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 23: autoload :SessionHijacking, 'rack/protection/session_hijacking'","file":"rack-protection/lib/rack/protection.rb","line":23,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 44: use ::Rack::Protection::SessionHijacking, options if use_these.include? :session_hijacking","file":"rack-protection/lib/rack/protection.rb","line":44,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/protection_spec.rb\nLine 11: use Rack::Protection, track: ['HTTP_FOO'], use: [:session_hijacking], except: [:remote_token]","file":"rack-protection/spec/lib/rack/protection/protection_spec.rb","line":11,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb\nLine 3: RSpec.describe Rack::Protection::SessionHijacking do","file":"rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb","line":3,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm trying to figure out how the middleware decides if a specific domain is allowed. Can you show me the logic that checks if a single hostname exists within the list of authorized hosts?","query":"permitted hosts include","file":"rack-protection/lib/rack/protection/host_authorization.rb","symbol":"exact_match?","line":119,"lang":"en","candidates":[{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 120: @permitted_hosts.include?(host)","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":120,"lexical":0.44999999999999996,"target":true},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 101: describe 'when permitted hosts include IPAddr instance for 0.0.0.0/0' do","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 131: describe 'when permitted hosts include IPAddr instance for ::/0' do","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":131,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/host_authorization_spec.rb\nLine 162: describe 'when permitted hosts include IPAddr instance for 192.168.0.1/32' do","file":"rack-protection/spec/lib/rack/protection/host_authorization_spec.rb","line":162,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"I'm looking for the core shared logic that powers all the security middleware layers. Can you show me where the common configuration options and the default rejection behavior are defined?","query":"middleware base options","file":"rack-protection/lib/rack/protection/base.rb","symbol":"Protection","line":10,"lang":"en","candidates":[{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 38: # [Rack::Protection::Base options] options supported by Rack::Protection::Base may affect this middleware.","file":"rack-protection/lib/rack/protection/frame_options.rb","line":38,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 33: # [Rack::Protection::Base options] options supported by Rack::Protection::Base may affect this middleware.","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/http_origin.rb\nLine 34: # [Rack::Protection::Base options] options supported by Rack::Protection::Base may affect this middleware.","file":"rack-protection/lib/rack/protection/http_origin.rb","line":34,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Onde é lançada a exceção de erro de IO quando tentamos ler algo que não está aberto?","query":"raise IOError reading","file":"sinatra-contrib/lib/sinatra/streaming.rb","symbol":"not_open_for_reading","line":186,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 161: raise IOError, 'closing non-duplex IO for reading'","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":161,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 187: raise IOError, 'not opened for reading'","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":187,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 351: to raise_error(IOError, \"closing non-duplex IO for reading\")","file":"sinatra-contrib/spec/streaming_spec.rb","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 389: to raise_error(IOError, \"not opened for reading\")","file":"sinatra-contrib/spec/streaming_spec.rb","line":389,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 402: to raise_error(IOError, \"not opened for reading\")","file":"sinatra-contrib/spec/streaming_spec.rb","line":402,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"レスポンスから不正なクッキーを削除する処理を記述して","query":"remove bad cookies","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","symbol":"call","line":34,"lang":"ja","candidates":[{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 38: remove_bad_cookies(request, response)","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":38,"lexical":0.44999999999999996,"target":true},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 54: def remove_bad_cookies(request, response)","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":54,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"查找在处理未找到路由时设置环境变量的逻辑","query":"sinatra route-missing env","file":"test/base_test.rb","symbol":"route_missing","line":109,"lang":"zh","candidates":[{"text":"File: test/base_test.rb\nLine 92: headers['X-Route-Missing'] = env['sinatra.route-missing'] || ''","file":"test/base_test.rb","line":92,"lexical":0.44999999999999996,"target":true},{"text":"File: test/base_test.rb\nLine 110: env['sinatra.route-missing'] = '1'","file":"test/base_test.rb","line":110,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"O middleware de segurança de conteúdo está falhando ao incluir diretivas que não possuem valores associados (como o upgrade de requisições inseguras) na geração do cabeçalho HTTP, pois a lógica atual parece iterar apenas sobre chaves que esperam um valor específico.","query":"Content Security Policy","file":"rack-protection/lib/rack/protection/content_security_policy.rb","symbol":"ContentSecurityPolicy","line":65,"lang":"pt","candidates":[{"text":"File: CHANGELOG.md\nLine 482: * Modernize Rack::Protection::ContentSecurityPolicy with CSP Level 2 and 3 Directives [#1202](https://github.com/sinatra/sinatra/issues/1202) by Glenn Rempe","file":"CHANGELOG.md","line":482,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 71: use Rack::Protection::ContentSecurityPolicy,","file":"rack-protection/README.md","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 114: * [`Rack::Protection::ContentSecurityPolicy`][content-security-policy]","file":"rack-protection/README.md","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 167: [content-security-policy]: http://www.sinatrarb.com/protection/content_security_policy","file":"rack-protection/README.md","line":167,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 11: autoload :ContentSecurityPolicy, 'rack/protection/content_security_policy'","file":"rack-protection/lib/rack/protection.rb","line":11,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 38: use ::Rack::Protection::ContentSecurityPolicy, options if use_these.include? :content_security_policy","file":"rack-protection/lib/rack/protection.rb","line":38,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 11: # Sets the 'content-security-policy' or the 'content-security-policy-report-only' header, based on options provided.","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":11,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 13: # Description:: Content Security Policy, is a mechanism web applications","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":13,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 16: # Content Security Policy is a declarative policy that lets","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":16,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 25: # * http://caniuse.com/#search=ContentSecurityPolicy","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":25,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 26: # * http://content-security-policy.com/","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":26,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 29: # * http://www.html5rocks.com/en/tutorials/security/content-security-policy/","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":29,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 33: # ContentSecurityPolicy configuration is a complex topic with","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":33,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 38: # [<tt>:report_only</tt>] - if true, the <tt>content-security-policy-report-only</tt>","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":38,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 39: # header is set, instead of <tt>content-security-policy</tt>. Note that","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":39,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 65: class ContentSecurityPolicy < Base","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":65,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 100: header = options[:report_only] ? 'content-security-policy-report-only' : 'content-security-policy'","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":100,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 15: # * See full details at https://caniuse.com/mdn-http_headers_content-security-policy_frame-ancestors","file":"rack-protection/lib/rack/protection/frame_options.rb","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 21: # {frame-ancestors directive}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors]","file":"rack-protection/lib/rack/protection/frame_options.rb","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 22: # in your content security policy.","file":"rack-protection/lib/rack/protection/frame_options.rb","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 3: RSpec.describe Rack::Protection::ContentSecurityPolicy do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":3,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 6: it 'should set the Content Security Policy' do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":6,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 8: get('/', {}, 'wants' => 'text/html').headers['Content-Security-Policy']","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":8,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 12: it 'should not set the Content Security Policy for other content types' do","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":12,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 14: expect(headers['Content-Security-Policy']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":14,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 15: expect(headers['Content-Security-Policy-Report-Only']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":15,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 20: use Rack::Protection::ContentSecurityPolicy, default_src: 'none', script_src: 'https://cdn.mybank.net', style_src: 'https://cdn.mybank.net', img_src: 'https://cdn.mybank.net', connect_src: 'https://api.mybank.com', frame_src: 'self', font_src: 'https://cdn…","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":20,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 26: expect(headers['Content-Security-Policy']).to eq('connect-src https://api.mybank.com; default-src none; font-src https://cdn.mybank.net; frame-src self; img-src https://cdn.mybank.net; media-src https://cdn.mybank.net; object-src https://cdn.mybank.net; re…","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":26,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 27: expect(headers['Content-Security-Policy-Report-Only']).to be_nil","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":27,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 32: use Rack::Protection::ContentSecurityPolicy, block_all_mixed_content: true, disown_opener: true, upgrade_insecure_requests: true","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":32,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 38: expect(headers['Content-Security-Policy']).to eq(\"block-all-mixed-content; default-src 'self'; disown-opener; upgrade-insecure-requests\")","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":38,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb\nLine 43: use Rack::Protection::ContentSecurityPolicy, block_all_mixed_content: false, disown_opener: 'false', upgrade_insecure_requests: 'foo'","file":"rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb","line":43,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"DNSリバインディング攻撃を防ぐために、許可されたホスト名を確認する仕組みはどこにありますか?","query":"DNS rebinding host","file":"rack-protection/lib/rack/protection/host_authorization.rb","symbol":"Protection","line":7,"lang":"ja","candidates":[{"text":"File: README.md\nLine 2008: The middleware can block requests with unrecognized hostnames, to prevent DNS rebinding","file":"README.md","line":2008,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 93: ## DNS rebinding and other Host header attacks","file":"rack-protection/README.md","line":93,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 9: # Prevented attack:: DNS rebinding and other Host header attacks","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":9,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"疎通確認用のパスが固定値になっており、変更可能な設計になっているが、オーバーライドするための仕組みが分かりにくい。","query":"ping path","file":"sinatra-contrib/lib/sinatra/runner.rb","symbol":"ping_path","line":135,"lang":"ja","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 37: # Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.","file":"sinatra-contrib/lib/sinatra/runner.rb","line":37,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 128: 3.times { get(ping_path) }","file":"sinatra-contrib/lib/sinatra/runner.rb","line":128,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 135: def ping_path","file":"sinatra-contrib/lib/sinatra/runner.rb","line":135,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"当需要为会话生成一个经过脱敏处理的验证令牌时,如果同时提供了路径和请求方法,它应该能够根据特定的路径和方法获取对应的令牌,否则则回退到使用全局令牌。请检查这个逻辑是否正确处理了不同作用域下的令牌生成。","query":"mask authenticity token","file":"rack-protection/lib/rack/protection/authenticity_token.rb","symbol":"mask_authenticity_token","line":131,"lang":"zh","candidates":[{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 112: new(nil).mask_authenticity_token(session, path: path, method: method)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":112,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 131: def mask_authenticity_token(session, path: nil, method: :post)","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":131,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 181: # Creates a masked version of the authenticity token that varies","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":181,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 35: it 'accepts post form requests with masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":35,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 88: it 'returns a unique masked version of the authenticity token' do","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":88,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 89: expect(Rack::Protection::AuthenticityToken.token(session)).not_to eq(masked_token)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":89,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb\nLine 95: allow_any_instance_of(Rack::Protection::AuthenticityToken).to receive(:mask_token).and_return(masked_token)","file":"rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb","line":95,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 35: it 'accepts post form requests with masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":35,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/form_token_spec.rb\nLine 36: post('/', { 'authenticity_token' => masked_token }, 'rack.session' => session)","file":"rack-protection/spec/lib/rack/protection/form_token_spec.rb","line":36,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 48: it 'accepts post form requests with a remote referrer and masked authenticity_token field' do","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":48,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/remote_token_spec.rb\nLine 49: post('/', { 'authenticity_token' => masked_token }, 'HTTP_REFERER' => 'http://example.com/foo',","file":"rack-protection/spec/lib/rack/protection/remote_token_spec.rb","line":49,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"이 프레임워크에서 객체가 특정 메서드 보유 여부를 확인하는 로직을 수정하고 싶어요. 기본 응답 확인 외에 문자열 변환 가능 여부까지 체크하는 부분이 어디에 구현되어 있나요?","query":"respond_to? to_str","file":"lib/sinatra/base.rb","symbol":"respond_to?","line":128,"lang":"ko","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 129: super || to_str.respond_to?(*args)","file":"lib/sinatra/base.rb","line":129,"lexical":0.39999999999999997,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 348: if code.respond_to? :to_str","file":"lib/sinatra/base.rb","line":348,"lexical":0.39999999999999997,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 55: frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str","file":"rack-protection/lib/rack/protection/frame_options.rb","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/link_header.rb\nLine 85: opts[:rel] = urls.shift unless urls.first.respond_to? :to_str","file":"sinatra-contrib/lib/sinatra/link_header.rb","line":85,"lexical":0.39999999999999997,"target":false},{"text":"File: test/test_helper.rb\nLine 91: if value.respond_to? :to_str","file":"test/test_helper.rb","line":91,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"El seguimiento de los componentes intermedios de configuración no está registrando correctamente las instancias utilizadas durante la inicialización de la aplicación.","query":"middleware tracker used","file":"test/settings_test.rb","symbol":"use","line":594,"lang":"es","candidates":[{"text":"File: test/settings_test.rb\nLine 583: MiddlewareTracker.used.clear","file":"test/settings_test.rb","line":583,"lexical":0.44999999999999996,"target":true},{"text":"File: test/settings_test.rb\nLine 595: MiddlewareTracker.used << middleware","file":"test/settings_test.rb","line":595,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 603: assert_include MiddlewareTracker.used, Rack::Protection","file":"test/settings_test.rb","line":603,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 610: assert_include MiddlewareTracker.used, Rack::Protection::PathTraversal","file":"test/settings_test.rb","line":610,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 617: assert_include MiddlewareTracker.used, Rack::Protection","file":"test/settings_test.rb","line":617,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 618: assert !MiddlewareTracker.used.include?(Rack::Protection::PathTraversal)","file":"test/settings_test.rb","line":618,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 625: assert_include MiddlewareTracker.used, Rack::Protection::RemoteToken","file":"test/settings_test.rb","line":625,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 635: assert_include MiddlewareTracker.used, Rack::Session::Pool","file":"test/settings_test.rb","line":635,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 636: assert_include MiddlewareTracker.used, Rack::Protection::RemoteToken","file":"test/settings_test.rb","line":636,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 643: assert !MiddlewareTracker.used.include?(Rack::Protection::RemoteToken)","file":"test/settings_test.rb","line":643,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 650: assert_include MiddlewareTracker.used, Rack::Protection::RemoteToken","file":"test/settings_test.rb","line":650,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"verify that a stack of components responds correctly to basic get requests","query":"assert body ok","file":"test/rack_test.rb","symbol":"check","line":18,"lang":"en","candidates":[{"text":"File: test/helpers_test.rb\nLine 522: assert_body 'ok'","file":"test/helpers_test.rb","line":522,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 538: assert_body 'ok'","file":"test/helpers_test.rb","line":538,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 556: assert_body 'ok'","file":"test/helpers_test.rb","line":556,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 570: assert_body 'ok'","file":"test/helpers_test.rb","line":570,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1077: assert_body 'ok'","file":"test/helpers_test.rb","line":1077,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1207: assert_body 'ok'","file":"test/helpers_test.rb","line":1207,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1234: assert_body 'ok'","file":"test/helpers_test.rb","line":1234,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1286: assert_body 'ok'","file":"test/helpers_test.rb","line":1286,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1300: assert_body 'ok'","file":"test/helpers_test.rb","line":1300,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1314: assert_body 'ok'","file":"test/helpers_test.rb","line":1314,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1357: assert_body 'ok'","file":"test/helpers_test.rb","line":1357,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1370: assert_body 'ok'","file":"test/helpers_test.rb","line":1370,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1383: assert_body 'ok'","file":"test/helpers_test.rb","line":1383,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1409: assert_body 'ok'","file":"test/helpers_test.rb","line":1409,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1438: assert_body 'ok'","file":"test/helpers_test.rb","line":1438,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1465: assert_body 'ok'","file":"test/helpers_test.rb","line":1465,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1517: assert_body 'ok'","file":"test/helpers_test.rb","line":1517,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1531: assert_body 'ok'","file":"test/helpers_test.rb","line":1531,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1546: assert_body 'ok'","file":"test/helpers_test.rb","line":1546,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1559: assert_body 'ok'","file":"test/helpers_test.rb","line":1559,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1572: assert_body 'ok'","file":"test/helpers_test.rb","line":1572,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1598: assert_body 'ok'","file":"test/helpers_test.rb","line":1598,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1627: assert_body 'ok'","file":"test/helpers_test.rb","line":1627,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1641: assert_body 'ok'","file":"test/helpers_test.rb","line":1641,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1654: assert_body 'ok'","file":"test/helpers_test.rb","line":1654,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1706: assert_body 'ok'","file":"test/helpers_test.rb","line":1706,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1720: assert_body 'ok'","file":"test/helpers_test.rb","line":1720,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1735: assert_body 'ok'","file":"test/helpers_test.rb","line":1735,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1748: assert_body 'ok'","file":"test/helpers_test.rb","line":1748,"lexical":0.44999999999999996,"target":false},{"text":"File: test/helpers_test.rb\nLine 1787: assert_body 'ok'","file":"test/helpers_test.rb","line":1787,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 31: assert_equal \"OK\", response.body","file":"test/host_authorization_test.rb","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 53: assert_equal \"OK\", body","file":"test/host_authorization_test.rb","line":53,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"El iterador de los resultados no está ejecutando el bloque proporcionado, parece que solo realiza la llamada al objeto sin ceder el control.","query":"yield call","file":"test/result_test.rb","symbol":"each","line":28,"lang":"es","candidates":[{"text":"File: CHANGELOG.md\nLine 655: which will be used when calling `yield` in the template. (Alexey Muranov)","file":"CHANGELOG.md","line":655,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 711: Since you cannot call Ruby methods (except for `yield`) from a Liquid","file":"README.md","line":711,"lexical":0.39999999999999997,"target":false},{"text":"File: README.md\nLine 933: A layout is usually just a template that calls `yield`.","file":"README.md","line":933,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 297: def block.each; yield(call) end","file":"lib/sinatra/base.rb","line":297,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/content_for.rb\nLine 25: # Then, you call +yield_content+ with that identifier, generally from a","file":"sinatra-contrib/lib/sinatra/content_for.rb","line":25,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 55: # @yieldparam _self [Sinatra::Base] the object that the method was called on","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: test/result_test.rb\nLine 28: def res.each ; yield call ; end","file":"test/result_test.rb","line":28,"lexical":0.39999999999999997,"target":true},{"text":"File: test/streaming_test.rb\nLine 131: def close.callback; yield end","file":"test/streaming_test.rb","line":131,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"我需要验证 transform_values 方法是否正确处理了哈希中的值转换,特别是针对包含字符串值的键。请帮我检查当值支持 upcase 方法时,转换后的哈希是否与原始哈希不同,并且特定键的值是否已正确转换为大写。","query":"transform_values test","file":"test/indifferent_hash_test.rb","symbol":"test_transform_values","line":219,"lang":"zh","candidates":[{"text":"File: test/indifferent_hash_test.rb\nLine 213: def test_transform_values!","file":"test/indifferent_hash_test.rb","line":213,"lexical":0.6000000000000001,"target":true},{"text":"File: test/indifferent_hash_test.rb\nLine 219: def test_transform_values","file":"test/indifferent_hash_test.rb","line":219,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Where is the default error code for bad requests defined?","query":"400 status","file":"lib/sinatra/base.rb","symbol":"http_status","line":278,"lang":"en","candidates":[{"text":"File: CHANGELOG.md\nLine 230: * Handle EOFError raised by Rack and return Bad Request 400 status. [#1743](https://github.com/sinatra/sinatra/pull/1743) by tamazon","file":"CHANGELOG.md","line":230,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGELOG.md\nLine 486: * Improve BadRequest logic. Raise and handle exceptions if status is 400 [#1212](https://github.com/sinatra/sinatra/issues/1212) by Mike Pastore","file":"CHANGELOG.md","line":486,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 278: def http_status; 400 end","file":"lib/sinatra/base.rb","line":278,"lexical":0.39999999999999997,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 672: status.between? 400, 499","file":"lib/sinatra/base.rb","line":672,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 685: # whether or not the status is set to 400","file":"lib/sinatra/base.rb","line":685,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 687: status == 400","file":"lib/sinatra/base.rb","line":687,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1223: http_status = 500 unless http_status&.between?(400, 599)","file":"lib/sinatra/base.rb","line":1223,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/required_params_spec.rb\nLine 14: expect(last_response.status).to eq(400)","file":"sinatra-contrib/spec/required_params_spec.rb","line":14,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/required_params_spec.rb\nLine 18: expect(last_response.status).to eq(400)","file":"sinatra-contrib/spec/required_params_spec.rb","line":18,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/required_params_spec.rb\nLine 38: expect(last_response.status).to eq(400)","file":"sinatra-contrib/spec/required_params_spec.rb","line":38,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/required_params_spec.rb\nLine 46: expect(last_response.status).to eq(400)","file":"sinatra-contrib/spec/required_params_spec.rb","line":46,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/required_params_spec.rb\nLine 58: expect(last_response.status).to eq(400)","file":"sinatra-contrib/spec/required_params_spec.rb","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 30: it 'is true for status == 400' do","file":"test/helpers_test.rb","line":30,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 31: status_app(400) { bad_request? }","file":"test/helpers_test.rb","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 35: it 'is false for status gt 400' do","file":"test/helpers_test.rb","line":35,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 40: it 'is false for status lt 400' do","file":"test/helpers_test.rb","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 70: status_app(200 + rand(400)) { informational? }","file":"test/helpers_test.rb","line":70,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 104: status_app(400 + rand(200)) { redirect? }","file":"test/helpers_test.rb","line":104,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 111: status_app(400 + rand(100)) { client_error? }","file":"test/helpers_test.rb","line":111,"lexical":0.39999999999999997,"target":false},{"text":"File: test/helpers_test.rb\nLine 115: it 'is false for status < 400' do","file":"test/helpers_test.rb","line":115,"lexical":0.39999999999999997,"target":false},{"text":"File: test/response_test.rb\nLine 36: [200, 201, 202, 301, 302, 400, 401, 403, 404, 500].each do |status_code|","file":"test/response_test.rb","line":36,"lexical":0.39999999999999997,"target":false},{"text":"File: test/result_test.rb\nLine 4: def http_status; 400 end","file":"test/result_test.rb","line":4,"lexical":0.39999999999999997,"target":false},{"text":"File: test/routing_test.rb\nLine 199: assert_equal 400, status","file":"test/routing_test.rb","line":199,"lexical":0.39999999999999997,"target":false},{"text":"File: test/routing_test.rb\nLine 214: assert_equal 400, status","file":"test/routing_test.rb","line":214,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 195: assert_equal 400, status","file":"test/settings_test.rb","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: test/settings_test.rb\nLine 302: assert_equal 400, status","file":"test/settings_test.rb","line":302,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"How does the parser handle input that starts with structural characters instead of atomic values?","query":"RFC 4627 parse","file":"sinatra-contrib/spec/okjson.rb","symbol":"textparse","line":54,"lang":"en","candidates":[{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 50: # Parses a \"json text\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":50,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 69: # Parses a \"value\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":69,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 87: # Parses an \"object\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 117: # Parses a \"member\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":117,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/okjson.rb\nLine 130: # Parses an \"array\" in the sense of RFC 4627.","file":"sinatra-contrib/spec/okjson.rb","line":130,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"为什么在返回信息性状态码或者需要丢弃响应体时,`drop_content_info` 方法会返回 true?","query":"drop content info","file":"lib/sinatra/base.rb","symbol":"drop_content_info?","line":211,"lang":"zh","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 186: if drop_content_info?","file":"lib/sinatra/base.rb","line":186,"lexical":0.44999999999999996,"target":true},{"text":"File: lib/sinatra/base.rb\nLine 211: def drop_content_info?","file":"lib/sinatra/base.rb","line":211,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"log a warning message using the configured logger or rack logger","query":"warn logging","file":"rack-protection/lib/rack/protection/base.rb","symbol":"warn","line":94,"lang":"en","candidates":[{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 20: # [<tt>:logging</tt>] - if true, debug and warning statements are sent to the logger.","file":"rack-protection/lib/rack/protection/base.rb","line":20,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/quiet_logger.rb\nLine 43: return warn('You need to specify the paths you wish to exclude from logging via `set :quiet_logger_prefixes, %w(images css fonts)`') if quiet_logger_prefixes.empty?","file":"sinatra-contrib/lib/sinatra/quiet_logger.rb","line":43,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Comment est-ce que le nom d'hôte est isolé à partir d'une chaîne d'autorité ?","query":"extract host authority","file":"rack-protection/lib/rack/protection/host_authorization.rb","symbol":"extract_host","line":111,"lang":"fr","candidates":[{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 87: origin_host = extract_host(request.host_authority)","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":87,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 88: forwarded_host = extract_host(request.forwarded_authority)","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":88,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/host_authorization.rb\nLine 111: def extract_host(authority)","file":"rack-protection/lib/rack/protection/host_authorization.rb","line":111,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"The mechanism for registering helper modules via lazy loading by specifying a name and a file path is not working as expected.","query":"autoload helpers","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","symbol":"helpers","line":17,"lang":"en","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/contrib.rb\nLine 38: autoload :TestHelpers, 'sinatra/test_helpers'","file":"sinatra-contrib/lib/sinatra/contrib.rb","line":38,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib/setup.rb\nLine 18: autoload name, path, :helpers","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","line":18,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"使用文件内容作为响应体发送文件","query":"send file response","file":"lib/sinatra/base.rb","symbol":"send_file","line":426,"lang":"zh","candidates":[{"text":"File: README.md\nLine 1649: To return the contents of a file as the response, you can use the `send_file`","file":"README.md","line":1649,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_test.rb\nLine 61: it 'sets the Content-Length response header when sending files' do","file":"test/integration_test.rb","line":61,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_test.rb\nLine 62: response = server.get_response '/send_file'","file":"test/integration_test.rb","line":62,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Le chemin de l'URL est transformé en minuscules de manière systématique avant d'atteindre le reste de l'application, ce qui peut casser la distinction entre casse et les routes sensibles.","query":"PATH_INFO downcase","file":"test/middleware_test.rb","symbol":"call","line":37,"lang":"fr","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 2037: #{request.request_method.downcase} '#{request.path_info}' do","file":"lib/sinatra/base.rb","line":2037,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2044: #{request.request_method.downcase} '#{request.path_info}' do","file":"lib/sinatra/base.rb","line":2044,"lexical":0.39999999999999997,"target":false},{"text":"File: test/middleware_test.rb\nLine 38: env['PATH_INFO'] = env['PATH_INFO'].downcase","file":"test/middleware_test.rb","line":38,"lexical":0.39999999999999997,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"읽기 스트림이 종료되었는지 확인하는 메서드가 항상 true를 반환하는데 이거 의도된 거야?","query":"closed read","file":"sinatra-contrib/lib/sinatra/streaming.rb","symbol":"closed_read?","line":164,"lang":"ko","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 164: def closed_read?","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":164,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 355: context 'closed_read?' do","file":"sinatra-contrib/spec/streaming_spec.rb","line":355,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 356: it('returns true') { stream { |out| expect(out).to be_closed_read }}","file":"sinatra-contrib/spec/streaming_spec.rb","line":356,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Wie wird der Pfad zur Hauptdatei der Anwendung ermittelt?","query":"app file path","file":"sinatra-contrib/lib/sinatra/runner.rb","symbol":"app_file","line":53,"lang":"de","candidates":[{"text":"File: CHANGELOG.md\nLine 1768: * BUG: Sinatra detects the app file and root path when run under","file":"CHANGELOG.md","line":1768,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 1969: Path to the main application file, used to detect project root, views","file":"README.md","line":1969,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2090: Path to project root folder. Inferred from <tt>app_file</tt> setting","file":"README.md","line":2090,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2190: Path to the views folder. Inferred from <tt>app_file</tt> setting if","file":"README.md","line":2190,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 428: content_type opts[:type] || File.extname(path), default: 'application/octet-stream'","file":"lib/sinatra/base.rb","line":428,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2007: set :root, proc { app_file && File.expand_path(File.dirname(app_file)) }","file":"lib/sinatra/base.rb","line":2007,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/main.rb\nLine 32: # app_file. all other path related options are calculated based","file":"lib/sinatra/main.rb","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/main.rb\nLine 36: set :run, proc { File.expand_path($0) == File.expand_path(app_file) }","file":"lib/sinatra/main.rb","line":36,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/runner.rb\nLine 37: # Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.","file":"sinatra-contrib/lib/sinatra/runner.rb","line":37,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 10: # Returns the path of the Sinatra application file created by","file":"sinatra-contrib/spec/reloader_spec.rb","line":10,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 12: def app_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":12,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 50: update_file(app_file_path) do |f|","file":"sinatra-contrib/spec/reloader_spec.rb","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 51: template_path = File.expand_path('reloader/app.rb.erb', __dir__)","file":"sinatra-contrib/spec/reloader_spec.rb","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 77: $LOADED_FEATURES.delete app_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":77,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 78: require app_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":78,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 114: FileUtils.rm app_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 146: app_const.inline_templates= template_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":146,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/reloader_spec.rb\nLine 353: app_const.dont_reload app_file_path","file":"sinatra-contrib/spec/reloader_spec.rb","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: test/integration_helper.rb\nLine 29: File.expand_path('integration/app.rb', __dir__)","file":"test/integration_helper.rb","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 227: assert_equal File.expand_path($0), File.expand_path(@application.send(:caller_files).first)","file":"test/settings_test.rb","line":227,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 510: assert_equal File.expand_path(__FILE__), Sinatra.new.app_file","file":"test/settings_test.rb","line":510,"lexical":0.44999999999999996,"target":false},{"text":"File: test/settings_test.rb\nLine 525: assert_equal File.expand_path(__dir__), @application.root","file":"test/settings_test.rb","line":525,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"¿Cómo puedo saber si hay una última solicitud en la sesión de prueba?","query":"last request session","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","symbol":"last_request?","line":181,"lang":"es","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 189: # @return [Hash] Session of last request, or the empty Hash","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":189,"lexical":0.44999999999999996,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 194: last_request.session","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":194,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"我想看看在编写测试套件时,是如何模拟中间件去调用应用程序的。能不能帮我找一下那个直接把环境参数传递给底层应用实例的方法?","query":"app call env","file":"rack-protection/spec/support/shared_examples.rb","symbol":"call","line":48,"lang":"zh","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 227: result = app.call(env)","file":"lib/sinatra/base.rb","line":227,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 262: env['sinatra.commonlogger'] ? @app.call(env) : super","file":"lib/sinatra/base.rb","line":262,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 1044: status, headers, body = @app.call env","file":"lib/sinatra/base.rb","line":1044,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/middleware/logger.rb\nLine 17: @app.call(env)","file":"lib/sinatra/middleware/logger.rb","line":17,"lexical":0.44999999999999996,"target":false},{"text":"File: lib/sinatra/show_exceptions.rb\nLine 23: @app.call(env)","file":"lib/sinatra/show_exceptions.rb","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 79: result or app.call(env)","file":"rack-protection/lib/rack/protection/base.rb","line":79,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/content_security_policy.rb\nLine 99: status, headers, body = @app.call(env)","file":"rack-protection/lib/rack/protection/content_security_policy.rb","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/escaped_params.rb\nLine 103: app.call env","file":"rack-protection/lib/rack/protection/escaped_params.rb","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/frame_options.rb\nLine 61: status, headers, body = @app.call(env)","file":"rack-protection/lib/rack/protection/frame_options.rb","line":61,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/json_csrf.rb\nLine 28: status, headers, body = app.call(env)","file":"rack-protection/lib/rack/protection/json_csrf.rb","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/path_traversal.rb\nLine 18: app.call env","file":"rack-protection/lib/rack/protection/path_traversal.rb","line":18,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/referrer_policy.rb\nLine 27: status, headers, body = @app.call(env)","file":"rack-protection/lib/rack/protection/referrer_policy.rb","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 39: status, headers, body = @app.call(env)","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/xss_header.rb\nLine 20: status, headers, body = @app.call(env)","file":"rack-protection/lib/rack/protection/xss_header.rb","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/support/shared_examples.rb\nLine 18: res = app.call(env)","file":"rack-protection/spec/support/shared_examples.rb","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: rack-protection/spec/support/shared_examples.rb\nLine 44: app.call(env)","file":"rack-protection/spec/support/shared_examples.rb","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/spec/support/shared_examples.rb\nLine 49: app.call(env)","file":"rack-protection/spec/support/shared_examples.rb","line":49,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 37: # status, headers, body = @app.call(env)","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":37,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/streaming.rb\nLine 56: # status, headers, body = @app.call(env)","file":"sinatra-contrib/lib/sinatra/streaming.rb","line":56,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 149: status, headers, body = @app.call(env)","file":"sinatra-contrib/spec/streaming_spec.rb","line":149,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 174: status, headers, body = @app.call(env)","file":"sinatra-contrib/spec/streaming_spec.rb","line":174,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 188: status, headers, body = @app.call(env)","file":"sinatra-contrib/spec/streaming_spec.rb","line":188,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/spec/streaming_spec.rb\nLine 202: status, headers, body = @app.call(env)","file":"sinatra-contrib/spec/streaming_spec.rb","line":202,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 138: get('/low-level-forward') { app.call(env) }","file":"test/base_test.rb","line":138,"lexical":0.44999999999999996,"target":false},{"text":"File: test/middleware_test.rb\nLine 18: app.call(env)","file":"test/middleware_test.rb","line":18,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 21: _, _, body = @app.call(env)","file":"test/static_test.rb","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 31: @app.call(env)","file":"test/static_test.rb","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 86: _, _, body = @app.call(env)","file":"test/static_test.rb","line":86,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 205: _, headers, _ = @app.call(env)","file":"test/static_test.rb","line":205,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 212: _, headers, _ = @app.call(env)","file":"test/static_test.rb","line":212,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 221: _, headers, _ = @app.call(env)","file":"test/static_test.rb","line":221,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"obtener la clave de sesión de las opciones","query":"session key option","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","symbol":"session_key","line":84,"lang":"es","candidates":[{"text":"File: CHANGELOG.md\nLine 722: * The `protection` option now takes a `session` key for force","file":"CHANGELOG.md","line":722,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 149: session[options[:key]] ||= self.class.random_token","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":149,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/authenticity_token.rb\nLine 223: decode_token(session[options[:key]])","file":"rack-protection/lib/rack/protection/authenticity_token.rb","line":223,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 125: env.include? options[:session_key]","file":"rack-protection/lib/rack/protection/base.rb","line":125,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/base.rb\nLine 129: return env[options[:session_key]] if session? env","file":"rack-protection/lib/rack/protection/base.rb","line":129,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 85: @session_key ||= options[:session_key]","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":85,"lexical":0.44999999999999996,"target":true},{"text":"File: rack-protection/lib/rack/protection/session_hijacking.rb\nLine 28: options[:track].each { |k| session[key][k] = encode(env[k]) }","file":"rack-protection/lib/rack/protection/session_hijacking.rb","line":28,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Estoy revisando cómo se maneja la comprobación de existencia de claves cuando se usan tipos de datos distintos. ¿Podrías explicarme cómo se está transformando el argumento antes de pasar la validación al método del padre?","query":"convert_value super","file":"lib/sinatra/indifferent_hash.rb","symbol":"value?","line":92,"lang":"es","candidates":[{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 53: super(convert_value(value))","file":"lib/sinatra/indifferent_hash.rb","line":53,"lexical":0.39999999999999997,"target":true},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 61: super(convert_value(value))","file":"lib/sinatra/indifferent_hash.rb","line":61,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 75: super(convert_key(key), convert_value(value))","file":"lib/sinatra/indifferent_hash.rb","line":75,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 81: super(convert_value(value))","file":"lib/sinatra/indifferent_hash.rb","line":81,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 93: super(convert_value(value))","file":"lib/sinatra/indifferent_hash.rb","line":93,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/indifferent_hash.rb\nLine 157: super(&method(:convert_value))","file":"lib/sinatra/indifferent_hash.rb","line":157,"lexical":0.39999999999999997,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"クッキーの値を配列で取得する処理を探して","query":"cookie values","file":"sinatra-contrib/lib/sinatra/cookies.rb","symbol":"values","line":287,"lang":"ja","candidates":[{"text":"File: sinatra-contrib/lib/sinatra/cookies.rb\nLine 30: # foo, bar = cookies.values_at 'foo', 'bar'","file":"sinatra-contrib/lib/sinatra/cookies.rb","line":30,"lexical":0.6000000000000001,"target":true},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 485: it 'returns values from request cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":485,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 489: it 'returns values from response cookies' do","file":"sinatra-contrib/spec/cookies_spec.rb","line":489,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 822: it { expect(cookies('foo=bar', 'bar=baz').values.sort).to eq(['bar', 'baz']) }","file":"sinatra-contrib/spec/cookies_spec.rb","line":822,"lexical":0.6000000000000001,"target":false},{"text":"File: sinatra-contrib/spec/cookies_spec.rb\nLine 826: it { expect(cookies('foo=bar', 'bar=baz').values_at('foo')).to eq(['bar']) }","file":"sinatra-contrib/spec/cookies_spec.rb","line":826,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"mostre como estender os métodos de verbo para suportar múltiplos caminhos simultâneos","query":"multi route verb","file":"sinatra-contrib/lib/sinatra/multi_route.rb","symbol":"MultiRoute","line":60,"lang":"pt","candidates":[{"text":"File: sinatra-contrib/README.md\nLine 40: routes and multiple or custom HTTP verbs.","file":"sinatra-contrib/README.md","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/multi_route.rb\nLine 24: # Or for multiple verbs and multiple routes:","file":"sinatra-contrib/lib/sinatra/multi_route.rb","line":24,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"Verificar se os exemplos de uso documentados no arquivo de introdução do projeto estão funcionando corretamente através de testes de integração, garantindo que todos os verbos HTTP básicos respondam com o conteúdo esperado.","query":"readme examples test","file":"test/readme_test.rb","symbol":"ReadmeTest","line":4,"lang":"pt","candidates":[{"text":"File: CHANGELOG.md\nLine 1317: * Broken examples for using Erubis, Haml and Test::Unit in README have been","file":"CHANGELOG.md","line":1317,"lexical":0.44999999999999996,"target":false},{"text":"File: test/readme_test.rb\nLine 3: # Tests to check if all the README examples work.","file":"test/readme_test.rb","line":3,"lexical":0.65,"target":true}]} | |
| {"site":"project_search","repo":"sinatra","task":"find where extensions are being added to the application class during registration","query":"register extensions","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","symbol":"registered","line":49,"lang":"en","candidates":[{"text":"File: lib/sinatra/base.rb\nLine 1564: def register(*extensions, &block)","file":"lib/sinatra/base.rb","line":1564,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2091: def self.register(*extensions, &block) # :nodoc:","file":"lib/sinatra/base.rb","line":2091,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2160: def self.register(*extensions, &block)","file":"lib/sinatra/base.rb","line":2160,"lexical":0.39999999999999997,"target":false},{"text":"File: lib/sinatra/base.rb\nLine 2161: Delegator.target.register(*extensions, &block)","file":"lib/sinatra/base.rb","line":2161,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/contrib/setup.rb\nLine 10: @extensions ||= { helpers: [], register: [] }","file":"sinatra-contrib/lib/sinatra/contrib/setup.rb","line":10,"lexical":0.39999999999999997,"target":true},{"text":"File: sinatra-contrib/lib/sinatra/namespace.rb\nLine 248: def register(*extensions, &block)","file":"sinatra-contrib/lib/sinatra/namespace.rb","line":248,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/reloader.rb\nLine 343: def register(*extensions, &block)","file":"sinatra-contrib/lib/sinatra/reloader.rb","line":343,"lexical":0.39999999999999997,"target":false},{"text":"File: sinatra-contrib/lib/sinatra/test_helpers.rb\nLine 86: # @!method register(*extensions, &block)","file":"sinatra-contrib/lib/sinatra/test_helpers.rb","line":86,"lexical":0.39999999999999997,"target":false},{"text":"File: test/delegator_test.rb\nLine 102: it \"registers extensions with the delegation target\" do","file":"test/delegator_test.rb","line":102,"lexical":0.39999999999999997,"target":false},{"text":"File: test/extensions_test.rb\nLine 35: Sinatra::Base.register FooExtensions","file":"test/extensions_test.rb","line":35,"lexical":0.6000000000000001,"target":false},{"text":"File: test/extensions_test.rb\nLine 38: Sinatra::Application.register BarExtensions","file":"test/extensions_test.rb","line":38,"lexical":0.6000000000000001,"target":false},{"text":"File: test/extensions_test.rb\nLine 50: Sinatra::Application.register FooExtensions","file":"test/extensions_test.rb","line":50,"lexical":0.6000000000000001,"target":false},{"text":"File: test/extensions_test.rb\nLine 58: Sinatra::Application.register PainExtensions","file":"test/extensions_test.rb","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: test/extensions_test.rb\nLine 68: Sinatra::Base.register QuuxExtensions","file":"test/extensions_test.rb","line":68,"lexical":0.6000000000000001,"target":false},{"text":"File: test/extensions_test.rb\nLine 73: Sinatra.register BazExtensions","file":"test/extensions_test.rb","line":73,"lexical":0.6000000000000001,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"hsts 헤더 구성하는 로직 찾아줘","query":"strict transport security","file":"rack-protection/lib/rack/protection/strict_transport.rb","symbol":"strict_transport","line":29,"lang":"ko","candidates":[{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 9: # Supported browsers:: All modern browsers. See https://caniuse.com/stricttransportsecurity","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":9,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 10: # More info:: https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":10,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 12: # Sets the {Strict-Transport-Security}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security]","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":12,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 16: # Note that if an upstream middleware sets the Strict-Transport-Security header, this middleware will not overwrite","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":16,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/strict_transport.rb\nLine 40: headers['strict-transport-security'] ||= strict_transport","file":"rack-protection/lib/rack/protection/strict_transport.rb","line":40,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 6: it 'should set the Strict-Transport-Security header' do","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":6,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 7: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":7,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 16: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=16070400')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":16,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 25: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; includeSubDomains')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":25,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 34: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; preload')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":34,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/strict_transport_spec.rb\nLine 43: expect(get('/', {}, 'wants' => 'text/html').headers['Strict-Transport-Security']).to eq('max-age=31536000; includeSubDomains; preload')","file":"rack-protection/spec/lib/rack/protection/strict_transport_spec.rb","line":43,"lexical":0.65,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"レスポンスボディが期待値と一致するか確認するメソッドを実装したい。文字列の場合は空白を無視して比較し、それ以外は正規表現マッチで判定する。","query":"assert response body","file":"test/test_helper.rb","symbol":"assert_body","line":90,"lang":"ja","candidates":[{"text":"File: README.md\nLine 2448: assert_equal 'Hello World!', last_response.body","file":"README.md","line":2448,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2453: assert_equal 'Hello Frank!', last_response.body","file":"README.md","line":2453,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 2458: assert_equal \"You're using Songbird!\", last_response.body","file":"README.md","line":2458,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 27: assert_equal 'Hello World', response.body","file":"test/base_test.rb","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 44: assert_equal 'Foo: new', response.body","file":"test/base_test.rb","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 67: assert_equal 'Hello World with Keyword Arguments: some argument', response.body","file":"test/base_test.rb","line":67,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 123: assert_equal 'Hello from middleware', response.body","file":"test/base_test.rb","line":123,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 129: assert_equal 'Hello from downstream', response.body","file":"test/base_test.rb","line":129,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 145: assert_equal 'Hello from downstream', response.body","file":"test/base_test.rb","line":145,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 155: assert_equal ['Hello from downstream'], response.body","file":"test/base_test.rb","line":155,"lexical":0.44999999999999996,"target":false},{"text":"File: test/base_test.rb\nLine 164: assert_equal 'Hello after explicit forward', response.body","file":"test/base_test.rb","line":164,"lexical":0.44999999999999996,"target":false},{"text":"File: test/delegator_test.rb\nLine 72: assert_equal 'Hello World', response.body","file":"test/delegator_test.rb","line":72,"lexical":0.44999999999999996,"target":false},{"text":"File: test/delegator_test.rb\nLine 88: assert_equal '', response.body","file":"test/delegator_test.rb","line":88,"lexical":0.44999999999999996,"target":false},{"text":"File: test/filter_test.rb\nLine 66: assert_equal [], response.body","file":"test/filter_test.rb","line":66,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 31: assert_equal \"OK\", response.body","file":"test/host_authorization_test.rb","line":31,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 71: assert_equal \"OK\", response.body","file":"test/host_authorization_test.rb","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 87: assert_equal \"Host not permitted\", response.body","file":"test/host_authorization_test.rb","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 100: assert_equal \"OK\", response.body","file":"test/host_authorization_test.rb","line":100,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 122: assert_equal message, response.body","file":"test/host_authorization_test.rb","line":122,"lexical":0.44999999999999996,"target":false},{"text":"File: test/host_authorization_test.rb\nLine 144: assert_equal \"OK\", response.body","file":"test/host_authorization_test.rb","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: test/response_test.rb\nLine 13: assert_equal [], @response.body","file":"test/response_test.rb","line":13,"lexical":0.65,"target":false},{"text":"File: test/response_test.rb\nLine 25: assert_equal 'Hello World', @response.body.join","file":"test/response_test.rb","line":25,"lexical":0.65,"target":false},{"text":"File: test/response_test.rb\nLine 53: assert_same_body @response.body, body","file":"test/response_test.rb","line":53,"lexical":0.65,"target":false},{"text":"File: test/response_test.rb\nLine 67: assert_same_body @response.body, [\"foo\"]","file":"test/response_test.rb","line":67,"lexical":0.65,"target":false},{"text":"File: test/response_test.rb\nLine 72: assert_same_body @response.body, [\"foo\"]","file":"test/response_test.rb","line":72,"lexical":0.65,"target":false},{"text":"File: test/routing_test.rb\nLine 30: assert_equal 'Hello World', response.body","file":"test/routing_test.rb","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 46: assert_equal '', response.body","file":"test/routing_test.rb","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 161: assert_equal \"<h1>Not Found</h1>\", response.body","file":"test/routing_test.rb","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 187: assert_equal \"This is not a drill\", response.body","file":"test/routing_test.rb","line":187,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 200: assert_equal \"This is not a drill either\", response.body","file":"test/routing_test.rb","line":200,"lexical":0.44999999999999996,"target":false},{"text":"File: test/routing_test.rb\nLine 215: assert_equal \"This is not a drill either\", response.body","file":"test/routing_test.rb","line":215,"lexical":0.44999999999999996,"target":false},{"text":"File: test/static_test.rb\nLine 87: assert_equal([\"<h1>Not Found</h1>\"], body, \"Unexpected response content.\")","file":"test/static_test.rb","line":87,"lexical":0.44999999999999996,"target":false}]} | |
| {"site":"project_search","repo":"sinatra","task":"Se detectan múltiples valores para la clave de sesión o claves con nombres duplicados codificados que podrían permitir ataques de inyección de cookies, y el middleware debería limpiar estas cookies maliciosas de la respuesta para evitar que se propaguen.","query":"cookie tossing protection","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","symbol":"CookieTossing","line":31,"lang":"es","candidates":[{"text":"File: CHANGELOG.md\nLine 500: * rack-protection: Bundle StrictTransport, CookieTossing, and CSP [#1267](https://github.com/sinatra/sinatra/issues/1267) by Mike Pastore","file":"CHANGELOG.md","line":500,"lexical":0.44999999999999996,"target":false},{"text":"File: rack-protection/README.md\nLine 138: * [`Rack::Protection::CookieTossing`][cookie-tossing] (not included by `use Rack::Protection`)","file":"rack-protection/README.md","line":138,"lexical":0.55,"target":false},{"text":"File: rack-protection/README.md\nLine 168: [cookie-tossing]: http://www.sinatrarb.com/protection/cookie_tossing","file":"rack-protection/README.md","line":168,"lexical":0.55,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 10: autoload :CookieTossing, 'rack/protection/cookie_tossing'","file":"rack-protection/lib/rack/protection.rb","line":10,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection.rb\nLine 39: use ::Rack::Protection::CookieTossing, options if use_these.include? :cookie_tossing","file":"rack-protection/lib/rack/protection.rb","line":39,"lexical":0.65,"target":false},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 25: # use Rack::Protection::CookieTossing","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":25,"lexical":0.65,"target":true},{"text":"File: rack-protection/lib/rack/protection/cookie_tossing.rb\nLine 30: # use Rack::Protection::CookieTossing, session_key: \"custom.session\"","file":"rack-protection/lib/rack/protection/cookie_tossing.rb","line":30,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 3: RSpec.describe Rack::Protection::CookieTossing do","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":3,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 9: use Rack::Protection::CookieTossing","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":9,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 55: use Rack::Protection::CookieTossing, reaction: :redirect","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":55,"lexical":0.65,"target":false},{"text":"File: rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb\nLine 76: use Rack::Protection::CookieTossing, session_key: '_session'","file":"rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb","line":76,"lexical":0.65,"target":false}]} | |