lib/tileset_tooling/utils.rb in tileset_tooling-0.0.2 vs lib/tileset_tooling/utils.rb in tileset_tooling-0.1.0
- old
+ new
@@ -1,26 +1,9 @@
# Copyright (c) 2020 Jean-Sebastien Gelinas, see LICENSE.txt
# frozen_string_literal: true
-require 'mini_magick'
-
-# A few random utilities
+# Module containing a few random utilities
module ::TilesetTooling::Utils
- module_function
-
- # Generate a signature from the image data
- def image_signature(image_path)
- ::MiniMagick::Tool::Identify.new do |identity|
- identity.quiet
- identity.format('%#\\n')
- identity << image_path
- end
- end
-
- # Gets the path to the spec file that should go with the given image
- def image_spec_file_path(image_path)
- file_name = ::File.basename(image_path, '.*')
- directory = ::File.dirname(image_path)
-
- "#{directory}/#{file_name}.specs"
- end
end
+
+require 'tileset_tooling/utils/common'
+require 'tileset_tooling/utils/specs_loader'