Sha256: ad381ea4d945f6e41d58d8485884872cd88b5273d438cf0343ecb603706028fc
Contents?: true
Size: 1.34 KB
Versions: 44
Compression:
Stored size: 1.34 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'ehbrs/executables' require 'ehbrs/vg/wii/wit/parsers/info' module Ehbrs module Vg module Wii module Wit class ImageFormat class << self SECTION_NAME_PATTERN = /\A#{::Regexp.quote('IMAGE-FORMAT:')}(.+)\z/.freeze enable_simple_cache def by_name(name) all.find { |i| i.name.downcase == name.to_s.downcase } || raise(::ArgumentError, "Image not found with name \"#{name.to_s.downcase}\"" \ " (Available: #{all.map(&:name).join(', ')})") end private def all_uncached ::Ehbrs::Vg::Wii::Wit::Parsers::Info.new(info_output).images.map do |_label, data| new( *%w[name info option].map { |k| data.fetch(k) }, *%w[extensions attributes].map { |k| data.fetch(k).to_s.split(/\s+/) } ) end end def info_output ::Ehbrs::Executables.wit.command .append(%w[info image-format --sections]) .execute! end end common_constructor :name, :description, :option, :extensions, :attributes end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems