### Run Package Tests Example (curl) Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Example using curl to execute all tests within a specified Smalltalk package by sending a GET request to the /run-package-test endpoint. ```bash curl "http://localhost:8086/run-package-test?package_name=Sis-Tests-Dummy" ``` -------------------------------- ### Install PharoSmalltalkInteropServer via Metacello Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/README.md Installs the PharoSmalltalkInteropServer baseline using Metacello. Requires Pharo Smalltalk image (tested with Pharo 12+). ```Smalltalk Metacello new baseline: 'PharoSmalltalkInteropServer'; repository: 'github://mumez/PharoSmalltalkInteropServer:main/src'; load. ``` -------------------------------- ### Search Classes Example (curl) Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Example using curl to perform a GET request to the /search-classes-like endpoint, querying for class names that match a specific pattern. ```bash curl "http://localhost:8086/search-classes-like?class_name_query=SisFixture" ``` -------------------------------- ### Package Installation via Metacello Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/CLAUDE.md Instructions for loading the PharoSmalltalkInteropServer project using Metacello, specifying the baseline and repository. ```Smalltalk Metacello new baseline: 'PharoSmalltalkInteropServer'; repository: 'github://mumez/PharoSmalltalkInteropServer:main/src'; load. ``` -------------------------------- ### Start, Stop, and Check PharoSmalltalkInteropServer Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/README.md Basic operations to start, stop, and check the status of the PharoSmalltalkInteropServer. ```Smalltalk "Start the server" SisServer current start "Stop the server" SisServer current stop "Check server status" SisServer current ``` -------------------------------- ### Get Method Source Example (curl) Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Example using curl to retrieve the source code of a specific Smalltalk method by providing the class name and method name as query parameters. ```bash curl "http://localhost:8086/get-method-source?class_name=SisFixtureClassForTest&method_name=testMethodBbb" ``` -------------------------------- ### Server Management Commands Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/CLAUDE.md Commands to start and stop the PharoSmalltalkInteropServer instance. ```Smalltalk SisServer current start "Start the server" SisServer current stop "Stop the server" ``` -------------------------------- ### Evaluate Smalltalk Code Example (curl) Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Example using curl to send a POST request to the /eval/ endpoint to execute a Smalltalk expression. It includes setting the Content-Type header and providing the code in the request body. ```bash curl -X POST http://localhost:8086/eval/ \ -H "Content-Type: application/json" \ -d '{"code": "5 rem: 3"}' ``` -------------------------------- ### Server Configuration: Port Change Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/CLAUDE.md Example of how to reconfigure the server's listening port using the Teapot configuration. ```Smalltalk SisServer teapotConfig at: #port put: 8080 "Change port" ``` -------------------------------- ### API Success Response Example Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Illustrates the standard JSON structure for successful API operations, including a boolean success flag and a result payload. ```json { "success": true, "result": "..." } ``` -------------------------------- ### API Error Response Example Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/API.md Demonstrates the standard JSON structure for API operations that encounter an error, indicating failure and providing an error message. ```json { "success": false, "error": "Error description" } ``` -------------------------------- ### Run PharoSmalltalkInteropServer Tests Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/README.md Executes all server tests by locating the 'Sis-Tests' package and running its test suite. It also shows how to run a specific test class. ```Smalltalk "Run all server tests" (Smalltalk packages detect: [:pkg | pkg name = 'Sis-Tests']) testSuite run "Run specific test class" SisTest suite run ``` -------------------------------- ### API Endpoints Overview Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/CLAUDE.md Summary of the core API functionalities provided by the PharoSmalltalkInteropServer, enabling interaction with Smalltalk environments. ```APIDOC API Endpoints: Code Evaluation: - Endpoint: /eval/ - Description: Allows execution of arbitrary Smalltalk code snippets remotely. - Input: Typically a JSON payload containing the code to evaluate. - Output: JSON response with evaluation results or errors. Package, Class, and Method Introspection: - Description: Provides endpoints to list packages, classes, traits, and methods. Allows retrieval of source code for these entities. - Functionality: Listing, searching, and retrieving source. Search Functionality: - Description: Enables searching for classes, traits, methods, and their references or implementors within the Smalltalk image. Package Export/Import (Tonel Format): - Description: Supports exporting and importing Smalltalk packages using the Tonel serialization format. - Functionality: Serializing and deserializing package structures. Test Execution: - Description: Facilitates running tests at the package and class levels. - Input: Specifies which tests to run. - Output: Test results. Project Installation: - Endpoint: /install-project - Description: Handles the installation of projects into the Smalltalk environment, likely using Metacello or similar tools. ``` -------------------------------- ### Running Test Suite Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/CLAUDE.md Command to execute the main test suite for the PharoSmalltalkInteropServer project. ```Smalltalk (Smalltalk packages detect: [:pkg | pkg name = 'Sis-Tests']) testSuite run ``` -------------------------------- ### Configure PharoSmalltalkInteropServer Port Source: https://github.com/mumez/pharosmalltalkinteropserver/blob/main/README.md Configures the server port for PharoSmalltalkInteropServer. The default port is 8086. This snippet also shows how to view the current configuration. ```Smalltalk "Change server port (default: 8086)" SisServer teapotConfig at: #port put: 9090 "View current configuration" SisServer teapotConfig ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.