mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-12 10:27:11 +00:00
81a43f028f
Java, C, C++, Ruby, C#, Kotlin, Scala, PHP via tree-sitter (13 total) benchmark.py measures BFS subgraph tokens vs corpus tokens 5 skill bug fixes (cohesion crash, dead step, missing MCP tool)
28 lines
359 B
Ruby
28 lines
359 B
Ruby
require 'json'
|
|
require 'net/http'
|
|
|
|
class ApiClient
|
|
def initialize(base_url)
|
|
@base_url = base_url
|
|
end
|
|
|
|
def get(path)
|
|
fetch(path, 'GET')
|
|
end
|
|
|
|
def post(path, body)
|
|
fetch(path, 'POST')
|
|
end
|
|
|
|
private
|
|
|
|
def fetch(path, method)
|
|
uri = URI(@base_url + path)
|
|
Net::HTTP.get(uri)
|
|
end
|
|
end
|
|
|
|
def parse_response(raw)
|
|
JSON.parse(raw)
|
|
end
|