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 +4 -4
- data/lib/ciql/sanitize.rb +1 -1
- data/lib/ciql/version.rb +1 -1
- data/spec/ciql/sanitize_spec.rb +16 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f26f570d1bc8bacceb9599d8152e10f579554a7
|
4
|
+
data.tar.gz: b98cd2478e03b49b84d6ebcf384bd7058d619707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fdfa0e41ef5a94ff3bbbf1b013f85c8b0f37b5798f9ab32b63ab5b53f9312919e6618a6d9b7e23b22af650d0a96a1f9fa60213af66323564c208c10561b8b3c
|
7
|
+
data.tar.gz: ebaf2b378cfae608cf0df3c9c4be37ae592d006850d4c1a7cbce51e428fee7fd460f6cdf2e82d9add43b21dc5e6f067d2cd98ea066788e96a18d8baa075589f4
|
data/lib/ciql/sanitize.rb
CHANGED
@@ -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.
|
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
|
data/lib/ciql/version.rb
CHANGED
data/spec/ciql/sanitize_spec.rb
CHANGED
@@ -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,'
|
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.
|
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-
|
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
|