Skip to content

Commit 894ed0c

Browse files
GRPC seems to be working...
1 parent 0b18305 commit 894ed0c

File tree

13 files changed

+926
-112
lines changed

13 files changed

+926
-112
lines changed

Cargo.lock

Lines changed: 141 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ gem "rake", "~> 13.0"
1010
gem "rake-compiler"
1111
gem "rb_sys", "~> 0.9.63"
1212

13-
gem "minitest", "~> 5.16"
13+
gem "minitest", "~> 5.0"
1414

15-
gem "httpx", "~> 1.4"
15+
gem "httpx", "~> 1.2"
16+
17+
# gRPC dependencies
18+
gem "grpc", "~> 1.62"
19+
gem "grpc-tools", "~> 1.62"
20+
gem "google-protobuf", "~> 3.25"

Gemfile.lock

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9+
google-protobuf (3.25.6)
10+
google-protobuf (3.25.6-arm64-darwin)
11+
googleapis-common-protos-types (1.18.0)
12+
google-protobuf (>= 3.18, < 5.a)
13+
grpc (1.70.1)
14+
google-protobuf (>= 3.25, < 5.0)
15+
googleapis-common-protos-types (~> 1.0)
16+
grpc (1.70.1-arm64-darwin)
17+
google-protobuf (>= 3.25, < 5.0)
18+
googleapis-common-protos-types (~> 1.0)
19+
grpc-tools (1.70.1)
920
http-2 (1.0.2)
1021
httpx (1.4.0)
1122
http-2 (>= 1.0.0)
@@ -22,9 +33,12 @@ PLATFORMS
2233
ruby
2334

2435
DEPENDENCIES
25-
httpx (~> 1.4)
36+
google-protobuf (~> 3.25)
37+
grpc (~> 1.62)
38+
grpc-tools (~> 1.62)
39+
httpx (~> 1.2)
2640
hyper_ruby!
27-
minitest (~> 5.16)
41+
minitest (~> 5.0)
2842
rake (~> 13.0)
2943
rake-compiler
3044
rb_sys (~> 0.9.63)

Rakefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
# frozen_string_literal: true
22

33
require "bundler/gem_tasks"
4-
require "minitest/test_task"
4+
require "rake/testtask"
55

6-
Minitest::TestTask.create
6+
Rake::TestTask.new(:test) do |t|
7+
t.libs << "test"
8+
t.libs << "lib"
9+
t.pattern = "test/**/test_*.rb"
10+
t.warning = false
11+
t.verbose = true
12+
end
13+
14+
# Remove the existing default task
15+
Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
16+
17+
namespace :proto do
18+
desc "Generate Ruby code from proto files"
19+
task :generate do
20+
system("grpc_tools_ruby_protoc -I test --ruby_out=test --grpc_out=test test/echo.proto") or fail "Failed to generate proto files"
21+
end
22+
end
723

824
require "rb_sys/extensiontask"
925

@@ -15,4 +31,5 @@ RbSys::ExtensionTask.new("hyper_ruby", GEMSPEC) do |ext|
1531
ext.lib_dir = "lib/hyper_ruby"
1632
end
1733

18-
task default: %i[compile test]
34+
# Define the default task to run both compile and test
35+
task :default => [:compile, :test]

ext/hyper_ruby/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"]
2121
http-body-util = "0.1.2"
2222
jemallocator = { version = "0.5.4", features = ["disable_initial_exec_tls"] }
2323
futures = "0.3.31"
24+
h2 = "0.4"
25+
async-stream = "0.3.5"
26+
env_logger = "0.11"
27+
log = "0.4"

0 commit comments

Comments
 (0)