Skip to content

Commit b5b3430

Browse files
committed
fix spaces around operators (RuboCop)
1 parent 591c67b commit b5b3430

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

lib/coderay/scanners/c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class C < Scanner
3737
add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
3838

3939
ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
40-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
40+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
4141

4242
protected
4343

lib/coderay/scanners/cpp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CPlusPlus < Scanner
4949
add(PREDEFINED_CONSTANTS, :predefined_constant) # :nodoc:
5050

5151
ESCAPE = / [rbfntv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
52-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
52+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
5353

5454
protected
5555

lib/coderay/scanners/diff.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def scan_tokens encoder, options
109109
for deleted_line, inserted_line in deleted_lines.zip(inserted_lines)
110110
pre, deleted_part, inserted_part, post = diff deleted_line, inserted_line
111111
content_scanner_entry_state = content_scanner.state
112-
deleted_lines_tokenized << content_scanner.tokenize([pre, deleted_part, post], :tokens => Tokens.new)
112+
deleted_lines_tokenized << content_scanner.tokenize([pre, deleted_part, post], :tokens => Tokens.new)
113113
content_scanner.state = content_scanner_entry_state || :initial
114114
inserted_lines_tokenized << content_scanner.tokenize([pre, inserted_part, post], :tokens => Tokens.new)
115115
end
@@ -212,7 +212,7 @@ def diff a, b
212212
# does not precede the leftmost one from the left.
213213
j = -1
214214
j -= 1 while j >= j_min && a[j] == b[j]
215-
return a[0...i], a[i..j], b[i..j], (j < -1) ? a[j+1..-1] : ''
215+
return a[0...i], a[i..j], b[i..j], (j < -1) ? a[j + 1..-1] : ''
216216
end
217217

218218
end

lib/coderay/scanners/groovy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class Groovy < Java
2222
add(GROOVY_MAGIC_VARIABLES, :local_variable) # :nodoc:
2323

2424
ESCAPE = / [bfnrtv$\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
25-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # :nodoc: no 4-byte unicode chars? U[a-fA-F0-9]{8}
26-
REGEXP_ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x # :nodoc:
25+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} /x # :nodoc: no 4-byte unicode chars? U[a-fA-F0-9]{8}
26+
REGEXP_ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} | \d | [bBdDsSwW\/] /x # :nodoc:
2727

2828
# TODO: interpretation inside ', ", /
2929
STRING_CONTENT_PATTERN = {

lib/coderay/scanners/java.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Java < Scanner
3838
add(DIRECTIVES, :directive) # :nodoc:
3939

4040
ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
41-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
41+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
4242
STRING_CONTENT_PATTERN = {
4343
"'" => /[^\\']+/,
4444
'"' => /[^\\"]+/,

lib/coderay/scanners/java_script.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class JavaScript < Scanner
4040
add(KEYWORDS, :keyword) # :nodoc:
4141

4242
ESCAPE = / [bfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
43-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
44-
REGEXP_ESCAPE = / [bBdDsSwW] /x # :nodoc:
43+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} /x # :nodoc:
44+
REGEXP_ESCAPE = / [bBdDsSwW] /x # :nodoc:
4545
STRING_CONTENT_PATTERN = {
4646
"'" => /[^\\']+/,
4747
'"' => /[^\\"]+/,

lib/coderay/scanners/python.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Python < Scanner
6363

6464
NAME = / [[:alpha:]_] \w* /x # :nodoc:
6565
ESCAPE = / [abfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc:
66-
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x # :nodoc:
66+
UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x # :nodoc:
6767

6868
OPERATOR = /
6969
\.\.\. | # ellipsis

lib/coderay/scanners/ruby/patterns.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Ruby::Patterns # :nodoc: all
6060

6161
QUOTE_TO_TYPE = {
6262
'`' => :shell,
63-
'/'=> :regexp,
63+
'/' => :regexp,
6464
}
6565
QUOTE_TO_TYPE.default = :string
6666

rake_tasks/code_statistics.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def print_code_test_stats
156156
code = calculate_code
157157
tests = calculate_tests
158158

159-
puts " Code LOC = #{code} Test LOC = #{tests} Code:Test Ratio = [1 : #{sprintf("%.2f", tests.to_f/code)}]"
159+
puts " Code LOC = #{code} Test LOC = #{tests} Code:Test Ratio = [1 : #{sprintf("%.2f", tests.to_f / code)}]"
160160
puts ""
161161
end
162162

0 commit comments

Comments
 (0)