Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Commit 66e0be1

Browse files
author
Jirka Kremser
authored
Merge pull request #194 from cfcosta/fix-old-usages-of-internal-constants
Fix old usages of internal constants
2 parents f27ed2b + e2c1603 commit 66e0be1

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

lib/hawkular/client_utils.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ def hawk_escape_id(url_part)
3737
end
3838
end
3939
end
40+
41+
HawkularUtilsMixin = Hawkular::ClientUtils
42+
deprecate_constant(:HawkularUtilsMixin) if self.respond_to?(:deprecate_constant)

spec/unit/deprecations_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require_relative '../spec_helper'
2+
3+
describe 'Deprecations' do
4+
def self.changed_constant(from:, to:)
5+
describe to do
6+
it 'is still accessible by its old name' do
7+
expect(from).to eq to
8+
end
9+
end
10+
end
11+
12+
describe 'pre-3.0' do
13+
changed_constant from: HawkularUtilsMixin, to: Hawkular::ClientUtils
14+
changed_constant from: Hawkular::Operations::OperationsClient, to: Hawkular::Operations::Client
15+
changed_constant from: Hawkular::Alerts::AlertsClient, to: Hawkular::Alerts::Client
16+
changed_constant from: Hawkular::Token::TokenClient, to: Hawkular::Token::Client
17+
changed_constant from: Hawkular::Inventory::InventoryClient, to: Hawkular::Inventory::Client
18+
end
19+
end

0 commit comments

Comments
 (0)