メインコンテンツへスキップ
Z

Ruby / Lua / Perl フォーマッター

Reindent only — not a full formatter

Ruby、Lua、Perlのソースコードを再インデントします。キーワードベースの3言語を1つのツールでまとめて処理。

無料 登録不要 クライアントサイド プライバシーに配慮 Updated

使い方

  1. 1 言語を選択します(Ruby、Lua、Perlのいずれか)。
  2. 2 ソースコードを貼り付けます。
  3. 3 インデント幅を調整します — Rubyはスペース2つが標準、LuaとPerlは2つまたは4つが使われます。
  4. 4 結果をコピーするか、ファイルとしてダウンロードします。

このツールを使う理由

  • 似たキーワード方式でブロックの開始・終了を表す3つの言語を、1つのツールでまとめてカバーします。
  • ブロック開始キーワードは言語ごとに異なります — Rubyは<code class="rounded bg-slate-100 px-1 text-xs dark:bg-slate-800">do/end</code>、Luaは<code class="rounded bg-slate-100 px-1 text-xs dark:bg-slate-800">function/end</code>、Perlは波括弧です。
  • 処理はすべてクライアント側で行われるため、コードがブラウザの外に送信されることはありません。
  • 厳密な整形結果が必要な場合は、ローカル環境でRuboCop(Ruby)、StyLua(Lua)、perltidy(Perl)を使用してください。

よくある質問

このツールはRuboCopと互換性がありますか?

いいえ — これは再インデントのみを行うツールです。RuboCopは数百ものスタイルルール(cops)を適用しますが、当ツールはブロック開始キーワードに基づくインデントルールのみを適用します。

ヒアドキュメントや文字列内挿(string interpolation)は認識されますか?

インデントは行単位で計算されるため、ヒアドキュメントの内容部分に余分な行頭スペースが追加されることがあります。ヒアドキュメントを多用するファイルには、その言語専用のフォーマッターを別途使用してください。

なぜ1つのツールで3つの言語に対応しているのですか?

ブロック構造が似ているためです — 1つのキーワードでブロックを開始し、<code class="rounded bg-slate-100 px-1 text-xs dark:bg-slate-800">end</code>または<code class="rounded bg-slate-100 px-1 text-xs dark:bg-slate-800">}</code>で閉じます。ルールエンジンは1つ、キーワードセットは3つという構成です。

Ruby / Lua / Perl フォーマッター とは?

Ruby / Lua / Perl Formatterは、Ruby、Lua、Perlのソースコードをブラウザ上で再インデントするツールです。キーワードでブロックを表す3つの言語を1つの整形エンジンにまとめ、各言語のブロック構造に基づいて一貫したインデントを適用します。処理はすべてクライアント側で完結します。

機能

Keyword-block aware

Understands `end`-terminated blocks (Ruby/Lua) and brace blocks (Perl) to indent correctly.

Three languages

Pick Ruby, Lua, or Perl — each with the right block-open and block-close rules.

100% private

Runs client-side — your source is never uploaded.

Input

class Foo
def bar(x)
return x*2
end
end

Output

class Foo
  def bar(x)
    return x*2
  end
end

主な用途

  1. 1

    Fix pasted scripts

    Repair indentation on Ruby, Lua, or Perl copied from a chat or PDF.

  2. 2

    Standardize nesting

    Apply consistent 2-space nesting across a script.

  3. 3

    Quick readability pass

    Tidy layout before sharing without a full linter setup.

概要

Zerethon's Ruby / Lua / Perl formatter reindents source in your browser, tracking keyword blocks (`def`/`do`/`end` in Ruby and Lua; braces in Perl) as well as literal brackets. It defaults to 2-space indentation. It is a lightweight reindenter, not a full RuboCop or perltidy — it fixes nesting without reflowing code. Nothing is uploaded.

カテゴリ
開発者
料金
無料
プライバシー
ブラウザベース
登録
不要

References

プライバシー

明記されない限り、データがブラウザの外に送信されることはありません。Ruby / Lua / Perl フォーマッター は完全にクライアント側で動作します — サーバーへのアップロードなし、ログなし、入力内容のトラッキングなし。

関連ツール

Zerethon Social で作成・共有・成長しよう

無料登録。ポイントを獲得し、実績を集め、世界中のクリエイターとつながりましょう。

Zerethon を無料で試す