couch_rest_adapter 0.4.9 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couch_rest_adapter/version.rb +1 -1
- data/lib/couch_rest_adapter.rb +1 -2
- data/lib/tasks/couch_rest_adapter_tasks.rake +12 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11b2df2932984773b4c5b446193596884c7eb901
|
4
|
+
data.tar.gz: 327fe4ea90fdc53c316108512442f3a521bef4bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0603c46068ad19faaba03a28cebaa1cd5dbdaf139c00a8108a5f1e019714f31ae003c4c5dacf4366e840a4f2dfba19989870fbf3ec1fdde4f87450098a56bc9c
|
7
|
+
data.tar.gz: 6737e4672b99240413e5349151a4855de2ed1fea006225b8313dab74e59be32ec3ca27ec0c50a498ef767f26ef9944467f9a71bc81081a84c905717bd9ff12f5
|
data/lib/couch_rest_adapter.rb
CHANGED
@@ -4,14 +4,13 @@ require 'couch_rest_adapter/attribute_method'
|
|
4
4
|
require 'couch_rest_adapter/query_views'
|
5
5
|
require 'couch_rest_adapter/document_management'
|
6
6
|
require 'couch_rest_adapter/db_config'
|
7
|
+
require 'couch_rest_adapter/railtie' if defined?(Rails)
|
7
8
|
|
8
9
|
require File.join(File.dirname(__FILE__), '/exceptions/couch_rest_adapter')
|
9
10
|
|
10
11
|
using CouchRestAdapter::Helpers
|
11
12
|
|
12
13
|
module CouchRestAdapter
|
13
|
-
autoload :Railtie, File.join( File.dirname(__FILE__), 'couch_rest_adapter', 'railtie')
|
14
|
-
|
15
14
|
class Base < CouchRest::Document
|
16
15
|
#TODO: As abstract class should not have any method definition
|
17
16
|
|
@@ -5,10 +5,6 @@
|
|
5
5
|
namespace :db do
|
6
6
|
|
7
7
|
namespace :push do
|
8
|
-
class BaseModel < CouchRestAdapter::Base
|
9
|
-
use_default_database
|
10
|
-
end
|
11
|
-
|
12
8
|
view_doc = {
|
13
9
|
language: "coffeescript",
|
14
10
|
views: {
|
@@ -24,14 +20,25 @@ namespace :db do
|
|
24
20
|
}
|
25
21
|
}
|
26
22
|
|
27
|
-
|
23
|
+
desc "Will save the default design document."
|
28
24
|
task :config do
|
25
|
+
# TODO: DRY this methods, the need to have config yml file loaded prevent us to
|
26
|
+
# add this on the namespace. Autoload didn;t work as expected.
|
27
|
+
class BaseModel < CouchRestAdapter::Base
|
28
|
+
use_default_database
|
29
|
+
end
|
30
|
+
|
29
31
|
doc_id = "_design/#{BaseModel.default_design_doc}"
|
30
32
|
BaseModel.database.save_doc view_doc.merge( "_id" => doc_id )
|
31
33
|
puts "Design document #{doc_id} added."
|
32
34
|
end
|
33
35
|
|
36
|
+
"Will update design document with what is on db/designs/*.coffee"
|
34
37
|
task design: :environment do
|
38
|
+
class BaseModel < CouchRestAdapter::Base
|
39
|
+
use_default_database
|
40
|
+
end
|
41
|
+
|
35
42
|
path = File.join Rails.root, 'db', 'designs'
|
36
43
|
files = Dir.glob("**/*.coffee")
|
37
44
|
views = {}
|
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.4.
|
4
|
+
version: 0.4.11
|
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-
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|