influxdb 0.6.3 → 0.6.4

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
  SHA256:
3
- metadata.gz: de9d8162fab3d514cea64b236b6646e3f5ac82fbd73b2212d27e62a0941477a2
4
- data.tar.gz: 8d2ad9db604f1792f384628c9b29a233abea16c7f21bd6db97bb472ee51e12af
3
+ metadata.gz: a35d70ed83c318bad08d7d03f1d65b67953a7fc3277c4a925d59fca5e097dde5
4
+ data.tar.gz: 4c34876161086123e961d6fa3c43ec808f2ed1024acf205436bdd284f00b756c
5
5
  SHA512:
6
- metadata.gz: cba9385d8d07bf5299ef050a26df71e2cc70341d02bffe7e6e64d9fe91885cec6d6aba40a154c0a5aa871f653b80f0c40316f9ccf59eb37557ec93b82c6c4581
7
- data.tar.gz: 26f8ee0318e7b3be065b768b3b134b8e4dadd741be340a97e0f4381994bc4bcf29f7e49bdce0a76dad20c02ed7b2c25ad759a6dcfca7e10299ba3d976a11b687
6
+ metadata.gz: e83524fcec1f9a816c05d6f4eb5c5e9d8067beccf25551e628b444d6d568f28aa55f8acb41336263640f143fd17f37e9ccd0289f1c97c670f3edf9b14e433193
7
+ data.tar.gz: c4c1e66730b9ba1a0dd0529b30f9bbc4b13929674ab0b523952ba5ee2264caa13b712ddf05c91d4262453b32df0559e4f84a37277c136fa8167fbd758329beb0
@@ -2,6 +2,11 @@
2
2
 
3
3
  For the full commit log, [see here](https://github.com/influxdata/influxdb-ruby/commits/master).
4
4
 
5
+ ## v0.6.4, releases 2018-12-02
6
+
7
+ - Fix newly introduced `InfluxDB.now(precision)` for precisions larger
8
+ than "s".
9
+
5
10
  ## v0.6.3, released 2018-11-30
6
11
 
7
12
  - Added `InfluxDB.now(precision)` and `InfluxDB::Client#now` as companions
@@ -31,7 +31,7 @@ module InfluxDB #:nodoc:
31
31
  # InfluxDB.now("m") #=> 25726868
32
32
  # InfluxDB.now("h") #=> 428781
33
33
  def self.now(precision = "s")
34
- name, divisor = TIME_PRECISION_FACTORS.fetch(precision) do
34
+ name, divisor = CLOCK_NAMES.fetch(precision) do
35
35
  raise ArgumentError, "invalid time precision: #{precision}"
36
36
  end
37
37
 
@@ -56,8 +56,8 @@ module InfluxDB #:nodoc:
56
56
  "u" => [:microsecond, 1],
57
57
  "ms" => [:millisecond, 1],
58
58
  "s" => [:second, 1],
59
- "m" => [:second, 1.to_r / 60],
60
- "h" => [:second, 1.to_r / 60 / 60],
59
+ "m" => [:second, 60.to_r],
60
+ "h" => [:second, (60 * 60).to_r],
61
61
  }.freeze
62
62
  private_constant :CLOCK_NAMES
63
63
  end
@@ -1,3 +1,3 @@
1
1
  module InfluxDB # :nodoc:
2
- VERSION = "0.6.3".freeze
2
+ VERSION = "0.6.4".freeze
3
3
  end
@@ -23,4 +23,23 @@ RSpec.describe InfluxDB do
23
23
  .to raise_exception(/invalid time precision.*whatever/i)
24
24
  end
25
25
  end
26
+
27
+ describe ".now" do
28
+ {
29
+ "ns" => [:nanosecond, 1_513_009_229_111_222_333],
30
+ nil => [:nanosecond, 1_513_009_229_111_222_333],
31
+ "u" => [:microsecond, 1_513_009_229_111_222],
32
+ "ms" => [:millisecond, 1_513_009_229_111],
33
+ "s" => [:second, 1_513_009_229],
34
+ "m" => [:second, 25_216_820, 1_513_009_229],
35
+ "h" => [:second, 420_280, 1_513_009_229],
36
+ }.each do |precision, (name, expected, stub)|
37
+ it "should return the current time in #{precision.inspect}" do
38
+ expect(Process).to receive(:clock_gettime)
39
+ .with(Process::CLOCK_REALTIME, name)
40
+ .and_return(stub || expected)
41
+ expect(described_class.now(precision)).to eq(expected)
42
+ end
43
+ end
44
+ end
26
45
  end
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.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-30 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler