dolly 0.5.2 → 0.5.3
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.
- checksums.yaml +4 -4
- data/lib/dolly/version.rb +1 -1
- data/lib/tasks/db.rake +13 -10
- data/test/dummy/log/test.log +87 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35db1156ac5ee6dea64335de6635119f60bb8c52
|
4
|
+
data.tar.gz: 34a314ce6e203b996408b971d61147575bfbe842
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87435c54056ff4f61ff78c96db633df2b9fc8dabc08bf2929defe6e88b6af801dc8d933a6d1dfe25ded35e3a97d4c30427306de6c2e361d9d765373b282c3db0
|
7
|
+
data.tar.gz: 446963d22016a5eb7a31bda7a4a3396b424cf570fe8bebdf6a9ae9f32eab0642bf0f6142cc1a496aa2399d2923244cb21e487a5f6e8513647c4ab245c68a50be
|
data/lib/dolly/version.rb
CHANGED
data/lib/tasks/db.rake
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
namespace :db do
|
2
2
|
desc "Will create if missing database and add default views"
|
3
3
|
task setup: :environment do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}
|
10
|
-
}
|
4
|
+
FIND_VIEW = { "find" => { "map" => "(d)->\n if d._id\n [str, t, id] = d._id.match /([^/]+)[/](.+)/\n emit [t, id], 1 if t and id"} }
|
5
|
+
|
6
|
+
default_doc = {
|
7
|
+
"language" => "coffeescript",
|
8
|
+
"views" => FIND_VIEW
|
11
9
|
}.freeze
|
12
10
|
|
13
11
|
Dolly::Document.database.put "", nil
|
@@ -15,12 +13,17 @@ namespace :db do
|
|
15
13
|
remote_doc = begin
|
16
14
|
JSON.parse Dolly::Document.database.get(Dolly::Document.design_doc).parsed_response
|
17
15
|
rescue Dolly::ResourceNotFound
|
18
|
-
|
16
|
+
nil
|
19
17
|
end
|
20
18
|
|
21
|
-
doc =
|
19
|
+
doc = if remote_doc
|
20
|
+
remote_doc["views"].merge! FIND_VIEW
|
21
|
+
remote_doc
|
22
|
+
else
|
23
|
+
default_doc
|
24
|
+
end
|
22
25
|
|
23
|
-
Dolly::Document.database.put Dolly::Document.design_doc, doc.to_json
|
26
|
+
res = Dolly::Document.database.put Dolly::Document.design_doc, doc.to_json
|
24
27
|
puts "design document #{Dolly::Document.design_doc} was created/updated."
|
25
28
|
end
|
26
29
|
|
data/test/dummy/log/test.log
CHANGED
@@ -30946,3 +30946,90 @@ DocumentTest: test_with_default_will_return_default_value_on_nil
|
|
30946
30946
|
-----------------------------------
|
30947
30947
|
DocumentTest: test_with_timestamps!
|
30948
30948
|
-----------------------------------
|
30949
|
+
--------------------------------------------------
|
30950
|
+
BulkDocumentTest: test_adding_document_to_bulk_doc
|
30951
|
+
--------------------------------------------------
|
30952
|
+
-----------------------------------------------------------------
|
30953
|
+
BulkDocumentTest: test_bulk_document_intialize_with_empty_payload
|
30954
|
+
-----------------------------------------------------------------
|
30955
|
+
------------------------------------------------------------------
|
30956
|
+
BulkDocumentTest: test_save_document_will_remove_docs_from_payload
|
30957
|
+
------------------------------------------------------------------
|
30958
|
+
--------------------------------------------------------------
|
30959
|
+
DocumentTest: test_Dolly::Document_have_bulk_document_instance
|
30960
|
+
--------------------------------------------------------------
|
30961
|
+
-------------------------------------------
|
30962
|
+
DocumentTest: test_all_first_returns_FooBar
|
30963
|
+
-------------------------------------------
|
30964
|
+
------------------------------------------
|
30965
|
+
DocumentTest: test_all_last_returns_FooBar
|
30966
|
+
------------------------------------------
|
30967
|
+
--------------------------------------
|
30968
|
+
DocumentTest: test_all_will_get_2_docs
|
30969
|
+
--------------------------------------
|
30970
|
+
------------------------------------------------
|
30971
|
+
DocumentTest: test_all_will_get_FooBar_documents
|
30972
|
+
------------------------------------------------
|
30973
|
+
----------------------------------------------
|
30974
|
+
DocumentTest: test_default_will_be_avoerwriten
|
30975
|
+
----------------------------------------------
|
30976
|
+
--------------------------------------------
|
30977
|
+
DocumentTest: test_delete_method_on_document
|
30978
|
+
--------------------------------------------
|
30979
|
+
------------------------------------------------
|
30980
|
+
DocumentTest: test_empty_find_should_raise_error
|
30981
|
+
------------------------------------------------
|
30982
|
+
------------------------------------------------------------
|
30983
|
+
DocumentTest: test_error_on_server_raises_Dolly::ServerError
|
30984
|
+
------------------------------------------------------------
|
30985
|
+
--------------------------------------------------
|
30986
|
+
DocumentTest: test_find_will_get_a_FooBar_document
|
30987
|
+
--------------------------------------------------
|
30988
|
+
----------------------------------------------------------------
|
30989
|
+
DocumentTest: test_find_with_multiple_ids_will_return_Collection
|
30990
|
+
----------------------------------------------------------------
|
30991
|
+
--------------------------------------------------------
|
30992
|
+
DocumentTest: test_first_class_method_returns_collection
|
30993
|
+
--------------------------------------------------------
|
30994
|
+
---------------------------------------------------------
|
30995
|
+
DocumentTest: test_first_class_method_returns_single_item
|
30996
|
+
---------------------------------------------------------
|
30997
|
+
---------------------------------------------
|
30998
|
+
DocumentTest: test_getting_not_found_document
|
30999
|
+
---------------------------------------------
|
31000
|
+
-------------------------------------------------------
|
31001
|
+
DocumentTest: test_last_class_method_returns_collection
|
31002
|
+
-------------------------------------------------------
|
31003
|
+
--------------------------------------------------------
|
31004
|
+
DocumentTest: test_last_class_method_returns_single_item
|
31005
|
+
--------------------------------------------------------
|
31006
|
+
-------------------------------------------------
|
31007
|
+
DocumentTest: test_multi_response_with_right_data
|
31008
|
+
-------------------------------------------------
|
31009
|
+
---------------------------------------
|
31010
|
+
DocumentTest: test_new_document_have_id
|
31011
|
+
---------------------------------------
|
31012
|
+
-----------------------------------------
|
31013
|
+
DocumentTest: test_new_in_memory_document
|
31014
|
+
-----------------------------------------
|
31015
|
+
------------------------------------
|
31016
|
+
DocumentTest: test_query_custom_view
|
31017
|
+
------------------------------------
|
31018
|
+
------------------------------------------
|
31019
|
+
DocumentTest: test_soft_delete_on_document
|
31020
|
+
------------------------------------------
|
31021
|
+
-------------------------------------------
|
31022
|
+
DocumentTest: test_will_have_key_properties
|
31023
|
+
-------------------------------------------
|
31024
|
+
--------------------------------------------------------
|
31025
|
+
DocumentTest: test_will_have_object_with_boolean?_method
|
31026
|
+
--------------------------------------------------------
|
31027
|
+
------------------------------------------------
|
31028
|
+
DocumentTest: test_will_have_only_set_properties
|
31029
|
+
------------------------------------------------
|
31030
|
+
----------------------------------------------------------------
|
31031
|
+
DocumentTest: test_with_default_will_return_default_value_on_nil
|
31032
|
+
----------------------------------------------------------------
|
31033
|
+
-----------------------------------
|
31034
|
+
DocumentTest: test_with_timestamps!
|
31035
|
+
-----------------------------------
|