-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Ruby: rack - model more responses and app types #13483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7a3b6f1
Ruby: add predicates to DataFlow::ModuleNode to get singleton methods
alexrford 521e65c
Ruby: rack - extend rack applications to include instance methods, la…
alexrford 4d59181
Ruby: rack - Rack::Response#finish constructs a valid rack response
alexrford e807972
Ruby: rack - extend rack tests
alexrford b8f537a
Ruby: update rack tests
alexrford f8140bc
Ruby: rack - improve performance of trackRackResponse
alexrford 4f9f41a
Ruby: rack - fix qldoc
alexrford 4b3d995
Ruby: rack - rename getResponse as getAResponse
alexrford 29844e6
Ruby: rack - test for response tracking
alexrford de65473
qlformat
alexrford b67b80c
Ruby: rack - rename App as RackApplication
alexrford 6008c7b
Ruby: rack - change note for response and app recognition improvements
alexrford 8fdc487
Ruby: rack - replace RackApplication with just the rack RequestHandler
alexrford 9cf165a
Ruby: rack - update a deprecation notice
alexrford 5fafd9e
Merge branch 'main' into rb/rack-extend-app-and-resp
alexrford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
category: minorAnalysis | ||
--- | ||
* More kinds of rack applications are now recognized. | ||
* Rack::Response instances are now recognized as potential responses from rack applications. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
rackApps | ||
| rack.rb:1:1:10:3 | HelloWorld | rack.rb:2:12:2:14 | env | | ||
| rack.rb:12:1:22:3 | Proxy | rack.rb:17:12:17:18 | the_env | | ||
| rack.rb:24:1:37:3 | Logger | rack.rb:30:12:30:14 | env | | ||
| rack.rb:39:1:45:3 | Redirector | rack.rb:40:12:40:14 | env | | ||
| rack.rb:59:1:75:3 | Baz | rack.rb:60:12:60:14 | env | | ||
rackRequestHandlers | ||
| rack.rb:2:3:9:5 | call | rack.rb:2:12:2:14 | env | rack.rb:8:5:8:38 | call to [] | | ||
| rack.rb:17:3:21:5 | call | rack.rb:17:12:17:18 | the_env | rack.rb:20:5:20:27 | call to [] | | ||
| rack.rb:30:3:36:5 | call | rack.rb:30:12:30:14 | env | rack.rb:35:5:35:26 | call to [] | | ||
| rack.rb:40:3:44:5 | call | rack.rb:40:12:40:14 | env | rack.rb:43:5:43:45 | call to [] | | ||
| rack.rb:60:3:62:5 | call | rack.rb:60:12:60:14 | env | rack.rb:66:7:66:22 | call to [] | | ||
| rack.rb:60:3:62:5 | call | rack.rb:60:12:60:14 | env | rack.rb:73:5:73:21 | call to [] | | ||
| rack.rb:79:3:81:5 | call | rack.rb:79:17:79:19 | env | rack.rb:93:5:93:78 | call to finish | | ||
| rack_apps.rb:6:3:12:5 | call | rack_apps.rb:6:12:6:14 | env | rack_apps.rb:10:12:10:34 | call to [] | | ||
| rack_apps.rb:16:3:18:5 | call | rack_apps.rb:16:17:16:19 | env | rack_apps.rb:17:5:17:28 | call to [] | | ||
| rack_apps.rb:21:14:21:50 | -> { ... } | rack_apps.rb:21:17:21:19 | env | rack_apps.rb:21:24:21:48 | call to [] | | ||
| rack_apps.rb:23:21:23:53 | { ... } | rack_apps.rb:23:24:23:26 | env | rack_apps.rb:23:29:23:51 | call to [] | | ||
rackResponseContentTypes | ||
| rack.rb:8:5:8:38 | call to [] | rack.rb:7:34:7:45 | "text/plain" | | ||
| rack.rb:20:5:20:27 | call to [] | rack.rb:19:28:19:38 | "text/html" | | ||
redirectResponses | ||
| rack.rb:43:5:43:45 | call to [] | rack.rb:42:30:42:40 | "/foo.html" | | ||
| rack.rb:93:5:93:78 | call to finish | rack.rb:93:60:93:70 | redirect_to | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'rack' | ||
require 'rack/handler/puma' | ||
handler = Rack::Handler::Puma | ||
|
||
class InstanceApp | ||
def call(env) | ||
status = 200 | ||
headers = {} | ||
body = ["instance app"] | ||
resp = [status, headers, body] | ||
resp | ||
end | ||
end | ||
|
||
class ClassApp | ||
def self.call(env) | ||
[200, {}, ["class app"]] | ||
end | ||
end | ||
|
||
lambda_app = ->(env) { [200, {}, ["lambda app"]] } | ||
|
||
proc_app = Proc.new { |env| [200, {}, ["proc app"]] } | ||
|
||
handler.run InstanceApp.new | ||
handler.run ClassApp | ||
handler.run lambda_app | ||
handler.run proc_app |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.