lib/icarus/mod/tools/modinfo.rb in Icarus-Mod-Tools-1.3.5 vs lib/icarus/mod/tools/modinfo.rb in Icarus-Mod-Tools-1.4.0
- old
+ new
@@ -18,22 +18,21 @@
def read(data)
@data = data.is_a?(String) ? JSON.parse(data, symbolize_names: true) : data
end
+ # rubocop:disable Naming/MethodName
+ def fileType
+ @data[:fileType] || "pak"
+ end
+ # rubocop:enable Naming/MethodName
+
def to_json(*args)
JSON.generate(@data, *args)
end
def to_h
@data || {}
- end
-
- def to_s
- format(
- "%-<name>30s %-<author>20s v%-<version>10s %<description>s",
- name:, author:, version: (version || "None"), description:
- )
end
def method_missing(method_name, *_args, &)
to_h[method_name.to_sym]&.strip
end