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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b804f31e8789787408b16352b14c4c579dc81994
4
- data.tar.gz: 8af99701ff295110fd1c8ce6d6e93086147ae69e
3
+ metadata.gz: 593150cd717c8403e0d504f356216e73fec7cde8
4
+ data.tar.gz: 526099326a03c286f9dc7c8dd1694a82f5ac0d6d
5
5
  SHA512:
6
- metadata.gz: 07514db7d3e35de5ba133b340e7f95d1d8117167ce774253cd1f8dc47d33603ac3a2dcb236b22944fe50dd8ff96a8f2577cd25b67f41cc431a11c67892958219
7
- data.tar.gz: 4240c7ef8d28b215d0b78f9c03b4e1b668f75cc37b55817b60ab133d06af88c6b565c11d9160a3d56d8404f38aea0926946272944786f98a593b091f51c79196
6
+ metadata.gz: bcba74e86a2df0e837a4081e745045cbd974f97d4f86f3ce01c2031c7626df8e9cf1091ae03a0dfae2240ee97df8c3273a8d1006d705f10777c62017cd57a098
7
+ data.tar.gz: 6f203eca73600be40712e3ff53bb94db5a3f27699a971684e238d676ee10f471bb738305f06339c258300630e57ad0e893ad104551ecc677c15ba676e320d042
@@ -1,5 +1,5 @@
1
1
  module Couchbase
2
2
  module ViewHelpers
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
@@ -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.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-02-21 00:00:00.000000000 Z
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: '1.3'
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: '0'
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