Skip to content
Merged
Show file tree
Hide file tree
Changes from 235 commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
29dfd96
Add rbs settings
znz May 17, 2023
5028f18
Add steep
znz May 17, 2023
8f8d29a
Remove LibraryEntry.include Enumerable
znz May 17, 2023
b26bcce
Add initial sig
znz May 17, 2023
ad85eed
Add re-generate sig/prototype task
znz May 17, 2023
0380ab1
Do not check Gemfile
znz May 17, 2023
4eccb02
Complete functionentry.rbs
znz May 18, 2023
2d28a26
Almost done bitclust/nameutils.rbs
znz May 18, 2023
9b43764
Complete bitclust/parseutils.rbs
znz May 18, 2023
dac0159
Almost complete bitclust/lineinput.rbs
znz May 18, 2023
18756f3
Complete bitclust/subcommand.rbs
znz May 19, 2023
cad4800
Almost done bitclust/syntax_highlighter.rbs
znz May 19, 2023
0cc92ec
Almost done bitclust/rrdparser.rbs except Context
znz May 19, 2023
49faefb
Revert some methods
znz May 22, 2023
e3b64b5
Almost done bitclust/preprocessor.rbs
znz May 22, 2023
5279dd9
Add bitclust/silent_progress_bar.rbs
znz May 29, 2023
4c545cd
Add bitclust/messagecatalog.rbs
znz May 29, 2023
8186edf
Add rbs for bitclust/server.rb
znz Jun 6, 2023
951d1ae
Add fileutils rbs
znz Jun 6, 2023
4f7912b
Add rbs for bitclust/database.rb
znz Jun 6, 2023
593d496
Add rbs for lib/bitclust/methoddatabase.rb
znz Jun 15, 2023
c9b35b2
Fix search_methods
znz Jun 15, 2023
d02b3c8
Add sig for lib/bitclust/methodid.rb
znz Jun 17, 2023
5acad66
Add methodentry.rbs (WIP) and BitClust::NameUtils::typename
znz Jun 26, 2023
78209e5
Add typemark and typechar too
znz Jun 26, 2023
ababfbb
Add types for methodentry.rb
znz Jun 27, 2023
06c6bff
Improve entry.rbs
znz Jun 30, 2023
33f92a5
Update classentry.rbs
znz Jul 3, 2023
85d03ee
Add rbs for textutils.rb
znz Jul 5, 2023
c3e091f
Fix some type errors
znz Aug 9, 2023
7bf5223
Add nkf and yaml for lib/bitclust/searcher.rb
znz Aug 10, 2023
458cda0
Add json for lib/bitclust/screen.rb
znz Aug 10, 2023
e2f02e4
Fix some type errors
znz Aug 10, 2023
ef04eb0
Ignore may be nil
znz Aug 10, 2023
0f0a8d7
Fix type errors in lib/bitclust/preprocessor.rb
znz Aug 10, 2023
d3748fc
Add Object#funcall
znz Aug 10, 2023
33ed6cc
Fix a type error
znz Aug 10, 2023
064a01b
Add rbs for libraryentry.rb
znz Aug 17, 2023
d2bcda1
Update rbs of classentry.rb
znz Aug 17, 2023
4de2c65
Fix errors
znz Aug 17, 2023
26b0c26
Replace buggy (unreachable?) codes with `raise`
znz Aug 17, 2023
2e17c4c
Add rbs for functiondatabase.rb
znz Aug 17, 2023
790a62d
Fix some type errors
znz Aug 17, 2023
291f2a2
Fix some type errors
znz Aug 17, 2023
45377e7
Add rbs tasks
znz Nov 16, 2023
4a110eb
rbs collection update
znz Nov 16, 2023
65ec6b1
`rake sig` with new gems
znz Nov 16, 2023
d36ff78
Add version.rbs
znz Nov 16, 2023
8992475
Fix some activation problems
znz Nov 16, 2023
15fc63e
Fix RBS::DuplicatedDeclaration
znz Nov 16, 2023
d0111b0
Fix type errors in methodid.rb
znz Nov 17, 2023
66adbfe
Add raise to $1
znz Dec 11, 2023
54f280e
Merge branch 'master' into add-rbs
znz Jul 5, 2024
54c2fbe
Install less
znz Jul 5, 2024
bb349da
Add Gemfile.lock
znz Jul 5, 2024
97b3ec0
rake rbs:update
znz Jul 5, 2024
aa75e3f
rake sig
znz Jul 5, 2024
ffde269
Revert "Fix RBS::DuplicatedDeclaration"
znz Jul 5, 2024
f979047
Add Steep (VSCode Extension)
znz Jul 5, 2024
d3d4577
Add RBS Syntax (VSCode extension)
znz Jul 5, 2024
0807124
Update ruby
znz Oct 1, 2024
c86f5f5
bundle update
znz Oct 1, 2024
9ec979f
rbs collection update
znz Oct 1, 2024
0a58b1c
Add date rbs
znz Oct 1, 2024
583dd9a
Fix type errors of chm_command.rb
znz Oct 1, 2024
e8b6b70
Add workaround for `rescue SomeModule`
znz Oct 2, 2024
a38f1bf
Add workaround for exception
znz Oct 2, 2024
efb1803
Merge chm_command.rbs
znz Oct 2, 2024
6d760f3
Update subcommand.rbs
znz Oct 2, 2024
dfcd1ad
Update methodsignature.rbs
znz Oct 2, 2024
d8393e2
Update htmlutils.rbs
znz Oct 2, 2024
d11955f
Use `|| raise` for non-nil
znz Oct 2, 2024
47f3ed6
Update rdcompiler.rbs
znz Oct 2, 2024
4396270
Add tmpdir
znz Oct 3, 2024
80fb94e
bundle update
znz Oct 3, 2024
ca19e3c
Update statichtml_command.rbs
znz Oct 3, 2024
2bf683e
Update screen.rbs
znz Oct 7, 2024
cc0bdf7
Update bundler
znz Oct 7, 2024
9813901
Add `attr_accessor`s
znz Oct 8, 2024
65145d5
Update list_command.rbs
znz Oct 8, 2024
9f05ed7
Add friendly error messages to list_command.rb
znz Oct 8, 2024
70c3241
Udpate methods_command.rbs
znz Oct 8, 2024
5f94a65
Update crossrubyutils.rbs
znz Oct 9, 2024
19f97d3
Update methods_command.rbs and fix a typo bug
znz Oct 9, 2024
44d5615
Update classes_command.rbs
znz Oct 9, 2024
d5e65ec
Update preproc_command.rbs
znz Oct 9, 2024
c140967
Update preprocessor.rbs
znz Oct 9, 2024
0c028f8
Use RBSs in webrick gem
znz Nov 18, 2024
4419bf1
Update gems
znz Nov 18, 2024
ab6b7cd
Update chm_command.rbs
znz Nov 18, 2024
1522c6b
Remove interface
znz Nov 18, 2024
e736564
Update extract_command.rbs
znz Nov 18, 2024
2f3aeef
Update htmlfile_command.rbs and some rbs
znz Nov 18, 2024
ebafc84
Add workaround for type errors in chm_command.rb
znz Nov 29, 2024
3897ac0
Add workaround for type errors in htmlfile_command.rb
znz Nov 29, 2024
42642d5
Add workaround for most type errors in server_command.rb
znz Nov 29, 2024
6a71ce8
Use fetch for HOME environment variable
znz Nov 29, 2024
3e1b9d9
Update server_command.rbs
znz Nov 29, 2024
e1c302f
bundle update
znz Dec 2, 2024
4e68f5c
Update setup_command.rbs
znz Dec 2, 2024
9f1429c
Update update_command.rbs
znz Dec 2, 2024
cceee76
Update entry.rbs
znz Dec 2, 2024
1f7b725
Merge sig/prototype/bitclust/server.rbs to sig/hand-written/bitclust/…
znz Dec 3, 2024
45b1dd6
diff by rake sig
znz Dec 3, 2024
e58e791
Update ancestors_command.rbs
znz Dec 3, 2024
5e194ef
Update query_command.rbs
znz Dec 3, 2024
49bcec1
Update property_command.rbs
znz Dec 3, 2024
f3a5daf
Update epub_command.rbs
znz Dec 3, 2024
f0cd6da
Update init_command.rbs
znz Dec 3, 2024
1737cb2
Add raise
znz Dec 3, 2024
08dcca6
Update lookup_command.rbs
znz Dec 5, 2024
855ca65
Add `or raise`
znz Dec 5, 2024
9fcd368
Update progress_bar.rbs
znz Dec 5, 2024
9fdd3d5
Merge methoddatabase.rbs
znz Dec 5, 2024
d0e6d08
Merge parseutils.rbs
znz Dec 5, 2024
c54beb4
Merge functionentry.rbs
znz Dec 5, 2024
796e212
Merge methodentry.rbs
znz Dec 5, 2024
2beddaf
Merge nameutils.rbs
znz Dec 5, 2024
7d90ee6
Update refsdatabase.rbs
znz Dec 5, 2024
4f74291
Merge rrdparser.rbs
znz Dec 5, 2024
d693c90
Update runner.rbs and options has :capi to bool
znz Dec 5, 2024
492704b
Fix some type errors
znz Dec 5, 2024
3ca73d3
bundle update
znz Dec 6, 2024
b6c6686
Use `rbs validate` instead of `steep validate`
znz Dec 6, 2024
69ce7b2
Fix type of kind
znz Dec 6, 2024
6dd7684
Update steep to 1.9.1
znz Dec 10, 2024
11a5d22
Add type comments and fix type of create_html_file
znz Dec 10, 2024
a936e4b
Add type comments and steep:ignore
znz Dec 10, 2024
88df5e3
Add type comments
znz Dec 10, 2024
c3ade56
rbs collection update
znz Dec 11, 2024
7ca946f
Updating rrdparser.rbs
znz Dec 11, 2024
4b999b9
Add types of ::BitClust::RRDParser::Context
znz Dec 12, 2024
596b25e
Merge methodid.rbs
znz Dec 12, 2024
3b57f7d
Add types of simplesearcher.rb
znz Dec 12, 2024
efe5014
bundle update
znz Dec 16, 2024
fa8012d
Update types of searcher.rbs
znz Dec 16, 2024
8926f48
Add time for Time#iso8601
znz Dec 16, 2024
82c121c
Update types of epub.rbs
znz Dec 16, 2024
6fb528e
Ignore some type errors
znz Dec 16, 2024
6faaa0d
Add some types to local variables
znz Dec 16, 2024
e44282e
Update epub.rbs
znz Dec 16, 2024
74125ae
tmp patch
znz Dec 16, 2024
945fff9
FunctionEntry#{params,source_location} can be nil
znz Dec 16, 2024
5aa6ab1
Update completion.rbs
znz Dec 16, 2024
593c7c0
bundle update
znz Dec 24, 2024
54d60b4
rbs collection update
znz Dec 24, 2024
3fd4da7
Update completion.rbs
znz Dec 24, 2024
94847c2
Merge syntax_highlighter.rbs
znz Dec 24, 2024
1c45674
Update ridatabase.rbs
znz Dec 25, 2024
9c2d97a
Update ridatabase.rbs
znz Dec 25, 2024
2d6f3cd
Use ERB::Util.url_encode instead of URI.escape
znz Dec 25, 2024
9c787fe
Ignore some type errors
znz Dec 25, 2024
179396c
Avoid type errors
znz Dec 25, 2024
554e450
Use void to ignore return value of yield
znz Jan 6, 2025
eb1ff08
Use void instead of untyped
znz Jan 6, 2025
bcc4fa2
Reduce more untyped and add more type
znz Jan 6, 2025
76f223e
Reduce untyped
znz Jan 16, 2025
aa2cb60
Reduce untyped
znz Jan 17, 2025
b3e5eb4
Split _GetInstance to _GetInstanceWithOptions and _GetInstanceWithout…
znz Jan 17, 2025
c4e2f11
Add steep:ignore
znz Jan 20, 2025
7527991
Reduce untyped
znz Jan 20, 2025
d517fed
Reduce untyped
znz Jan 20, 2025
c99749f
Reduce untyped around database properties
znz Jan 20, 2025
6fa6d10
Reduce untyped
znz Jan 20, 2025
1466bbd
Reduce untyped
znz Jan 20, 2025
280d0b0
Remove unused instance variables
znz Jan 20, 2025
025a71a
Reduce untyped
znz Jan 20, 2025
f4a55dd
Reduce untyped
znz Jan 20, 2025
b38121f
Reduce errors around RDCompiler::option
znz Jan 20, 2025
a5874de
Reduce untyped
znz Jan 20, 2025
edb3071
Reduce untyped
znz Jan 20, 2025
7dacba8
Reduce untyped
znz Jan 20, 2025
cfbeee1
Add type Subcommand::options
znz Jan 20, 2025
8416a92
Reduce untyped
znz Jan 20, 2025
889a824
Reduce untyped
znz Jan 20, 2025
68e907b
Reduce untyped
znz Jan 20, 2025
0e8ea38
Redue untyped
znz Jan 20, 2025
554361e
Reduce untyped
znz Jan 20, 2025
3baf655
Fix type of entry in lineinput
znz Jan 20, 2025
fb6f5cc
Fix type of handler of interface
znz Jan 20, 2025
b002105
Add type BitClust::Generators::EPUB::options
znz Jan 20, 2025
447a6b5
Reduce untyped
znz Jan 20, 2025
c6513c3
Add interface Entry::_TypeId
znz Jan 20, 2025
3561fef
bundle update
znz Jan 29, 2025
00bdea2
Fix type of class to instance
znz Jan 29, 2025
e6ec6a6
bundle update
znz Mar 17, 2025
e60f88c
`bundle up --bundler`
znz Feb 25, 2026
73d5461
`bundle update --all`
znz Feb 25, 2026
3251f82
`bundle lock --add-checksums`
znz Feb 25, 2026
c7117b0
`rake rbs:install`
znz Feb 25, 2026
b349458
`rbs collection update`
znz Feb 25, 2026
9b7d0f3
`bundle exec rake sig`
znz Feb 25, 2026
a2ad042
Revert again
znz Feb 26, 2026
dc53b53
Ignore Ruby::ArgumentTypeMismatch
znz Feb 26, 2026
e8df941
Remove unnecessary bot
znz Feb 26, 2026
c2e21a7
Fix return type same as String#casecmp
znz Feb 26, 2026
10cbc01
Add else clause
znz Feb 26, 2026
a3ef57e
Use union in NameUtils
znz Feb 26, 2026
7447627
Fix return types
znz Feb 26, 2026
82bbc89
Entry makes generic
znz Feb 26, 2026
1978634
Restrict writer type
znz Feb 26, 2026
d6ec2fc
Use def instead of attr_reader to narrow reader type
znz Feb 26, 2026
7540cab
Use def instead of attr_reader to narrow reader type
znz Feb 26, 2026
41fed72
Remove warnings
znz Feb 26, 2026
6a3e628
Fix deprecated warning
znz Feb 26, 2026
175346f
Add RequestHandler::any_conf
znz Feb 26, 2026
c57e647
Use accessor instead of instance variable directly
znz Feb 26, 2026
c66cba2
Fix Ruby::ArgumentTypeMismatch
znz Feb 26, 2026
b2bce77
`bundle update --all`
znz Mar 9, 2026
3bb9d3c
Downgrade steep < 1.10.0
znz Mar 9, 2026
2d178fa
`rake rbs:update`
znz Mar 9, 2026
744f28c
Remove hand-written and prototype
znz Mar 9, 2026
f970945
Support ERB.new with keyword arguments
znz Mar 9, 2026
7dac5d3
Remove the duplicate entry (webrick)
znz Mar 9, 2026
fb2c10f
Remove unused buggy methods
znz Mar 9, 2026
aa2af05
Fix buggy methods
znz Mar 9, 2026
b312669
Allow String
znz Mar 9, 2026
f1ef92a
Fix replacement of URI.unescape
znz Mar 9, 2026
90dadb8
Change from String | WEBrick::HTTPUtils::FormData to String only
znz Mar 9, 2026
6bd62dd
Add :capi missing key
znz Mar 9, 2026
8d1375d
Use keyword arguments to fix type problems
znz Mar 9, 2026
01375ab
Add json to runtime dependency explicitly
znz Mar 11, 2026
197eb06
Use remote object type instead of DRbObject
znz Mar 11, 2026
9893c32
Fix ignoring db of `bitclust -d db search pattern`
znz Mar 11, 2026
772881b
Support capi
znz Mar 11, 2026
0b757e6
Fix missing first argument `self`
znz Mar 11, 2026
5b6fa79
Remove `|| raise` after `class.name`
znz Mar 12, 2026
bd1667d
Avoid malformed output `self[] =` when `@params` is unexpectedly nil
znz Mar 12, 2026
3d0a1f1
Remove unnecessary fallback
znz Mar 12, 2026
ca53fda
Use pure instead of local variable
znz Mar 12, 2026
5a85280
Use local variable instead of raise
znz Mar 12, 2026
5f02044
Remove Ruby magic comment from RBS files
znz Mar 12, 2026
7249cba
Fix typos
znz Mar 12, 2026
6f8fd7e
Fix missing `()`
znz Mar 12, 2026
baef912
Raise user-friendly error
znz Mar 12, 2026
7dc217e
Use type annotations instead of workaround
znz Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand All @@ -34,7 +34,14 @@
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},
"customizations": {
"vscode": {
"extensions": [
"soutaro.rbs-syntax",
"soutaro.steep-vscode"
]
}
}

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Gemfile.lock
/pkg/
/.bundle
/.gem_rbs_collection/
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ruby:3.3.3-bookworm
FROM ruby:3.3.5-bookworm
RUN apt-get update -y && apt-get install -y less
RUN useradd rurema --create-home --shell /bin/bash
USER rurema:rurema
ENV BUNDLE_AUTO_INSTALL true
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
source "https://rubygems.org"

gem "rake"
gem "steep", "~> 1.9.0", require: false

gem "uri"
gem "pathname"

# Specify your gem's dependencies in bitclust.gemspec
gemspec :name => "bitclust-core"
Expand Down
199 changes: 199 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
PATH
remote: .
specs:
bitclust-core (1.4.0)
drb
json
nkf
progressbar (>= 1.9.0, < 2.0)
rack
webrick
bitclust-dev (1.4.0)
bitclust-core (= 1.4.0)
refe2 (1.4.0)
bitclust-core (= 1.4.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (8.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (4.0.1)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
csv (3.3.5)
drb (2.2.3)
ffi (1.17.3)
ffi (1.17.3-aarch64-linux-gnu)
ffi (1.17.3-aarch64-linux-musl)
ffi (1.17.3-arm-linux-gnu)
ffi (1.17.3-arm-linux-musl)
ffi (1.17.3-arm64-darwin)
ffi (1.17.3-x86-linux-gnu)
ffi (1.17.3-x86-linux-musl)
ffi (1.17.3-x86_64-darwin)
ffi (1.17.3-x86_64-linux-gnu)
ffi (1.17.3-x86_64-linux-musl)
fileutils (1.8.0)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.19.1)
language_server-protocol (3.17.0.5)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
nkf (0.2.0)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
pathname (0.4.0)
power_assert (3.0.1)
prism (1.9.0)
progressbar (1.13.0)
racc (1.8.1)
rack (3.2.5)
rainbow (3.1.1)
rake (13.3.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.10.3)
logger
tsort
rr (3.1.2)
securerandom (0.4.1)
steep (1.9.4)
activesupport (>= 5.1)
concurrent-ruby (>= 1.1.10)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
language_server-protocol (>= 3.15, < 4.0)
listen (~> 3.0)
logger (>= 1.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (~> 3.8)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 4)
uri (>= 0.12.0)
strscan (3.1.7)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
test-unit (3.7.7)
power_assert
test-unit-notify (1.0.4)
test-unit (>= 2.4.9)
test-unit-rr (1.0.5)
rr (>= 1.1.1)
test-unit (>= 2.5.2)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (1.1.1)
webrick (1.9.2)

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
ruby
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bitclust-core!
bitclust-dev!
pathname
rake
refe2!
steep (~> 1.9.0)
test-unit (>= 2.3.0)
test-unit-notify
test-unit-rr
uri

CHECKSUMS
activesupport (8.1.2) sha256=88842578ccd0d40f658289b0e8c842acfe9af751afee2e0744a7873f50b6fdae
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
bitclust-core (1.4.0)
bitclust-dev (1.4.0)
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
ffi (1.17.3) sha256=0e9f39f7bb3934f77ad6feab49662be77e87eedcdeb2a3f5c0234c2938563d4c
ffi (1.17.3-aarch64-linux-gnu) sha256=28ad573df26560f0aedd8a90c3371279a0b2bd0b4e834b16a2baa10bd7a97068
ffi (1.17.3-aarch64-linux-musl) sha256=020b33b76775b1abacc3b7d86b287cef3251f66d747092deec592c7f5df764b2
ffi (1.17.3-arm-linux-gnu) sha256=5bd4cea83b68b5ec0037f99c57d5ce2dd5aa438f35decc5ef68a7d085c785668
ffi (1.17.3-arm-linux-musl) sha256=0d7626bb96265f9af78afa33e267d71cfef9d9a8eb8f5525344f8da6c7d76053
ffi (1.17.3-arm64-darwin) sha256=0c690555d4cee17a7f07c04d59df39b2fba74ec440b19da1f685c6579bb0717f
ffi (1.17.3-x86-linux-gnu) sha256=868a88fcaf5186c3a46b7c7c2b2c34550e1e61a405670ab23f5b6c9971529089
ffi (1.17.3-x86-linux-musl) sha256=f0286aa6ef40605cf586e61406c446de34397b85dbb08cc99fdaddaef8343945
ffi (1.17.3-x86_64-darwin) sha256=1f211811eb5cfaa25998322cdd92ab104bfbd26d1c4c08471599c511f2c00bb5
ffi (1.17.3-x86_64-linux-gnu) sha256=3746b01f677aae7b16dc1acb7cb3cc17b3e35bdae7676a3f568153fb0e2c887f
ffi (1.17.3-x86_64-linux-musl) sha256=086b221c3a68320b7564066f46fed23449a44f7a1935f1fe5a245bd89d9aea56
fileutils (1.8.0) sha256=8c6b1df54e2540bdb2f39258f08af78853aa70bad52b4d394bbc6424593c6e02
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
json (2.19.1) sha256=dd94fdc59e48bff85913829a32350b3148156bc4fd2a95a2568a78b11344082d
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
minitest (6.0.2) sha256=db6e57956f6ecc6134683b4c87467d6dd792323c7f0eea7b93f66bd284adbc3d
nkf (0.2.0) sha256=fbc151bda025451f627fafdfcb3f4f13d0b22ae11f58c6d3a2939c76c5f5f126
parser (3.3.10.2) sha256=6f60c84aa4bdcedb6d1a2434b738fe8a8136807b6adc8f7f53b97da9bc4e9357
pathname (0.4.0) sha256=d8bef9d54dd35667f057708ee4f8ed91818e493091f86788fd5ef21a7cbeee89
power_assert (3.0.1) sha256=8ce9876716cc74e863fcd4cdcdc52d792bd983598d1af3447083a3a9a4d34103
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
progressbar (1.13.0) sha256=18c921d1c527dbe7eba3c5a07a1e3bcdd5e42fc18276f5711187a7489448be78
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
rack (3.2.5) sha256=4cbd0974c0b79f7a139b4812004a62e4c60b145cba76422e288ee670601ed6d3
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
rbs (3.10.3) sha256=70627f3919016134d554e6c99195552ae3ef6020fe034c8e983facc9c192daa6
refe2 (1.4.0)
rr (3.1.2) sha256=cc4a5cc91f012327d317dc661154419f9d36d8f9c05031ac46accd89ceb0ff1b
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
steep (1.9.4) sha256=09a941469b55d31cdc70a3812b5c1d4102d361f628f5fe5497b6a9aabc3cee05
strscan (3.1.7) sha256=5f76462b94a3ea50b44973225b7d75b2cb96d4e1bee9ef1319b99ca117b72c8c
terminal-table (3.0.2) sha256=f951b6af5f3e00203fb290a669e0a85c5dd5b051b3b023392ccfd67ba5abae91
test-unit (3.7.7) sha256=3c89d5ff0690a16bef9946156c4624390402b9d54dfcf4ce9cbd5b06bead1e45
test-unit-notify (1.0.4) sha256=db33d37c32c40f209b8c379b1fee2fb0696a1179ef2b7ce80e358f2f5013fbb7
test-unit-rr (1.0.5) sha256=346af09fe4c4d793a9107b978d9a62e3274972e5c17b8d4c0a8f348c77e78250
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131

BUNDLED WITH
4.0.7
23 changes: 23 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ task :test do
sh 'ruby test/run_test.rb'
end

desc "Re-generate sig/prototype"
task :sig do
out_dir = 'sig-prototype'
FileUtils.rm_rf out_dir
sh "rbs prototype rb --out-dir=#{out_dir} lib"
FileUtils.rm "#{out_dir}/bitclust/compat.rbs"
sh "rbs subtract --write #{out_dir} sig"
FileUtils.rmdir ["#{out_dir}/bitclust/generators", "#{out_dir}/bitclust/subcommands", "#{out_dir}/bitclust", "#{out_dir}"]
sh 'rbs validate'
end

namespace :rbs do
desc 'rbs collection install'
task :install do
sh 'rbs collection install'
end

desc 'rbs collection update'
task :update do
sh 'rbs collection update'
end
end

Bundler::GemHelper.install_tasks(:name => "bitclust-core")
Bundler::GemHelper.install_tasks(:name => "bitclust-dev")
Bundler::GemHelper.install_tasks(:name => "refe2")
5 changes: 5 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
target :lib do
signature "sig"

check "lib"
end
1 change: 1 addition & 0 deletions bitclust-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ EOD
s.add_runtime_dependency "webrick"
s.add_runtime_dependency "drb"
s.add_runtime_dependency "nkf"
s.add_runtime_dependency "json"
end
24 changes: 15 additions & 9 deletions lib/bitclust/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module BitClust

# Main class of BitClust server application.
# Actual actions are implemneted by RequestHandler.
# Actual actions are implemented by RequestHandler.
#
# Supports Rack and WEBrick.
class App
Expand All @@ -26,10 +26,11 @@ def initialize(options)
@interfaces = {}
case dbpath
when String
# @type var viewpath: String
dbpath = File.expand_path(dbpath)
db = BitClust::MethodDatabase.new(dbpath)
if capi
db = [db, BitClust::FunctionDatabase.new(dbpath)]
db = [db, BitClust::FunctionDatabase.new(dbpath)] #: [MethodDatabase, FunctionDatabase]
end
manager = BitClust::ScreenManager.new(
:base_url => baseurl,
Expand All @@ -42,12 +43,13 @@ def initialize(options)
handler = request_handler_class.new(db, manager)
@interfaces[viewpath] = BitClust::Interface.new { handler }
when Array
# @type var viewpath: String?
dbpaths = dbpath
@versions = []
dbpaths.each do |dbpath|
next unless /db-([\d_\.]+)/ =~ dbpath
dbpath = File.expand_path(dbpath)
version = $1.tr("_", ".")
version = ($1 || raise).tr("_", ".")
@versions << version
if viewpath
version_viewpath = File.join(version, viewpath)
Expand All @@ -56,7 +58,7 @@ def initialize(options)
end
db = BitClust::MethodDatabase.new(dbpath)
if capi
db = [db, BitClust::FunctionDatabase.new(dbpath)]
db = [db, BitClust::FunctionDatabase.new(dbpath)] #: [MethodDatabase, FunctionDatabase]
end
manager = BitClust::ScreenManager.new(
:base_url => baseurl,
Expand Down Expand Up @@ -88,13 +90,15 @@ def index(req)
req.path_info
end
if @versions.any?{|version| %r|\A/?#{version}/?\z| =~ request_path }
viewpath = File.join(request_path, @options[:viewpath])
viewpath = @options[:viewpath]
raise unless viewpath.is_a?(String)
viewpath = File.join(request_path || raise, viewpath)
@index = "<html><head><meta http-equiv='Refresh' content='0;URL=#{viewpath}'></head></html>"
else
links = "<ul>"
@interfaces.keys.sort.each do |v|
if @options[:viewpath]
version = v.sub(@options[:viewpath], '')
if (viewpath = @options[:viewpath]).is_a?(String)
version = v.sub(viewpath, '')
else
version = v
end
Expand All @@ -108,15 +112,17 @@ def index(req)
@index = "<html><head><title>bitclust</title></head><body>#{links}</body></html>"
end
end
else
raise '[BUG]'
end
end

def get_instance(server)
def get_instance(_server, *_)
self
end

def service(req, res)
unless %r|/#{File.basename(@options[:baseurl])}/?\z| =~ req.path
unless %r|/#{File.basename(@options[:baseurl] || raise)}/?\z| =~ req.path
raise WEBrick::HTTPStatus::NotFound
end
res.body = index(req)
Expand Down
Loading
Loading