hachiwari 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,120 +1,108 @@
1
1
  # 八割 Hachiwari
2
2
 
3
- Hachiwari は、八割に由来します。
4
- ご自身の目指す勝率(=既定値八割)を達成するために必要な勝ち数を表示する gem です。
3
+ Hachiwari は、「目指す勝率 80%(=八割)」という合言葉から生まれた勝率サポートツールです。
4
+ 日々の対局成績を入力するだけで、目標勝率に届くまでにあと何勝必要なのかをすぐに教えてくれます。
5
5
 
6
- Hachiwari is derived from the word "80%".
7
- It is a gem that shows you the number of wins you need to achieve your target win rate (i.e. the default of 80%).
6
+ For translations, see [README.en.md](README.en.md) / [README.es.md](README.es.md) / [README.fr.md](README.fr.md) / [README.de.md](README.de.md).
8
7
 
9
- ## インストール方法 Installation
8
+ ## インストール方法
10
9
 
11
10
  以下のコマンドを実行して、インストールしてください。
12
- Install it yourself as:
13
11
 
14
12
  ```
15
13
  % gem install hachiwari
16
14
  ```
17
15
 
18
- ## 使い方 Usage
16
+ ## 使い方
19
17
 
20
- ## 目標勝率を達成するために必要な勝ち数を表示する (自動保存機能付)
18
+ ## 目標勝率を達成するために必要な勝ち数・敗数を表示する (自動保存機能付)
21
19
 
22
- ``` zsh
23
- % hachiwari status [wins] [losses] [target] [language]
20
+ ```zsh
21
+ % hachiwari [status] [wins] [losses] [target] [language]
24
22
  ```
25
23
 
26
- (``` status ``` コマンドの別名として、 ``` s ``` コマンドを用いることが出来ます。)
24
+ `status` は省略可能で、引数のみを渡しても同じ結果が得られます。
25
+ (``` s ``` コマンドは廃止予定です。利用すると警告が表示され、内部で `status` が実行されます。)
27
26
 
28
27
  四つの引数、勝ち数、負け数、目標勝率、表示言語があります。すべての引数は省略可能です。
29
28
 
30
29
  * 引数がないとき、既定値もしくは保存されたデータを元に、現在の対局成績を表示します。
31
30
  既定値は、勝ち数:0、負け数:0、勝率:八割、表示言語:日本語です。
31
+ 目標勝率を既に上回っている場合は、勝率が閾値を下回るまでに許容される敗北数も表示されます。
32
32
  * 一つ目の引数として勝ち数が与えられると、それに基づく必要勝ち数を表示します。
33
33
  残りの引数は、既定値もしくは保存されたデータを用います。
34
- 与えられた勝ち数のデータは、ホームディレクトリの直下のファイル「.hachiwari」に自動的に保存・更新されます。
35
34
  * 負け数を与えたい場合・更新したい場合には、二番目の引数として、status コマンドを実行してください。
36
- * 目標勝率を変更したい場合には、三番目の引数として下さい。九割の勝率を目指す場合には、90 と指定します。
37
- * 表示言語を変更したい場合には、四番目の引数として与えてください。既定値は日本語 ja です。英語に変更したい場合には、en を指定してください。
35
+ * 表示言語を変更したい場合には、四番目の引数として与えてください。既定値は日本語 `ja` です。英語への切り替えは `en`、スペイン語は `es`、フランス語は `fr`、ドイツ語は `de` を指定してください。
38
36
  * 与えられた引数は、自動で保存される為、勝ち数のみが増えた場合、残りの引数の入力は不要です。
39
37
 
40
- ## 目標勝率を達成するために必要な勝ち数を表示する (情報表示のみ)
41
-
42
- ``` zsh
43
- % hachiwari info [wins] [losses] [target] [language]
44
- ```
45
-
46
- (``` info ``` コマンドの別名として、 ``` i ``` コマンドを用いることが出来ます。)
47
-
48
- 使い方は、``` status / s ``` コマンドと同じです。
49
- 自動保存を行わず、情報表示のみである点が異なります。
50
- 例えばこの場合はどうなるのだろうかと、試算する用途などに便利です。
51
-
52
38
  ## Hachiwari のバージョンを表示する
53
39
 
54
- ``` zsh
40
+ ```zsh
55
41
  % hachiwari version
56
42
  ```
57
43
 
58
44
  Hachiwari のバージョンを表示します。
59
45
 
60
- ## Display the number of wins needed to achieve the target win rate. (with automatic saving)
46
+ ## 保存済みの対局成績を削除する
61
47
 
62
- ``` zsh
63
- % hachiwari status [wins] [losses] [target] [language]
48
+ ```zsh
49
+ % hachiwari clear
64
50
  ```
65
51
 
66
- (The ``` s ``` command can also be used as an alias for ``` status ```).
52
+ 保存されている `.hachiwari` ファイルを削除します。データが存在しない場合は警告のみが表示されます。
67
53
 
68
- There are four arguments: number of wins, number of losses, target win percentage, and display language. All arguments are optional.
54
+ ## コマンド一覧や詳細を表示する
69
55
 
70
- * If there is no argument, the current game results are displayed based on default values or saved data.
71
- The default values are: wins: 0, losses: 0, win percentage: 80%, display language: Japanese.
72
- * If the number of wins is given as the first argument, the required number of wins based on it will be displayed.
73
- The rest of the arguments are default values or saved data.
74
- The data of the number of wins given will be automatically saved and updated in the file ".hachiwari" directly under the home directory.
75
- * If you want to give/update the number of losses, please execute the status command as the second argument.
76
- * If you want to change the target winning percentage, make it the third argument. If you want to aim for a 90% win rate, specify 90.
77
- * If you want to change the display language, give it as the fourth argument. The default language is Japanese ``` ja ```. If you want to change it to English, specify ``` en ```.
78
- * The arguments given are automatically saved, so if only the number of wins is increased, the remaining arguments need not be entered.
79
56
 
80
- ## Display the number of wins needed to achieve the target win rate. (information only)
57
+ ```zsh
58
+ % hachiwari --help
59
+ % hachiwari status --help
60
+ ```
81
61
 
82
- Usage is the same as the ```status / s ``` command.
83
- The difference is that it does not save automatically, but only displays information.
84
- It is useful, for example, for estimating what would happen in this case.
62
+ `hachiwari --help` で利用可能なコマンドの一覧、あるいは特定コマンドの詳細ヘルプを表示します。
85
63
 
86
- ## Display the version of Hachiwari
64
+ ## 非推奨コマンドについて
87
65
 
88
- ``` zsh
89
- % hachiwari version
90
- ```
66
+ 以下のコマンド/エイリアスは非推奨です。実行すると警告が表示され、後方互換の動作にフォールバックします。
91
67
 
92
- Displays the version of Hachiwari.
68
+ - `s`
69
+ - `status` のエイリアスでしたが、非推奨です。
70
+ - 実行すると警告を表示し、内部的に `status` を実行します(`hachiwari [status] ...` の利用を推奨)。
71
+ - `info` / `i`
72
+ - 保存せずに試算のみを行うためのコマンドでしたが、非推奨です。
73
+ - 実行すると警告を表示し、`status --trial` と同等の動作になります。
74
+ - `calculate`
75
+ - オプション指定で計算のみを行うためのコマンドでしたが、非推奨です。
76
+ - 実行すると警告を表示し、`status --trial` と同等の動作になります(`--target`/`--language` は引き続き利用可能)。
93
77
 
94
- ## 開発 Development
95
78
 
96
- repo をチェックアウトしたら、`bin/setup`を実行して、依存関係をインストールします。その後、`rake test` を実行してテストを実行します。また、`bin/console`を実行すると、インタラクティブなプロンプトが表示され、実験を行うことができます。
79
+ ## 開発
97
80
 
98
- このgemをローカルマシンにインストールするには、`bundle exec rake install`を実行します。新しいバージョンをリリースするには、`version.rb` のバージョン番号を更新してから、`bundle exec rake release` を実行すると、そのバージョンの git タグが作成され、git commits と作成されたタグがプッシュされ、`.gem` ファイルが [rubygems.org](https://rubygems.org) にプッシュされます。
81
+ リポジトリをクローンしたら、以下のコマンドで開発環境を整えてください。
99
82
 
100
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
101
-
102
- 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).
83
+ ```zsh
84
+ bundle install
85
+ bundle exec rake test
86
+ ```
103
87
 
104
- ## 貢献 Contributing
88
+ - **依存関係のインストール**: `bundle install`
89
+ - **テストの実行**: `bundle exec rake test`
90
+ - **CLI の手動確認**: `bundle exec ruby -Ilib bin/hachiwari --help`
105
91
 
106
- バグレポートやプルリクエストは、GitHub(https://github.com/Atelier-Mirai/hachiwari)で受け付けています。このプロジェクトは、共同作業のための安全で歓迎される空間であることを意図しており、貢献者は[行動規範](https://github.com/Atelier-Mirai/hachiwari/blob/master/CODE_OF_CONDUCT.md)を遵守することが期待されています。
92
+ この gem をローカルにインストールするには、`bundle exec rake install` を実行します。
107
93
 
108
- Bug reports and pull requests are welcome on GitHub at https://github.com/Atelier-Mirai/hachiwari. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Atelier-Mirai/hachiwari/blob/master/CODE_OF_CONDUCT.md).
94
+ 新しいバージョンをリリースする手順:
109
95
 
110
- ## ライセンス License
96
+ 1. `lib/hachiwari/version.rb` の `VERSION` を更新する
97
+ 2. 変更をコミットしてリモートへプッシュする
98
+ 3. `bundle exec rake release` を実行する
111
99
 
112
- このgemは、[MIT License](https://opensource.org/licenses/MIT)の条件でオープンソースとして提供されています。
100
+ `rake release` は、更新したバージョンで git タグを作成し、コミットとタグを push し、生成された `.gem` を [rubygems.org](https://rubygems.org) に公開します(RubyGems への公開には MFA 設定が必要です)。
113
101
 
114
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
102
+ ## 貢献
115
103
 
116
- ## 行動規範 Code of Conduct
104
+ バグレポートやプルリクエストは、[GitHub](https://github.com/Atelier-Mirai/hachiwari)で受け付けています。
117
105
 
118
- Hachiwariプロジェクトのコードベース、イシュートラッカー、チャットルーム、メーリングリストで交流するすべての人は、[行動規範](https://github.com/Atelier-Mirai/hachiwari/blob/master/CODE_OF_CONDUCT.md)に従うことが求められます。
106
+ ## ライセンス
119
107
 
120
- Everyone interacting in the Hachiwari project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/hachiwari/blob/master/CODE_OF_CONDUCT.md).
108
+ このgemは、[MIT License](https://opensource.org/licenses/MIT)の条件でオープンソースとして提供されています。詳しくは [LICENSE](./LICENSE) を参照してください。
@@ -0,0 +1,37 @@
1
+ # Release Notes — `hachiwari` 1.0.0 (2025-09-27)
2
+
3
+ ## Highlights
4
+ - `hachiwari clear` コマンドで保存済みの対局成績を手軽に削除できます。
5
+ - `status --trial` によって保存を伴わない試算が簡単に行えます。`info` / `i` / `calculate` / `s` は非推奨となり、内部で `status` 系へ統一されました。
6
+ - ローカライズ可能なヘルプを導入し、日本語・英語に加えてスペイン語・フランス語・ドイツ語へ自動切り替えできます。
7
+
8
+ ## Added
9
+ - `hachiwari clear` コマンドを追加して保存済みデータの削除を自動化。
10
+ - `hachiwari status --trial` オプションで、保存せずに勝率計算を実行。
11
+ - コマンド名を省略した場合でも `status` を自動起動。
12
+ - 目標勝率を下回るまでの許容敗北数を提示し、現在の余裕度を可視化。
13
+ - `config/locales/*.yml` を参照してヘルプ文言をローカライズし、`ja` / `en` / `es` / `fr` / `de` をサポート。
14
+
15
+ ## Changed
16
+ - 対応 Ruby を `>= 3.3.0` へ更新し、最新環境での安定動作を保証。
17
+ - `bundle update` により開発用依存関係を刷新。
18
+ - CLI を `StatusRunner` / `StatusCalculator` / `StatusPresenter` / `Storage` の各コンポーネントへ分離し責務を整理。
19
+ - 実行ファイルを `bin/` 配下へ集約し、不要スクリプト (`bin/setup`, `bin/console`) を削除。
20
+ - `info` / `i` / `calculate` / `s` コマンドを非推奨化し、利用時に警告を表示して `status` 系処理へ誘導。
21
+
22
+ ## Fixed
23
+ - アンインストールフックを追加し、gem 削除時に保存ファイルを自動クリア。
24
+
25
+ ## Documentation
26
+ - `README.md`(日本語)を更新し、`README.en.md`(英語版)を追加。
27
+ - `LICENSE` に日本語訳を補足。
28
+ - `test/hachiwari_test.rb` にコメントと追加テストを導入し、挙動と境界ケースを文書化。
29
+ - `lib/` 配下の主要クラスへ説明コメントを拡充し、アーキテクチャを明文化。
30
+
31
+ ## Upgrade Notes
32
+ - Ruby 3.3 以降が必須です。環境の Ruby を更新してからアップグレードしてください。
33
+ - 非推奨コマンド (`info`, `i`, `calculate`, `s`) は今後削除予定です。`status` / `status --trial` への移行を推奨します。
34
+ - ヘルプ文言は `config/locales/` 配下の YAML を編集することでカスタマイズ可能です。
35
+
36
+ ## Test Summary
37
+ - `bundle exec rake`(テストスイートと RuboCop を実行)
data/Rakefile CHANGED
@@ -3,6 +3,7 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
5
 
6
+ # `bundle exec rake test` でテストスイートを走らせるタスクを定義
6
7
  Rake::TestTask.new(:test) do |t|
7
8
  t.libs << "test"
8
9
  t.libs << "lib"
@@ -11,6 +12,8 @@ end
11
12
 
12
13
  require "rubocop/rake_task"
13
14
 
15
+ # `bundle exec rake rubocop` で静的解析を実行できるようにする
14
16
  RuboCop::RakeTask.new
15
17
 
18
+ # デフォルトタスクでテストと RuboCop をまとめて実行
16
19
  task default: %i[test rubocop]
data/bin/hachiwari ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ lib = File.expand_path("../lib", __dir__)
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+
7
+ require "hachiwari"
8
+
9
+ Hachiwari::CLI.start
@@ -0,0 +1,70 @@
1
+ de:
2
+ status:
3
+ summary: "%<total>d Spiele %<wins>d Siege %<losses>d Niederlagen Siegquote %<percentage>.4f %%"
4
+ needed: "Noch %<needed>d Siege bis zum Ziel von %<target>d %%"
5
+ cushion: "Nach %<losses_to_fall>d weiteren Niederlagen fällt die Quote unter %<target>d %%"
6
+ help:
7
+ general_intro: "Verfügbare Befehle:"
8
+ command_heading: "Befehl: %<usage>s"
9
+ description_heading: "Beschreibung: %<description>s"
10
+ unknown_command: "Der Befehl \"%<command>s\" ist nicht vorhanden."
11
+ general_footer:
12
+ - "Mit `hachiwari <befehl> --help` erhältst du weitere Details."
13
+ commands:
14
+ status:
15
+ usage: "hachiwari [status] [siege] [niederlagen] [ziel] [sprache]"
16
+ description: "Zeigt die Siegquote und die benötigten Siege zum Erreichen des Ziels an."
17
+ details:
18
+ - "'status' kann weggelassen werden; übergib nur die Argumente."
19
+ - "Option: --trial / -t für eine Simulation ohne zu speichern."
20
+ s:
21
+ usage: "hachiwari s [siege] [niederlagen] [ziel] [sprache]"
22
+ description: "Veralteter Alias. Wird nach einer Warnung wie 'status' behandelt."
23
+ version:
24
+ usage: "hachiwari version"
25
+ description: "Zeigt die installierte Version von Hachiwari an."
26
+ clear:
27
+ usage: "hachiwari clear"
28
+ description: "Entfernt die gespeicherten Matchdaten."
29
+ info:
30
+ usage: "hachiwari info [siege] [niederlagen] [ziel] [sprache]"
31
+ description: "Veralteter Befehl. Bitte `status --trial` verwenden."
32
+ details:
33
+ - "Zeigt eine Warnung und verhält sich wie --trial."
34
+ i:
35
+ usage: "hachiwari i [siege] [niederlagen] [ziel] [sprache]"
36
+ description: "Veralteter Alias von info."
37
+ calculate:
38
+ usage: "hachiwari calculate [siege] [niederlagen] --target=<wert> --language=<ja|en|es|fr|de>"
39
+ description: "Veralteter Befehl. Bitte `status --trial` verwenden."
40
+ help:
41
+ usage: "hachiwari help [befehl]"
42
+ description: "Zeigt die Liste der Befehle oder Details zu einem Befehl."
43
+ deprecations:
44
+ trial: "Dieser Befehl ist veraltet. Verwende `hachiwari status --trial`."
45
+ alias: "Dieser Alias ist veraltet. Verwende `hachiwari status --trial`."
46
+ thor:
47
+ status:
48
+ short: "Zeigt den aktuellen Stand und benötigte Siege"
49
+ long: "Zeigt die Siegquote und die Anzahl benötigter Siege, um das Ziel zu erreichen."
50
+ details:
51
+ - "'status' kann weggelassen werden; übergib nur die Argumente."
52
+ - "Option: --trial / -t für eine Simulation ohne Speicherung."
53
+ option_trial: "Simulation ohne Speicherung der Ergebnisse."
54
+ info:
55
+ short: "Veraltet. Verhält sich wie status --trial"
56
+ long: "Veralteter Befehl. Bitte status --trial verwenden."
57
+ option_trial: "Verwendet den Simulationsmodus von status."
58
+ alias_i:
59
+ short: "Veralteter Alias von info"
60
+ long: "Veralteter Alias. Bitte status --trial verwenden."
61
+ calculate:
62
+ short: "Veraltet. Verhält sich wie status --trial"
63
+ long: "Veralteter Befehl. Bitte status --trial verwenden."
64
+ option_trial: "Verwendet den Simulationsmodus von status."
65
+ option_target: "Ziel-Prozentsatz"
66
+ option_language: "Ausgabe-Sprache (ja, en, es, fr, de)"
67
+ version:
68
+ short: "Zeigt die installierte Version von Hachiwari an."
69
+ clear:
70
+ short: "Löscht die gespeicherten Ergebnisse."
@@ -0,0 +1,70 @@
1
+ en:
2
+ status:
3
+ summary: "%<total>d games %<wins>d wins %<losses>d losses a winning percentage of %<percentage>.4f %%."
4
+ needed: "You need %<needed>d more wins to reach %<target>d %%."
5
+ cushion: "%<losses_to_fall>d more losses would drop you below %<target>d %%"
6
+ help:
7
+ general_intro: "Available commands:"
8
+ command_heading: "Command: %<usage>s"
9
+ description_heading: "Description: %<description>s"
10
+ unknown_command: "Command \"%<command>s\" was not found."
11
+ general_footer:
12
+ - "Run `hachiwari <command> --help` for more details."
13
+ commands:
14
+ status:
15
+ usage: "hachiwari [status] [wins] [losses] [target] [language]"
16
+ description: "Displays winning percentage and number of wins to achieve the goal. (use --trial to skip saving)"
17
+ details:
18
+ - "You can omit 'status' and just pass the arguments."
19
+ - "Option: --trial / -t to simulate without saving."
20
+ s:
21
+ usage: "hachiwari s [wins] [losses] [target] [language]"
22
+ description: "Deprecated alias. You can omit 'status' and pass arguments directly."
23
+ version:
24
+ usage: "hachiwari version"
25
+ description: "Display the installed version of Hachiwari."
26
+ clear:
27
+ usage: "hachiwari clear"
28
+ description: "Remove any saved match results."
29
+ info:
30
+ usage: "hachiwari info [wins] [losses] [target] [language]"
31
+ description: "Deprecated. Please use `status --trial` instead."
32
+ details:
33
+ - "Running this command prints a warning and behaves like `status --trial`."
34
+ i:
35
+ usage: "hachiwari i [wins] [losses] [target] [language]"
36
+ description: "Deprecated alias of info."
37
+ calculate:
38
+ usage: "hachiwari calculate [wins] [losses] --target=<value> --language=<ja|en|es|fr|de>"
39
+ description: "Deprecated. Please use `status --trial` instead."
40
+ help:
41
+ usage: "hachiwari help [command]"
42
+ description: "Show the list of commands or details for one command."
43
+ deprecations:
44
+ trial: "This command is deprecated. Use `hachiwari status --trial` instead."
45
+ alias: "This alias is deprecated. Use `hachiwari status --trial` instead."
46
+ thor:
47
+ status:
48
+ short: "Display current record and wins needed to reach the target"
49
+ long: "Displays winning percentage and number of wins to achieve the goal."
50
+ details:
51
+ - "You can omit 'status' and just pass the arguments."
52
+ - "Option: --trial / -t to simulate without saving."
53
+ option_trial: "Run in trial mode without saving results."
54
+ info:
55
+ short: "Deprecated. Behaves like status --trial"
56
+ long: "Deprecated command. Please use status --trial instead."
57
+ option_trial: "Use trial mode for the status command."
58
+ alias_i:
59
+ short: "Deprecated alias of info"
60
+ long: "Deprecated alias. Please use status --trial instead."
61
+ calculate:
62
+ short: "Deprecated. Behaves like status --trial"
63
+ long: "Deprecated command. Please use status --trial instead."
64
+ option_trial: "Use trial mode for the status command."
65
+ option_target: "Target percentage"
66
+ option_language: "Display language (ja, en, es, fr, de)"
67
+ version:
68
+ short: "Display the installed version of Hachiwari."
69
+ clear:
70
+ short: "Remove any saved match results."
@@ -0,0 +1,70 @@
1
+ es:
2
+ status:
3
+ summary: "%<total>d partidas %<wins>d victorias %<losses>d derrotas porcentaje %<percentage>.4f %%"
4
+ needed: "Necesitas %<needed>d victorias más para alcanzar el %<target>d %%"
5
+ cushion: "Conceder %<losses_to_fall>d derrotas más bajará el porcentaje por debajo de %<target>d %%"
6
+ help:
7
+ general_intro: "Comandos disponibles:"
8
+ command_heading: "Comando: %<usage>s"
9
+ description_heading: "Descripción: %<description>s"
10
+ unknown_command: "El comando \"%<command>s\" no existe."
11
+ general_footer:
12
+ - "Usa `hachiwari <command> --help` para ver detalles de cada comando."
13
+ commands:
14
+ status:
15
+ usage: "hachiwari [status] [victorias] [derrotas] [objetivo] [idioma]"
16
+ description: "Muestra el porcentaje de victorias y las victorias necesarias para alcanzar la meta."
17
+ details:
18
+ - "Puedes omitir 'status' y pasar sólo los argumentos."
19
+ - "Opción: --trial / -t para simular sin guardar."
20
+ s:
21
+ usage: "hachiwari s [victorias] [derrotas] [objetivo] [idioma]"
22
+ description: "Alias en desuso. Se procesará como 'status' tras mostrar una advertencia."
23
+ version:
24
+ usage: "hachiwari version"
25
+ description: "Muestra la versión instalada de Hachiwari."
26
+ clear:
27
+ usage: "hachiwari clear"
28
+ description: "Elimina los datos guardados del registro de partidas."
29
+ info:
30
+ usage: "hachiwari info [victorias] [derrotas] [objetivo] [idioma]"
31
+ description: "Comando obsoleto. Usa `status --trial`."
32
+ details:
33
+ - "Al ejecutarlo, muestra una advertencia y funciona igual que --trial."
34
+ i:
35
+ usage: "hachiwari i [victorias] [derrotas] [objetivo] [idioma]"
36
+ description: "Alias obsoleto de info."
37
+ calculate:
38
+ usage: "hachiwari calculate [victorias] [derrotas] --target=<valor> --language=<ja|en>"
39
+ description: "Comando obsoleto. Usa `status --trial`."
40
+ help:
41
+ usage: "hachiwari help [comando]"
42
+ description: "Muestra la lista de comandos o los detalles de uno."
43
+ deprecations:
44
+ trial: "Este comando está obsoleto. Usa `hachiwari status --trial`."
45
+ alias: "Este alias está obsoleto. Usa `hachiwari status --trial`."
46
+ thor:
47
+ status:
48
+ short: "Muestra el resultado actual y las victorias necesarias"
49
+ long: "Muestra el porcentaje de victorias y cuántas victorias necesitas para alcanzar el objetivo."
50
+ details:
51
+ - "Puedes omitir 'status' y pasar sólo los argumentos."
52
+ - "Opción: --trial / -t para simular sin guardar."
53
+ option_trial: "Simula sin guardar el resultado."
54
+ info:
55
+ short: "Obsoleto. Se comporta como status --trial"
56
+ long: "Comando obsoleto. Usa status --trial."
57
+ option_trial: "Usa el modo de simulación de status."
58
+ alias_i:
59
+ short: "Alias obsoleto de info"
60
+ long: "Alias en desuso. Usa status --trial."
61
+ calculate:
62
+ short: "Obsoleto. Se comporta como status --trial"
63
+ long: "Comando obsoleto. Usa status --trial."
64
+ option_trial: "Usa el modo de simulación de status."
65
+ option_target: "Porcentaje objetivo"
66
+ option_language: "Idioma de salida (ja, en, es, fr, de)"
67
+ version:
68
+ short: "Muestra la versión instalada de Hachiwari."
69
+ clear:
70
+ short: "Elimina los resultados guardados."
@@ -0,0 +1,70 @@
1
+ fr:
2
+ status:
3
+ summary: "%<total>d parties %<wins>d victoires %<losses>d défaites pourcentage %<percentage>.4f %%"
4
+ needed: "Encore %<needed>d victoires pour atteindre %<target>d %%"
5
+ cushion: "Après %<losses_to_fall>d défaites supplémentaires, le pourcentage passera sous %<target>d %%"
6
+ help:
7
+ general_intro: "Commandes disponibles :"
8
+ command_heading: "Commande : %<usage>s"
9
+ description_heading: "Description : %<description>s"
10
+ unknown_command: "La commande \"%<command>s\" n'existe pas."
11
+ general_footer:
12
+ - "Utilisez `hachiwari <commande> --help` pour plus de détails."
13
+ commands:
14
+ status:
15
+ usage: "hachiwari [status] [victoires] [défaites] [objectif] [langue]"
16
+ description: "Affiche le pourcentage de victoires et le nombre de victoires nécessaires pour atteindre l'objectif."
17
+ details:
18
+ - "Vous pouvez omettre 'status' et passer uniquement les arguments."
19
+ - "Option : --trial / -t pour simuler sans enregistrer."
20
+ s:
21
+ usage: "hachiwari s [victoires] [défaites] [objectif] [langue]"
22
+ description: "Alias obsolète. Sera traité comme 'status' après un avertissement."
23
+ version:
24
+ usage: "hachiwari version"
25
+ description: "Affiche la version installée de Hachiwari."
26
+ clear:
27
+ usage: "hachiwari clear"
28
+ description: "Supprime les données sauvegardées des matchs."
29
+ info:
30
+ usage: "hachiwari info [victoires] [défaites] [objectif] [langue]"
31
+ description: "Commande obsolète. Utilisez `status --trial`."
32
+ details:
33
+ - "Affiche un avertissement et se comporte comme --trial."
34
+ i:
35
+ usage: "hachiwari i [victoires] [défaites] [objectif] [langue]"
36
+ description: "Alias obsolète de info."
37
+ calculate:
38
+ usage: "hachiwari calculate [victoires] [défaites] --target=<valeur> --language=<ja|en|es|fr|de>"
39
+ description: "Commande obsolète. Utilisez `status --trial`."
40
+ help:
41
+ usage: "hachiwari help [commande]"
42
+ description: "Affiche la liste des commandes ou les détails d'une commande."
43
+ deprecations:
44
+ trial: "Cette commande est obsolète. Utilisez `hachiwari status --trial`."
45
+ alias: "Cet alias est obsolète. Utilisez `hachiwari status --trial`."
46
+ thor:
47
+ status:
48
+ short: "Affiche le résultat actuel et les victoires nécessaires"
49
+ long: "Affiche le pourcentage de victoires et le nombre de victoires nécessaires pour atteindre l'objectif."
50
+ details:
51
+ - "Vous pouvez omettre 'status' et passer uniquement les arguments."
52
+ - "Option : --trial / -t pour simuler sans enregistrer."
53
+ option_trial: "Simuler sans enregistrer les résultats."
54
+ info:
55
+ short: "Obsolète. Se comporte comme status --trial"
56
+ long: "Commande obsolète. Utilisez status --trial."
57
+ option_trial: "Utilise le mode simulation de status."
58
+ alias_i:
59
+ short: "Alias obsolète de info"
60
+ long: "Alias obsolète. Utilisez status --trial."
61
+ calculate:
62
+ short: "Obsolète. Se comporte comme status --trial"
63
+ long: "Commande obsolète. Utilisez status --trial."
64
+ option_trial: "Utilise le mode simulation de status."
65
+ option_target: "Pourcentage cible"
66
+ option_language: "Langue d'affichage (ja, en, es, fr, de)"
67
+ version:
68
+ short: "Affiche la version installée de Hachiwari."
69
+ clear:
70
+ short: "Supprime les données sauvegardées."
@@ -0,0 +1,70 @@
1
+ ja:
2
+ status:
3
+ summary: "%<total>d 戦 %<wins>d 勝 %<losses>d 敗 勝率 %<percentage>.4f %% です"
4
+ needed: "あと %<needed>d 勝で 勝率 %<target>d %% です"
5
+ cushion: "あと %<losses_to_fall>d 敗すると 勝率 %<target>d %% を下回ります"
6
+ help:
7
+ general_intro: "利用可能なコマンド:"
8
+ command_heading: "コマンド: %<usage>s"
9
+ description_heading: "説明: %<description>s"
10
+ unknown_command: "コマンド \"%<command>s\" は存在しません。"
11
+ general_footer:
12
+ - "各コマンドの詳細は `hachiwari <command> --help` で確認できます。"
13
+ commands:
14
+ status:
15
+ usage: "hachiwari [status] [wins] [losses] [target] [language]"
16
+ description: "保存済みまたは指定した勝敗から、勝率と必要勝ち数を表示します。"
17
+ details:
18
+ - "status は省略可能です。引数のみでも実行できます。"
19
+ - "オプション: --trial / -t で保存せず試算します。"
20
+ s:
21
+ usage: "hachiwari s [wins] [losses] [target] [language]"
22
+ description: "廃止予定のエイリアスです。status を省略して引数のみでも実行できます。"
23
+ version:
24
+ usage: "hachiwari version"
25
+ description: "Hachiwari のバージョン番号を表示します。"
26
+ clear:
27
+ usage: "hachiwari clear"
28
+ description: "保存されている対局成績データを削除します。"
29
+ info:
30
+ usage: "hachiwari info [wins] [losses] [target] [language]"
31
+ description: "廃止予定のコマンドです。status --trial を使用してください。"
32
+ details:
33
+ - "実行すると警告を表示し、--trial 相当の結果を出力します。"
34
+ i:
35
+ usage: "hachiwari i [wins] [losses] [target] [language]"
36
+ description: "info コマンドの非推奨エイリアスです。"
37
+ calculate:
38
+ usage: "hachiwari calculate [wins] [losses] --target=<value> --language=<ja|en|es|fr|de>"
39
+ description: "廃止予定のコマンドです。status --trial を使用してください。"
40
+ help:
41
+ usage: "hachiwari help [command]"
42
+ description: "コマンド一覧や詳細を表示します。"
43
+ deprecations:
44
+ trial: "このコマンドは廃止されました。代わりに `hachiwari status --trial` を利用してください。"
45
+ alias: "このエイリアスは廃止予定です。`hachiwari status --trial` を利用してください。"
46
+ thor:
47
+ status:
48
+ short: "対局成績を表示し、必要勝ち数を計算します"
49
+ long: "保存済みまたは指定した勝敗から、勝率と必要勝ち数を表示します。"
50
+ details:
51
+ - "status は省略可能です。引数のみでも実行できます。"
52
+ - "オプション: --trial / -t で保存せず試算します。"
53
+ option_trial: "試算モードで保存せずに結果を表示します。"
54
+ info:
55
+ short: "廃止予定。status --trial と同等に動作します"
56
+ long: "廃止予定のコマンドです。status --trial を使用してください。"
57
+ option_trial: "status の試算モードを利用します。"
58
+ alias_i:
59
+ short: "info の非推奨エイリアスです"
60
+ long: "廃止予定のエイリアスです。status --trial を使用してください。"
61
+ calculate:
62
+ short: "廃止予定。status --trial と同等に動作します"
63
+ long: "廃止予定のコマンドです。status --trial を使用してください。"
64
+ option_trial: "status の試算モードを利用します。"
65
+ option_target: "目標勝率"
66
+ option_language: "表示言語 (ja, en, es, fr, de)"
67
+ version:
68
+ short: "Hachiwari のバージョン番号を表示します。"
69
+ clear:
70
+ short: "保存されている対局成績データを削除します。"
data/hachiwari.gemspec CHANGED
@@ -3,39 +3,34 @@
3
3
  require_relative "lib/hachiwari/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
+ # Gem の基本的なメタ情報を定義
6
7
  spec.name = "hachiwari"
7
8
  spec.version = Hachiwari::VERSION
8
9
  spec.authors = ["Atelier-Mirai"]
9
10
  spec.email = ["contact@atelier-mirai.net"]
10
11
 
11
- spec.summary = "Winning rate 80%"
12
- spec.description = "Calculate the number of wins needed to achieve an 80% win rate."
12
+ spec.summary = "Track progress toward your target win rate"
13
+ spec.description = "Enter your record and instantly see how many wins you need to reach 80% or a custom goal."
13
14
  spec.homepage = "https://github.com/Atelier-Mirai/hachiwari"
14
15
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
-
17
- # spec.metadata["allowed_push_host"] = "https://github.com/Atelier-Mirai/hachiwari"
16
+ spec.required_ruby_version = ">= 3.3.0"
18
17
 
19
18
  spec.metadata["homepage_uri"] = spec.homepage
20
19
  spec.metadata["source_code_uri"] = "https://github.com/Atelier-Mirai/hachiwari"
21
20
  spec.metadata["changelog_uri"] = "https://github.com/Atelier-Mirai/hachiwari/blob/master/CHANGELOG.md"
22
21
 
23
- # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ # 配布対象ファイルを Git の管理対象から自動検出
25
23
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
24
  `git ls-files -z`.split("\x0").reject do |f|
27
25
  (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
26
  end
29
27
  end
30
- spec.bindir = "exe"
31
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
33
-
34
- # Uncomment to register a new dependency of your gem
35
- # spec.add_dependency "example-gem", "~> 1.0"
36
-
37
- # For more information and examples about making a new gem, checkout our
38
- # guide at: https://bundler.io/guides/creating_gem.html
28
+ # 実行可能ファイルの配置先と読み込み対象ディレクトリを指定
29
+ spec.bindir = "bin"
30
+ spec.executables = Dir.children("bin")
31
+ spec.require_paths = %w[lib]
39
32
 
33
+ # ランタイムで利用する依存関係を宣言
34
+ spec.add_dependency "pstore"
40
35
  spec.add_dependency "thor"
41
36
  end