lib/ttfunk/reader.rb in ttfunk-1.7.0 vs lib/ttfunk/reader.rb in ttfunk-1.8.0

- old
+ new

@@ -1,8 +1,10 @@ # frozen_string_literal: true module TTFunk + # Helper methods to read form file content. + # @api rpivate module Reader private def io @file.contents @@ -21,11 +23,11 @@ end def parse_from(position) saved = io.pos io.pos = position - result = yield position + result = yield(position) io.pos = saved result end # For debugging purposes @@ -34,14 +36,14 @@ bytes.each_with_index do |c, i| printf('%02X', c) if ((i + 1) % 16).zero? puts elsif ((i + 1) % 8).zero? - print ' ' + print(' ') else - print ' ' + print(' ') end end - puts unless (bytes.length % 16).zero? + puts if (bytes.length % 16) != 0 end end end