ruby binding 追加

- FFI gem (libptouch)、exe ptouch-print-png(PNG のみ)
- ステータス 32 バイトを Hash に展開(parse_status / status_hash)
- CMake: libptouch 共有ライブラリ(ptouch_shared)
- RuboCop、gemspec(homepage / source_code_uri)

Made-with: Cursor
This commit is contained in:
knb
2026-04-12 16:06:10 +09:00
parent d649b1b014
commit c5c7c2ba52
16 changed files with 889 additions and 0 deletions

66
ruby/.rubocop.yml Normal file
View File

@@ -0,0 +1,66 @@
# RuboCop — libptouch gem
# https://docs.rubocop.org/
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
SuggestExtensions: false
Exclude:
- "vendor/**/*"
- ".bundle/**/*"
Layout/LineLength:
Max: 120
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented_relative_to_receiver
Lint/RedundantCopDisableDirective:
Severity: convention
# ステータスデコードはデータテーブル中心で行数・複雑度が大きくなりがち
Metrics/AbcSize:
Max: 60
Metrics/BlockLength:
Max: 35
Exclude:
- "**/*.gemspec"
Metrics/MethodLength:
Max: 40
Metrics/ModuleLength:
Max: 220
Metrics/ParameterLists:
Max: 6
Naming/MethodParameterName:
AllowedNames:
- "b"
- "w"
Style/Documentation:
Enabled: false
Style/DoubleNegation:
Enabled: false
# optional な環境変数の参照に fetch は不向きなことが多い
Style/FetchEnvVar:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: always
# FFI の %i[] / %w[] はそのままの方が読みやすい
Style/SymbolArray:
Enabled: false
Style/WordArray:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
ConsistentQuotesInMultiline: true