decentworks-hexdigest-support 0.1.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 +7 -0
- data/.claude/CLAUDE.md +24 -0
- data/.claude/hooks/rubocop-fix.sh +27 -0
- data/.claude/rules/general.md +5 -0
- data/.claude/rules/git.md +6 -0
- data/.claude/rules/rspec.md +24 -0
- data/.claude/rules/ruby.md +11 -0
- data/.claude/settings.json +67 -0
- data/.rspec +3 -0
- data/.rubocop.yml +300 -0
- data/CHANGELOG.md +3 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +532 -0
- data/Rakefile +12 -0
- data/lib/decentworks/hexdigest_support/array.rb +24 -0
- data/lib/decentworks/hexdigest_support/big_decimal.rb +14 -0
- data/lib/decentworks/hexdigest_support/configuration.rb +40 -0
- data/lib/decentworks/hexdigest_support/data.rb +13 -0
- data/lib/decentworks/hexdigest_support/date.rb +24 -0
- data/lib/decentworks/hexdigest_support/hash.rb +28 -0
- data/lib/decentworks/hexdigest_support/input.rb +97 -0
- data/lib/decentworks/hexdigest_support/nil_class.rb +13 -0
- data/lib/decentworks/hexdigest_support/numeric.rb +31 -0
- data/lib/decentworks/hexdigest_support/numeric_like.rb +93 -0
- data/lib/decentworks/hexdigest_support/object.rb +91 -0
- data/lib/decentworks/hexdigest_support/range.rb +24 -0
- data/lib/decentworks/hexdigest_support/set.rb +14 -0
- data/lib/decentworks/hexdigest_support/struct.rb +16 -0
- data/lib/decentworks/hexdigest_support/time.rb +9 -0
- data/lib/decentworks/hexdigest_support/time_like.rb +42 -0
- data/lib/decentworks/hexdigest_support/time_with_zone.rb +19 -0
- data/lib/decentworks/hexdigest_support/version.rb +7 -0
- data/lib/decentworks/hexdigest_support.rb +20 -0
- data/lib/decentworks-hexdigest-support.rb +3 -0
- data/lib/generators/decentworks/hexdigest_support/install/install_generator.rb +38 -0
- data/lib/generators/decentworks/hexdigest_support/install/templates/decentworks_hexdigest_support.rb.tt +16 -0
- data/sig/decentworks/hexdigest_support/array.rbs +3 -0
- data/sig/decentworks/hexdigest_support/configuration.rbs +14 -0
- data/sig/decentworks/hexdigest_support/data.rbs +3 -0
- data/sig/decentworks/hexdigest_support/date.rbs +7 -0
- data/sig/decentworks/hexdigest_support/hash.rbs +3 -0
- data/sig/decentworks/hexdigest_support/input.rbs +11 -0
- data/sig/decentworks/hexdigest_support/nil_class.rbs +3 -0
- data/sig/decentworks/hexdigest_support/object.rbs +19 -0
- data/sig/decentworks/hexdigest_support/range.rbs +3 -0
- data/sig/decentworks/hexdigest_support/set.rbs +3 -0
- data/sig/decentworks/hexdigest_support/struct.rbs +3 -0
- data/sig/decentworks/hexdigest_support/time.rbs +3 -0
- data/sig/decentworks/hexdigest_support/time_like.rbs +8 -0
- data/sig/decentworks/hexdigest_support/time_with_zone.rbs +5 -0
- data/sig/decentworks/hexdigest_support/version.rbs +5 -0
- metadata +123 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b0b2fcafcc218920bbece471e20ea60b82e9abf9a980fbee2d8b544baef0e8dd
|
|
4
|
+
data.tar.gz: 2c1545e3753a3362c6c5224a5b1089718c0688eedcdba47203aabfd40ef8ec08
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e9285585481a683d6299dcf1255d59515f32738788d81ec7c19db6b418f2a7bf6e043cfe0e9ff2940da772e9c80ab931f00f1ec731f26c5fe8e503bfc51fa345
|
|
7
|
+
data.tar.gz: af95e4ce22c90fe320a3b9a1fd3455dfc59918bb8c2262dca00fbefad8ba2ce4679ec4f77fe534e71e5b9c80e72656038607488ad5dcf10173945025024c5e71
|
data/.claude/CLAUDE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# プロジェクト概要
|
|
2
|
+
|
|
3
|
+
- オブジェクトのHash値化のユーティリティgem
|
|
4
|
+
|
|
5
|
+
## 前提環境
|
|
6
|
+
|
|
7
|
+
- Ruby 4.0(gemspecの required_ruby_version)
|
|
8
|
+
- テスト: RSpec
|
|
9
|
+
- Lint: RuboCop
|
|
10
|
+
|
|
11
|
+
# コミュニケーション
|
|
12
|
+
|
|
13
|
+
- 日本語で応答する(コード・変数名は英語)
|
|
14
|
+
- 簡潔に回答し、自明な説明は省略する
|
|
15
|
+
- 複雑なタスクでは実装前に計画を提示し、承認後に着手する
|
|
16
|
+
|
|
17
|
+
# 禁止事項
|
|
18
|
+
|
|
19
|
+
- README・ドキュメントを勝手に生成・変更しない
|
|
20
|
+
- テストコードを確認なしに削除・コメントアウトしない
|
|
21
|
+
- 既存の動作するコードを理由なくリファクタリングしない
|
|
22
|
+
- APIキー・トークンをプロンプトに含めない
|
|
23
|
+
- .env ファイルを読んで内容を出力しない
|
|
24
|
+
- 環境変数の値をログやコメントに書かない
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/rubocop-fix.sh
|
|
3
|
+
# PostToolUse(Edit|Write) で発火。編集された .rb に rubocop -a をかけ、
|
|
4
|
+
# 残った違反を Claude にフィードバックする。
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
input=$(cat)
|
|
8
|
+
file_path=$(jq -r '.tool_input.file_path // empty' <<<"$input")
|
|
9
|
+
|
|
10
|
+
[[ -z "$file_path" ]] && exit 0
|
|
11
|
+
[[ "$file_path" != *.rb ]] && exit 0
|
|
12
|
+
[[ ! -f "$file_path" ]] && exit 0
|
|
13
|
+
|
|
14
|
+
cd "${CLAUDE_PROJECT_DIR:-.}" || exit 0
|
|
15
|
+
|
|
16
|
+
# --server で常駐プロセスを使い、毎回のRuby起動コスト(1〜2秒)を避ける
|
|
17
|
+
output=$(bundle exec rubocop --server --autocorrect --format simple "$file_path" 2>&1)
|
|
18
|
+
status=$?
|
|
19
|
+
|
|
20
|
+
if [[ $status -ne 0 ]]; then
|
|
21
|
+
# exit 2 の stderr は Claude に渡り、自分で直させられる
|
|
22
|
+
echo "RuboCop violations remain in ${file_path}:" >&2
|
|
23
|
+
echo "$output" >&2
|
|
24
|
+
exit 2
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
exit 0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: spec/**/*.rb
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# テスト
|
|
6
|
+
|
|
7
|
+
## 品質
|
|
8
|
+
|
|
9
|
+
- テストは必ず実際の機能を検証すること
|
|
10
|
+
- 各テストケースは、具体的な入力と出力を検証すること
|
|
11
|
+
- モックの利用は最小限にすること
|
|
12
|
+
- 実際の動作に即した形のテストをすること
|
|
13
|
+
|
|
14
|
+
## テスト実装の原則
|
|
15
|
+
|
|
16
|
+
- テストが失敗する状態から始めること(Red - Green - Refactor)
|
|
17
|
+
- 境界値、異常系、エラーケースも必ずテストすること
|
|
18
|
+
- カバレッジではなっく、実際の品質を重視すること
|
|
19
|
+
- テストケース名は、何をテストしているのかを明確にすること
|
|
20
|
+
|
|
21
|
+
## 実装前の確認
|
|
22
|
+
|
|
23
|
+
- 機能の仕様を正しく理解してからテストを書くこと
|
|
24
|
+
- 不明な点があれば、仮の実装ではなく、ユーザーに確認すること
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "リポジトリの .claude/settings.json に置く(コミットしてチームで共有する)",
|
|
3
|
+
|
|
4
|
+
"permissions": {
|
|
5
|
+
"defaultMode": "default",
|
|
6
|
+
|
|
7
|
+
"deny": [
|
|
8
|
+
"Read(./.env)",
|
|
9
|
+
"Read(./.env.*)",
|
|
10
|
+
"Bash(rm -rf *)",
|
|
11
|
+
"Bash(git push --force*)",
|
|
12
|
+
"Bash(git push -f*)"
|
|
13
|
+
],
|
|
14
|
+
|
|
15
|
+
"ask": [
|
|
16
|
+
"Bash(git push*)",
|
|
17
|
+
"Bash(git commit*)",
|
|
18
|
+
"Bash(bundle add*)",
|
|
19
|
+
"Bash(bundle update*)",
|
|
20
|
+
"Bash(gh pr *)",
|
|
21
|
+
"Edit(./Gemfile)",
|
|
22
|
+
|
|
23
|
+
"Bash(gem push*)",
|
|
24
|
+
"Bash(rake release*)"
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
"allow": [
|
|
28
|
+
"Bash(bundle exec rspec*)",
|
|
29
|
+
"Bash(bundle exec rubocop*)",
|
|
30
|
+
"Bash(git status*)",
|
|
31
|
+
"Bash(git diff*)",
|
|
32
|
+
"Bash(git log*)",
|
|
33
|
+
"Bash(git add*)",
|
|
34
|
+
"Bash(git switch*)",
|
|
35
|
+
"Bash(git stash*)",
|
|
36
|
+
"Bash(bundle install)",
|
|
37
|
+
"Bash(bin/setup*)"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"hooks": {
|
|
42
|
+
"PostToolUse": [
|
|
43
|
+
{
|
|
44
|
+
"$comment": "Rubyファイルを編集/新規作成したら即rubocop -a。ifはツールごとに1つしかマッチしないためEdit/Writeで別ハンドラに分けている。--serverで起動コストを抑える",
|
|
45
|
+
"matcher": "Edit|Write",
|
|
46
|
+
"hooks": [
|
|
47
|
+
{
|
|
48
|
+
"type": "command",
|
|
49
|
+
"if": "Edit(**/*.rb)",
|
|
50
|
+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/rubocop-fix.sh",
|
|
51
|
+
"args": [],
|
|
52
|
+
"timeout": 60,
|
|
53
|
+
"statusMessage": "RuboCop 実行中"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "command",
|
|
57
|
+
"if": "Write(**/*.rb)",
|
|
58
|
+
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/rubocop-fix.sh",
|
|
59
|
+
"args": [],
|
|
60
|
+
"timeout": 60,
|
|
61
|
+
"statusMessage": "RuboCop 実行中"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
# rubocop-rails-omakase をベースにした設定。
|
|
2
|
+
#
|
|
3
|
+
# 【重要】omakase は Layout / Lint / Metrics / Naming / Style / Rails / Bundler /
|
|
4
|
+
# Gemspec / Security の各部門を丸ごと `Enabled: false` にしたうえで、必要な cop だけを
|
|
5
|
+
# 個別に有効化する設計になっている。
|
|
6
|
+
# そのため、omakase が有効化していない cop に対して `EnforcedStyle` や `Max` だけを
|
|
7
|
+
# 書いても cop は無効のままで何も起きない。有効にしたい場合は必ず `Enabled: true` を
|
|
8
|
+
# 併記すること。
|
|
9
|
+
#
|
|
10
|
+
# omakase が有効化している cop 一覧:
|
|
11
|
+
# vendor/bundle/ruby/*/gems/rubocop-rails-omakase-*/rubocop.yml
|
|
12
|
+
|
|
13
|
+
# rubocop-performance / rubocop-rails は omakase 側で読み込まれる。
|
|
14
|
+
# rubocop-rspec はどこからも読み込まれないのでここで明示する。
|
|
15
|
+
plugins:
|
|
16
|
+
- rubocop-rspec
|
|
17
|
+
|
|
18
|
+
inherit_gem:
|
|
19
|
+
rubocop-rails-omakase: rubocop.yml
|
|
20
|
+
|
|
21
|
+
AllCops:
|
|
22
|
+
# gemspec の required_ruby_version からも解決できるが、明示しておく
|
|
23
|
+
TargetRubyVersion: 4.0
|
|
24
|
+
SuggestExtensions: false
|
|
25
|
+
NewCops: enable
|
|
26
|
+
# 何のルールに引っかかったか表示する
|
|
27
|
+
DisplayCopNames: true
|
|
28
|
+
Exclude:
|
|
29
|
+
- 'bin/**/*'
|
|
30
|
+
- 'tmp/**/*'
|
|
31
|
+
# BUNDLE_PATH: vendor/bundle なので必須
|
|
32
|
+
- 'vendor/**/*'
|
|
33
|
+
- 'coverage/**/*'
|
|
34
|
+
|
|
35
|
+
# #####################################################################################################################
|
|
36
|
+
# omakase が有効化済みの cop に対する調整
|
|
37
|
+
# #####################################################################################################################
|
|
38
|
+
|
|
39
|
+
# omakase の Include は Rails 前提 (app/ config/ lib/ test/ Gemfile) で spec/ と
|
|
40
|
+
# gemspec が漏れるため追加する。EnforcedStyle: double_quotes は omakase 側で指定済み。
|
|
41
|
+
Style/StringLiterals:
|
|
42
|
+
inherit_mode:
|
|
43
|
+
merge:
|
|
44
|
+
- Include
|
|
45
|
+
Include:
|
|
46
|
+
- 'spec/**/*'
|
|
47
|
+
- '*.gemspec'
|
|
48
|
+
|
|
49
|
+
# ケツカンマは付けない (RuboCop / standardrb の既定に揃える)
|
|
50
|
+
# Arguments / ArrayLiteral / HashLiteral の 3つは必ず同じ値にすること
|
|
51
|
+
Style/TrailingCommaInArrayLiteral:
|
|
52
|
+
EnforcedStyleForMultiline: no_comma
|
|
53
|
+
|
|
54
|
+
Style/TrailingCommaInHashLiteral:
|
|
55
|
+
EnforcedStyleForMultiline: no_comma
|
|
56
|
+
|
|
57
|
+
# spec 内は見た目が綺麗になるので許可
|
|
58
|
+
Style/Semicolon:
|
|
59
|
+
Exclude:
|
|
60
|
+
- 'spec/**/*'
|
|
61
|
+
|
|
62
|
+
# omakase は Rails 流の `[ a, b ]` (EnforcedStyle: space) を指定しているが、
|
|
63
|
+
# gem では RuboCop 標準の `[a, b]` に揃える
|
|
64
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
|
65
|
+
EnforcedStyle: no_space
|
|
66
|
+
|
|
67
|
+
# #####################################################################################################################
|
|
68
|
+
# omakase では無効な部門から、追加で有効化する cop
|
|
69
|
+
# (ここに書いていない Style/Layout/Lint/Metrics/Naming の cop はすべて無効)
|
|
70
|
+
# #####################################################################################################################
|
|
71
|
+
|
|
72
|
+
# --- Lint ---
|
|
73
|
+
|
|
74
|
+
# =- ではなく、-= と書く
|
|
75
|
+
Lint/AmbiguousAssignment:
|
|
76
|
+
Enabled: true
|
|
77
|
+
|
|
78
|
+
# カッコは付ける a || (b && c)
|
|
79
|
+
Lint/AmbiguousOperatorPrecedence:
|
|
80
|
+
Enabled: true
|
|
81
|
+
|
|
82
|
+
# 非推奨の定数をチェックしたい
|
|
83
|
+
Lint/DeprecatedConstants:
|
|
84
|
+
Enabled: true
|
|
85
|
+
|
|
86
|
+
# gem として名前空間の衝突を避けたいので、曖昧になる定数参照は完全名で書く
|
|
87
|
+
Lint/ConstantResolution:
|
|
88
|
+
Enabled: true
|
|
89
|
+
Only: [ Causing ]
|
|
90
|
+
|
|
91
|
+
# RuntimeError は「特定の Error を定義できない場合」なので、
|
|
92
|
+
# 定義できるエラーは RuntimeError ではなく StandardError を継承する
|
|
93
|
+
Lint/InheritException:
|
|
94
|
+
Enabled: true
|
|
95
|
+
EnforcedStyle: standard_error
|
|
96
|
+
|
|
97
|
+
# spec 内では expect { subject }.to change { foo } という書き方をよく行うので
|
|
98
|
+
# () を省略したい。{ foo } は明らかに change に紐付く。
|
|
99
|
+
Lint/AmbiguousBlockAssociation:
|
|
100
|
+
Enabled: true
|
|
101
|
+
Exclude:
|
|
102
|
+
- 'spec/**/*_spec.rb'
|
|
103
|
+
|
|
104
|
+
# --- Style ---
|
|
105
|
+
|
|
106
|
+
# レキシカルスコープの扱いが alias_method の方が自然
|
|
107
|
+
Style/Alias:
|
|
108
|
+
Enabled: true
|
|
109
|
+
EnforcedStyle: prefer_alias_method
|
|
110
|
+
|
|
111
|
+
# lambda はすべて `->` リテラルで書く
|
|
112
|
+
Style/Lambda:
|
|
113
|
+
Enabled: true
|
|
114
|
+
EnforcedStyle: literal
|
|
115
|
+
|
|
116
|
+
# String#intern は ruby の内部表現すぎるので String#to_sym を使う
|
|
117
|
+
Style/StringMethods:
|
|
118
|
+
Enabled: true
|
|
119
|
+
|
|
120
|
+
# end.some_method とチェインするのはダサい
|
|
121
|
+
Style/MethodCalledOnDoEndBlock:
|
|
122
|
+
Enabled: true
|
|
123
|
+
|
|
124
|
+
# 無指定だと StandardError を rescue するのは常識の範疇なので
|
|
125
|
+
Style/RescueStandardError:
|
|
126
|
+
Enabled: true
|
|
127
|
+
EnforcedStyle: implicit
|
|
128
|
+
|
|
129
|
+
# fail と使い分ける必要ナシ
|
|
130
|
+
Style/SignalException:
|
|
131
|
+
Enabled: true
|
|
132
|
+
EnforcedStyle: only_raise
|
|
133
|
+
|
|
134
|
+
# 三項演算子は () を外さない方が条件式が何なのか読み取りやすい
|
|
135
|
+
Style/TernaryParentheses:
|
|
136
|
+
Enabled: true
|
|
137
|
+
EnforcedStyle: require_parentheses_when_complex
|
|
138
|
+
|
|
139
|
+
# ケツカンマは付けない (Array / Hash リテラルと揃える)
|
|
140
|
+
# omakase は引数側の cop を有効化しないため Enabled: true が必要
|
|
141
|
+
Style/TrailingCommaInArguments:
|
|
142
|
+
Enabled: true
|
|
143
|
+
EnforcedStyleForMultiline: no_comma
|
|
144
|
+
|
|
145
|
+
# attr_xxx は可読性から並べて書きたい
|
|
146
|
+
Style/AccessorGrouping:
|
|
147
|
+
Enabled: true
|
|
148
|
+
EnforcedStyle: separated
|
|
149
|
+
|
|
150
|
+
# 1_000_000 と区切り文字が 1個以上必要になる場合のみ _ 区切りを必須にする
|
|
151
|
+
Style/NumericLiterals:
|
|
152
|
+
Enabled: true
|
|
153
|
+
MinDigits: 4
|
|
154
|
+
|
|
155
|
+
# --- Layout ---
|
|
156
|
+
|
|
157
|
+
# 現代のディスプレイはそんなに狭くない
|
|
158
|
+
Layout/LineLength:
|
|
159
|
+
Enabled: true
|
|
160
|
+
Max: 200
|
|
161
|
+
|
|
162
|
+
# メソッドをグループ分けして書き順を揃えておくと読みやすくなる
|
|
163
|
+
Layout/ClassStructure:
|
|
164
|
+
Enabled: true
|
|
165
|
+
|
|
166
|
+
# ハッシュの並びは揃えたい
|
|
167
|
+
Layout/HashAlignment:
|
|
168
|
+
Enabled: true
|
|
169
|
+
EnforcedHashRocketStyle: table
|
|
170
|
+
EnforcedColonStyle: table
|
|
171
|
+
|
|
172
|
+
# メソッドチェーン感がより感じられるインデントにする
|
|
173
|
+
Layout/MultilineMethodCallIndentation:
|
|
174
|
+
Enabled: true
|
|
175
|
+
EnforcedStyle: indented_relative_to_receiver
|
|
176
|
+
|
|
177
|
+
# ({ と hash を開始した場合に ( の位置にインデントさせる
|
|
178
|
+
Layout/FirstArrayElementIndentation:
|
|
179
|
+
Enabled: true
|
|
180
|
+
EnforcedStyle: consistent
|
|
181
|
+
|
|
182
|
+
# --- Naming ---
|
|
183
|
+
|
|
184
|
+
# 番号系はスネークケース (xxx_1) で記載した方が可読性が上がる
|
|
185
|
+
Naming/VariableNumber:
|
|
186
|
+
Enabled: true
|
|
187
|
+
EnforcedStyle: snake_case
|
|
188
|
+
|
|
189
|
+
# --- Metrics ---
|
|
190
|
+
# gem なので Rails アプリより厳しめでも回るが、まずは移植元の値を踏襲する
|
|
191
|
+
|
|
192
|
+
Metrics/AbcSize:
|
|
193
|
+
Enabled: true
|
|
194
|
+
Max: 30
|
|
195
|
+
|
|
196
|
+
Metrics/CyclomaticComplexity:
|
|
197
|
+
Enabled: true
|
|
198
|
+
Max: 10
|
|
199
|
+
|
|
200
|
+
# 分岐の数。ガード句を多用していると既定の 7 だと厳しい
|
|
201
|
+
Metrics/PerceivedComplexity:
|
|
202
|
+
Enabled: true
|
|
203
|
+
Max: 10
|
|
204
|
+
|
|
205
|
+
Metrics/MethodLength:
|
|
206
|
+
Enabled: true
|
|
207
|
+
CountComments: false
|
|
208
|
+
Max: 30
|
|
209
|
+
|
|
210
|
+
Metrics/ClassLength:
|
|
211
|
+
Enabled: true
|
|
212
|
+
CountComments: false
|
|
213
|
+
Max: 300
|
|
214
|
+
|
|
215
|
+
Metrics/ModuleLength:
|
|
216
|
+
Enabled: true
|
|
217
|
+
CountComments: false
|
|
218
|
+
Max: 300
|
|
219
|
+
|
|
220
|
+
# spec と gemspec は巨大な block 不可避なので除外
|
|
221
|
+
Metrics/BlockLength:
|
|
222
|
+
Enabled: true
|
|
223
|
+
Exclude:
|
|
224
|
+
- 'spec/**/*.rb'
|
|
225
|
+
- '*.gemspec'
|
|
226
|
+
|
|
227
|
+
# #####################################################################################################################
|
|
228
|
+
# RSpec
|
|
229
|
+
# (RSpec 部門は omakase の対象外なので既定で有効。設定はそのまま効く)
|
|
230
|
+
# #####################################################################################################################
|
|
231
|
+
|
|
232
|
+
# 日本語だと「〜の場合」になるので suffix でないと対応できない
|
|
233
|
+
RSpec/ContextWording:
|
|
234
|
+
Enabled: false
|
|
235
|
+
|
|
236
|
+
# it の中に複数の expect があることを許可する
|
|
237
|
+
RSpec/MultipleExpectations:
|
|
238
|
+
Enabled: false
|
|
239
|
+
|
|
240
|
+
# it が長くなることを許可する
|
|
241
|
+
RSpec/ExampleLength:
|
|
242
|
+
Enabled: false
|
|
243
|
+
|
|
244
|
+
# let の数の上限。割と大きくしていいかと
|
|
245
|
+
RSpec/MultipleMemoizedHelpers:
|
|
246
|
+
Max: 20
|
|
247
|
+
|
|
248
|
+
# ネストは 5 までは許容
|
|
249
|
+
RSpec/NestedGroups:
|
|
250
|
+
Max: 5
|
|
251
|
+
|
|
252
|
+
# it が一つしか無いような context では空行を開ける方が読みづらい
|
|
253
|
+
RSpec/EmptyLineAfterFinalLet:
|
|
254
|
+
Enabled: false
|
|
255
|
+
|
|
256
|
+
# block の方がテスト対象が目立ち、普段書く形と同じなので自然に読める
|
|
257
|
+
RSpec/ExpectChange:
|
|
258
|
+
EnforcedStyle: block
|
|
259
|
+
|
|
260
|
+
# one-liner の should は書きやすく意味も通るので撥ねる必要がない
|
|
261
|
+
RSpec/ImplicitExpect:
|
|
262
|
+
Enabled: false
|
|
263
|
+
|
|
264
|
+
# before の方が事前条件を整えていることが分かりやすい
|
|
265
|
+
RSpec/InstanceVariable:
|
|
266
|
+
Enabled: false
|
|
267
|
+
|
|
268
|
+
# ブロックの方が見た目がスッキリして見やすいので、どちらでもお好きにどうぞ
|
|
269
|
+
RSpec/ReturnFromStub:
|
|
270
|
+
Enabled: false
|
|
271
|
+
|
|
272
|
+
# どうしても使用しなければならない場面がある
|
|
273
|
+
RSpec/AnyInstance:
|
|
274
|
+
Enabled: false
|
|
275
|
+
|
|
276
|
+
# subject に名前をつけない方が読みやすい場面もある
|
|
277
|
+
RSpec/NamedSubject:
|
|
278
|
+
Enabled: false
|
|
279
|
+
|
|
280
|
+
# データ作成では並べて記述した方が可読性が上がる場合がある
|
|
281
|
+
RSpec/LetSetup:
|
|
282
|
+
Enabled: false
|
|
283
|
+
|
|
284
|
+
# spec を適度に分割したいためチェックはいらない
|
|
285
|
+
RSpec/SpecFilePathFormat:
|
|
286
|
+
Enabled: false
|
|
287
|
+
|
|
288
|
+
RSpec/SpecFilePathSuffix:
|
|
289
|
+
Enabled: false
|
|
290
|
+
|
|
291
|
+
# receive はまとめたくない
|
|
292
|
+
RSpec/ReceiveMessages:
|
|
293
|
+
Enabled: false
|
|
294
|
+
|
|
295
|
+
# ジェネレータのspecはdescribeにクラスを渡せない。
|
|
296
|
+
# type: :generator を付けたspecを対象外にする
|
|
297
|
+
RSpec/DescribeClass:
|
|
298
|
+
IgnoredMetadata:
|
|
299
|
+
type:
|
|
300
|
+
- generator
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official email address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
[INSERT CONTACT METHOD].
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
|
86
|
+
actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
+
ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
+
community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.1, available at
|
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by
|
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
123
|
+
|
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
127
|
+
|
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SrDecentWorks
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YutakaMizomoto
|
|
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.
|