couchrest 1.1.0.pre → 1.1.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/couchrest.gemspec +1 -1
- data/history.txt +2 -1
- data/lib/couchrest/design.rb +2 -1
- data/spec/couchrest/design_spec.rb +4 -0
- metadata +146 -156
data/couchrest.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{couchrest}
|
5
|
-
s.version = "1.1.0.
|
5
|
+
s.version = "1.1.0.pre2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["J. Chris Anderson", "Matt Aimonetti", "Marcos Tapajos", "Will Leinweber", "Sam Lown"]
|
data/history.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
== 1.1.0.
|
1
|
+
== 1.1.0.pre2 - 2011-04-08
|
2
2
|
|
3
3
|
* Major changes
|
4
4
|
* Time#to_json monkey patch removed! Standard JSON methods now used instead.
|
@@ -10,6 +10,7 @@
|
|
10
10
|
* Streamer#view method removed, use Database.view with block
|
11
11
|
* Database#changes method added (with streamer option)
|
12
12
|
* Added :allow_nil option when creating views
|
13
|
+
* Bug fix: only symbols can be passed as view options (helps fix auto :reduce option)
|
13
14
|
|
14
15
|
WARNING: If you depend on ordering by Time, this release may cause issues on old databases!
|
15
16
|
Either update your documents to use the new format (JSON standard), or use Javascript's Date.parse
|
data/lib/couchrest/design.rb
CHANGED
@@ -40,13 +40,14 @@ JAVASCRIPT
|
|
40
40
|
|
41
41
|
# Dispatches to any named view in a specific database
|
42
42
|
def view_on db, view_name, query = {}, &block
|
43
|
+
raise ArgumentError, "View query options must be set as symbols!" if query.keys.find{|k| k.is_a?(String)}
|
43
44
|
view_name = view_name.to_s
|
44
45
|
view_slug = "#{name}/#{view_name}"
|
45
46
|
# Set the default query options
|
46
47
|
query = view_defaults(view_name).merge(query)
|
47
48
|
# Ensure reduce is set if dealing with a reduceable view
|
48
49
|
# This is a requirement of CouchDB.
|
49
|
-
query[
|
50
|
+
query[:reduce] ||= false if can_reduce_view?(view_name)
|
50
51
|
db.view(view_slug, query, &block)
|
51
52
|
end
|
52
53
|
|
@@ -189,6 +189,7 @@ describe CouchRest::Design do
|
|
189
189
|
@des['views']['by_code']['couchrest-defaults'].should be_nil
|
190
190
|
end
|
191
191
|
it "should include reduce parameter in query" do
|
192
|
+
# this would fail without it
|
192
193
|
res = @des.view :by_code
|
193
194
|
res["rows"][0]["key"].should == 'a'
|
194
195
|
end
|
@@ -196,6 +197,9 @@ describe CouchRest::Design do
|
|
196
197
|
res = @des.view :by_code, :reduce => true
|
197
198
|
res["rows"][0]["value"].should eql(3)
|
198
199
|
end
|
200
|
+
it "does not allow string keys to be passed to view as options" do
|
201
|
+
lambda{ @des.view :by_code, 'reduce' => true }.should raise_error(ArgumentError, /set as symbols/)
|
202
|
+
end
|
199
203
|
end
|
200
204
|
|
201
205
|
|
metadata
CHANGED
@@ -3,18 +3,18 @@ name: couchrest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: true
|
5
5
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
version: 1.1.0.
|
6
|
+
- 1
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- pre2
|
10
|
+
version: 1.1.0.pre2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
- J. Chris Anderson
|
14
|
+
- Matt Aimonetti
|
15
|
+
- Marcos Tapajos
|
16
|
+
- Will Leinweber
|
17
|
+
- Sam Lown
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
@@ -22,61 +22,65 @@ cert_chain: []
|
|
22
22
|
date: 2011-04-06 00:00:00 +02:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rest-client
|
27
|
+
prerelease: false
|
28
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
segments:
|
34
|
+
- 1
|
35
|
+
- 6
|
36
|
+
- 1
|
37
|
+
version: 1.6.1
|
38
|
+
type: :runtime
|
39
|
+
version_requirements: *id001
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: mime-types
|
42
|
+
prerelease: false
|
43
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
segments:
|
49
|
+
- 1
|
50
|
+
- 15
|
51
|
+
version: "1.15"
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: json
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 5
|
65
|
+
- 1
|
66
|
+
version: 1.5.1
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 3
|
80
|
+
- 0
|
81
|
+
version: 1.3.0
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id004
|
80
84
|
description: CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments.
|
81
85
|
email: jchris@apache.org
|
82
86
|
executables: []
|
@@ -84,112 +88,98 @@ executables: []
|
|
84
88
|
extensions: []
|
85
89
|
|
86
90
|
extra_rdoc_files:
|
87
|
-
|
88
|
-
|
89
|
-
|
91
|
+
- LICENSE
|
92
|
+
- README.md
|
93
|
+
- THANKS.md
|
90
94
|
files:
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
95
|
+
- .gitignore
|
96
|
+
- Gemfile
|
97
|
+
- LICENSE
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- THANKS.md
|
101
|
+
- couchrest.gemspec
|
102
|
+
- examples/word_count/markov
|
103
|
+
- examples/word_count/views/books/chunked-map.js
|
104
|
+
- examples/word_count/views/books/united-map.js
|
105
|
+
- examples/word_count/views/markov/chain-map.js
|
106
|
+
- examples/word_count/views/markov/chain-reduce.js
|
107
|
+
- examples/word_count/views/word_count/count-map.js
|
108
|
+
- examples/word_count/views/word_count/count-reduce.js
|
109
|
+
- examples/word_count/word_count.rb
|
110
|
+
- examples/word_count/word_count_query.rb
|
111
|
+
- examples/word_count/word_count_views.rb
|
112
|
+
- history.txt
|
113
|
+
- init.rb
|
114
|
+
- lib/couchrest.rb
|
115
|
+
- lib/couchrest/commands/generate.rb
|
116
|
+
- lib/couchrest/commands/push.rb
|
117
|
+
- lib/couchrest/database.rb
|
118
|
+
- lib/couchrest/design.rb
|
119
|
+
- lib/couchrest/document.rb
|
120
|
+
- lib/couchrest/helper/attachments.rb
|
121
|
+
- lib/couchrest/helper/pager.rb
|
122
|
+
- lib/couchrest/helper/streamer.rb
|
123
|
+
- lib/couchrest/helper/upgrade.rb
|
124
|
+
- lib/couchrest/middlewares/logger.rb
|
125
|
+
- lib/couchrest/monkeypatches.rb
|
126
|
+
- lib/couchrest/response.rb
|
127
|
+
- lib/couchrest/rest_api.rb
|
128
|
+
- lib/couchrest/server.rb
|
129
|
+
- lib/couchrest/support/inheritable_attributes.rb
|
130
|
+
- spec/.gitignore
|
131
|
+
- spec/couchrest/couchrest_spec.rb
|
132
|
+
- spec/couchrest/database_spec.rb
|
133
|
+
- spec/couchrest/design_spec.rb
|
134
|
+
- spec/couchrest/document_spec.rb
|
135
|
+
- spec/couchrest/helpers/pager_spec.rb
|
136
|
+
- spec/couchrest/helpers/streamer_spec.rb
|
137
|
+
- spec/couchrest/server_spec.rb
|
138
|
+
- spec/fixtures/attachments/README
|
139
|
+
- spec/fixtures/attachments/couchdb.png
|
140
|
+
- spec/fixtures/attachments/test.html
|
141
|
+
- spec/fixtures/views/lib.js
|
142
|
+
- spec/fixtures/views/test_view/lib.js
|
143
|
+
- spec/fixtures/views/test_view/only-map.js
|
144
|
+
- spec/fixtures/views/test_view/test-map.js
|
145
|
+
- spec/fixtures/views/test_view/test-reduce.js
|
146
|
+
- spec/spec.opts
|
147
|
+
- spec/spec_helper.rb
|
148
|
+
- utils/remap.rb
|
149
|
+
- utils/subset.rb
|
146
150
|
has_rdoc: true
|
147
151
|
homepage: http://github.com/couchrest/couchrest
|
148
152
|
licenses: []
|
149
153
|
|
150
154
|
post_install_message:
|
151
155
|
rdoc_options:
|
152
|
-
|
156
|
+
- --charset=UTF-8
|
153
157
|
require_paths:
|
154
|
-
|
158
|
+
- lib
|
155
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
156
161
|
requirements:
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
162
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
163
169
|
requirements:
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
170
|
+
- - ">"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
segments:
|
173
|
+
- 1
|
174
|
+
- 3
|
175
|
+
- 1
|
176
|
+
version: 1.3.1
|
171
177
|
requirements: []
|
172
178
|
|
173
179
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.3.
|
180
|
+
rubygems_version: 1.3.7
|
175
181
|
signing_key:
|
176
182
|
specification_version: 3
|
177
183
|
summary: Lean and RESTful interface to CouchDB.
|
178
|
-
test_files:
|
179
|
-
|
180
|
-
- spec/couchrest/database_spec.rb
|
181
|
-
- spec/couchrest/design_spec.rb
|
182
|
-
- spec/couchrest/document_spec.rb
|
183
|
-
- spec/couchrest/helpers/pager_spec.rb
|
184
|
-
- spec/couchrest/helpers/streamer_spec.rb
|
185
|
-
- spec/couchrest/server_spec.rb
|
186
|
-
- spec/fixtures/attachments/README
|
187
|
-
- spec/fixtures/attachments/couchdb.png
|
188
|
-
- spec/fixtures/attachments/test.html
|
189
|
-
- spec/fixtures/views/lib.js
|
190
|
-
- spec/fixtures/views/test_view/lib.js
|
191
|
-
- spec/fixtures/views/test_view/only-map.js
|
192
|
-
- spec/fixtures/views/test_view/test-map.js
|
193
|
-
- spec/fixtures/views/test_view/test-reduce.js
|
194
|
-
- spec/spec.opts
|
195
|
-
- spec/spec_helper.rb
|
184
|
+
test_files: []
|
185
|
+
|