Added .rubocop.yml, sync.

This commit is contained in:
2020-12-14 16:07:43 -06:00
parent a1aa9a3396
commit 22ab122604
4 changed files with 14 additions and 6 deletions

8
.rubocop.yml Normal file
View File

@@ -0,0 +1,8 @@
Style/StringLiterals:
EnforcedStyle: double_quotes
Metrics/MethodLength:
Max: 40
Style/EmptyMethod:
EnforcedStyle: expanded

View File

@@ -6,9 +6,9 @@ module TAC
@titlebar.style.background = [ Palette::TACNET_PRIMARY, Palette::TACNET_SECONDARY ]
background Gosu::Color::GRAY
label @options[:message]
label @options[:message], width: 1.0
@sound = Gosu::Sample.new(TAC::ROOT_PATH + "/media/error_alarm.ogg").play(1, 1, true)
@sound = Gosu::Sample.new("#{TAC::ROOT_PATH}/media/error_alarm.ogg").play(1, 1, true)
button "Close", width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
close

View File

@@ -40,7 +40,7 @@ class NewEditor < CyberarmEngine::GuiState
end
button get_image("#{TAC::ROOT_PATH}/media/icons/larger.png"), tip: "Maximize", image_height: 1.0 do |btn|
window.maximize
window.maximize if window.respond_to?(:maximize)
end
button get_image("#{TAC::ROOT_PATH}/media/icons/cross.png"), tip: "Exit", image_height: 1.0, **TAC::THEME_DANGER_BUTTON do

View File

@@ -41,15 +41,15 @@ module TAC
net_stats += "<b>Data Received:</b> #{client.data_received} bytes\n"
"<b>Status:</b> #{_status}\n\n#{net_stats}"
elsif @connection && @connection.client && @connection.client.socket_error?
"<b>Status:</b> #{_status}\n\n#{@connection.client.last_socket_error.to_s.chars.each_slice(80).to_a.map { |c| c.join }.join("\n")}"
elsif @connection&.client && @connection.client.socket_error?
"<b>Status:</b> #{_status}\n\n#{@connection.client.last_socket_error.to_s}"
else
"<b>Status:</b> #{_status}"
end
end
def connected?
@connection && @connection.connected?
@connection&.connected?
end
def close