ciql 0.3.2 → 0.3.3

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: d970154542794f5068a3eb1c3db01626c0043dac
4
- data.tar.gz: 6fa0c48171ecbcb7eaadf406612a556ea181474d
3
+ metadata.gz: 1f26f570d1bc8bacceb9599d8152e10f579554a7
4
+ data.tar.gz: b98cd2478e03b49b84d6ebcf384bd7058d619707
5
5
  SHA512:
6
- metadata.gz: f8617949842428fab81a257d449b7e48c2cf56e5f4babc0f5b53860a8c3d0b7413fd69472f018b247eb30dad144305014a462495d5e02c37df91838806cf0957
7
- data.tar.gz: 16e5a590c5820eba2909d849a57c87e629bbac5d7a84421aa62b41b1227f2350d48636441d1f04ac161fa5ff4e4daeb12ee6936ea941c780b5a900aad94e4ead
6
+ metadata.gz: 9fdfa0e41ef5a94ff3bbbf1b013f85c8b0f37b5798f9ab32b63ab5b53f9312919e6618a6d9b7e23b22af650d0a96a1f9fa60213af66323564c208c10561b8b3c
7
+ data.tar.gz: ebaf2b378cfae608cf0df3c9c4be37ae592d006850d4c1a7cbce51e428fee7fd460f6cdf2e82d9add43b21dc5e6f067d2cd98ea066788e96a18d8baa075589f4
@@ -40,7 +40,7 @@ module Ciql
40
40
 
41
41
  when NilClass then 'NULL'
42
42
  when Numeric then obj
43
- when DateTime, Time then obj.strftime('%s%3N').to_i
43
+ when DateTime, Time then (obj.to_time.to_f * 1000).to_i
44
44
  when Date then quote(obj.strftime('%Y-%m-%d'))
45
45
 
46
46
  when ::SimpleUUID::UUID then obj.to_guid
@@ -1,3 +1,3 @@
1
1
  module Ciql
2
- VERSION = '0.3.2'.freeze
2
+ VERSION = '0.3.3'.freeze
3
3
  end
@@ -74,6 +74,20 @@ module Ciql
74
74
  .should == 1364338862123.to_s
75
75
  end
76
76
 
77
+ context 'converting a Time to milliseconds' do
78
+ it 'correctly handles floating point rounding' do
79
+ subject.sanitize('?', Time.at(1388442849.643))
80
+ .should == 1388442849643.to_s
81
+ end
82
+ end
83
+
84
+ context 'converting a DateTime to milliseconds' do
85
+ it 'correctly handles floating point rounding' do
86
+ subject.sanitize('?', Time.at(1388442849.643).to_datetime)
87
+ .should == 1388442849643.to_s
88
+ end
89
+ end
90
+
77
91
  it 'converts SimpleUUID::UUID to a bare string representation' do
78
92
  subject.sanitize('?', SimpleUUID::UUID.new(2**127 - 1))
79
93
  .should == "7fffffff-ffff-ffff-ffff-ffffffffffff"
@@ -93,8 +107,8 @@ module Ciql
93
107
  end
94
108
 
95
109
  it 'joins casted elements of an array with a comma separator wrapped in []' do
96
- subject.sanitize('?', [1,true,Time.at(0).to_date])
97
- .should == "[1,true,'1969-12-31']"
110
+ subject.sanitize('?', [1,true,Time.at(0).utc.to_date])
111
+ .should == "[1,true,'1970-01-01']"
98
112
  end
99
113
 
100
114
  it 'joins casted elements of a set with a comma separator wrapped in {}' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bradford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-20 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cql-rb
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.0
41
- - !ruby/object:Gem::Dependency
42
- name: cassandra-cql
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: 1.2.1
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 1.2.1
55
41
  description: A CQL-based Cassandra client for Ruby
56
42
  email:
57
43
  - justin@nulu.com