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.
- checksums.yaml +4 -4
- data/.rubocop.yml +36 -1
- data/CHANGELOG.md +39 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +41 -20
- data/LICENSE +34 -0
- data/README.de.md +103 -0
- data/README.en.md +103 -0
- data/README.es.md +103 -0
- data/README.fr.md +103 -0
- data/README.md +53 -65
- data/RELEASE_NOTES_v1.0.0.md +37 -0
- data/Rakefile +3 -0
- data/bin/hachiwari +9 -0
- data/config/locales/de.yml +70 -0
- data/config/locales/en.yml +70 -0
- data/config/locales/es.yml +70 -0
- data/config/locales/fr.yml +70 -0
- data/config/locales/ja.yml +70 -0
- data/hachiwari.gemspec +11 -16
- data/lib/hachiwari/cli.rb +250 -49
- data/lib/hachiwari/locales.rb +59 -0
- data/lib/hachiwari/results.rb +11 -0
- data/lib/hachiwari/status_calculator.rb +61 -0
- data/lib/hachiwari/status_presenter.rb +27 -0
- data/lib/hachiwari/status_runner.rb +82 -0
- data/lib/hachiwari/storage.rb +205 -0
- data/lib/hachiwari/version.rb +2 -1
- data/lib/hachiwari.rb +8 -1
- data/lib/rubygems_plugin.rb +47 -0
- metadata +41 -16
- data/CODE_OF_CONDUCT.md +0 -163
- data/LICENSE.txt +0 -21
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/exe/hachiwari +0 -5
- data/lib/results.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b64e8e052849e8217860d6d7f244c85f80af59abf5d924cffb3090e119bbdab
|
4
|
+
data.tar.gz: 91aa8f06a84c9bedf01a367e3a415b101b5c617ae61070d18b75c7eb3d66bead
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a63f4f880bc8a3e22291812800aadb27326a724a539bb5de369874b27cb430a7dd3a078c32561104844ac1edc5d0a0cf1a8e54077b5f54c9cb0c6cdfd0c8ce6
|
7
|
+
data.tar.gz: 6079b2b61b32a1e8225aad7f50ed7659f5abb0b16fd85757b3c69326d96be0f24ffcdcee8bae7afbe4d0cc0b42d08dd528b878747c1582d6d687d3cbec0fd343
|
data/.rubocop.yml
CHANGED
@@ -1,13 +1,48 @@
|
|
1
|
+
# RuboCop 全体設定
|
1
2
|
AllCops:
|
2
|
-
TargetRubyVersion:
|
3
|
+
TargetRubyVersion: 3.3
|
4
|
+
# Ruby 3.3 以降向けの新しい Cop も自動的に有効化
|
5
|
+
NewCops: enable
|
6
|
+
# 実行ファイルはコマンドライン用途でスタイルが特殊なため除外
|
7
|
+
Exclude:
|
8
|
+
- "bin/**/*"
|
3
9
|
|
10
|
+
# 文字列リテラルはダブルクォートで統一
|
4
11
|
Style/StringLiterals:
|
5
12
|
Enabled: true
|
6
13
|
EnforcedStyle: double_quotes
|
7
14
|
|
15
|
+
# 補間文字列もダブルクォートを強制
|
8
16
|
Style/StringLiteralsInInterpolation:
|
9
17
|
Enabled: true
|
10
18
|
EnforcedStyle: double_quotes
|
11
19
|
|
20
|
+
# 行の長さ上限を 120 文字に設定
|
12
21
|
Layout/LineLength:
|
13
22
|
Max: 120
|
23
|
+
|
24
|
+
# ドキュメントコメントを必須にしない
|
25
|
+
Style/Documentation:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
# CLI やストレージ周りの複雑さ、およびテストコードの冗長さを許容
|
29
|
+
Metrics/ClassLength:
|
30
|
+
Max: 220
|
31
|
+
|
32
|
+
# CLI やストレージなどで必要な手続き型処理を許容するため閾値を緩和
|
33
|
+
Metrics/MethodLength:
|
34
|
+
Max: 20
|
35
|
+
Exclude:
|
36
|
+
- "test/**/*"
|
37
|
+
|
38
|
+
# バリデーションやフォーマット処理の複雑さを吸収
|
39
|
+
Metrics/AbcSize:
|
40
|
+
Max: 25
|
41
|
+
|
42
|
+
# CLI 分岐やレガシー移行ロジック向けに複雑度の上限を調整
|
43
|
+
Metrics/CyclomaticComplexity:
|
44
|
+
Max: 10
|
45
|
+
|
46
|
+
# 全体的な認知的複雑度もやや緩和
|
47
|
+
Metrics/PerceivedComplexity:
|
48
|
+
Max: 10
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
_No changes yet._
|
4
|
+
|
5
|
+
## [1.0.0] - 2025-09-27
|
6
|
+
|
7
|
+
### Added
|
8
|
+
- `hachiwari clear` コマンドを追加し、保存済みの対局成績を削除できるようにしました。
|
9
|
+
- `hachiwari status --trial` オプションを追加し、保存せずに試算できるようにしました。
|
10
|
+
- `hachiwari` 実行時にコマンド名を省略しても `status` として扱われるようにしました。
|
11
|
+
- 目標勝率を既に上回っている場合に、勝率を下回るまでに許容される敗北数を案内する機能を追加しました。
|
12
|
+
- CLI のヘルプ・コマンド説明をロケールごとの YAML (`config/locales/*.yml`) から読み込むようにし、日本語 (`ja`)/英語 (`en`) に加えてスペイン語 (`es`)・フランス語 (`fr`)・ドイツ語 (`de`) への自動切り替えに対応しました。
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Ruby の対応バージョンを `>= 3.3.0` へ引き上げ、最新環境での動作を保証しました。
|
16
|
+
- `bundle update` を実施し、開発用依存関係を最新化しました。
|
17
|
+
- CLI 実装を `StatusRunner` / `StatusCalculator` / `StatusPresenter` / `Storage` へ分割し、責務を明確化しました。
|
18
|
+
- 実行ファイルの配置を `bin/` に統一し、余分なスクリプト (`bin/setup` / `bin/console`) を削除しました。
|
19
|
+
- `info` / `i` / `calculate` コマンドを非推奨化し、実行時は `status --trial` と同等の挙動になるよう警告を表示します。
|
20
|
+
- `s` エイリアスを非推奨化し、利用時は警告表示後に `status` として処理します。一般ヘルプからも非表示にしました。
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
- gem アンインストール時に自動で保存ファイルを削除するフックを追加し、不要なデータが残らないようにしました。
|
24
|
+
|
25
|
+
### Documentation
|
26
|
+
- 日本語 README (`README.md`) を整備し、英語版 `README.en.md` を新規追加しました。
|
27
|
+
- `LICENSE` に参考用の日本語訳を追記しました。
|
28
|
+
- `test/hachiwari_test.rb` に日本語コメントを追加し、テストの意図を明確化しました。
|
29
|
+
- 勝率・敗北案内に関するテストケースを追加し、境界条件での挙動を検証できるようにしました。
|
30
|
+
- `lib/` 配下の主要コンポーネントに説明コメントを追加し、アーキテクチャをドキュメント化しました。
|
31
|
+
|
32
|
+
## [0.4.0] - 2022-04-27
|
33
|
+
|
34
|
+
### Added
|
35
|
+
- `info` コマンドを追加し、状態を保存せずに勝率を試算できるようにしました。
|
36
|
+
|
37
|
+
## [0.3.1] - 2021-12-06
|
38
|
+
|
39
|
+
### Changed
|
40
|
+
- 軽微な修正を行い、安定性を向上しました。
|
41
|
+
|
3
42
|
## [0.1.0] - 2021-11-08
|
4
43
|
|
5
44
|
- Initial release
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,44 +1,65 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hachiwari (0.
|
4
|
+
hachiwari (1.0.0)
|
5
|
+
pstore
|
5
6
|
thor
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
ansi (1.5.0)
|
12
|
+
ast (2.4.3)
|
13
|
+
builder (3.3.0)
|
14
|
+
json (2.15.0)
|
15
|
+
language_server-protocol (3.17.0.5)
|
16
|
+
lint_roller (1.1.0)
|
17
|
+
minitest (5.25.5)
|
18
|
+
minitest-reporters (1.7.1)
|
19
|
+
ansi
|
20
|
+
builder
|
21
|
+
minitest (>= 5.0)
|
22
|
+
ruby-progressbar
|
23
|
+
parallel (1.27.0)
|
24
|
+
parser (3.3.9.0)
|
14
25
|
ast (~> 2.4.1)
|
26
|
+
racc
|
27
|
+
prism (1.5.1)
|
28
|
+
pstore (0.1.4)
|
29
|
+
racc (1.8.1)
|
15
30
|
rainbow (3.1.1)
|
16
|
-
rake (13.0
|
17
|
-
regexp_parser (2.3
|
18
|
-
|
19
|
-
|
31
|
+
rake (13.3.0)
|
32
|
+
regexp_parser (2.11.3)
|
33
|
+
rubocop (1.81.1)
|
34
|
+
json (~> 2.3)
|
35
|
+
language_server-protocol (~> 3.17.0.2)
|
36
|
+
lint_roller (~> 1.1.0)
|
20
37
|
parallel (~> 1.10)
|
21
|
-
parser (>= 3.
|
38
|
+
parser (>= 3.3.0.2)
|
22
39
|
rainbow (>= 2.2.2, < 4.0)
|
23
|
-
regexp_parser (>=
|
24
|
-
|
25
|
-
rubocop-ast (>= 1.17.0, < 2.0)
|
40
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
41
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
26
42
|
ruby-progressbar (~> 1.7)
|
27
|
-
unicode-display_width (>=
|
28
|
-
rubocop-ast (1.
|
29
|
-
parser (>= 3.
|
30
|
-
|
31
|
-
|
32
|
-
|
43
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
44
|
+
rubocop-ast (1.47.1)
|
45
|
+
parser (>= 3.3.7.2)
|
46
|
+
prism (~> 1.4)
|
47
|
+
ruby-progressbar (1.13.0)
|
48
|
+
thor (1.4.0)
|
49
|
+
unicode-display_width (3.2.0)
|
50
|
+
unicode-emoji (~> 4.1)
|
51
|
+
unicode-emoji (4.1.0)
|
33
52
|
|
34
53
|
PLATFORMS
|
54
|
+
arm64-darwin-24
|
35
55
|
x86_64-darwin-21
|
36
56
|
|
37
57
|
DEPENDENCIES
|
38
58
|
hachiwari!
|
39
59
|
minitest (~> 5.0)
|
60
|
+
minitest-reporters (~> 1.6)
|
40
61
|
rake (~> 13.0)
|
41
62
|
rubocop (~> 1.21)
|
42
63
|
|
43
64
|
BUNDLED WITH
|
44
|
-
2.
|
65
|
+
2.7.1
|
data/LICENSE
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021-2025 Atelier-Mirai
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
22
|
+
|
23
|
+
------------------------------------------------------------
|
24
|
+
以下は参考用の日本語訳です。法的効力を持つのは上記の英語版ライセンス文です。
|
25
|
+
|
26
|
+
MIT ライセンス(参考訳)
|
27
|
+
|
28
|
+
Copyright (c) 2021-2025 Atelier-Mirai
|
29
|
+
|
30
|
+
本ソフトウェアおよび関連文書ファイル(以下「ソフトウェア」)の複製を入手した者に対し、ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの使用、複製、改変、結合、掲載、頒布、再許諾、および/または販売の権利、ならびにソフトウェアを供給された者に同様のことを許可する権利が含まれます。
|
31
|
+
|
32
|
+
上記の著作権表示および本許諾表示は、ソフトウェアのすべての複製または重要な部分に記載しなければなりません。
|
33
|
+
|
34
|
+
ソフトウェアは「現状のまま」で提供され、明示黙示を問わず、商品性、特定目的への適合性、および権利非侵害についての保証を含め、いかなる種類の保証も行いません。著作者または著作権者は、契約、不法行為、その他いかなる行為によるかを問わず、ソフトウェアに起因または関連して生じる一切の請求、損害、その他の責任について責任を負いません。
|
data/README.de.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Hachiwari
|
2
|
+
|
3
|
+
Hachiwari leitet sich vom Ziel ab, eine Siegquote von 80 % zu erreichen. Die Ruby-Gem zeigt, wie viele zusätzliche Siege nötig sind, um das gesetzte Ziel zu schaffen (Standardziel: 80 %).
|
4
|
+
|
5
|
+
Weitere Sprachen: [README.md](README.md) (Japanisch) / [README.en.md](README.en.md) (Englisch) / [README.es.md](README.es.md) (Spanisch) / [README.fr.md](README.fr.md) (Französisch).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Installiere die Gem mit:
|
10
|
+
|
11
|
+
```
|
12
|
+
% gem install hachiwari
|
13
|
+
```
|
14
|
+
|
15
|
+
## Verwendung
|
16
|
+
|
17
|
+
### Anzahl der benötigten Siege zur Zielquote anzeigen (mit automatischer Speicherung)
|
18
|
+
|
19
|
+
```
|
20
|
+
% hachiwari [status] [wins] [losses] [target] [language]
|
21
|
+
```
|
22
|
+
|
23
|
+
- `status` kann weggelassen werden; übergib einfach die Argumente.
|
24
|
+
- Der alte Alias `s` ist veraltet. Bei Verwendung erscheint eine Warnung und `status` wird intern ausgeführt.
|
25
|
+
- Es gibt vier Argumente: Siege, Niederlagen, Zielquote und Ausgabesprache. Alle sind optional.
|
26
|
+
- Ohne Argumente wird der aktuelle Stand anhand der Standardwerte oder gespeicherter Daten gezeigt. Standard: Siege 0, Niederlagen 0, Zielquote 80 %, Sprache Japanisch (`ja`).
|
27
|
+
- Gibst du Siege als erstes Argument an, berechnet Hachiwari, wie viele zusätzliche Siege dafür noch fehlen. Die übrigen Argumente greifen auf Standard- oder gespeicherte Werte zurück.
|
28
|
+
- Die eingegebenen Siege werden automatisch in `~/.hachiwari` gespeichert.
|
29
|
+
- Um Niederlagen zu aktualisieren, übergib sie als zweites Argument.
|
30
|
+
- Zum Anpassen der Zielquote nutze das dritte Argument (z. B. `90` für 90 %).
|
31
|
+
- Zum Ändern der Sprache verwende das vierte Argument. Unterstützt werden `ja` (Japanisch, Standard), `en` (Englisch), `es` (Spanisch), `fr` (Französisch) und `de` (Deutsch).
|
32
|
+
|
33
|
+
Um das Ergebnis ohne Speicherung anzuzeigen, hänge die Option `--trial` (oder kurz `-t`) an:
|
34
|
+
|
35
|
+
```
|
36
|
+
% hachiwari [status] --trial [wins] [losses] [target] [language]
|
37
|
+
```
|
38
|
+
|
39
|
+
Die Argumente funktionieren wie beim regulären `status`, aber es wird nichts gespeichert. Die früheren Befehle `info`, `i` und `calculate` sind veraltet; sie zeigen eine Warnung und verhalten sich wie `status --trial`.
|
40
|
+
|
41
|
+
### Version von Hachiwari anzeigen
|
42
|
+
|
43
|
+
```
|
44
|
+
% hachiwari version
|
45
|
+
```
|
46
|
+
|
47
|
+
Zeigt die installierte Version von Hachiwari an.
|
48
|
+
|
49
|
+
### Gespeicherte Daten löschen
|
50
|
+
|
51
|
+
```
|
52
|
+
% hachiwari clear
|
53
|
+
```
|
54
|
+
|
55
|
+
Löscht die gespeicherte Datei `.hachiwari`. Existiert sie nicht, erscheint nur eine Warnung.
|
56
|
+
|
57
|
+
### Befehlsliste oder Detailhilfe anzeigen
|
58
|
+
|
59
|
+
```
|
60
|
+
% hachiwari --help
|
61
|
+
% hachiwari status --help
|
62
|
+
```
|
63
|
+
|
64
|
+
`hachiwari --help` listet verfügbare Befehle auf; `hachiwari <befehl> --help` zeigt detaillierte Hilfe.
|
65
|
+
|
66
|
+
### Veraltete Befehle
|
67
|
+
|
68
|
+
Folgende Befehle/Aliase sind veraltet. Bei Ausführung erscheint eine Warnung, danach erfolgt ein kompatibles Verhalten:
|
69
|
+
|
70
|
+
- **s**: Früher ein Alias von `status`. Warnung und anschließende Ausführung von `status`.
|
71
|
+
- **info / i**: Dienten früher als Simulation ohne Speicherung. Jetzt Warnung und Verhalten wie `status --trial`.
|
72
|
+
- **calculate**: Diente dem reinen Options-basierten Berechnen. Jetzt Warnung und Verhalten wie `status --trial` (Optionen `--target`/`--language` bleiben nutzbar).
|
73
|
+
|
74
|
+
## Entwicklung
|
75
|
+
|
76
|
+
Klone das Repository und richte die Umgebung mit:
|
77
|
+
|
78
|
+
```
|
79
|
+
bundle install
|
80
|
+
bundle exec rake test
|
81
|
+
```
|
82
|
+
|
83
|
+
- **Abhängigkeiten installieren**: `bundle install`
|
84
|
+
- **Tests ausführen**: `bundle exec rake test`
|
85
|
+
- **CLI manuell prüfen**: `bundle exec ruby -Ilib bin/hachiwari --help`
|
86
|
+
|
87
|
+
Zum lokalen Installieren der Gem: `bundle exec rake install`.
|
88
|
+
|
89
|
+
### Neue Version veröffentlichen
|
90
|
+
|
91
|
+
1. `VERSION` in `lib/hachiwari/version.rb` anpassen.
|
92
|
+
2. Änderungen committen und pushen.
|
93
|
+
3. `bundle exec rake release` ausführen.
|
94
|
+
|
95
|
+
Damit werden Tag und Commits erstellt und gepusht, und die Gem wird auf [rubygems.org](https://rubygems.org) veröffentlicht (MFA bei RubyGems erforderlich).
|
96
|
+
|
97
|
+
## Mitwirken
|
98
|
+
|
99
|
+
Fehlerberichte und Pull Requests sind auf [GitHub](https://github.com/Atelier-Mirai/hachiwari) willkommen.
|
100
|
+
|
101
|
+
## Lizenz
|
102
|
+
|
103
|
+
Diese Gem steht unter der [MIT-Lizenz](https://opensource.org/licenses/MIT). Details siehe [LICENSE](./LICENSE).
|
data/README.en.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Hachiwari
|
2
|
+
|
3
|
+
Hachiwari originates from the phrase "80 percent" (hachiwari). It is a Ruby gem that tells you how many additional wins you need to hit your target win rate (80 percent by default).
|
4
|
+
|
5
|
+
For other languages, see [README.md](README.md) (Japanese) / [README.es.md](README.es.md) (Spanish) / [README.fr.md](README.fr.md) (French) / [README.de.md](README.de.md) (German).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install it with:
|
10
|
+
|
11
|
+
```
|
12
|
+
% gem install hachiwari
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
### Display the number of wins required to reach the target win rate (with automatic saving)
|
18
|
+
|
19
|
+
```
|
20
|
+
% hachiwari [status] [wins] [losses] [target] [language]
|
21
|
+
```
|
22
|
+
|
23
|
+
- You can omit `status` and pass only the arguments.
|
24
|
+
- The legacy alias `s` is deprecated; it prints a warning and internally invokes `status`.
|
25
|
+
- There are four arguments: number of wins, number of losses, target win rate, and display language. All of them are optional.
|
26
|
+
- With no arguments, the current record is shown based on defaults or previously saved data. Defaults are wins: 0, losses: 0, target: 80 percent, language: Japanese (`ja`).
|
27
|
+
- If you pass wins as the first argument, Hachiwari tells you how many more wins are required from that value. Remaining arguments fall back to defaults or saved data.
|
28
|
+
- The number of wins you provide is automatically saved to `~/.hachiwari`.
|
29
|
+
- To update losses, pass them as the second argument.
|
30
|
+
- To change the target win rate, use the third argument (for example, `90` for 90 percent).
|
31
|
+
- To change the language, use the fourth argument. Supported values are `ja` (Japanese, default), `en` (English), `es` (Spanish), `fr` (French), and `de` (German).
|
32
|
+
|
33
|
+
To preview the result without saving it, append the `--trial` (or `-t`) option:
|
34
|
+
|
35
|
+
```
|
36
|
+
% hachiwari [status] --trial [wins] [losses] [target] [language]
|
37
|
+
```
|
38
|
+
|
39
|
+
Arguments behave exactly as in the regular `status` command, but no state is persisted. The legacy `info`, `i`, and `calculate` commands are deprecated; they print a warning and behave like `status --trial`.
|
40
|
+
|
41
|
+
### Display the version of Hachiwari
|
42
|
+
|
43
|
+
```
|
44
|
+
% hachiwari version
|
45
|
+
```
|
46
|
+
|
47
|
+
Shows the installed version of Hachiwari.
|
48
|
+
|
49
|
+
### Delete saved match data
|
50
|
+
|
51
|
+
```
|
52
|
+
% hachiwari clear
|
53
|
+
```
|
54
|
+
|
55
|
+
Removes the stored `.hachiwari` file. If no data exists, a warning is shown instead.
|
56
|
+
|
57
|
+
### Show command lists or detailed help
|
58
|
+
|
59
|
+
```
|
60
|
+
% hachiwari --help
|
61
|
+
% hachiwari status --help
|
62
|
+
```
|
63
|
+
|
64
|
+
`hachiwari --help` prints available commands, and `hachiwari <command> --help` prints detailed help for each command.
|
65
|
+
|
66
|
+
### Deprecated commands
|
67
|
+
|
68
|
+
The following commands/aliases are deprecated. When executed, they print a warning and fall back to compatible behavior:
|
69
|
+
|
70
|
+
- **s**: Former alias of `status`. A warning is printed and `status` runs.
|
71
|
+
- **info / i**: Formerly provided trial output without saving. They now warn and behave like `status --trial`.
|
72
|
+
- **calculate**: Former option-driven calculator command. It now warns and behaves like `status --trial` (the `--target` / `--language` options remain available).
|
73
|
+
|
74
|
+
## Development
|
75
|
+
|
76
|
+
Clone the repository and set up the development environment with:
|
77
|
+
|
78
|
+
```
|
79
|
+
bundle install
|
80
|
+
bundle exec rake test
|
81
|
+
```
|
82
|
+
|
83
|
+
- **Install dependencies**: `bundle install`
|
84
|
+
- **Run tests**: `bundle exec rake test`
|
85
|
+
- **Check the CLI manually**: `bundle exec ruby -Ilib bin/hachiwari --help`
|
86
|
+
|
87
|
+
To install the gem locally, run `bundle exec rake install`.
|
88
|
+
|
89
|
+
### Releasing a new version
|
90
|
+
|
91
|
+
1. Update `VERSION` in `lib/hachiwari/version.rb`.
|
92
|
+
2. Commit and push your changes.
|
93
|
+
3. Run `bundle exec rake release`.
|
94
|
+
|
95
|
+
The release task creates a git tag, pushes commits and the tag, and publishes the gem to [rubygems.org](https://rubygems.org) (you need MFA enabled on RubyGems).
|
96
|
+
|
97
|
+
## Contributing
|
98
|
+
|
99
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/Atelier-Mirai/hachiwari).
|
100
|
+
|
101
|
+
## License
|
102
|
+
|
103
|
+
This gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). See [LICENSE](./LICENSE) for details.
|
data/README.es.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Hachiwari
|
2
|
+
|
3
|
+
Hachiwari debe su nombre al objetivo de alcanzar un 80 % de victorias. Es una gema de Ruby que te muestra cuántas victorias necesitas para llegar a tu porcentaje objetivo (el objetivo predeterminado es 80 %).
|
4
|
+
|
5
|
+
Para documentación en otros idiomas, consulta [README.md](README.md) / [README.en.md](README.en.md) / [README.fr.md](README.fr.md) / [README.de.md](README.de.md).
|
6
|
+
|
7
|
+
## Instalación
|
8
|
+
|
9
|
+
Instálalo ejecutando:
|
10
|
+
|
11
|
+
```
|
12
|
+
% gem install hachiwari
|
13
|
+
```
|
14
|
+
|
15
|
+
## Uso
|
16
|
+
|
17
|
+
### Mostrar el número de victorias necesarias para alcanzar la tasa objetivo (con guardado automático)
|
18
|
+
|
19
|
+
```
|
20
|
+
% hachiwari [status] [wins] [losses] [target] [language]
|
21
|
+
```
|
22
|
+
|
23
|
+
- Puedes omitir `status` y pasar únicamente los argumentos.
|
24
|
+
- El alias heredado `s` está en desuso; al usarlo se mostrará una advertencia y se ejecutará `status` internamente.
|
25
|
+
- Hay cuatro argumentos: número de victorias, número de derrotas, porcentaje objetivo y idioma de salida. Todos son opcionales.
|
26
|
+
- Si no proporcionas argumentos, se mostrará el registro actual usando los valores predeterminados o los datos guardados previamente. Los valores predeterminados son victorias: 0, derrotas: 0, porcentaje objetivo: 80 %, idioma: japonés (`ja`).
|
27
|
+
- Si proporcionas el número de victorias como primer argumento, se mostrará la cantidad de victorias adicionales necesarias a partir de ese valor. El resto de los argumentos usará valores predeterminados o guardados.
|
28
|
+
- El número de victorias proporcionado se guarda automáticamente en `~/.hachiwari`.
|
29
|
+
- Para actualizar el número de derrotas, pásalo como segundo argumento.
|
30
|
+
- Para cambiar el porcentaje objetivo, proporciónalo como tercer argumento (por ejemplo `90` para un objetivo del 90 %).
|
31
|
+
- Para cambiar el idioma, usa el cuarto argumento. Especifica `ja` para japonés (predeterminado), `en` para inglés, `es` para español, `fr` para francés o `de` para alemán.
|
32
|
+
|
33
|
+
Para obtener el resultado sin guardarlo, agrega la opción `--trial` (o `-t`):
|
34
|
+
|
35
|
+
```
|
36
|
+
% hachiwari [status] --trial [wins] [losses] [target] [language]
|
37
|
+
```
|
38
|
+
|
39
|
+
Los argumentos funcionan igual que en el comando `status`, pero el estado no se persiste. Los comandos heredados `info`, `i` y `calculate` están obsoletos; se mostrará una advertencia y se comportarán como `status --trial`.
|
40
|
+
|
41
|
+
### Mostrar la versión de Hachiwari
|
42
|
+
|
43
|
+
```
|
44
|
+
% hachiwari version
|
45
|
+
```
|
46
|
+
|
47
|
+
Muestra la versión instalada de Hachiwari.
|
48
|
+
|
49
|
+
### Borrar los datos guardados
|
50
|
+
|
51
|
+
```
|
52
|
+
% hachiwari clear
|
53
|
+
```
|
54
|
+
|
55
|
+
Elimina el archivo `.hachiwari` guardado. Si no existe, solo se mostrará una advertencia.
|
56
|
+
|
57
|
+
### Mostrar la lista de comandos o la ayuda detallada
|
58
|
+
|
59
|
+
```
|
60
|
+
% hachiwari --help
|
61
|
+
% hachiwari status --help
|
62
|
+
```
|
63
|
+
|
64
|
+
`hachiwari --help` muestra la lista de comandos disponibles, y `hachiwari <comando> --help` muestra la ayuda detallada de cada comando.
|
65
|
+
|
66
|
+
### Comandos obsoletos
|
67
|
+
|
68
|
+
Los siguientes comandos/alias están obsoletos. Al ejecutarlos se mostrará una advertencia y se realizará una acción de compatibilidad:
|
69
|
+
|
70
|
+
- **s**: Era un alias de `status`. Se mostrará una advertencia y se ejecutará `status`.
|
71
|
+
- **info / i**: Realizaban una simulación sin guardar. Ahora muestran una advertencia y se comportan como `status --trial`.
|
72
|
+
- **calculate**: Permitía calcular solo con opciones. Ahora muestra una advertencia y se comporta como `status --trial` (los parámetros `--target`/`--language` siguen disponibles).
|
73
|
+
|
74
|
+
## Desarrollo
|
75
|
+
|
76
|
+
Clona el repositorio y prepara el entorno con:
|
77
|
+
|
78
|
+
```
|
79
|
+
bundle install
|
80
|
+
bundle exec rake test
|
81
|
+
```
|
82
|
+
|
83
|
+
- **Instalar dependencias**: `bundle install`
|
84
|
+
- **Ejecutar pruebas**: `bundle exec rake test`
|
85
|
+
- **Comprobar el CLI manualmente**: `bundle exec ruby -Ilib bin/hachiwari --help`
|
86
|
+
|
87
|
+
Para instalar la gema localmente, ejecuta `bundle exec rake install`.
|
88
|
+
|
89
|
+
### Publicar una nueva versión
|
90
|
+
|
91
|
+
1. Actualiza `VERSION` en `lib/hachiwari/version.rb`.
|
92
|
+
2. Haz commit y push de los cambios.
|
93
|
+
3. Ejecuta `bundle exec rake release`.
|
94
|
+
|
95
|
+
Este comando creará la etiqueta git, la publicará y subirá la gema a [rubygems.org](https://rubygems.org) (necesitas MFA en RubyGems).
|
96
|
+
|
97
|
+
## Contribuir
|
98
|
+
|
99
|
+
Aceptamos informes de errores y pull requests en [GitHub](https://github.com/Atelier-Mirai/hachiwari).
|
100
|
+
|
101
|
+
## Licencia
|
102
|
+
|
103
|
+
Este software se distribuye bajo la [Licencia MIT](https://opensource.org/licenses/MIT). Consulta [LICENSE](./LICENSE) para más detalles.
|
data/README.fr.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Hachiwari
|
2
|
+
|
3
|
+
Hachiwari tire son nom de l'objectif d'atteindre 80 % de victoires. C'est une gem Ruby qui indique le nombre de victoires supplémentaires nécessaires pour atteindre votre pourcentage cible (80 % par défaut).
|
4
|
+
|
5
|
+
Pour les autres langues, consultez [README.md](README.md) (japonais) / [README.en.md](README.en.md) (anglais) / [README.es.md](README.es.md) (espagnol) / [README.de.md](README.de.md) (allemand).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Installez la gem avec :
|
10
|
+
|
11
|
+
```
|
12
|
+
% gem install hachiwari
|
13
|
+
```
|
14
|
+
|
15
|
+
## Utilisation
|
16
|
+
|
17
|
+
### Afficher le nombre de victoires nécessaires pour atteindre le taux cible (avec sauvegarde automatique)
|
18
|
+
|
19
|
+
```
|
20
|
+
% hachiwari [status] [wins] [losses] [target] [language]
|
21
|
+
```
|
22
|
+
|
23
|
+
- Vous pouvez omettre `status` et ne passer que les arguments.
|
24
|
+
- L'alias hérité `s` est obsolète : son utilisation affiche un avertissement puis exécute `status` en interne.
|
25
|
+
- Les quatre arguments sont : nombre de victoires, nombre de défaites, pourcentage cible et langue d'affichage. Ils sont tous facultatifs.
|
26
|
+
- Sans argument, le score actuel est affiché à partir des valeurs par défaut ou des données enregistrées. Par défaut : victoires : 0, défaites : 0, objectif : 80 %, langue : japonais (`ja`).
|
27
|
+
- Si vous fournissez le nombre de victoires en premier argument, Hachiwari indique combien de victoires supplémentaires sont nécessaires à partir de ce total. Les autres arguments reviennent aux valeurs par défaut ou enregistrées.
|
28
|
+
- Le nombre de victoires fourni est automatiquement enregistré dans `~/.hachiwari`.
|
29
|
+
- Pour mettre à jour le nombre de défaites, passez-le en second argument.
|
30
|
+
- Pour modifier le pourcentage cible, utilisez le troisième argument (par exemple `90` pour 90 %).
|
31
|
+
- Pour changer la langue, utilisez le quatrième argument. Valeurs prises en charge : `ja` (japonais, par défaut), `en` (anglais), `es` (espagnol), `fr` (français) et `de` (allemand).
|
32
|
+
|
33
|
+
Pour obtenir un résultat sans enregistrer, ajoutez l'option `--trial` (ou `-t`) :
|
34
|
+
|
35
|
+
```
|
36
|
+
% hachiwari [status] --trial [wins] [losses] [target] [language]
|
37
|
+
```
|
38
|
+
|
39
|
+
Les arguments se comportent comme pour `status`, mais l'état n'est pas sauvegardé. Les anciens commandes `info`, `i` et `calculate` sont obsolètes : elles affichent un avertissement et se comportent comme `status --trial`.
|
40
|
+
|
41
|
+
### Afficher la version de Hachiwari
|
42
|
+
|
43
|
+
```
|
44
|
+
% hachiwari version
|
45
|
+
```
|
46
|
+
|
47
|
+
Affiche la version installée de Hachiwari.
|
48
|
+
|
49
|
+
### Supprimer les données enregistrées
|
50
|
+
|
51
|
+
```
|
52
|
+
% hachiwari clear
|
53
|
+
```
|
54
|
+
|
55
|
+
Supprime le fichier `.hachiwari` enregistré. S'il n'existe pas, seul un avertissement est affiché.
|
56
|
+
|
57
|
+
### Afficher la liste des commandes ou une aide détaillée
|
58
|
+
|
59
|
+
```
|
60
|
+
% hachiwari --help
|
61
|
+
% hachiwari status --help
|
62
|
+
```
|
63
|
+
|
64
|
+
`hachiwari --help` affiche la liste des commandes disponibles, et `hachiwari <commande> --help` montre l'aide détaillée de chaque commande.
|
65
|
+
|
66
|
+
### Commandes obsolètes
|
67
|
+
|
68
|
+
Les commandes/alias suivants sont obsolètes ; ils affichent un avertissement et basculent vers un comportement compatible :
|
69
|
+
|
70
|
+
- **s** : ancien alias de `status`. Un avertissement est affiché, puis `status` s'exécute.
|
71
|
+
- **info / i** : réalisaient une simulation sans sauvegarde. Elles avertissent désormais et se comportent comme `status --trial`.
|
72
|
+
- **calculate** : permettait un calcul basé uniquement sur des options. Elle avertit désormais et se comporte comme `status --trial` (les options `--target`/`--language` restent disponibles).
|
73
|
+
|
74
|
+
## Développement
|
75
|
+
|
76
|
+
Clonez le dépôt et préparez l'environnement avec :
|
77
|
+
|
78
|
+
```
|
79
|
+
bundle install
|
80
|
+
bundle exec rake test
|
81
|
+
```
|
82
|
+
|
83
|
+
- **Installer les dépendances** : `bundle install`
|
84
|
+
- **Lancer les tests** : `bundle exec rake test`
|
85
|
+
- **Vérifier le CLI manuellement** : `bundle exec ruby -Ilib bin/hachiwari --help`
|
86
|
+
|
87
|
+
Pour installer la gem localement, exécutez `bundle exec rake install`.
|
88
|
+
|
89
|
+
### Publier une nouvelle version
|
90
|
+
|
91
|
+
1. Mettez à jour `VERSION` dans `lib/hachiwari/version.rb`.
|
92
|
+
2. Commitez et poussez les modifications.
|
93
|
+
3. Lancez `bundle exec rake release`.
|
94
|
+
|
95
|
+
Cette commande crée un tag git, pousse les commits et le tag, puis publie la gem sur [rubygems.org](https://rubygems.org) (MFA requis sur RubyGems).
|
96
|
+
|
97
|
+
## Contribuer
|
98
|
+
|
99
|
+
Les rapports de bugs et pull requests sont les bienvenus sur [GitHub](https://github.com/Atelier-Mirai/hachiwari).
|
100
|
+
|
101
|
+
## Licence
|
102
|
+
|
103
|
+
Cette gem est publiée sous [licence MIT](https://opensource.org/licenses/MIT). Consultez [LICENSE](./LICENSE) pour plus de détails.
|