Skip to content

Commit 8a50e85

Browse files
committed
Merge pull request #253 from mynameisrufus/rubocop-fix/space-after-comma
fix space after comma
2 parents 6e5348f + 8572cac commit 8a50e85

File tree

9 files changed

+15
-28
lines changed

9 files changed

+15
-28
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -529,19 +529,6 @@ Style/SingleSpaceBeforeFirstArg:
529529
- 'lib/net/ldap/dataset.rb'
530530
- 'lib/net/ldap/instrumentation.rb'
531531

532-
# Offense count: 24
533-
# Cop supports --auto-correct.
534-
Style/SpaceAfterComma:
535-
Exclude:
536-
- 'lib/net/ber/core_ext/integer.rb'
537-
- 'lib/net/ber/core_ext/string.rb'
538-
- 'lib/net/ldap/dataset.rb'
539-
- 'lib/net/ldap/entry.rb'
540-
- 'lib/net/snmp.rb'
541-
- 'test/ber/core_ext/test_array.rb'
542-
- 'test/ber/test_ber.rb'
543-
- 'test/test_dn.rb'
544-
545532
# Offense count: 2
546533
# Cop supports --auto-correct.
547534
# Configuration parameters: EnforcedStyle, SupportedStyles.

lib/net/ber/core_ext/integer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def to_ber_length_encoding
2020
if self <= 127
2121
[self].pack('C')
2222
else
23-
i = [self].pack('N').sub(/^[\0]+/,"")
23+
i = [self].pack('N').sub(/^[\0]+/, "")
2424
[0x80 + i.length].pack('C') + i
2525
end
2626
end

lib/net/ber/core_ext/string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ def read_ber!(syntax = nil)
7575
end
7676

7777
def reject_empty_ber_arrays
78-
self.gsub(/0\000/n,'')
78+
self.gsub(/0\000/n, '')
7979
end
8080
end

lib/net/ldap/dataset.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def read_ldif(io)
141141
# $' is the dn-value
142142
# Avoid the Base64 class because not all Ruby versions have it.
143143
dn = ($1 == ":") ? $'.unpack('m').shift : $'
144-
ds[dn] = Hash.new { |k,v| k[v] = [] }
144+
ds[dn] = Hash.new { |k, v| k[v] = [] }
145145
yield :dn, dn if block_given?
146146
elsif line.empty?
147147
dn = nil

lib/net/ldap/entry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def attribute_names
142142
def each # :yields: attribute-name, data-values-array
143143
if block_given?
144144
attribute_names.each do|a|
145-
attr_name,values = a,self[a]
145+
attr_name, values = a, self[a]
146146
yield attr_name, values
147147
end
148148
end

lib/net/snmp.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def parse_get_request data
148148
# data[2] is error_index, always zero.
149149
send :error_status=, 0
150150
send :error_index=, 0
151-
data[3].each do |n,v|
151+
data[3].each do |n, v|
152152
# A variable-binding, of which there may be several,
153153
# consists of an OID and a BER null.
154154
# We're ignoring the null, we might want to verify it instead.
@@ -166,7 +166,7 @@ def parse_get_response data
166166
send :request_id=, data[0].to_i
167167
send :error_status=, data[1].to_i
168168
send :error_index=, data[2].to_i
169-
data[3].each do |n,v|
169+
data[3].each do |n, v|
170170
# A variable-binding, of which there may be several,
171171
# consists of an OID and a BER null.
172172
# We're ignoring the null, we might want to verify it instead.
@@ -177,7 +177,7 @@ def parse_get_response data
177177

178178

179179
def version= ver
180-
unless [0,2].include?(ver)
180+
unless [0, 2].include?(ver)
181181
raise Error.new("unknown snmp-version: #{ver}")
182182
end
183183
@version = ver
@@ -227,7 +227,7 @@ def pdu_to_ber_string
227227
error_status.to_ber,
228228
error_index.to_ber,
229229
[
230-
@variables.map do|n,v|
230+
@variables.map do|n, v|
231231
[n.to_ber_oid, Net::BER::BerIdentifiedNull.new.to_ber].to_ber_sequence
232232
end
233233
].to_ber_sequence
@@ -238,7 +238,7 @@ def pdu_to_ber_string
238238
error_status.to_ber,
239239
error_index.to_ber,
240240
[
241-
@variables.map do|n,v|
241+
@variables.map do|n, v|
242242
[n.to_ber_oid, Net::BER::BerIdentifiedNull.new.to_ber].to_ber_sequence
243243
end
244244
].to_ber_sequence
@@ -249,7 +249,7 @@ def pdu_to_ber_string
249249
error_status.to_ber,
250250
error_index.to_ber,
251251
[
252-
@variables.map do|n,v|
252+
@variables.map do|n, v|
253253
[n.to_ber_oid, v.to_ber].to_ber_sequence
254254
end
255255
].to_ber_sequence

test/ber/core_ext/test_array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def test_control_code_array
66
control_codes << ['1.2.3'.to_ber, true.to_ber].to_ber_sequence
77
control_codes << ['1.7.9'.to_ber, false.to_ber].to_ber_sequence
88
control_codes = control_codes.to_ber_sequence
9-
res = [['1.2.3', true],['1.7.9',false]].to_ber_control
9+
res = [['1.2.3', true], ['1.7.9', false]].to_ber_control
1010
assert_equal control_codes, res
1111
end
1212

test/ber/test_ber.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def test_empty_array
66
end
77

88
def test_array
9-
ary = [1,2,3]
9+
ary = [1, 2, 3]
1010
encoded_ary = ary.map { |el| el.to_ber }.to_ber
1111

1212
assert_equal ary, encoded_ary.read_ber

test/test_dn.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ def test_escape_on_initialize
1313

1414
def test_to_a
1515
dn = Net::LDAP::DN.new('cn=James, ou=Company\\,\\20LLC')
16-
assert_equal ['cn','James','ou','Company, LLC'], dn.to_a
16+
assert_equal ['cn', 'James', 'ou', 'Company, LLC'], dn.to_a
1717
end
1818

1919
def test_to_a_parenthesis
2020
dn = Net::LDAP::DN.new('cn = \ James , ou = "Comp\28ny" ')
21-
assert_equal ['cn',' James','ou','Comp(ny'], dn.to_a
21+
assert_equal ['cn', ' James', 'ou', 'Comp(ny'], dn.to_a
2222
end
2323

2424
def test_to_a_hash_symbol
2525
dn = Net::LDAP::DN.new('1.23.4= #A3B4D5 ,ou=Company')
26-
assert_equal ['1.23.4','#A3B4D5','ou','Company'], dn.to_a
26+
assert_equal ['1.23.4', '#A3B4D5', 'ou', 'Company'], dn.to_a
2727
end
2828

2929
# TODO: raise a more specific exception than RuntimeError

0 commit comments

Comments
 (0)