hosted_graphite 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51694c0ed4f94bebc6c609dcfe1f6270cf023921
4
- data.tar.gz: e9d09ff3c340fc7ac7092d5d7fdb5b49c6289314
3
+ metadata.gz: f6aa577490387b6dee333ad6d6a3525dd195a25e
4
+ data.tar.gz: 647e214a6af4dc12fde2888e3b4b5a6c6b072491
5
5
  SHA512:
6
- metadata.gz: 5c23d537f1bb553db7e334b82360960beb877b601e607be382f190d407361d8eb6afd7e97aee19c8f4bfde5cdf3359929b5104f99ea3742c1280b6f3ef6c49a3
7
- data.tar.gz: 15bf9e975464ba4cb77b7d7e24e92b5590f2c8765b66b71cdb2a984f47410396f10422c31a03723a20f6f7c8049ff8ec6a330b29e751e839c4fbdf082e09f113
6
+ metadata.gz: 35148133080ec01eaea23c52bcced766ca13684499fa4a704afc27c9ba06688917cb2f1f7294dd1eda9068d822aab39111b15dbf00081abdf66f33082fc92013
7
+ data.tar.gz: 253428cb080c00480df01735607076f6f0d3813ccef212447c69c61e13ff51dc0fb24125987cbbfd42fb35b5465789fff42a0aed3ffea2048a858158baa77d9a
data/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0.0
6
+ - 1.9.3
3
7
  - jruby-19mode
4
8
  - rbx-2
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1
8
- - 2.2
data/Gemfile CHANGED
@@ -3,4 +3,6 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in hosted_graphite.gemspec
4
4
  gemspec
5
5
 
6
- gem 'byebug', platform: :mri
6
+ platforms :mri_20, :mri_21 do
7
+ gem 'byebug'
8
+ end
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/seuros/hosted_graphite.svg?branch=master)](https://travis-ci.org/seuros/hosted_graphite)
2
+ [![Code Climate](https://codeclimate.com/github/seuros/hosted_graphite/badges/gpa.svg)](https://codeclimate.com/github/seuros/hosted_graphite)
1
3
  # HostedGraphite
2
4
 
3
5
  A Ruby client for HostedGraphite
@@ -20,29 +22,30 @@ Or install it yourself as:
20
22
 
21
23
  ## Usage
22
24
 
23
- Set ENV['HOSTEDGRAPHITE_APIKEY'] to your api key.
25
+ Set ```ENV['HOSTEDGRAPHITE_APIKEY']``` to your api key.
24
26
  Your API key can be found on your [account home](https://www.hostedgraphite.com/accounts/profile/) page.
25
- You can also set it programatically with
27
+
28
+ You can also set it programatically with:
26
29
 
27
30
  HostedGraphite.api_key = 'YOUR API KEY'
28
31
 
29
32
  ### Sending a metric via UDP
30
-
33
+ ```ruby
31
34
  HostedGraphite.protocol = HostedGraphite::UDP
32
35
  HostedGraphite.send_metric('foo.udp', 1.2)
33
-
36
+ ```
34
37
 
35
38
  ### Sending a metric via TCP
36
-
39
+ ```ruby
37
40
  HostedGraphite.protocol = HostedGraphite::TCP
38
41
  HostedGraphite.send_metric('foo.tcp', 1.2)
39
-
42
+ ```
40
43
 
41
44
  ### Sending a metric via HTTP
42
-
45
+ ```ruby
43
46
  HostedGraphite.protocol = HostedGraphite::HTTP
44
47
  HostedGraphite.send_metric('foo.http', 1.2)
45
-
48
+ ```
46
49
 
47
50
  ## Contributing
48
51
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = spec.files.grep(%r{^(test)/})
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_development_dependency 'bundler', '~> 1.7'
19
+ spec.add_development_dependency 'bundler', '>= 1.6.2'
20
20
  spec.add_development_dependency 'rake', '~> 10.0'
21
21
  spec.add_development_dependency 'minitest', '~> 5.4'
22
22
  end
@@ -2,7 +2,6 @@ require 'socket'
2
2
  module HostedGraphite
3
3
  class UDP < Protocol
4
4
  private
5
-
6
5
  def build_message(name, value)
7
6
  message = [name, value].join(' ') + "\n"
8
7
  [@api_key, message].join('.')
@@ -14,7 +13,11 @@ module HostedGraphite
14
13
  end
15
14
 
16
15
  def socket
17
- Thread.current[:hostedgraphite_udpsocket] ||= UDPSocket.new addr_info.afamily
16
+ Thread.current[:hostedgraphite_udpsocket] ||= begin
17
+ s = UDPSocket.new addr_info.afamily
18
+ s.connect(addr_info.ip_address, addr_info.ip_port)
19
+ s
20
+ end
18
21
  end
19
22
  end
20
23
  end
@@ -1,3 +1,3 @@
1
1
  module HostedGraphite
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hosted_graphite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: 1.6.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: 1.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement