couchrest 1.1.0.pre → 1.1.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,4 +2,5 @@
2
2
  html/*
3
3
  pkg
4
4
  *.swp
5
+ *.gem
5
6
  Gemfile.lock
@@ -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.pre"
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"]
@@ -1,4 +1,4 @@
1
- == 1.1.0.rc
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
@@ -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['reduce'] ||= false if can_reduce_view?(view_name)
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
- - 1
7
- - 1
8
- - 0
9
- - pre
10
- version: 1.1.0.pre
6
+ - 1
7
+ - 1
8
+ - 0
9
+ - pre2
10
+ version: 1.1.0.pre2
11
11
  platform: ruby
12
12
  authors:
13
- - J. Chris Anderson
14
- - Matt Aimonetti
15
- - Marcos Tapajos
16
- - Will Leinweber
17
- - Sam Lown
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
- - !ruby/object:Gem::Dependency
26
- name: rest-client
27
- prerelease: false
28
- requirement: &id001 !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ~>
31
- - !ruby/object:Gem::Version
32
- segments:
33
- - 1
34
- - 6
35
- - 1
36
- version: 1.6.1
37
- type: :runtime
38
- version_requirements: *id001
39
- - !ruby/object:Gem::Dependency
40
- name: mime-types
41
- prerelease: false
42
- requirement: &id002 !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- segments:
47
- - 1
48
- - 15
49
- version: "1.15"
50
- type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: json
54
- prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
- requirements:
57
- - - ~>
58
- - !ruby/object:Gem::Version
59
- segments:
60
- - 1
61
- - 5
62
- - 1
63
- version: 1.5.1
64
- type: :runtime
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: rspec
68
- prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ~>
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 1
75
- - 3
76
- - 0
77
- version: 1.3.0
78
- type: :development
79
- version_requirements: *id004
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
- - LICENSE
88
- - README.md
89
- - THANKS.md
91
+ - LICENSE
92
+ - README.md
93
+ - THANKS.md
90
94
  files:
91
- - .gitignore
92
- - Gemfile
93
- - LICENSE
94
- - README.md
95
- - Rakefile
96
- - THANKS.md
97
- - couchrest.gemspec
98
- - examples/word_count/markov
99
- - examples/word_count/views/books/chunked-map.js
100
- - examples/word_count/views/books/united-map.js
101
- - examples/word_count/views/markov/chain-map.js
102
- - examples/word_count/views/markov/chain-reduce.js
103
- - examples/word_count/views/word_count/count-map.js
104
- - examples/word_count/views/word_count/count-reduce.js
105
- - examples/word_count/word_count.rb
106
- - examples/word_count/word_count_query.rb
107
- - examples/word_count/word_count_views.rb
108
- - history.txt
109
- - init.rb
110
- - lib/couchrest.rb
111
- - lib/couchrest/commands/generate.rb
112
- - lib/couchrest/commands/push.rb
113
- - lib/couchrest/database.rb
114
- - lib/couchrest/design.rb
115
- - lib/couchrest/document.rb
116
- - lib/couchrest/helper/attachments.rb
117
- - lib/couchrest/helper/pager.rb
118
- - lib/couchrest/helper/streamer.rb
119
- - lib/couchrest/helper/upgrade.rb
120
- - lib/couchrest/middlewares/logger.rb
121
- - lib/couchrest/monkeypatches.rb
122
- - lib/couchrest/response.rb
123
- - lib/couchrest/rest_api.rb
124
- - lib/couchrest/server.rb
125
- - lib/couchrest/support/inheritable_attributes.rb
126
- - spec/.gitignore
127
- - spec/couchrest/couchrest_spec.rb
128
- - spec/couchrest/database_spec.rb
129
- - spec/couchrest/design_spec.rb
130
- - spec/couchrest/document_spec.rb
131
- - spec/couchrest/helpers/pager_spec.rb
132
- - spec/couchrest/helpers/streamer_spec.rb
133
- - spec/couchrest/server_spec.rb
134
- - spec/fixtures/attachments/README
135
- - spec/fixtures/attachments/couchdb.png
136
- - spec/fixtures/attachments/test.html
137
- - spec/fixtures/views/lib.js
138
- - spec/fixtures/views/test_view/lib.js
139
- - spec/fixtures/views/test_view/only-map.js
140
- - spec/fixtures/views/test_view/test-map.js
141
- - spec/fixtures/views/test_view/test-reduce.js
142
- - spec/spec.opts
143
- - spec/spec_helper.rb
144
- - utils/remap.rb
145
- - utils/subset.rb
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
- - --charset=UTF-8
156
+ - --charset=UTF-8
153
157
  require_paths:
154
- - lib
158
+ - lib
155
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
+ none: false
156
161
  requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- segments:
160
- - 0
161
- version: "0"
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
- - !ruby/object:Gem::Version
166
- segments:
167
- - 1
168
- - 3
169
- - 1
170
- version: 1.3.1
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.6
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
- - spec/couchrest/couchrest_spec.rb
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
+