Applied most Rubocop-suggested layout fixes

This commit is contained in:
Maruno17
2021-12-18 01:56:10 +00:00
parent 5dc64f1709
commit 2480ab0f9e
88 changed files with 839 additions and 783 deletions

View File

@@ -9,16 +9,14 @@ module PBDebug
PBDebug.log("**Exception: #{$!.message}")
PBDebug.log("#{$!.backtrace.inspect}")
PBDebug.log("")
# if $INTERNAL
pbPrintException($!)
# end
pbPrintException($!) # if $INTERNAL
PBDebug.flush
end
end
def self.flush
if $DEBUG && $INTERNAL && @@log.length>0
File.open("Data/debuglog.txt", "a+b") { |f| f.write("#{@@log}") }
File.open("Data/debuglog.txt", "a+b") { |f| f.write(@@log.to_s) }
end
@@log.clear
end
@@ -26,9 +24,7 @@ module PBDebug
def self.log(msg)
if $DEBUG && $INTERNAL
@@log.push("#{msg}\r\n")
# if @@log.length>1024
PBDebug.flush
# end
PBDebug.flush # if @@log.length > 1024
end
end

View File

@@ -1,7 +1,7 @@
# The Kernel module is extended to include the validate method.
module Kernel
private
# Used to check whether method arguments are of a given class or respond to a method.
# @param value_pairs [Hash{Object => Class, Array<Class>, Symbol}] value pairs to validate
# @example Validate a class or method

View File

@@ -10,7 +10,7 @@ class Dir
filters = [filters] if !filters.is_a?(Array)
self.chdir(dir) do
for filter in filters
self.glob(filter){ |f| files.push(full ? (dir + "/" + f) : f) }
self.glob(filter) { |f| files.push(full ? (dir + "/" + f) : f) }
end
end
return files.sort
@@ -294,7 +294,7 @@ end
# NOTE: load_data checks anything added in MKXP's RTP setting,
# and matching mount points added through System.mount
def pbRgssOpen(file,mode=nil)
#File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") }
# File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") }
if !safeExists?("./Game.rgssad")
if block_given?
File.open(file,mode) { |f| yield f }
@@ -374,7 +374,7 @@ class StringInput
include Enumerable
class << self
def new( str )
def new(str)
if block_given?
begin
f = super
@@ -389,7 +389,7 @@ class StringInput
alias open new
end
def initialize( str )
def initialize(str)
@string = str
@pos = 0
@closed = false
@@ -440,7 +440,7 @@ class StringInput
@pos > @string.size
end
def each( &block )
def each(&block)
raise IOError, 'closed stream' if @closed
begin
@string.each(&block)
@@ -453,11 +453,11 @@ class StringInput
raise IOError, 'closed stream' if @closed
if idx = @string.index(?\n, @pos)
idx += 1 # "\n".size
line = @string[ @pos ... idx ]
line = @string[@pos...idx]
@pos = idx
@pos += 1 if @pos == @string.size
else
line = @string[ @pos .. -1 ]
line = @string[@pos..-1]
@pos = @string.size + 1
end
@lineno += 1
@@ -472,11 +472,11 @@ class StringInput
ch
end
def read( len = nil )
def read(len = nil)
raise IOError, 'closed stream' if @closed
if !len
return nil if eof?
rest = @string[@pos ... @string.size]
rest = @string[@pos...@string.size]
@pos = @string.size + 1
return rest
end

View File

@@ -373,11 +373,11 @@ class Messages
def self.stringToKey(str)
if str && str[/[\r\n\t\1]|^\s+|\s+$|\s{2,}/]
key=str.clone
key.gsub!(/^\s+/,"")
key.gsub!(/\s+$/,"")
key.gsub!(/\s{2,}/," ")
return key
key = str.clone
key.gsub!(/^\s+/, "")
key.gsub!(/\s+$/, "")
key.gsub!(/\s{2,}/, " ")
return key
end
return str
end

View File

@@ -9,13 +9,13 @@ class SpriteAnimation
%w[
x y ox oy viewport flash src_rect opacity tone
].each_with_index do |s, _i|
eval <<-__END__
eval <<-__END__
def #{s}(*arg)
@sprite.#{s}(*arg)
end
__END__
__END__
end
def self.clear