From ba64f9bfebb46d859649557c4e69bf25efb150f5 Mon Sep 17 00:00:00 2001 From: tufusa Date: Tue, 28 Jul 2026 15:52:57 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20README=20=E3=82=92=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 387ab38..025204d 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,83 @@ -# MrubycTypes +# mrubyc_types -TODO: Delete this and the text below, and describe your gem +mrubyc_types は [mruby/c](https://github.com/mrubyc/mrubyc) の組み込みライブラリに向けた型定義のコレクションです。 -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mrubyc_types`. To experiment with that code, run `bin/console` for an interactive prompt. +### Requirements + +mrubyc_types は [Steep](https://github.com/soutaro/steep) から利用することを想定しています。 + +```bash +gem install steep +``` ## Installation -TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. +```bash +gem install mrubyc_types +``` + +## Usage -Install the gem and add to the application's Gemfile by executing: +適用したいディレクトリに `Steepfile` ファイルを作成し、以下の内容を記述してください。 - $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG +```rb +rbs_path = Gem.loaded_specs['rbs'].full_gem_path +types_path = Gem.loaded_specs['mrubyc_types'].full_gem_path +stdlib_path core_root: "#{types_path}/core", stdlib_root: "#{rbs_path}/stdlib" +target :app do + check "**/*.rb" +end +``` -If bundler is not being used to manage dependencies, install the gem by executing: +以下のコマンドで `Steepfile` があるディレクトリの `.rb` ファイルについて mrubyc_types による型チェックを実行できます。 - $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG +```bash +steep check +``` -## Usage +### Usage with Editor + +VSCode に Steep 拡張機能を入れることで、エディタ上で mrubyc_types の定義による型チェック・コード補完が使えるようになります。 -TODO: Write usage instructions here +1. 拡張機能ペインで "steep" と検索し、Steep 拡張機能 ( `soutaro.steep-vscode` ) をインストールしてください。 +2. 設定ウィンドウで "steep.command" と検索し、`Steep: Command` の値を `steep` に変更してください。 +3. 上記の `Steepfile` を作成したディレクトリを開いてください。 ## Development -After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +リポジトリをクローンして依存関係をインストールします。 + +```bash +git clone git@github.com:poporonnet/mrubyc_types.git +cd mrubyc_types +bundle install +``` + +デフォルトタスクを実行し正常に終了すればセットアップ完了です。 + +```bash +bundle exec rake +``` + +## Versioning + +mrubyc_types のバージョニングは mruby/c のバージョンと連動します。 -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). +- 基本的に major と minor は mruby/c のものに追従します。 +- patch は独立しており、型の改善などを意味します。 +- mruby/c の minor リリースで型に関する変更がされなかった場合、mrubyc_types のバージョンは単にそれを無視します。 +- 例: + 1. mruby/c: v4.0.0, mrubyc_types: v4.0.0 ( mruby/c に追従 ) + 2. mruby/c: v4.0.0, mrubyc_types: v4.0.1 ( 型を修正 ) + 3. mruby/c: v4.1.0, mrubyc_types: v4.1.0 ( mruby/c に追従 ) + 4. mruby/c: v4.1.1, mrubyc_types: v4.1.1 ( 型を修正 ) + 5. mruby/c: v4.2.0, mrubyc_types: v4.1.1 ( 型の変更がないため無視 ) +- mrubyc_types の major が 0 のバージョン ( v0.\*.\* ) は例外であり、いかなる mruby/c バージョンにも追従しません。 ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mrubyc_types. +mrubyc_types はフィードバック・質問・貢献を歓迎します! ## License -The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). +MIT License ( [LICENSE.txt](./LICENSE.txt) )