From 70a03dc88f2112df711d1a2ffcd45740dcdd990d Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 5 Nov 2022 17:27:13 +0100 Subject: [PATCH] rubocop -A lib/packet.rb --- lib/packet.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/packet.rb b/lib/packet.rb index 1559e6e..99bf566 100644 --- a/lib/packet.rb +++ b/lib/packet.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'huffman_tw' class PacketFlags @@ -70,14 +72,14 @@ class Packet token = bytes[3..6].join(' ').green payload = bytes[7..].join(' ') puts @prefix + " data: #{[header, token, payload].join(' ')}" - print @prefix + ' ' + print "#{@prefix} " print 'header'.ljust(3 * 3, ' ').yellow print 'token'.ljust(4 * 3, ' ').green puts 'data' end def to_s - puts @prefix + 'Packet' + puts "#{@prefix}Packet" puts @prefix + " flags: #{@flags}" bytes = str_hex(@data).split(' ') # TODO: check terminal size? @@ -85,7 +87,7 @@ class Packet rows = bytes.groups_of(max_width) annotate_first_row(rows.first) rows[1..].each do |row| - print @prefix + ' ' + print "#{@prefix} " puts row.join(' ') end puts ''