Module: ModpackLocalizer::SNBT::DescriptionExtractor

Includes:
IndentHelper
Included in:
Reader
Defined in:
lib/modpack_localizer/snbt/description_extractor.rb

Overview

SNBT形式のファイルからdescription: [“some description”]を抽出するモジュール

Instance Method Summary collapse

Methods included from IndentHelper

#count_indent, #create_indent, #middle_indent

Instance Method Details

#extract_descriptions(file_path) ⇒ Array<Hash>

description: [“some description”]を抽出する

Parameters:

  • file_path (String)

    ファイルのパス

Returns:

  • (Array<Hash>)

    説明、開始行番号、終了行番号の配列



13
14
15
16
# File 'lib/modpack_localizer/snbt/description_extractor.rb', line 13

def extract_descriptions(file_path)
  lines = File.readlines(file_path)
  extract_from_file(lines)
end