Skip to content

Commit

Permalink
Correct Style/RedundantRegexpArgument offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jan 21, 2024
1 parent 5fa9315 commit f3a3546
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/riemann/tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def options

def attributes
@attributes ||= Hash[options[:attribute].map do |attr|
k, v = attr.split(/=/)
k, v = attr.split('=')
[k, v] if k && v
end]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/riemann/tools/diskstats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def tick
next unless service =~ /io time$/

report(
service: "diskstats #{service.gsub(/time/, 'util')}",
service: "diskstats #{service.gsub('time', 'util')}",
metric: (delta.to_f / (opts[:interval] * 1000)),
state: 'ok',
)
Expand Down
2 changes: 1 addition & 1 deletion lib/riemann/tools/health.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def linux_load
end

def linux_memory
m = File.read('/proc/meminfo').split(/\n/).each_with_object({}) do |line, info|
m = File.read('/proc/meminfo').split("\n").each_with_object({}) do |line, info|
x = line.split(/:?\s+/)
# Assume kB...
info[x[0]] = x[1].to_i
Expand Down
2 changes: 1 addition & 1 deletion tools/riemann-docker/lib/riemann/tools/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def memory(_id, name, stats)
end

def disk
`df -P`.split(/\n/).each do |r|
`df -P`.split("\n").each do |r|
f = r.split(/\s+/)
next if f[0] == 'Filesystem'
next unless f[0] =~ %r{/} # Needs at least one slash in the mount path
Expand Down
2 changes: 1 addition & 1 deletion tools/riemann-riak/lib/riemann/tools/riak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def stats_riak_admin
str = `riak-admin status`
raise 'riak-admin failed' unless $CHILD_STATUS == 0

Hash[str.split(/\n/).map { |i| i.split(/ : /) }]
Hash[str.split("\n").map { |i| i.split(' : ') }]
end

# Get current stats as a hash
Expand Down

0 comments on commit f3a3546

Please sign in to comment.