Skip to content

Commit 59c4412

Browse files
authored
Merge pull request #279 from sferik/add-rbs-signatures
Add RBS signatures from ruby/rbs repo
2 parents af75f84 + 5191d32 commit 59c4412

10 files changed

Lines changed: 6250 additions & 1 deletion

File tree

.github/workflows/push_gem.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
with:
3535
bundler-cache: true
3636
ruby-version: ruby
37+
env:
38+
BUNDLE_WITHOUT: sig
3739

3840
- name: Publish to RubyGems
3941
uses: rubygems/release-gem@e9a6361a0b14562539327c2a02373edc56dd3169 # v1.1.4

.github/workflows/sig.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: sig
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
sig:
7+
runs-on: ubuntu-latest
8+
env:
9+
BUNDLE_WITH: sig
10+
steps:
11+
- uses: actions/checkout@v6
12+
- name: Set up Ruby
13+
uses: ruby/setup-ruby@v1
14+
with:
15+
ruby-version: ruby
16+
bundler-cache: true
17+
- name: Run RBS test
18+
run: bundle exec rake rbs:test

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
ruby-version: ${{ matrix.ruby }}
2727
- name: Install dependencies
2828
run: bundle install
29+
env:
30+
BUNDLE_WITHOUT: sig
2931
- name: Run test
3032
run: rake test
3133
- name: Build

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ gemspec
55
gem "rake"
66
gem "test-unit"
77
gem "test-unit-ruby-core"
8+
9+
group :sig do
10+
gem "rbs"
11+
gem "rdoc"
12+
end

Rakefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
require "bundler/gem_tasks"
22
require "rake/testtask"
3+
require "tmpdir"
34

45
Rake::TestTask.new(:test) do |t|
56
t.libs << "test/lib"
67
t.ruby_opts << "-rhelper"
78
t.test_files = FileList["test/**/test_*.rb"]
89
end
910

11+
namespace :rbs do
12+
Rake::TestTask.new(:test) do |t|
13+
t.libs << "test_sig"
14+
t.ruby_opts << "-rtest_helper"
15+
t.test_files = FileList["test_sig/test_*.rb"]
16+
end
17+
18+
desc "Update public RBS comments from local RDoc"
19+
task :annotate do
20+
Dir.mktmpdir do |tmpdir|
21+
sh "rdoc", "--ri", "--output", "#{tmpdir}/doc", "--root=.", "lib", "doc"
22+
sh "rbs", "annotate", "--no-system", "--no-gems", "--no-site", "--no-home",
23+
"-d", "#{tmpdir}/doc", "sig/net-http.rbs"
24+
end
25+
end
26+
end
27+
1028
task :default => :test

net-http.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030

3131
# Specify which files should be added to the gem when it is released.
3232
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33-
excludes = %W[/.git* /bin /test /*file /#{File.basename(__FILE__)}]
33+
excludes = %W[/.git* /bin /test /test_sig /*file /#{File.basename(__FILE__)}]
3434
spec.files = IO.popen(%W[git -C #{__dir__} ls-files -z --] + excludes.map {|e| ":^#{e}"}, &:read).split("\x0")
3535
spec.bindir = "exe"
3636
spec.require_paths = ["lib"]

sig/manifest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies:
2+
- name: net-protocol
3+
- name: uri

0 commit comments

Comments
 (0)