Remove useless condition in example
## Motivation and Context The example files `examples/http_client.rb` and `examples/streamable_http_client.rb` are intended to be run as standalone scripts and are not designed to be reused as modules (e.g., via `require`). The `if __FILE__ == $PROGRAM_NAME` guard therefore serves no purpose and is removed. ## How Has This Been Tested? Manually verified that each example script can still be executed directly (`ruby examples/http_client.rb`, `ruby examples/streamable_http_client.rb`). No automated tests cover files under `examples/`. ## Breaking Changes None. The files under `examples/` are standalone scripts and are not part of the gem's public API.
This commit is contained in:
parent
541200ffcd
commit
704d362a12
2 changed files with 4 additions and 3 deletions
|
|
@ -137,8 +137,7 @@ class MCPHTTPClient
|
|||
end
|
||||
end
|
||||
|
||||
# Main script
|
||||
if __FILE__ == $PROGRAM_NAME
|
||||
def main
|
||||
puts <<~MESSAGE
|
||||
MCP HTTP Client Example
|
||||
Make sure the HTTP server is running (ruby examples/http_server.rb)
|
||||
|
|
@ -182,3 +181,5 @@ if __FILE__ == $PROGRAM_NAME
|
|||
client.close_session
|
||||
end
|
||||
end
|
||||
|
||||
main
|
||||
|
|
|
|||
|
|
@ -176,4 +176,4 @@ def main
|
|||
end
|
||||
end
|
||||
|
||||
main if __FILE__ == $PROGRAM_NAME
|
||||
main
|
||||
|
|
|
|||
Loading…
Reference in a new issue