couch-warmer 1.0.4 → 1.0.5
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.
- data/VERSION +1 -1
- data/couch-warmer.gemspec +2 -2
- data/lib/couch-warmer.rb +7 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.5
|
data/couch-warmer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "couch-warmer"
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mathieu Elie"]
|
12
|
-
s.date = "2012-02-
|
12
|
+
s.date = "2012-02-07"
|
13
13
|
s.description = "couchdb view generation could take a while. you could build temp views, then copy them in one shot"
|
14
14
|
s.email = "mathieuelie@gmail.com"
|
15
15
|
s.executables = ["couch-warmer"]
|
data/lib/couch-warmer.rb
CHANGED
@@ -10,7 +10,8 @@ class CouchWarmer
|
|
10
10
|
def warm(name, suffix)
|
11
11
|
puts "warming.. #{name} from #{name}#{suffix}"
|
12
12
|
begin
|
13
|
-
|
13
|
+
view_name = get_first_view(name + suffix)
|
14
|
+
src = @db.view('_design/' + name + suffix + '/_view/' + view_name)
|
14
15
|
rescue RestClient::RequestTimeout => e
|
15
16
|
puts "working hard...."
|
16
17
|
end
|
@@ -44,5 +45,10 @@ class CouchWarmer
|
|
44
45
|
tasks.map! { |t| t['task'] + ' ' + t['status'] }
|
45
46
|
!tasks.empty?
|
46
47
|
end
|
48
|
+
|
49
|
+
def get_first_view(design_doc)
|
50
|
+
design_info = CouchRest.get(@db.server.uri + '/' + @db.name + '/_design/' + design_doc)
|
51
|
+
design_info["views"].keys.first
|
52
|
+
end
|
47
53
|
end
|
48
54
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couch-warmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 5
|
10
|
+
version: 1.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mathieu Elie
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-07 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|