influxdb 0.3.6 → 0.3.7

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: c027fe626b731c0fe89678ae44f7f87a24db7c68
4
- data.tar.gz: 929dc5eda07eabfba284891ede0a293a6b0fc49a
3
+ metadata.gz: de7cdbcf5a4222dcaa8d992605533a4b1961da0f
4
+ data.tar.gz: e449d025b563a796dde3412612713383a1a9f0ab
5
5
  SHA512:
6
- metadata.gz: 64db490708b15350c4e2ab2cc76b5f934db510a86eec7be024f9a6c652e26d09fa2570b729ab6987887382769b5b9a1f5bbfdb0a3c8fc96775ce2db7b0a563fb
7
- data.tar.gz: b4fc2890772ec74612dac94633e5607904b4aadeef0a3760d698b24cbf16d4a23e6c004edece2b15d8926fa21e028f7479a26d168a03ab59ae4cbaedccc782f5
6
+ metadata.gz: 0959fc07ab3a1753edfef682273bfb5472e7b492098b8e0c466f4ebc9f24851818868bda53ef323efc5e903bb865e8f02095a46e9bac3784aae4cb271b094b3c
7
+ data.tar.gz: 506cd94546133b923bdb40b120364f48182124df319d1d5994be3b557679b2d52f5d2309d7530be6284e1cb5c60493844e08ecf2b9104e61ac0544d1a6437d78
data/.rubocop.yml CHANGED
@@ -12,32 +12,13 @@ AllCops:
12
12
  Rails:
13
13
  Enabled: false
14
14
 
15
- Style/Documentation:
16
- Exclude:
17
- - 'spec/**/*.rb'
18
-
19
15
  Style/StringLiterals:
20
16
  Enabled: false
21
17
 
22
- Style/BlockDelimiters:
23
- Exclude:
24
- - 'spec/**/*.rb'
25
-
26
18
  Style/RescueModifier:
27
19
  Enabled: false
28
20
 
29
- Lint/HandleExceptions:
30
- Enabled: false
31
-
32
- Lint/Void:
33
- Exclude:
34
- - 'spec/**/*.rb'
35
-
36
21
  Metrics/LineLength:
37
22
  Max: 100
38
23
  Exclude:
39
24
  - 'spec/**/*.rb'
40
-
41
- Metrics/MethodLength:
42
- Exclude:
43
- - 'spec/**/*.rb'
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ For the full commit log, [see here](https://github.com/influxdata/influxdb-ruby/
6
6
 
7
7
  - None.
8
8
 
9
+ ## v0.3.7, released 2016-08-14
10
+
11
+ - Fixed `prefix` handling for `#ping` and `#version` (#157, @dimiii)
12
+
9
13
  ## v0.3.6, released 2016-07-24
10
14
 
11
15
  - Added feature for JSON streaming response, via `"chunk_size"` parameter
data/README.md CHANGED
@@ -427,7 +427,7 @@ influxdb.write_point(name, data)
427
427
 
428
428
  ### Reading data
429
429
 
430
- ### Querying
430
+ #### Querying
431
431
 
432
432
  ``` ruby
433
433
  username = 'foo'
@@ -547,8 +547,7 @@ If you pass `:retry => -1` it will keep trying forever until it gets the connect
547
547
  git clone git@github.com:influxdata/influxdb-ruby.git
548
548
  cd influxdb-ruby
549
549
  bundle
550
- bundle exec rake spec
551
- bundle exec rake rubocop
550
+ bundle exec rake
552
551
  ```
553
552
 
554
553
  ## Contributing
@@ -558,7 +557,6 @@ bundle exec rake rubocop
558
557
  - Add tests.
559
558
  - Add an entry in the `CHANGELOG.md` in the "unreleased" section on top.
560
559
  - Run the tests: `bundle exec rake`.
561
- - Run Rubocop: `bundle exec rubocop`.
562
560
  - Send a pull request.
563
561
  - Please rebase against the master branch.
564
562
  - If your changes look good, we'll merge them.
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
13
13
  t.pattern = FileList[file_pattern]
14
14
  end
15
15
 
16
- task default: :spec
16
+ task default: [:spec, :rubocop]
17
17
 
18
18
  task :console do
19
19
  lib = File.expand_path('../lib', __FILE__)
@@ -3,12 +3,12 @@ module InfluxDB
3
3
  # rubocop:disable Metrics/AbcSize
4
4
  module Core
5
5
  def ping
6
- get "/ping".freeze
6
+ url = URI::Generic.build(path: File.join(config.prefix, '/ping')).to_s
7
+ get url
7
8
  end
8
9
 
9
10
  def version
10
- resp = get "/ping".freeze
11
- resp.header['x-influxdb-version']
11
+ ping.header['x-influxdb-version']
12
12
  end
13
13
 
14
14
  # rubocop:disable Metrics/MethodLength
@@ -1,3 +1,3 @@
1
1
  module InfluxDB # :nodoc:
2
- VERSION = "0.3.6".freeze
2
+ VERSION = "0.3.7".freeze
3
3
  end
@@ -62,6 +62,17 @@ describe InfluxDB::Client do
62
62
 
63
63
  expect(subject.ping).to be_a(Net::HTTPNoContent)
64
64
  end
65
+
66
+ context "with prefix" do
67
+ let(:args) { { prefix: '/dev' } }
68
+
69
+ it "returns OK with prefix" do
70
+ stub_request(:get, "http://influxdb.test:9999/dev/ping")
71
+ .to_return(status: 204)
72
+
73
+ expect(subject.ping).to be_a(Net::HTTPNoContent)
74
+ end
75
+ end
65
76
  end
66
77
 
67
78
  describe "GET #version" do
@@ -71,6 +82,17 @@ describe InfluxDB::Client do
71
82
 
72
83
  expect(subject.version).to eq('1.1.1')
73
84
  end
85
+
86
+ context "with prefix" do
87
+ let(:args) { { prefix: '/dev' } }
88
+
89
+ it "returns 1.1.1 with prefix" do
90
+ stub_request(:get, "http://influxdb.test:9999/dev/ping")
91
+ .to_return(status: 204, headers: { 'x-influxdb-version' => '1.1.1' })
92
+
93
+ expect(subject.version).to eq('1.1.1')
94
+ end
95
+ end
74
96
  end
75
97
 
76
98
  describe "Load balancing" do
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "influxdb"
2
2
  require "webmock/rspec"
3
+
3
4
  begin
5
+ # rubocop:disable Lint/HandleExceptions
4
6
  require "pry-byebug"
5
7
  rescue LoadError
6
8
  end
metadata CHANGED
@@ -1,108 +1,108 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-24 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: json
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: '0'
19
- name: json
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: cause
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: cause
34
- prerelease: false
35
34
  type: :runtime
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
+ name: rake
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
- name: rake
48
- prerelease: false
49
48
  type: :development
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
+ name: bundler
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
59
  - - "~>"
59
60
  - !ruby/object:Gem::Version
60
61
  version: '1.3'
61
- name: bundler
62
- prerelease: false
63
62
  type: :development
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
+ name: rspec
70
71
  requirement: !ruby/object:Gem::Requirement
71
72
  requirements:
72
73
  - - "~>"
73
74
  - !ruby/object:Gem::Version
74
75
  version: 3.4.0
75
- name: rspec
76
- prerelease: false
77
76
  type: :development
77
+ prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.4.0
83
83
  - !ruby/object:Gem::Dependency
84
+ name: webmock
84
85
  requirement: !ruby/object:Gem::Requirement
85
86
  requirements:
86
87
  - - "~>"
87
88
  - !ruby/object:Gem::Version
88
89
  version: 1.24.2
89
- name: webmock
90
- prerelease: false
91
90
  type: :development
91
+ prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.24.2
97
97
  - !ruby/object:Gem::Dependency
98
+ name: rubocop
98
99
  requirement: !ruby/object:Gem::Requirement
99
100
  requirements:
100
101
  - - "~>"
101
102
  - !ruby/object:Gem::Version
102
103
  version: 0.39.0
103
- name: rubocop
104
- prerelease: false
105
104
  type: :development
105
+ prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
@@ -167,7 +167,7 @@ homepage: http://influxdb.org
167
167
  licenses:
168
168
  - MIT
169
169
  metadata: {}
170
- post_install_message:
170
+ post_install_message:
171
171
  rdoc_options: []
172
172
  require_paths:
173
173
  - lib
@@ -182,9 +182,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubyforge_project:
186
- rubygems_version: 2.4.8
187
- signing_key:
185
+ rubyforge_project:
186
+ rubygems_version: 2.5.1
187
+ signing_key:
188
188
  specification_version: 4
189
189
  summary: Ruby library for InfluxDB.
190
190
  test_files: