couch_visible 0.0.2 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/features/couch_publish_integration.feature +39 -0
- data/features/hide.feature +3 -2
- data/features/show.feature +2 -2
- data/features/step_definitions/couch_publish_integration.rb +11 -0
- data/features/step_definitions/couch_publish_integration.rbc +328 -0
- data/features/step_definitions/hide_steps.rb +4 -4
- data/features/step_definitions/hide_steps.rbc +24 -45
- data/features/step_definitions/show_steps.rb +4 -4
- data/features/step_definitions/show_steps.rbc +18 -39
- data/features/support/env.rb +7 -1
- data/lib/couch_visible.rb +6 -0
- data/lib/couch_visible.rbc +54 -6
- data/lib/couch_visible/conditions/published.rb +9 -0
- data/lib/couch_visible/conditions/unpublished.rb +9 -0
- data/lib/couch_visible/couch_visible.rb +13 -14
- data/lib/couch_visible/couch_visible.rbc +236 -218
- data/lib/couch_visible/integrations/couch_publish.rb +15 -0
- data/lib/couch_visible/maps/by_hidden.rb +16 -0
- data/lib/couch_visible/maps/by_hidden.rbc +305 -0
- data/lib/couch_visible/maps/by_shown.rb +15 -0
- data/lib/couch_visible/maps/by_shown.rbc +305 -0
- data/readme.markdown +93 -56
- metadata +38 -11
@@ -0,0 +1,15 @@
|
|
1
|
+
module CouchVisible
|
2
|
+
module CouchPublish
|
3
|
+
def self.included(base)
|
4
|
+
base.couch_view :by_hidden do
|
5
|
+
map CouchVisible::ByHidden
|
6
|
+
conditions CouchVisible::Conditions::Published, CouchVisible::Conditions::Unpublished
|
7
|
+
end
|
8
|
+
|
9
|
+
base.couch_view :by_shown do
|
10
|
+
map CouchVisible::ByShown
|
11
|
+
conditions CouchVisible::Conditions::Published, CouchVisible::Conditions::Unpublished
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,305 @@
|
|
1
|
+
!RBIX
|
2
|
+
17831730954501249321
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
28
|
13
|
+
99
|
14
|
+
7
|
15
|
+
0
|
16
|
+
65
|
17
|
+
49
|
18
|
+
1
|
19
|
+
2
|
20
|
+
13
|
21
|
+
99
|
22
|
+
12
|
23
|
+
7
|
24
|
+
2
|
25
|
+
12
|
26
|
+
7
|
27
|
+
3
|
28
|
+
12
|
29
|
+
65
|
30
|
+
12
|
31
|
+
49
|
32
|
+
4
|
33
|
+
4
|
34
|
+
15
|
35
|
+
49
|
36
|
+
2
|
37
|
+
0
|
38
|
+
15
|
39
|
+
2
|
40
|
+
11
|
41
|
+
I
|
42
|
+
6
|
43
|
+
I
|
44
|
+
0
|
45
|
+
I
|
46
|
+
0
|
47
|
+
I
|
48
|
+
0
|
49
|
+
n
|
50
|
+
p
|
51
|
+
5
|
52
|
+
x
|
53
|
+
12
|
54
|
+
CouchVisible
|
55
|
+
x
|
56
|
+
11
|
57
|
+
open_module
|
58
|
+
x
|
59
|
+
15
|
60
|
+
__module_init__
|
61
|
+
M
|
62
|
+
1
|
63
|
+
n
|
64
|
+
n
|
65
|
+
x
|
66
|
+
12
|
67
|
+
CouchVisible
|
68
|
+
i
|
69
|
+
29
|
70
|
+
5
|
71
|
+
66
|
72
|
+
99
|
73
|
+
7
|
74
|
+
0
|
75
|
+
1
|
76
|
+
65
|
77
|
+
49
|
78
|
+
1
|
79
|
+
3
|
80
|
+
13
|
81
|
+
99
|
82
|
+
12
|
83
|
+
7
|
84
|
+
2
|
85
|
+
12
|
86
|
+
7
|
87
|
+
3
|
88
|
+
12
|
89
|
+
65
|
90
|
+
12
|
91
|
+
49
|
92
|
+
4
|
93
|
+
4
|
94
|
+
15
|
95
|
+
49
|
96
|
+
2
|
97
|
+
0
|
98
|
+
11
|
99
|
+
I
|
100
|
+
6
|
101
|
+
I
|
102
|
+
0
|
103
|
+
I
|
104
|
+
0
|
105
|
+
I
|
106
|
+
0
|
107
|
+
n
|
108
|
+
p
|
109
|
+
5
|
110
|
+
x
|
111
|
+
8
|
112
|
+
ByHidden
|
113
|
+
x
|
114
|
+
10
|
115
|
+
open_class
|
116
|
+
x
|
117
|
+
14
|
118
|
+
__class_init__
|
119
|
+
M
|
120
|
+
1
|
121
|
+
n
|
122
|
+
n
|
123
|
+
x
|
124
|
+
8
|
125
|
+
ByHidden
|
126
|
+
i
|
127
|
+
27
|
128
|
+
5
|
129
|
+
66
|
130
|
+
5
|
131
|
+
45
|
132
|
+
0
|
133
|
+
1
|
134
|
+
43
|
135
|
+
2
|
136
|
+
47
|
137
|
+
49
|
138
|
+
3
|
139
|
+
1
|
140
|
+
15
|
141
|
+
99
|
142
|
+
7
|
143
|
+
4
|
144
|
+
7
|
145
|
+
5
|
146
|
+
65
|
147
|
+
67
|
148
|
+
49
|
149
|
+
6
|
150
|
+
0
|
151
|
+
49
|
152
|
+
7
|
153
|
+
4
|
154
|
+
11
|
155
|
+
I
|
156
|
+
5
|
157
|
+
I
|
158
|
+
0
|
159
|
+
I
|
160
|
+
0
|
161
|
+
I
|
162
|
+
0
|
163
|
+
n
|
164
|
+
p
|
165
|
+
8
|
166
|
+
x
|
167
|
+
9
|
168
|
+
CouchView
|
169
|
+
n
|
170
|
+
x
|
171
|
+
3
|
172
|
+
Map
|
173
|
+
x
|
174
|
+
7
|
175
|
+
include
|
176
|
+
x
|
177
|
+
3
|
178
|
+
map
|
179
|
+
M
|
180
|
+
1
|
181
|
+
n
|
182
|
+
n
|
183
|
+
x
|
184
|
+
3
|
185
|
+
map
|
186
|
+
i
|
187
|
+
13
|
188
|
+
7
|
189
|
+
0
|
190
|
+
5
|
191
|
+
48
|
192
|
+
1
|
193
|
+
47
|
194
|
+
101
|
195
|
+
2
|
196
|
+
7
|
197
|
+
3
|
198
|
+
63
|
199
|
+
3
|
200
|
+
11
|
201
|
+
I
|
202
|
+
3
|
203
|
+
I
|
204
|
+
0
|
205
|
+
I
|
206
|
+
0
|
207
|
+
I
|
208
|
+
0
|
209
|
+
n
|
210
|
+
p
|
211
|
+
4
|
212
|
+
s
|
213
|
+
38
|
214
|
+
|
215
|
+
function(doc){
|
216
|
+
if (
|
217
|
+
x
|
218
|
+
10
|
219
|
+
conditions
|
220
|
+
x
|
221
|
+
4
|
222
|
+
to_s
|
223
|
+
s
|
224
|
+
97
|
225
|
+
&& doc.couch_visible == false){
|
226
|
+
emit(doc['_id'], null);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
p
|
231
|
+
7
|
232
|
+
I
|
233
|
+
-1
|
234
|
+
I
|
235
|
+
5
|
236
|
+
I
|
237
|
+
0
|
238
|
+
I
|
239
|
+
6
|
240
|
+
I
|
241
|
+
2
|
242
|
+
I
|
243
|
+
8
|
244
|
+
I
|
245
|
+
d
|
246
|
+
x
|
247
|
+
76
|
248
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_hidden.rb
|
249
|
+
p
|
250
|
+
0
|
251
|
+
x
|
252
|
+
17
|
253
|
+
method_visibility
|
254
|
+
x
|
255
|
+
15
|
256
|
+
add_defn_method
|
257
|
+
p
|
258
|
+
5
|
259
|
+
I
|
260
|
+
2
|
261
|
+
I
|
262
|
+
3
|
263
|
+
I
|
264
|
+
d
|
265
|
+
I
|
266
|
+
5
|
267
|
+
I
|
268
|
+
1b
|
269
|
+
x
|
270
|
+
76
|
271
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_hidden.rb
|
272
|
+
p
|
273
|
+
0
|
274
|
+
x
|
275
|
+
13
|
276
|
+
attach_method
|
277
|
+
p
|
278
|
+
3
|
279
|
+
I
|
280
|
+
2
|
281
|
+
I
|
282
|
+
2
|
283
|
+
I
|
284
|
+
1d
|
285
|
+
x
|
286
|
+
76
|
287
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_hidden.rb
|
288
|
+
p
|
289
|
+
0
|
290
|
+
x
|
291
|
+
13
|
292
|
+
attach_method
|
293
|
+
p
|
294
|
+
3
|
295
|
+
I
|
296
|
+
0
|
297
|
+
I
|
298
|
+
1
|
299
|
+
I
|
300
|
+
1c
|
301
|
+
x
|
302
|
+
76
|
303
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_hidden.rb
|
304
|
+
p
|
305
|
+
0
|
@@ -0,0 +1,305 @@
|
|
1
|
+
!RBIX
|
2
|
+
17831730954501249321
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
28
|
13
|
+
99
|
14
|
+
7
|
15
|
+
0
|
16
|
+
65
|
17
|
+
49
|
18
|
+
1
|
19
|
+
2
|
20
|
+
13
|
21
|
+
99
|
22
|
+
12
|
23
|
+
7
|
24
|
+
2
|
25
|
+
12
|
26
|
+
7
|
27
|
+
3
|
28
|
+
12
|
29
|
+
65
|
30
|
+
12
|
31
|
+
49
|
32
|
+
4
|
33
|
+
4
|
34
|
+
15
|
35
|
+
49
|
36
|
+
2
|
37
|
+
0
|
38
|
+
15
|
39
|
+
2
|
40
|
+
11
|
41
|
+
I
|
42
|
+
6
|
43
|
+
I
|
44
|
+
0
|
45
|
+
I
|
46
|
+
0
|
47
|
+
I
|
48
|
+
0
|
49
|
+
n
|
50
|
+
p
|
51
|
+
5
|
52
|
+
x
|
53
|
+
12
|
54
|
+
CouchVisible
|
55
|
+
x
|
56
|
+
11
|
57
|
+
open_module
|
58
|
+
x
|
59
|
+
15
|
60
|
+
__module_init__
|
61
|
+
M
|
62
|
+
1
|
63
|
+
n
|
64
|
+
n
|
65
|
+
x
|
66
|
+
12
|
67
|
+
CouchVisible
|
68
|
+
i
|
69
|
+
29
|
70
|
+
5
|
71
|
+
66
|
72
|
+
99
|
73
|
+
7
|
74
|
+
0
|
75
|
+
1
|
76
|
+
65
|
77
|
+
49
|
78
|
+
1
|
79
|
+
3
|
80
|
+
13
|
81
|
+
99
|
82
|
+
12
|
83
|
+
7
|
84
|
+
2
|
85
|
+
12
|
86
|
+
7
|
87
|
+
3
|
88
|
+
12
|
89
|
+
65
|
90
|
+
12
|
91
|
+
49
|
92
|
+
4
|
93
|
+
4
|
94
|
+
15
|
95
|
+
49
|
96
|
+
2
|
97
|
+
0
|
98
|
+
11
|
99
|
+
I
|
100
|
+
6
|
101
|
+
I
|
102
|
+
0
|
103
|
+
I
|
104
|
+
0
|
105
|
+
I
|
106
|
+
0
|
107
|
+
n
|
108
|
+
p
|
109
|
+
5
|
110
|
+
x
|
111
|
+
7
|
112
|
+
ByShown
|
113
|
+
x
|
114
|
+
10
|
115
|
+
open_class
|
116
|
+
x
|
117
|
+
14
|
118
|
+
__class_init__
|
119
|
+
M
|
120
|
+
1
|
121
|
+
n
|
122
|
+
n
|
123
|
+
x
|
124
|
+
7
|
125
|
+
ByShown
|
126
|
+
i
|
127
|
+
27
|
128
|
+
5
|
129
|
+
66
|
130
|
+
5
|
131
|
+
45
|
132
|
+
0
|
133
|
+
1
|
134
|
+
43
|
135
|
+
2
|
136
|
+
47
|
137
|
+
49
|
138
|
+
3
|
139
|
+
1
|
140
|
+
15
|
141
|
+
99
|
142
|
+
7
|
143
|
+
4
|
144
|
+
7
|
145
|
+
5
|
146
|
+
65
|
147
|
+
67
|
148
|
+
49
|
149
|
+
6
|
150
|
+
0
|
151
|
+
49
|
152
|
+
7
|
153
|
+
4
|
154
|
+
11
|
155
|
+
I
|
156
|
+
5
|
157
|
+
I
|
158
|
+
0
|
159
|
+
I
|
160
|
+
0
|
161
|
+
I
|
162
|
+
0
|
163
|
+
n
|
164
|
+
p
|
165
|
+
8
|
166
|
+
x
|
167
|
+
9
|
168
|
+
CouchView
|
169
|
+
n
|
170
|
+
x
|
171
|
+
3
|
172
|
+
Map
|
173
|
+
x
|
174
|
+
7
|
175
|
+
include
|
176
|
+
x
|
177
|
+
3
|
178
|
+
map
|
179
|
+
M
|
180
|
+
1
|
181
|
+
n
|
182
|
+
n
|
183
|
+
x
|
184
|
+
3
|
185
|
+
map
|
186
|
+
i
|
187
|
+
13
|
188
|
+
7
|
189
|
+
0
|
190
|
+
5
|
191
|
+
48
|
192
|
+
1
|
193
|
+
47
|
194
|
+
101
|
195
|
+
2
|
196
|
+
7
|
197
|
+
3
|
198
|
+
63
|
199
|
+
3
|
200
|
+
11
|
201
|
+
I
|
202
|
+
3
|
203
|
+
I
|
204
|
+
0
|
205
|
+
I
|
206
|
+
0
|
207
|
+
I
|
208
|
+
0
|
209
|
+
n
|
210
|
+
p
|
211
|
+
4
|
212
|
+
s
|
213
|
+
38
|
214
|
+
|
215
|
+
function(doc){
|
216
|
+
if (
|
217
|
+
x
|
218
|
+
10
|
219
|
+
conditions
|
220
|
+
x
|
221
|
+
4
|
222
|
+
to_s
|
223
|
+
s
|
224
|
+
96
|
225
|
+
&& doc.couch_visible == true){
|
226
|
+
emit(doc['_id'], null);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
p
|
231
|
+
7
|
232
|
+
I
|
233
|
+
-1
|
234
|
+
I
|
235
|
+
5
|
236
|
+
I
|
237
|
+
0
|
238
|
+
I
|
239
|
+
6
|
240
|
+
I
|
241
|
+
2
|
242
|
+
I
|
243
|
+
8
|
244
|
+
I
|
245
|
+
d
|
246
|
+
x
|
247
|
+
75
|
248
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_shown.rb
|
249
|
+
p
|
250
|
+
0
|
251
|
+
x
|
252
|
+
17
|
253
|
+
method_visibility
|
254
|
+
x
|
255
|
+
15
|
256
|
+
add_defn_method
|
257
|
+
p
|
258
|
+
5
|
259
|
+
I
|
260
|
+
2
|
261
|
+
I
|
262
|
+
3
|
263
|
+
I
|
264
|
+
d
|
265
|
+
I
|
266
|
+
5
|
267
|
+
I
|
268
|
+
1b
|
269
|
+
x
|
270
|
+
75
|
271
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_shown.rb
|
272
|
+
p
|
273
|
+
0
|
274
|
+
x
|
275
|
+
13
|
276
|
+
attach_method
|
277
|
+
p
|
278
|
+
3
|
279
|
+
I
|
280
|
+
2
|
281
|
+
I
|
282
|
+
2
|
283
|
+
I
|
284
|
+
1d
|
285
|
+
x
|
286
|
+
75
|
287
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_shown.rb
|
288
|
+
p
|
289
|
+
0
|
290
|
+
x
|
291
|
+
13
|
292
|
+
attach_method
|
293
|
+
p
|
294
|
+
3
|
295
|
+
I
|
296
|
+
0
|
297
|
+
I
|
298
|
+
1
|
299
|
+
I
|
300
|
+
1c
|
301
|
+
x
|
302
|
+
75
|
303
|
+
/Users/mparker/work/github/couch_visible/lib/couch_visible/maps/by_shown.rb
|
304
|
+
p
|
305
|
+
0
|