mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Ran rubocop autocorrect
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class ConnectCommand < Command
|
||||
@@ -14,8 +15,8 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def usage
|
||||
"Connect to a server.\n#{Style.highlight("connect")} #{Style.notice("[example.com:56789]")}"
|
||||
"Connect to a server.\n#{Style.highlight('connect')} #{Style.notice('[example.com:56789]')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class DebugCommand < Command
|
||||
@@ -39,7 +40,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def usage
|
||||
"debug\n #{@subcommands.map { |sub| sub.usage }.join("\n ")}"
|
||||
"debug\n #{@subcommands.map(&:usage).join("\n ")}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class DisconnectCommand < Command
|
||||
@@ -18,4 +19,4 @@ class IMICFPS
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class FPSCommand < Command
|
||||
@@ -12,13 +13,13 @@ class IMICFPS
|
||||
|
||||
def handle(arguments, console)
|
||||
if arguments.size > 1
|
||||
console.stdin("to many arguments for #{Style.highlight("#{command}")}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
|
||||
console.stdin("to many arguments for #{Style.highlight(command.to_s)}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
|
||||
return
|
||||
end
|
||||
|
||||
case arguments.last
|
||||
when "", nil
|
||||
console.stdin("#{Style.highlight("fps")}: #{$window.config.get(:options, :fps)}")
|
||||
console.stdin("#{Style.highlight('fps')}: #{$window.config.get(:options, :fps)}")
|
||||
when "on"
|
||||
var = $window.config[:options, :fps] = true
|
||||
console.stdin("fps => #{Style.highlight(var)}")
|
||||
@@ -26,12 +27,12 @@ class IMICFPS
|
||||
var = $window.config[:options, :fps] = false
|
||||
console.stdin("fps => #{Style.highlight(var)}")
|
||||
else
|
||||
console.stdin("Invalid argument for #{Style.highlight("#{command}")}, got #{Style.error(arguments.last)} expected #{Style.notice("on")}, or #{Style.notice("off")}.")
|
||||
console.stdin("Invalid argument for #{Style.highlight(command.to_s)}, got #{Style.error(arguments.last)} expected #{Style.notice('on')}, or #{Style.notice('off')}.")
|
||||
end
|
||||
end
|
||||
|
||||
def usage
|
||||
"#{Style.highlight("fps")} #{Style.notice("[on|off]")}"
|
||||
"#{Style.highlight('fps')} #{Style.notice('[on|off]')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class HelpCommand < Command
|
||||
@@ -21,7 +22,7 @@ class IMICFPS
|
||||
if list.size == 1
|
||||
console.text_input.text = "#{split.first} #{list.first} "
|
||||
elsif list.size > 1
|
||||
console.stdin(list.map { |cmd| Style.highlight(cmd) }.join(', '))
|
||||
console.stdin(list.map { |cmd| Style.highlight(cmd) }.join(", "))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -34,9 +35,9 @@ class IMICFPS
|
||||
"#{Style.error(command)} is not a command"
|
||||
end
|
||||
else
|
||||
"Available commands:\n#{Command.list_commands.map { |cmd| "#{Style.highlight(cmd.command)}" }.join(', ')}"
|
||||
"Available commands:\n#{Command.list_commands.map { |cmd| Style.highlight(cmd.command).to_s }.join(', ')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class ReloadShaderCommand < Command
|
||||
@@ -12,7 +13,7 @@ class IMICFPS
|
||||
|
||||
def handle(arguments, console)
|
||||
if arguments.size > 2
|
||||
console.stdin("to many arguments for #{Style.highlight("#{command}")}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
|
||||
console.stdin("to many arguments for #{Style.highlight(command.to_s)}, got #{Style.error(arguments.size)} expected #{Style.notice(1)}.")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -22,7 +23,7 @@ class IMICFPS
|
||||
|
||||
case arguments.size
|
||||
when 0
|
||||
console.stdin( usage )
|
||||
console.stdin(usage)
|
||||
return
|
||||
when 1
|
||||
name = arguments.first
|
||||
@@ -50,9 +51,9 @@ class IMICFPS
|
||||
string = $stdout.string
|
||||
|
||||
if shader.compiled?
|
||||
console.stdin("#{Style.notice("Successfully reloaded shader")}: #{shader.name}")
|
||||
console.stdin("#{Style.notice('Successfully reloaded shader')}: #{shader.name}")
|
||||
else
|
||||
console.stdin("#{Style.error("Failed to reload #{shader.name}")}")
|
||||
console.stdin(Style.error("Failed to reload #{shader.name}").to_s)
|
||||
console.stdin(string)
|
||||
end
|
||||
ensure
|
||||
@@ -61,7 +62,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def usage
|
||||
"#{Style.highlight(command)} #{Style.notice("vertex_name [fragment_name]")}"
|
||||
"#{Style.highlight(command)} #{Style.notice('vertex_name [fragment_name]')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Commands
|
||||
class RendererInfoCommand < Command
|
||||
@@ -10,7 +11,7 @@ class IMICFPS
|
||||
:renderer_info
|
||||
end
|
||||
|
||||
def handle(arguments, console)
|
||||
def handle(_arguments, console)
|
||||
console.stdin("OpenGL Vendor: #{Style.notice(glGetString(GL_VENDOR))}")
|
||||
console.stdin("OpenGL Renderer: #{Style.notice(glGetString(GL_RENDERER))}")
|
||||
console.stdin("OpenGL Version: #{Style.notice(glGetString(GL_VERSION))}")
|
||||
@@ -18,7 +19,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def usage
|
||||
"#{Style.highlight("renderer_info")} #{Style.notice("Returns OpenGL renderer information")}"
|
||||
"#{Style.highlight('renderer_info')} #{Style.notice('Returns OpenGL renderer information')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user