Skip to content

Commit cb505cb

Browse files
authored
Merge pull request #15 from bigcommerce/fix-base-ruby3
Fix keywords argument issue with Collectors::Base and Ruby 3.0+
2 parents 2f530da + 65c4a6a commit cb505cb

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Changelog for the bc-prometheus-ruby gem.
22

33
### Pending Release
44

5+
### 0.5.1
6+
7+
- Fix keywords argument issue with Collectors::Base and Ruby 3.0+
8+
59
### 0.5.0
610

711
- Add configuration to disable the Railtie that activates the web instrumentor automatically. This allows applications to choose how and when this is initialized.

lib/bigcommerce/prometheus/collectors/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Base
2525
##
2626
# Start the collector
2727
#
28-
def self.start(*args, &block)
29-
process_collector = new(*args, &block)
28+
def self.start(args, &block)
29+
process_collector = new(**args, &block)
3030

3131
stop if @thread
3232

spec/bigcommerce/prometheus/collectors/base_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222
let(:client) { double(:client, send_json: true) }
2323
let(:collector) { AppCollector.new(client: client, frequency: 0) }
2424

25+
describe '#start' do
26+
subject { AppCollector.start(client: client, frequency: 0) }
27+
28+
it 'starts the collector on a thread' do
29+
thread = subject
30+
expect(thread).to be_a(Thread)
31+
expect(thread).to be_alive
32+
ensure
33+
AppCollector.stop
34+
end
35+
end
36+
2537
describe '#run' do
2638
subject { collector.run }
2739

0 commit comments

Comments
 (0)