dolly 0.5.1 → 0.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ce659db7a91657df6f7d8d7e8e9c9eecc57b23b
4
- data.tar.gz: 9ed99e0ffcd0d3ec81c77bdc1fa3c85c1d7eec41
3
+ metadata.gz: 916e8ef8b8f4a3d80565b2fefc117a7623074a7a
4
+ data.tar.gz: ee4b24602992793c7b430bf5d348f1c24f510d82
5
5
  SHA512:
6
- metadata.gz: 0ea6637679a4f379356a7e03616d92827e0631bd85e737e7d3fd0f1bcb97dd33fdcdc7d1ec9fb1031e19799c64db2079db407790f79f4e7ea525609686f2aea7
7
- data.tar.gz: b946ab815afee3855339fa13cbe11a60fd4406b5d4f78be03b408e69243a1432d9ffd72d6c37a6b28563bfb993926db5576c30647242b092058457bf245f52b2
6
+ metadata.gz: 0abc6f4dd3f93cd9ab95124e7bfef754673da50c5f30249fa8a6459314252bf442ff9f5a9b368a4d25e2ffc868de231453abae12de2907ce7f4410fad106c7db
7
+ data.tar.gz: 78a9619b0c231563c65a118f322312f47f4847daccfc9e3df323688c025b91c60dd613e6591faae540217180bece6d9eca98e5661342aced1ee295e9851d56b5
data/lib/dolly/request.rb CHANGED
@@ -19,7 +19,7 @@ module Dolly
19
19
  @password = options["password"]
20
20
 
21
21
  @bulk_document = Dolly::BulkDocument.new []
22
- self.class.base_uri "#{protocol}://#{auth_info}#{host}:#{port}"
22
+ self.class.base_uri "#{protocol}://#{host}:#{port}"
23
23
  end
24
24
 
25
25
  def get resource, data = nil
@@ -54,8 +54,8 @@ module Dolly
54
54
  end
55
55
 
56
56
  def auth_info
57
- return "" unless @username.present?
58
- "#{@username}:#{@password}@"
57
+ return nil unless @username.present?
58
+ {username: @username, password: @password}
59
59
  end
60
60
 
61
61
  def values_to_json hash
@@ -68,6 +68,7 @@ module Dolly
68
68
 
69
69
  def request method, resource, data = nil
70
70
  data ||= {}
71
+ data.merge!(basic_auth: auth_info) if auth_info.present?
71
72
  headers = { 'Content-Type' => 'application/json' }
72
73
  response = self.class.send method, full_path(resource), data.merge(headers: headers)
73
74
  if response.code == 404
data/lib/dolly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dolly
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -30859,3 +30859,90 @@ DocumentTest: test_with_default_will_return_default_value_on_nil
30859
30859
  -----------------------------------
30860
30860
  DocumentTest: test_with_timestamps!
30861
30861
  -----------------------------------
30862
+ --------------------------------------------------
30863
+ BulkDocumentTest: test_adding_document_to_bulk_doc
30864
+ --------------------------------------------------
30865
+ -----------------------------------------------------------------
30866
+ BulkDocumentTest: test_bulk_document_intialize_with_empty_payload
30867
+ -----------------------------------------------------------------
30868
+ ------------------------------------------------------------------
30869
+ BulkDocumentTest: test_save_document_will_remove_docs_from_payload
30870
+ ------------------------------------------------------------------
30871
+ --------------------------------------------------------------
30872
+ DocumentTest: test_Dolly::Document_have_bulk_document_instance
30873
+ --------------------------------------------------------------
30874
+ -------------------------------------------
30875
+ DocumentTest: test_all_first_returns_FooBar
30876
+ -------------------------------------------
30877
+ ------------------------------------------
30878
+ DocumentTest: test_all_last_returns_FooBar
30879
+ ------------------------------------------
30880
+ --------------------------------------
30881
+ DocumentTest: test_all_will_get_2_docs
30882
+ --------------------------------------
30883
+ ------------------------------------------------
30884
+ DocumentTest: test_all_will_get_FooBar_documents
30885
+ ------------------------------------------------
30886
+ ----------------------------------------------
30887
+ DocumentTest: test_default_will_be_avoerwriten
30888
+ ----------------------------------------------
30889
+ --------------------------------------------
30890
+ DocumentTest: test_delete_method_on_document
30891
+ --------------------------------------------
30892
+ ------------------------------------------------
30893
+ DocumentTest: test_empty_find_should_raise_error
30894
+ ------------------------------------------------
30895
+ ------------------------------------------------------------
30896
+ DocumentTest: test_error_on_server_raises_Dolly::ServerError
30897
+ ------------------------------------------------------------
30898
+ --------------------------------------------------
30899
+ DocumentTest: test_find_will_get_a_FooBar_document
30900
+ --------------------------------------------------
30901
+ ----------------------------------------------------------------
30902
+ DocumentTest: test_find_with_multiple_ids_will_return_Collection
30903
+ ----------------------------------------------------------------
30904
+ --------------------------------------------------------
30905
+ DocumentTest: test_first_class_method_returns_collection
30906
+ --------------------------------------------------------
30907
+ ---------------------------------------------------------
30908
+ DocumentTest: test_first_class_method_returns_single_item
30909
+ ---------------------------------------------------------
30910
+ ---------------------------------------------
30911
+ DocumentTest: test_getting_not_found_document
30912
+ ---------------------------------------------
30913
+ -------------------------------------------------------
30914
+ DocumentTest: test_last_class_method_returns_collection
30915
+ -------------------------------------------------------
30916
+ --------------------------------------------------------
30917
+ DocumentTest: test_last_class_method_returns_single_item
30918
+ --------------------------------------------------------
30919
+ -------------------------------------------------
30920
+ DocumentTest: test_multi_response_with_right_data
30921
+ -------------------------------------------------
30922
+ ---------------------------------------
30923
+ DocumentTest: test_new_document_have_id
30924
+ ---------------------------------------
30925
+ -----------------------------------------
30926
+ DocumentTest: test_new_in_memory_document
30927
+ -----------------------------------------
30928
+ ------------------------------------
30929
+ DocumentTest: test_query_custom_view
30930
+ ------------------------------------
30931
+ ------------------------------------------
30932
+ DocumentTest: test_soft_delete_on_document
30933
+ ------------------------------------------
30934
+ -------------------------------------------
30935
+ DocumentTest: test_will_have_key_properties
30936
+ -------------------------------------------
30937
+ --------------------------------------------------------
30938
+ DocumentTest: test_will_have_object_with_boolean?_method
30939
+ --------------------------------------------------------
30940
+ ------------------------------------------------
30941
+ DocumentTest: test_will_have_only_set_properties
30942
+ ------------------------------------------------
30943
+ ----------------------------------------------------------------
30944
+ DocumentTest: test_with_default_will_return_default_value_on_nil
30945
+ ----------------------------------------------------------------
30946
+ -----------------------------------
30947
+ DocumentTest: test_with_timestamps!
30948
+ -----------------------------------
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - javierg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-21 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails