influxdb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 015169efb594ef5763c19ae7775484d4d7bb5503
4
- data.tar.gz: 5028373587c1b36ce5d8c5e723f9641d71fea996
3
+ metadata.gz: 5317b3f282142902370f70efe284c0b3bc26fd33
4
+ data.tar.gz: 7c8d66553e69ca83a7c7bd195c15b720ce566db4
5
5
  SHA512:
6
- metadata.gz: fb0d6534aa38bf7673c310a864731f21f0e7154244eb37c9cf92bc78833dae03ff6548a31e381a535533de48528df10da4e09af453b782dfae1eb853374d5826
7
- data.tar.gz: bbb42ada8b32eeda12ee2966814cfd6fa18d336499d4c7accea408cd23bb4cc5e9b8678f8e1f0db82768d6f66408990dc56933629ba4624d76d7e0f10ecf494d
6
+ metadata.gz: 4aa6353445b0e3741e9618389f96db0494c0bca4d9287275db4eb09abbc092adea05fd294800f7a3b06fd80402fdf58fdebbc9174a493c0abb379841b7a7c307
7
+ data.tar.gz: 6d04fd6f05351872f029af105b2c7a183d136ab76be4580339e97bb9d58c5ff37d48c1a81e54e1ece16a4ad58a13ff660a064d275305aa70520fccbf61bd6fcf
@@ -38,19 +38,23 @@ module InfluxDB
38
38
  http = Net::HTTP.new(@host, @port)
39
39
  url = "/db?u=#{@username}&p=#{@password}"
40
40
  data = JSON.generate({:name => name})
41
+
41
42
  response = http.request(Net::HTTP::Post.new(url), data)
42
43
  end
43
44
 
44
45
  def delete_database(name)
45
46
  http = Net::HTTP.new(@host, @port)
46
47
  url = "/db/#{name}?u=#{@username}&p=#{@password}"
48
+
47
49
  response = http.request(Net::HTTP::Delete.new(url))
48
50
  end
49
51
 
50
52
  def get_database_list
51
53
  http = Net::HTTP.new(@host, @port)
52
54
  url = "/dbs?u=#{@username}&p=#{@password}"
55
+
53
56
  response = http.request(Net::HTTP::Get.new(url))
57
+ JSON.parse(response.body)
54
58
  end
55
59
 
56
60
  def create_database_user(database, username, password)
@@ -1,3 +1,3 @@
1
1
  module InfluxDB
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -53,11 +53,12 @@ describe InfluxDB::Client do
53
53
 
54
54
  describe "#get_database_list" do
55
55
  it "should GET a list of databases" do
56
+ database_list = [{"name" => "foobar"}]
56
57
  stub_request(:get, "http://influxdb.test:9999/dbs").with(
57
58
  :query => {:u => "username", :p => "password"}
58
- )
59
+ ).to_return(:body => JSON.generate(database_list, :status => 200))
59
60
 
60
- @influxdb.get_database_list.should be_a(Net::HTTPOK)
61
+ @influxdb.get_database_list.should == database_list
61
62
  end
62
63
  end
63
64
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-09 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json