couch_potato 0.6.0 → 0.7.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.travis.yml +9 -1
- data/CHANGES.md +12 -0
- data/Gemfile.lock +29 -23
- data/MIT-LICENSE.txt +1 -1
- data/README.md +68 -38
- data/Rakefile +19 -60
- data/active_support_3_0.lock +4 -0
- data/active_support_3_1.lock +4 -0
- data/active_support_3_2 +4 -0
- data/active_support_3_2.lock +55 -0
- data/couch_potato.gemspec +1 -0
- data/lib/couch_potato/database.rb +55 -27
- data/lib/couch_potato/persistence/active_model_compliance.rb +6 -2
- data/lib/couch_potato/persistence/callbacks.rb +0 -1
- data/lib/couch_potato/persistence/dirty_attributes.rb +8 -17
- data/lib/couch_potato/persistence/json.rb +3 -2
- data/lib/couch_potato/persistence/properties.rb +19 -8
- data/lib/couch_potato/persistence/simple_property.rb +1 -3
- data/lib/couch_potato/persistence/type_caster.rb +7 -2
- data/lib/couch_potato/persistence.rb +27 -13
- data/lib/couch_potato/railtie.rb +1 -1
- data/lib/couch_potato/rspec/matchers/list_as_matcher.rb +12 -12
- data/lib/couch_potato/rspec/matchers/map_to_matcher.rb +8 -8
- data/lib/couch_potato/rspec/matchers/reduce_to_matcher.rb +10 -10
- data/lib/couch_potato/rspec/matchers.rb +8 -7
- data/lib/couch_potato/validation.rb +15 -11
- data/lib/couch_potato/version.rb +1 -1
- data/lib/couch_potato/view/base_view_spec.rb +14 -12
- data/lib/couch_potato/view/model_view_spec.rb +134 -39
- data/lib/couch_potato/view/properties_view_spec.rb +11 -7
- data/lib/couch_potato/view/view_query.rb +10 -9
- data/lib/couch_potato.rb +25 -10
- data/spec/callbacks_spec.rb +88 -0
- data/spec/create_spec.rb +22 -4
- data/spec/default_property_spec.rb +6 -0
- data/spec/property_spec.rb +81 -44
- data/spec/railtie_spec.rb +20 -18
- data/spec/spec_helper.rb +19 -1
- data/spec/unit/active_model_compliance_spec.rb +17 -11
- data/spec/unit/attributes_spec.rb +33 -10
- data/spec/unit/base_view_spec_spec.rb +19 -5
- data/spec/unit/couch_potato_spec.rb +1 -20
- data/spec/unit/create_spec.rb +2 -2
- data/spec/unit/database_spec.rb +113 -47
- data/spec/unit/dirty_attributes_spec.rb +19 -19
- data/spec/unit/model_view_spec_spec.rb +78 -1
- data/spec/unit/properties_view_spec_spec.rb +18 -5
- data/spec/unit/validation_spec.rb +1 -55
- data/spec/unit/view_query_spec.rb +48 -26
- data/spec/{custom_view_spec.rb → views_spec.rb} +59 -17
- metadata +88 -90
- data/.rvmrc +0 -1
- data/lib/core_ext/object.rb +0 -5
- data/lib/core_ext/string.rb +0 -12
- data/lib/core_ext/symbol.rb +0 -15
- data/lib/couch_potato/validation/with_active_model.rb +0 -27
- data/lib/couch_potato/validation/with_validatable.rb +0 -41
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe 'CouchPotato
|
4
|
-
before(:each) do
|
5
|
-
@original_validation_framework = CouchPotato::Config.validation_framework
|
6
|
-
end
|
7
|
-
after(:each) do
|
8
|
-
CouchPotato::Config.validation_framework = @original_validation_framework
|
9
|
-
end
|
3
|
+
describe 'CouchPotato Validation' do
|
10
4
|
|
11
5
|
describe "access to errors object" do
|
12
6
|
it "should description" do
|
@@ -16,52 +10,4 @@ describe 'CouchPotato::Config.validation_framework' do
|
|
16
10
|
end
|
17
11
|
end
|
18
12
|
|
19
|
-
begin
|
20
|
-
require 'active_model'
|
21
|
-
|
22
|
-
describe 'with :active_model' do
|
23
|
-
before(:each) do
|
24
|
-
CouchPotato::Config.validation_framework = :active_model
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should include ActiveModel::Validations upon inclusion of CouchPotato::Persistence" do
|
28
|
-
model_class = Class.new
|
29
|
-
ActiveModel::Validations.should_receive(:included).with(model_class)
|
30
|
-
model_class.send(:include, CouchPotato::Persistence)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
rescue LoadError
|
35
|
-
STDERR.puts "WARNING: active_model gem not installed. Not running ActiveModel validation specs."
|
36
|
-
end
|
37
|
-
|
38
|
-
begin
|
39
|
-
require 'validatable'
|
40
|
-
|
41
|
-
describe 'with :validatable' do
|
42
|
-
before(:each) do
|
43
|
-
CouchPotato::Config.validation_framework = :validatable
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should include ActiveModel::Validations upon inclusion of CouchPotato::Persistence" do
|
47
|
-
model_class = Class.new
|
48
|
-
Validatable.should_receive(:included).with(model_class)
|
49
|
-
model_class.send(:include, CouchPotato::Persistence)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
rescue LoadError
|
54
|
-
STDERR.puts "WARNING: validatable gem not installed. Not running Validatable validation specs."
|
55
|
-
end
|
56
|
-
|
57
|
-
describe 'with an unknown framework' do
|
58
|
-
before(:each) do
|
59
|
-
CouchPotato::Config.validation_framework = :unknown_validation_framework
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should raise an error" do
|
63
|
-
model_class = Class.new
|
64
|
-
lambda { model_class.send(:include, CouchPotato::Persistence) }.should raise_error
|
65
|
-
end
|
66
|
-
end
|
67
13
|
end
|
@@ -4,46 +4,68 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
|
|
4
4
|
before(:each) do
|
5
5
|
CouchRest.stub(:get => nil)
|
6
6
|
end
|
7
|
-
|
8
|
-
it "
|
7
|
+
|
8
|
+
it "does not pass a key if conditions are empty" do
|
9
9
|
db = mock 'db', :get => nil, :save_doc => nil
|
10
10
|
db.should_receive(:view).with(anything, {})
|
11
11
|
CouchPotato::View::ViewQuery.new(db, '', {:view0 => {}}).query_view!
|
12
12
|
end
|
13
|
-
|
14
|
-
it
|
13
|
+
|
14
|
+
it 'updates a view if it does not exist' do
|
15
|
+
db = mock 'db', :get => nil, :view => nil
|
16
|
+
|
17
|
+
db.should_receive(:save_doc).with(
|
18
|
+
'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
|
19
|
+
'lists' => {}, "_id" => "_design/design", "language" => "javascript")
|
20
|
+
|
21
|
+
CouchPotato::View::ViewQuery.new(db, 'design', :view => {:map => '<map_code>', :reduce => '<reduce_code>'}).query_view!
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'updates a view in erlang if it does not exist' do
|
25
|
+
db = mock 'db', :get => nil, :view => nil
|
26
|
+
|
27
|
+
db.should_receive(:save_doc).with(
|
28
|
+
'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
|
29
|
+
'lists' => {}, "_id" => "_design/design", "language" => "erlang")
|
30
|
+
|
31
|
+
CouchPotato::View::ViewQuery.new(db, 'design',
|
32
|
+
{:view => {:map => '<map_code>', :reduce => '<reduce_code>'}},
|
33
|
+
nil, :erlang).query_view!
|
34
|
+
end
|
35
|
+
|
36
|
+
it "does not update a view when the map/reduce functions haven't changed" do
|
15
37
|
db = mock 'db', :get => {'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}}, :view => nil
|
16
38
|
db.should_not_receive(:save_doc)
|
17
39
|
CouchPotato::View::ViewQuery.new(db, 'design', :view => {:map => '<map_code>', :reduce => '<reduce_code>'}).query_view!
|
18
40
|
end
|
19
|
-
|
20
|
-
it "
|
41
|
+
|
42
|
+
it "does not update a view when the list function hasn't changed" do
|
21
43
|
db = mock 'db', :get => {'views' => {'view' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}, 'lists' => {'list0' => '<list_code>'}}, :view => nil
|
22
44
|
db.should_not_receive(:save_doc)
|
23
45
|
CouchPotato::View::ViewQuery.new(db, 'design', {:view => {:map => '<map_code>', :reduce => '<reduce_code>'}}, :list0 => '<list_code>').query_view!
|
24
46
|
end
|
25
|
-
|
26
|
-
it "
|
47
|
+
|
48
|
+
it "updates a view when the map function has changed" do
|
27
49
|
db = mock 'db', :get => {'views' => {'view2' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}}, :view => nil
|
28
50
|
db.should_receive(:save_doc)
|
29
51
|
CouchPotato::View::ViewQuery.new(db, 'design', :view2 => {:map => '<new map_code>', :reduce => '<reduce_code>'}).query_view!
|
30
52
|
end
|
31
|
-
|
32
|
-
it "
|
53
|
+
|
54
|
+
it "does not pass in a reduce key if there is no reduce function" do
|
33
55
|
db = mock 'db', :get => {'views' => {}}, :view => nil
|
34
|
-
|
56
|
+
|
35
57
|
db.should_receive(:save_doc).with('views' => {'view3' => {'map' => '<map code>'}})
|
36
|
-
|
58
|
+
|
37
59
|
CouchPotato::View::ViewQuery.new(db, 'design', :view3 => {:map => '<map code>', :reduce => nil}).query_view!
|
38
60
|
end
|
39
|
-
|
40
|
-
it "
|
61
|
+
|
62
|
+
it "updates a view when the reduce function has changed" do
|
41
63
|
db = mock 'db', :get => {'views' => {'view4' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}}, :view => nil
|
42
64
|
db.should_receive(:save_doc)
|
43
65
|
CouchPotato::View::ViewQuery.new(db, 'design', :view4 => {:map => '<map_code>', :reduce => '<new reduce_code>'}).query_view!
|
44
66
|
end
|
45
|
-
|
46
|
-
it "
|
67
|
+
|
68
|
+
it "updates a view when the list function has changed" do
|
47
69
|
db = mock 'db', :get => {
|
48
70
|
'views' => {'view5' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
|
49
71
|
'lists' => {'list1' => '<list_code>'}
|
@@ -51,16 +73,16 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
|
|
51
73
|
db.should_receive(:save_doc)
|
52
74
|
CouchPotato::View::ViewQuery.new(db, 'design', {:view5 => {:map => '<map_code>', :reduce => '<reduce_code>'}}, :list1 => '<new_list_code>').query_view!
|
53
75
|
end
|
54
|
-
|
55
|
-
it "
|
76
|
+
|
77
|
+
it "updates a view when there wasn't a list function but now there is one" do
|
56
78
|
db = mock 'db', :get => {
|
57
79
|
'views' => {'view6' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}
|
58
80
|
}, :view => nil
|
59
81
|
db.should_receive(:save_doc)
|
60
82
|
CouchPotato::View::ViewQuery.new(db, 'design', {:view6 => {:map => '<map_code>', :reduce => '<reduce_code>'}}, :list1 => '<new_list_code>').query_view!
|
61
83
|
end
|
62
|
-
|
63
|
-
it "
|
84
|
+
|
85
|
+
it "does not update a view when there is a list function but no list function is passed" do
|
64
86
|
db = mock 'db', :get => {
|
65
87
|
'views' => {'view7' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}},
|
66
88
|
'lists' => {'list1' => '<list_code>'}
|
@@ -68,19 +90,19 @@ describe CouchPotato::View::ViewQuery, 'query_view!' do
|
|
68
90
|
db.should_not_receive(:save_doc)
|
69
91
|
CouchPotato::View::ViewQuery.new(db, 'design', {:view7 => {:map => '<map_code>', :reduce => '<reduce_code>'}}, {}).query_view!
|
70
92
|
end
|
71
|
-
|
72
|
-
it "
|
93
|
+
|
94
|
+
it "does not update a view when there were no lists before and no list function is passed" do
|
73
95
|
db = mock 'db', :get => {
|
74
96
|
'views' => {'view8' => {'map' => '<map_code>', 'reduce' => '<reduce_code>'}}
|
75
97
|
}, :view => nil
|
76
98
|
db.should_not_receive(:save_doc)
|
77
99
|
CouchPotato::View::ViewQuery.new(db, 'design', {:view8 => {:map => '<map_code>', :reduce => '<reduce_code>'}}, {}).query_view!
|
78
100
|
end
|
79
|
-
|
80
|
-
it "
|
101
|
+
|
102
|
+
it "queries CouchRest directly when querying a list" do
|
81
103
|
db = stub('db').as_null_object
|
82
104
|
CouchRest.should_receive(:get).with('http://127.0.0.1:5984/couch_potato_test/_design/my_design/_list/list1/view9?key=1')
|
83
105
|
CouchPotato::View::ViewQuery.new(db, 'my_design', {:view9 => {:map => '<map_code>', :reduce => '<reduce_code>'}}, :list1 => '<new_list_code>').query_view!(:key => 1)
|
84
106
|
end
|
85
|
-
|
86
|
-
end
|
107
|
+
|
108
|
+
end
|
@@ -22,18 +22,61 @@ end
|
|
22
22
|
class CustomBuild < Build
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
class ErlangBuild
|
26
|
+
include CouchPotato::Persistence
|
27
|
+
property :name
|
28
|
+
property :code
|
29
|
+
|
30
|
+
view :by_name, :key => :name, :language => :erlang
|
31
|
+
view :by_name_and_code, :key => [:name, :code], :language => :erlang
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'views' do
|
26
35
|
before(:each) do
|
27
36
|
recreate_db
|
28
37
|
@db = CouchPotato.database
|
29
38
|
end
|
30
39
|
|
40
|
+
context 'in erlang' do
|
41
|
+
it 'builds views with single keys' do
|
42
|
+
build = ErlangBuild.new(:name => 'erlang')
|
43
|
+
@db.save_document build
|
44
|
+
|
45
|
+
results = @db.view(ErlangBuild.by_name('erlang'))
|
46
|
+
results.should == [build]
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'does not crash couchdb when a document does not have the key' do
|
50
|
+
build = {'ruby_class' => 'ErlangBuild'}
|
51
|
+
@db.couchrest_database.save_doc build
|
52
|
+
|
53
|
+
results = @db.view(ErlangBuild.by_name(:key => nil))
|
54
|
+
results.size.should == 1
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'builds views with composite keys' do
|
58
|
+
build = ErlangBuild.new(:name => 'erlang', :code => '123')
|
59
|
+
@db.save_document build
|
60
|
+
|
61
|
+
results = @db.view(ErlangBuild.by_name_and_code(['erlang', '123']))
|
62
|
+
results.should == [build]
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'can reduce over erlang views' do
|
66
|
+
build = ErlangBuild.new(:name => 'erlang')
|
67
|
+
@db.save_document build
|
68
|
+
|
69
|
+
results = @db.view(ErlangBuild.by_name(:reduce => true))
|
70
|
+
results.should == 1
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
31
74
|
it "should return instances of the class" do
|
32
75
|
@db.save_document Build.new(:state => 'success', :time => '2008-01-01')
|
33
76
|
results = @db.view(Build.timeline)
|
34
77
|
results.map(&:class).should == [Build]
|
35
78
|
end
|
36
|
-
|
79
|
+
|
37
80
|
it "should return the ids if there document was not included" do
|
38
81
|
build = Build.new(:state => 'success', :time => '2008-01-01')
|
39
82
|
@db.save_document build
|
@@ -61,19 +104,19 @@ describe 'view' do
|
|
61
104
|
it "should count zero documents" do
|
62
105
|
@db.view(Build.count(:reduce => true)).should == 0
|
63
106
|
end
|
64
|
-
|
107
|
+
|
65
108
|
it "should return the total_rows" do
|
66
109
|
@db.save_document! Build.new(:state => 'success', :time => '2008-01-01')
|
67
110
|
@db.view(Build.count(:reduce => false)).total_rows.should == 1
|
68
111
|
end
|
69
|
-
|
112
|
+
|
70
113
|
describe "with multiple keys" do
|
71
114
|
it "should return the documents with matching keys" do
|
72
115
|
build = Build.new(:state => 'success', :time => '2008-01-01')
|
73
116
|
@db.save! build
|
74
117
|
@db.view(Build.timeline(:keys => ['2008-01-01'])).should == [build]
|
75
118
|
end
|
76
|
-
|
119
|
+
|
77
120
|
it "should not return documents with non-matching keys" do
|
78
121
|
build = Build.new(:state => 'success', :time => '2008-01-01')
|
79
122
|
@db.save! build
|
@@ -128,7 +171,7 @@ describe 'view' do
|
|
128
171
|
CouchPotato.couchrest_database.save_doc({:state => 'success', :time => '2008-01-01'})
|
129
172
|
@db.view(Build.custom_timeline).map(&:time).should == [nil]
|
130
173
|
end
|
131
|
-
|
174
|
+
|
132
175
|
describe "that returns null documents" do
|
133
176
|
it "should return instances of the class" do
|
134
177
|
CouchPotato.couchrest_database.save_doc({:state => 'success', :time => '2008-01-01'})
|
@@ -139,7 +182,7 @@ describe 'view' do
|
|
139
182
|
CouchPotato.couchrest_database.save_doc({:state => 'success', :time => '2008-01-01'})
|
140
183
|
@db.view(Build.custom_timeline_returns_docs).map(&:state).should == ['success']
|
141
184
|
end
|
142
|
-
|
185
|
+
|
143
186
|
it "should still return instance of class if document included JSON.create_id" do
|
144
187
|
CouchPotato.couchrest_database.save_doc({:state => 'success', :time => '2008-01-01', JSON.create_id.to_sym => "Build"})
|
145
188
|
view_data = @db.view(Build.custom_timeline_returns_docs)
|
@@ -147,14 +190,14 @@ describe 'view' do
|
|
147
190
|
view_data.map(&:state).should == ['success']
|
148
191
|
end
|
149
192
|
end
|
150
|
-
|
193
|
+
|
151
194
|
describe "additional reduce function given" do
|
152
195
|
it "should still assign the id" do
|
153
196
|
doc = CouchPotato.couchrest_database.save_doc({})
|
154
197
|
CouchPotato.couchrest_database.save_doc({:foreign_key => doc['id']})
|
155
198
|
@db.view(Build.custom_with_reduce).map(&:_id).should == [doc['id']]
|
156
199
|
end
|
157
|
-
|
200
|
+
|
158
201
|
describe "when the additional reduce function is a typical count" do
|
159
202
|
it "should parse the reduce count" do
|
160
203
|
doc = CouchPotato.couchrest_database.save_doc({})
|
@@ -169,7 +212,7 @@ describe 'view' do
|
|
169
212
|
it "should create a map function with the composite key" do
|
170
213
|
CouchPotato::View::ViewQuery.should_receive(:new) do |db, design_name, view, list|
|
171
214
|
view['key_array_timeline'][:map].should match(/emit\(\[doc\['time'\], doc\['state'\]\]/)
|
172
|
-
|
215
|
+
|
173
216
|
stub('view query', :query_view! => {'rows' => []})
|
174
217
|
end
|
175
218
|
@db.view Build.key_array_timeline
|
@@ -202,16 +245,16 @@ describe 'view' do
|
|
202
245
|
@db.view(CustomBuild.timeline).first.should be_kind_of(CustomBuild)
|
203
246
|
end
|
204
247
|
end
|
205
|
-
|
248
|
+
|
206
249
|
describe "list functions" do
|
207
250
|
class Coworker
|
208
251
|
include CouchPotato::Persistence
|
209
|
-
|
252
|
+
|
210
253
|
property :name
|
211
|
-
|
254
|
+
|
212
255
|
view :all_with_list, :key => :name, :list => :append_doe
|
213
256
|
view :all, :key => :name
|
214
|
-
|
257
|
+
|
215
258
|
list :append_doe, <<-JS
|
216
259
|
function(head, req) {
|
217
260
|
var row;
|
@@ -224,16 +267,15 @@ describe 'view' do
|
|
224
267
|
}
|
225
268
|
JS
|
226
269
|
end
|
227
|
-
|
270
|
+
|
228
271
|
it "should use the list function declared at class level" do
|
229
272
|
@db.save! Coworker.new(:name => 'joe')
|
230
273
|
@db.view(Coworker.all_with_list).first.name.should == 'joe doe'
|
231
274
|
end
|
232
|
-
|
275
|
+
|
233
276
|
it "should use the list function passed at runtime" do
|
234
277
|
@db.save! Coworker.new(:name => 'joe')
|
235
278
|
@db.view(Coworker.all(:list => :append_doe)).first.name.should == 'joe doe'
|
236
279
|
end
|
237
|
-
|
238
280
|
end
|
239
281
|
end
|
metadata
CHANGED
@@ -1,106 +1,111 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: couch_potato
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.0.pre.1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Alexander Lang
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: json
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70113496423300 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
18
|
+
requirements:
|
22
19
|
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
24
21
|
version: 1.6.0
|
25
22
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: couchrest
|
29
23
|
prerelease: false
|
30
|
-
|
24
|
+
version_requirements: *70113496423300
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: couchrest
|
27
|
+
requirement: &70113496422680 !ruby/object:Gem::Requirement
|
31
28
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
35
32
|
version: 1.0.1
|
36
33
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: activemodel
|
40
34
|
prerelease: false
|
41
|
-
|
35
|
+
version_requirements: *70113496422680
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activemodel
|
38
|
+
requirement: &70113496422120 !ruby/object:Gem::Requirement
|
42
39
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
47
44
|
type: :runtime
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: rspec
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *70113496422120
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &70113496421240 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
58
55
|
type: :development
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: timecop
|
62
56
|
prerelease: false
|
63
|
-
|
57
|
+
version_requirements: *70113496421240
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: timecop
|
60
|
+
requirement: &70113496436300 !ruby/object:Gem::Requirement
|
64
61
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
69
66
|
type: :development
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: tzinfo
|
73
67
|
prerelease: false
|
74
|
-
|
68
|
+
version_requirements: *70113496436300
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: tzinfo
|
71
|
+
requirement: &70113496434780 !ruby/object:Gem::Requirement
|
75
72
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version:
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
80
77
|
type: :development
|
81
|
-
|
82
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70113496434780
|
80
|
+
- !ruby/object:Gem::Dependency
|
83
81
|
name: rake
|
82
|
+
requirement: &70113496434200 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
84
89
|
prerelease: false
|
85
|
-
|
90
|
+
version_requirements: *70113496434200
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: therubyracer
|
93
|
+
requirement: &70113496433500 !ruby/object:Gem::Requirement
|
86
94
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
91
99
|
type: :development
|
92
|
-
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70113496433500
|
93
102
|
description: Ruby persistence layer for CouchDB
|
94
103
|
email: alex@upstre.am
|
95
104
|
executables: []
|
96
|
-
|
97
105
|
extensions: []
|
98
|
-
|
99
106
|
extra_rdoc_files: []
|
100
|
-
|
101
|
-
files:
|
107
|
+
files:
|
102
108
|
- .gitignore
|
103
|
-
- .rvmrc
|
104
109
|
- .travis.yml
|
105
110
|
- CHANGES.md
|
106
111
|
- CREDITS
|
@@ -113,12 +118,11 @@ files:
|
|
113
118
|
- active_support_3_0.lock
|
114
119
|
- active_support_3_1
|
115
120
|
- active_support_3_1.lock
|
121
|
+
- active_support_3_2
|
122
|
+
- active_support_3_2.lock
|
116
123
|
- couch_potato.gemspec
|
117
124
|
- init.rb
|
118
125
|
- lib/core_ext/date.rb
|
119
|
-
- lib/core_ext/object.rb
|
120
|
-
- lib/core_ext/string.rb
|
121
|
-
- lib/core_ext/symbol.rb
|
122
126
|
- lib/core_ext/time.rb
|
123
127
|
- lib/couch_potato.rb
|
124
128
|
- lib/couch_potato/database.rb
|
@@ -143,8 +147,6 @@ files:
|
|
143
147
|
- lib/couch_potato/rspec/matchers/reduce_to_matcher.rb
|
144
148
|
- lib/couch_potato/rspec/stub_db.rb
|
145
149
|
- lib/couch_potato/validation.rb
|
146
|
-
- lib/couch_potato/validation/with_active_model.rb
|
147
|
-
- lib/couch_potato/validation/with_validatable.rb
|
148
150
|
- lib/couch_potato/version.rb
|
149
151
|
- lib/couch_potato/view/base_view_spec.rb
|
150
152
|
- lib/couch_potato/view/custom_view_spec.rb
|
@@ -159,7 +161,6 @@ files:
|
|
159
161
|
- spec/attachments_spec.rb
|
160
162
|
- spec/callbacks_spec.rb
|
161
163
|
- spec/create_spec.rb
|
162
|
-
- spec/custom_view_spec.rb
|
163
164
|
- spec/default_property_spec.rb
|
164
165
|
- spec/destroy_spec.rb
|
165
166
|
- spec/fixtures/address.rb
|
@@ -192,39 +193,35 @@ files:
|
|
192
193
|
- spec/unit/view_query_spec.rb
|
193
194
|
- spec/update_spec.rb
|
194
195
|
- spec/view_updates_spec.rb
|
195
|
-
|
196
|
+
- spec/views_spec.rb
|
196
197
|
homepage: http://github.com/langalex/couch_potato
|
197
198
|
licenses: []
|
198
|
-
|
199
199
|
post_install_message:
|
200
200
|
rdoc_options: []
|
201
|
-
|
202
|
-
require_paths:
|
201
|
+
require_paths:
|
203
202
|
- lib
|
204
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
203
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
205
204
|
none: false
|
206
|
-
requirements:
|
207
|
-
- -
|
208
|
-
- !ruby/object:Gem::Version
|
209
|
-
version:
|
210
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ! '>='
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
210
|
none: false
|
212
|
-
requirements:
|
213
|
-
- -
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version:
|
211
|
+
requirements:
|
212
|
+
- - ! '>'
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 1.3.1
|
216
215
|
requirements: []
|
217
|
-
|
218
216
|
rubyforge_project:
|
219
|
-
rubygems_version: 1.
|
217
|
+
rubygems_version: 1.8.11
|
220
218
|
signing_key:
|
221
219
|
specification_version: 3
|
222
220
|
summary: Ruby persistence layer for CouchDB
|
223
|
-
test_files:
|
221
|
+
test_files:
|
224
222
|
- spec/attachments_spec.rb
|
225
223
|
- spec/callbacks_spec.rb
|
226
224
|
- spec/create_spec.rb
|
227
|
-
- spec/custom_view_spec.rb
|
228
225
|
- spec/default_property_spec.rb
|
229
226
|
- spec/destroy_spec.rb
|
230
227
|
- spec/fixtures/address.rb
|
@@ -257,3 +254,4 @@ test_files:
|
|
257
254
|
- spec/unit/view_query_spec.rb
|
258
255
|
- spec/update_spec.rb
|
259
256
|
- spec/view_updates_spec.rb
|
257
|
+
- spec/views_spec.rb
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm 1.9.2@couch_potato
|
data/lib/core_ext/object.rb
DELETED
data/lib/core_ext/string.rb
DELETED
data/lib/core_ext/symbol.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# taken from ActiveSupport 2.3.2
|
2
|
-
unless :to_proc.respond_to?(:to_proc)
|
3
|
-
class Symbol
|
4
|
-
# Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
|
5
|
-
#
|
6
|
-
# # The same as people.collect { |p| p.name }
|
7
|
-
# people.collect(&:name)
|
8
|
-
#
|
9
|
-
# # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
|
10
|
-
# people.select(&:manager?).collect(&:salary)
|
11
|
-
def to_proc
|
12
|
-
Proc.new { |*args| args.shift.__send__(self, *args) }
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|