couch_rest_adapter 0.7.1 → 0.8.0

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: 83e246d746f6829fc0dbbd2d8e416add14bf45a4
4
- data.tar.gz: 025b484105520d3ba03fc40ca139c61ffe0c03ca
3
+ metadata.gz: 04c0ca6fe65e476bd2fd8e46b4b56a3884e76dec
4
+ data.tar.gz: 2f3860eb9434e1fca36f979e7c3413975faed8e6
5
5
  SHA512:
6
- metadata.gz: ed65ab24fabcd8dd2525d5bc44dadc36425a5234c0beaf01808c56d2618c58225544c7322ecd7a7b3ed8765786a2d9e312f020d1d5d047f1bd63da103de18c15
7
- data.tar.gz: ec86619d08e786706d412de7fd607e23424432007304ba59163e25c45bd08a3f9b781895a6fc7830ff401bfb6a2b59290ab2cc2fcaf5ce37435ba9f23aca8f3e
6
+ metadata.gz: f234ec7d784c22928afa6b5d6bdae67a51cdacb7fa5448edcba9db1796675fff15e5e234b519aa5e468831b20ac940bd51e2a1ccf2439ed974d68575aaa46b44
7
+ data.tar.gz: 2f4eaa5d13448c0dd84e563488a8fad59778b4666a85e69854905e9f30edb9c15e14fa379c343d7ab588acba3fca02153e8bb272eb0d529c62e491651f270e7a
data/README.rdoc CHANGED
@@ -29,6 +29,9 @@ All this are required attributes.
29
29
  port: 5984
30
30
  protocol: http
31
31
  design_doc: my_app
32
+ # optional
33
+ # username: username
34
+ # password: password
32
35
 
33
36
  development:
34
37
  <<: *defaults
@@ -38,6 +41,7 @@ All this are required attributes.
38
41
  <<: *defaults
39
42
  name: db_test
40
43
 
44
+ Versions > 0.8.0 support https protocol, s
41
45
 
42
46
  === CouchViews
43
47
 
@@ -90,4 +94,3 @@ One thing: this will allow you to add tests to your couch views ;-)
90
94
  * Allow setting new attributes with ```model.attribute = value```
91
95
  * More test coverage
92
96
  * Add tasks for pushing design documents
93
- * Add support for basic database http auth.
@@ -11,9 +11,14 @@ module CouchRestAdapter
11
11
  YAML::load( ERB.new( File.read(config_file) ).result)
12
12
  end
13
13
 
14
+ def auth_info parts
15
+ return "" unless parts['username'].present?
16
+ "#{parts['username']}:#{parts['password']}@"
17
+ end
18
+
14
19
  def base_path
15
20
  parts = parse_config[Rails.env]
16
- "#{parts['protocol']}://#{parts['host']}:#{parts['port']}"
21
+ "#{parts['protocol']}://#{auth_info parts}#{parts['host']}:#{parts['port']}"
17
22
  end
18
23
 
19
24
  def full_path
@@ -1,3 +1,3 @@
1
1
  module CouchRestAdapter
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -7303,3 +7303,69 @@ LintTest: test_to_param
7303
7303
  ------------------------------
7304
7304
  LintTest: test_to_partial_path
7305
7305
  ------------------------------
7306
+ ---------------------------------------------------
7307
+ CouchRestAdapter::AttributeMethodTest: test_base_id
7308
+ ---------------------------------------------------
7309
+ -----------------------------------------------------------------------------------------------------------------------
7310
+ CouchRestAdapter::DocumentManagementTest: test__set_id_and_namespace_will_set_the__id_variable_with_an_id_and_namespace
7311
+ -----------------------------------------------------------------------------------------------------------------------
7312
+ ---------------------------------------------------------------------------------------------------
7313
+ CouchRestAdapter::DocumentManagementTest: test_class_method_namespace=_allows_override_of_namespace
7314
+ ---------------------------------------------------------------------------------------------------
7315
+ ---------------------------------------------------------------------------------------------
7316
+ CouchRestAdapter::DocumentManagementTest: test_class_method_namespace_defaults_to_object_name
7317
+ ---------------------------------------------------------------------------------------------
7318
+ -----------------------------------------------------------------------------------------------------------
7319
+ CouchRestAdapter::DocumentManagementTest: test_class_method_object_name_returns_model_name_in_singular_form
7320
+ -----------------------------------------------------------------------------------------------------------
7321
+ --------------------------------------------------------------
7322
+ CouchRestAdapterTest: test_attributes_are_available_as_methods
7323
+ --------------------------------------------------------------
7324
+ ------------------------------------------------------------
7325
+ CouchRestAdapterTest: test_attributes_can_be_set_dynamically
7326
+ ------------------------------------------------------------
7327
+ ---------------------------------------------------------
7328
+ CouchRestAdapterTest: test_can_not_instantiate_base_class
7329
+ ---------------------------------------------------------
7330
+ ---------------------------------------------------------------------------------------------
7331
+ CouchRestAdapterTest: test_find_by_attr_will_return_array_of_docs_with_type_set_to_model_name
7332
+ ---------------------------------------------------------------------------------------------
7333
+ ---------------------------------------------------------
7334
+ CouchRestAdapterTest: test_find_will_work_with_partial_id
7335
+ ---------------------------------------------------------
7336
+ -------------------------------------------------------------
7337
+ CouchRestAdapterTest: test_one_can_update_existing_attributes
7338
+ -------------------------------------------------------------
7339
+ --------------------------------------------------------------------------------------------------
7340
+ CouchRestAdapterTest: test_query_all_by_type_will_return_array_of_docs_with_type_set_to_model_name
7341
+ --------------------------------------------------------------------------------------------------
7342
+ ----------------------------------------------------------------------
7343
+ CouchRestAdapterTest: test_query_all_will_bring_array_of_Foo_instances
7344
+ ----------------------------------------------------------------------
7345
+ -----------------------------------------------------
7346
+ CouchRestAdapterTest: test_save!_will_run_validations
7347
+ -----------------------------------------------------
7348
+ -------------------------------------------------------
7349
+ CouchRestAdapterTest: test_update_to_attr=_will_persist
7350
+ -------------------------------------------------------
7351
+ --------------------------------------------------------------
7352
+ CouchRestAdapterTest: test_will_add_class_underscorename_to_id
7353
+ --------------------------------------------------------------
7354
+ --------------------------
7355
+ LintTest: test_errors_aref
7356
+ --------------------------
7357
+ ---------------------------
7358
+ LintTest: test_model_naming
7359
+ ---------------------------
7360
+ -------------------------
7361
+ LintTest: test_persisted?
7362
+ -------------------------
7363
+ ---------------------
7364
+ LintTest: test_to_key
7365
+ ---------------------
7366
+ -----------------------
7367
+ LintTest: test_to_param
7368
+ -----------------------
7369
+ ------------------------------
7370
+ LintTest: test_to_partial_path
7371
+ ------------------------------
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_rest_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Guerra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.0.0
161
+ rubygems_version: 2.0.3
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Simple couchrest adapter.