-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto corrected by following Format Ruby Code #749
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,7 @@ | |
end | ||
|
||
if @плодъ != плодъ | ||
raise "Плодна Страза со значенꙇемъ '#{@плодъ}' должна имѣти значенꙇе " \ | ||
"'#{плодъ}'" | ||
raise "Плодна Страза со значенꙇемъ '#{@плодъ}' должна имѣти значенꙇе '#{плодъ}'" | ||
end | ||
end | ||
|
||
|
@@ -257,7 +256,8 @@ | |
end | ||
|
||
То(/^исключение невѣрнѣ опции вызвано будетъ$/) do | ||
expect { @проц.call }.to raise_error(Rdoba::Mixin::InvalidOption) | ||
expect { @проц.call } | ||
.to raise_error(Rdoba::Mixin::InvalidOption) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/DotPosition: Place the . on the previous line, together with the method call receiver. |
||
end | ||
|
||
# #!/usr/bin/ruby -KU | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
|
||
module MixinSupport | ||
def random_string(count) | ||
Random.new.bytes((count + 1) / 2).split('').map do |b| b.ord.to_s(16)end.join[0...count] | ||
Random.new.bytes((count + 1) / 2).split('').map do |b| b.ord.to_s(16) end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
.join[0...count] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/DotPosition: Place the . on the previous line, together with the method call receiver. |
||
end | ||
|
||
def tmpfile | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ class Hash | |
def geta_value(cid, options = {}) | ||
res = | ||
(!cid || cid.empty?) && self || self[cid] || | ||
(options[:сокр] && (self[options[:сокр][cid]] || self[options[:сокр].reverse[cid]])) | ||
(options[:сокр] && (self[options[:сокр][cid]] || self[options[:сокр].reverse[cid]])) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [90/80] |
||
|
||
if !res and options[:try_regexp] | ||
keys.each do |key| | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
class Object | ||
def blank? | ||
case self | ||
when NilClass, FalseClass | ||
true | ||
when TrueClass | ||
false | ||
when Hash, Array | ||
!self.any? | ||
else | ||
self.to_s == "" | ||
end | ||
end | ||
def blank? | ||
case self | ||
when NilClass, FalseClass | ||
true | ||
when TrueClass | ||
false | ||
when Hash, Array | ||
!self.any? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/InverseMethods: Use none? instead of inverting any?. |
||
else | ||
self.to_s == "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/RedundantSelf: Redundant self detected. |
||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,28 @@ | |
# frozen_string_literal: true | ||
|
||
class Array | ||
public | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lint/UselessAccessModifier: Useless public access modifier. |
||
|
||
def each_comby(*args) | ||
return self if empty? or !block_given? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/AndOr: Use || instead of or. |
||
|
||
if args.include?(:backward) | ||
yield [dup] | ||
((1 << (size - 1)) - 2).downto(0) do |i| | ||
c = __comby(i, size - 1) | ||
yield c | ||
end | ||
else | ||
0.upto((1 << (size - 1)) - 2) do |i| | ||
c = __comby(i, size - 1) | ||
yield c | ||
end | ||
yield [dup] | ||
end | ||
|
||
self | ||
end | ||
|
||
private | ||
|
||
def __comby(i, size) | ||
|
@@ -36,26 +58,4 @@ def up0(v) | |
up0(v) if v[:c0] > 1 | ||
v[:res] | ||
end | ||
|
||
public | ||
|
||
def each_comby(*args) | ||
return self if empty? or !block_given? | ||
|
||
if args.include?(:backward) | ||
yield [dup] | ||
((1 << (size - 1)) - 2).downto(0) do |i| | ||
c = __comby(i, size - 1) | ||
yield c | ||
end | ||
else | ||
0.upto((1 << (size - 1)) - 2) do |i| | ||
c = __comby(i, size - 1) | ||
yield c | ||
end | ||
yield [dup] | ||
end | ||
|
||
self | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ def parse_opts(opts) | |
end | ||
|
||
def apply_opts(opts) | ||
parse_opts(opts).each do |x, y| instance_variable_set("@#{x}".to_sym, y)end | ||
parse_opts(opts).each do |x, y| instance_variable_set("@#{x}".to_sym, y) end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/BlockDelimiters: Prefer {...} over do...end for single-line blocks. |
||
end | ||
end | ||
|
||
|
@@ -103,7 +103,7 @@ def -(other) | |
(0...len).each do |idx| | ||
break bc = idx if self[idx] == other[0] | ||
end | ||
((bc + 1)...len).each do |idx| break ec = idx if self[idx] != other[idx - bc]end if bc | ||
((bc + 1)...len).each do |idx| break ec = idx if self[idx] != other[idx - bc] end if bc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/BlockDelimiters: Prefer {...} over do...end for single-line blocks. |
||
bc ? ec ? self[0, bc] + self[ec, len - ec] : self[0, bc] : clone | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
warn "Warning: the module has kept only for backward compatibility\n" \ | ||
"Please use 'rdoba :log' form instead" | ||
warn "Warning: the module has kept only for backward compatibility\nPlease use 'rdoba :log' form instead" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [105/80] |
||
|
||
require 'rdoba/log' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,12 @@ def sprintf(format, *args) | |
indent = ' ' * (Regexp.last_match(2) == '*' ? args.shift : Regexp.last_match(2)).to_i | ||
plain = | ||
value && | ||
value.to_p( | ||
padding: | ||
(Regexp.last_match(3) == '*' ? args.shift : Regexp.last_match(3).empty? ? 1 : Regexp.last_match(3)) | ||
.to_i, | ||
be: Regexp.last_match(4).empty? ? nil : true | ||
) || '' | ||
value.to_p( | ||
padding: | ||
(Regexp.last_match(3) == '*' ? args.shift : Regexp.last_match(3).empty? ? 1 : Regexp.last_match(3)) | ||
.to_i, | ||
be: Regexp.last_match(4).empty? ? nil : true | ||
) || '' | ||
nformat += (Regexp.last_match(1) ? plain + indent : indent + plain) + str | ||
else | ||
nformat += '%' + keys + 'c' + str | ||
|
@@ -63,32 +63,32 @@ def scanf_re(format) | |
# TODO add performing the special case in fss[1] | ||
nformat += | ||
fss.pre_match[pos..-1].to_res + | ||
case fss[4] | ||
when 'x' | ||
'(?:0[xX])?([a-fA-F0-9]+)' | ||
when 'i' | ||
'([+\-]?[0-9]+)' | ||
when 'u' | ||
'([0-9]+)' | ||
when 'e' | ||
'([+\-]?[0-9]+[eE][+\-]?[0-9]+)' | ||
when 'f' | ||
'([+\-]?[0-9]+\.[0-9]*)' | ||
when 'g' | ||
'([+\-]?[0-9]+(?:[eE][+\-]?[0-9]+|\.[0-9]*))' | ||
when 'c' | ||
fss[2] ? "(.{1,#{fss[2]}})" : '(.)' | ||
when 'b' | ||
'([01]+)b?' | ||
when 'o' | ||
'0([0-9]+)' | ||
when 'd' | ||
'([+\-]?(?:0X)?[A-F0-9.+]+)' | ||
when 's' | ||
'(.+)' | ||
when 'r' | ||
'([IVXLCDMivxlcdm]+)' | ||
end | ||
case fss[4] | ||
when 'x' | ||
'(?:0[xX])?([a-fA-F0-9]+)' | ||
when 'i' | ||
'([+\-]?[0-9]+)' | ||
when 'u' | ||
'([0-9]+)' | ||
when 'e' | ||
'([+\-]?[0-9]+[eE][+\-]?[0-9]+)' | ||
when 'f' | ||
'([+\-]?[0-9]+\.[0-9]*)' | ||
when 'g' | ||
'([+\-]?[0-9]+(?:[eE][+\-]?[0-9]+|\.[0-9]*))' | ||
when 'c' | ||
fss[2] ? "(.{1,#{fss[2]}})" : '(.)' | ||
when 'b' | ||
'([01]+)b?' | ||
when 'o' | ||
'0([0-9]+)' | ||
when 'd' | ||
'([+\-]?(?:0X)?[A-F0-9.+]+)' | ||
when 's' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
'(.+)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
when 'r' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
'([IVXLCDMivxlcdm]+)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
|
||
pos = fss.pos | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/AsciiIdentifiers: Use only ascii symbols in identifiers.
Metrics/LineLength: Line is too long. [84/80]