couchbase-view-helpers 1.1.1-java → 1.1.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couchbase/view_helpers/version.rb +1 -1
- data/lib/couchbase/view_helpers.rb +24 -2
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593150cd717c8403e0d504f356216e73fec7cde8
|
4
|
+
data.tar.gz: 526099326a03c286f9dc7c8dd1694a82f5ac0d6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcba74e86a2df0e837a4081e745045cbd974f97d4f86f3ce01c2031c7626df8e9cf1091ae03a0dfae2240ee97df8c3273a8d1006d705f10777c62017cd57a098
|
7
|
+
data.tar.gz: 6f203eca73600be40712e3ff53bb94db5a3f27699a971684e238d676ee10f471bb738305f06339c258300630e57ad0e893ad104551ecc677c15ba676e320d042
|
@@ -6,11 +6,11 @@ module Couchbase
|
|
6
6
|
|
7
7
|
# Keys
|
8
8
|
def key(key)
|
9
|
-
add_param(key: key)
|
9
|
+
add_param(key: jsonify_key(key))
|
10
10
|
end
|
11
11
|
|
12
12
|
def keys(*keys)
|
13
|
-
add_param(keys: Array(keys).flatten)
|
13
|
+
add_param(keys: Array(keys).flatten.map { |key| jsonify_key(key) })
|
14
14
|
end
|
15
15
|
|
16
16
|
# Pagination
|
@@ -26,6 +26,15 @@ module Couchbase
|
|
26
26
|
paginate(per_page: per_page)
|
27
27
|
end
|
28
28
|
|
29
|
+
# Limit & Skip
|
30
|
+
def limit(num)
|
31
|
+
add_param(limit: num)
|
32
|
+
end
|
33
|
+
|
34
|
+
def skip(num)
|
35
|
+
add_param(skip: num)
|
36
|
+
end
|
37
|
+
|
29
38
|
# Ordering
|
30
39
|
def order(direction)
|
31
40
|
add_param(descending: (direction.to_s =~ /^asc/i) != 0)
|
@@ -83,5 +92,18 @@ module Couchbase
|
|
83
92
|
self
|
84
93
|
end
|
85
94
|
|
95
|
+
def jsonify_key(key)
|
96
|
+
if key.is_a? Array
|
97
|
+
key.to_s
|
98
|
+
else
|
99
|
+
quote_key(key)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def quote_key(key)
|
104
|
+
key = key.to_s
|
105
|
+
key =~ /^"/ ? key : '"' + key + '"'
|
106
|
+
end
|
107
|
+
|
86
108
|
end
|
87
109
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-view-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Mike Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: couchbase-jruby-client
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.0
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - '>='
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: 0.2.0
|
19
|
+
name: couchbase-jruby-client
|
25
20
|
prerelease: false
|
26
21
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - '>='
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
26
|
+
version: 0.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - ~>
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '1.3'
|
33
|
+
name: bundler
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
|
-
- -
|
38
|
+
- - ~>
|
46
39
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
44
|
- - '>='
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: '0'
|
47
|
+
name: rake
|
53
48
|
prerelease: false
|
54
49
|
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
55
|
description: Adds syntactic sugar to Couchbase view options hashes.
|
56
56
|
email:
|
57
57
|
- mike@urlgonomics.com
|