Skip to content

Commit 4e080d3

Browse files
committed
enable 1.9 support
1 parent c74fe79 commit 4e080d3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ before_install:
55
- |
66
if [[ "$(ruby -e 'puts RUBY_VERSION')" != 1.* ]]; then gem update --system; fi
77
rvm:
8+
- 1.9.3
89
- 2.3.3
910
- 2.4.0
1011
- jruby-9.1.5.0

lib/prometheus/api_client/cadvisor.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module Cadvisor
2020
#
2121
# A default client is created if options is omitted.
2222
class Node < Client
23-
def initialize(instance:, **options)
23+
def initialize(**options)
24+
instance = options[:instance]
2425
region = options[:region] || 'infra'
2526
zone = options[:zone] || 'default'
2627

@@ -42,7 +43,8 @@ def query_range(options)
4243

4344
# A client with special labels for pod cadvisor metrics
4445
class Pod < Client
45-
def initialize(pod_name:, **options)
46+
def initialize(**options)
47+
pod_name = options[:pod_name]
4648
namespace = options[:namespace] || 'default'
4749
region = options[:region] || 'infra'
4850
zone = options[:zone] || 'default'
@@ -66,7 +68,9 @@ def query_range(options)
6668

6769
# A client with special labels for container cadvisor metrics
6870
class Container < Client
69-
def initialize(container_name:, pod_name:, **options)
71+
def initialize(**options)
72+
container_name = args[:container_name]
73+
pod_name = args[:pod_name]
7074
namespace = args[:namespace] || 'default'
7175
region = options[:region] || 'infra'
7276
zone = options[:zone] || 'default'

0 commit comments

Comments
 (0)