Skip to content

Commit 1008621

Browse files
authored
DEV: Remove unnecessary array allocation (#127)
Follow up to 3f03588
1 parent 3f03588 commit 1008621

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/collector

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
Process.setproctitle("discourse prometheus-collector")
55

6-
["prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}"].each do |spec_name|
7-
spec_file =
8-
File.expand_path("../../gems/#{RUBY_VERSION}/specifications/#{spec_name}.gemspec", __FILE__)
9-
spec = Gem::Specification.load(spec_file)
10-
spec.activate
11-
end
6+
spec_file =
7+
File.expand_path(
8+
"../../gems/#{RUBY_VERSION}/specifications/#{"prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}"}.gemspec",
9+
__FILE__,
10+
)
11+
12+
spec = Gem::Specification.load(spec_file)
13+
spec.activate
1214

1315
require "oj"
1416
require "prometheus_exporter"

0 commit comments

Comments
 (0)