graphite-api 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/graphite-api/connector.rb +1 -0
- data/lib/graphite-api/utils.rb +9 -3
- data/lib/graphite-api/version.rb +1 -1
- metadata +2 -2
data/lib/graphite-api/utils.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'forwardable'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
module GraphiteAPI
|
4
5
|
module Utils
|
@@ -36,9 +37,14 @@ module GraphiteAPI
|
|
36
37
|
module_function
|
37
38
|
|
38
39
|
def expand_host host
|
39
|
-
host
|
40
|
-
|
41
|
-
|
40
|
+
if host =~ /:\/\//
|
41
|
+
uri = URI.parse host
|
42
|
+
[ uri.host, uri.port || default_options[:port] ]
|
43
|
+
else
|
44
|
+
host, port = host.split(":")
|
45
|
+
port = port.nil? ? default_options[:port] : port.to_i
|
46
|
+
[ host, port]
|
47
|
+
end
|
42
48
|
end
|
43
49
|
|
44
50
|
def default_options
|
data/lib/graphite-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphite-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|