capitate 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +0 -1
- data/lib/capitate/version.rb +1 -1
- data/lib/capitate.rb +0 -1
- data/lib/recipes/memcached.rb +1 -1
- data/lib/recipes/nginx.rb +2 -5
- data/lib/templates/nginx/nginx_vhost_generic.conf.erb +2 -2
- data/website/index.html +1 -1
- metadata +2 -3
- data/lib/capitate/plugins/upload.rb +0 -62
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/capitate/version.rb
CHANGED
data/lib/capitate.rb
CHANGED
data/lib/recipes/memcached.rb
CHANGED
@@ -46,7 +46,7 @@ namespace :memcached do
|
|
46
46
|
fetch_or_default(:memcached_servers, [ "localhost:11211" ])
|
47
47
|
fetch_or_default(:memcached_yml_template, "memcached/memcached.yml.erb")
|
48
48
|
|
49
|
-
|
49
|
+
put(memcached_yml_template, "#{shared_path}/config/memcached.yml")
|
50
50
|
end
|
51
51
|
|
52
52
|
desc "Symlink memcached configuration after deploy."
|
data/lib/recipes/nginx.rb
CHANGED
@@ -32,13 +32,10 @@ namespace :nginx do
|
|
32
32
|
fetch(:nginx_upstream_size)
|
33
33
|
fetch(:nginx_upstream_port)
|
34
34
|
|
35
|
-
set :
|
35
|
+
set :nginx_upstream_ports, (0...nginx_upstream_size.to_i).collect { |i| nginx_upstream_port.to_i + i }
|
36
36
|
set :public_path, current_path + "/public"
|
37
37
|
|
38
|
-
|
39
|
-
put template.load("nginx/nginx_vhost_generic.conf.erb"), "/tmp/nginx_#{nginx_upstream_name}.conf"
|
40
|
-
|
41
|
-
sudo "install -o root /tmp/nginx_#{nginx_upstream_name}.conf /etc/nginx/vhosts/#{nginx_upstream_name}.conf"
|
38
|
+
utils.install_template("nginx/nginx_vhost_generic.conf.erb", "/etc/nginx/vhosts/#{nginx_upstream_name}.conf")
|
42
39
|
end
|
43
40
|
|
44
41
|
end
|
@@ -55,7 +55,7 @@ server {
|
|
55
55
|
# For iphone unique url
|
56
56
|
if ($http_user_agent ~* "(iPhone|iPod)") {
|
57
57
|
rewrite ^/$ /iphone break;
|
58
|
-
proxy_pass http://<%=
|
58
|
+
proxy_pass http://<%= nginx_upstream_name %>;
|
59
59
|
break;
|
60
60
|
}
|
61
61
|
|
@@ -76,7 +76,7 @@ server {
|
|
76
76
|
}
|
77
77
|
|
78
78
|
if (!-f $request_filename) {
|
79
|
-
proxy_pass http://<%=
|
79
|
+
proxy_pass http://<%= nginx_upstream_name %>;
|
80
80
|
break;
|
81
81
|
}
|
82
82
|
}
|
data/website/index.html
CHANGED
@@ -35,7 +35,7 @@
|
|
35
35
|
|
36
36
|
<div id="version" class="clickable box" onclick='document.location = "http://rubyforge.org/projects/capitate"; return false'>
|
37
37
|
<p>Get Version</p>
|
38
|
-
<a href="http://rubyforge.org/projects/capitate" class="numbers">0.3.
|
38
|
+
<a href="http://rubyforge.org/projects/capitate" class="numbers">0.3.4</a>
|
39
39
|
</div>
|
40
40
|
|
41
41
|
<div id="recipes">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capitate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ""
|
6
6
|
authors:
|
7
7
|
- Gabriel Handford
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-05 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -56,7 +56,6 @@ files:
|
|
56
56
|
- lib/capitate/plugins/prompt.rb
|
57
57
|
- lib/capitate/plugins/script.rb
|
58
58
|
- lib/capitate/plugins/templates.rb
|
59
|
-
- lib/capitate/plugins/upload.rb
|
60
59
|
- lib/capitate/plugins/utils.rb
|
61
60
|
- lib/capitate/plugins/yum.rb
|
62
61
|
- lib/capitate/recipes.rb
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module Capitate::Plugins::Upload
|
2
|
-
|
3
|
-
# Upload file with source path.
|
4
|
-
#
|
5
|
-
# Data is streamed.
|
6
|
-
#
|
7
|
-
# ==== Options
|
8
|
-
# +src_path+:: Source path
|
9
|
-
# +dest_path+:: Remote destination path
|
10
|
-
# +options+:: Options (see capistrano 'put')
|
11
|
-
#
|
12
|
-
# ==== Examples
|
13
|
-
# upload.file("/tmp/large_file.tgz", "#{shared_path}/tmp/large_file.tgz")
|
14
|
-
#
|
15
|
-
def file(src_path, dest_path, options = {})
|
16
|
-
data = FileData.new(src_path)
|
17
|
-
put(data, dest_path, options)
|
18
|
-
end
|
19
|
-
|
20
|
-
# Stream data with Net::SFTP by looking like an Array
|
21
|
-
class FileData
|
22
|
-
|
23
|
-
def initialize(path)
|
24
|
-
@path = path
|
25
|
-
@next_start = 0
|
26
|
-
end
|
27
|
-
|
28
|
-
def [](start, length)
|
29
|
-
|
30
|
-
if start != @next_start
|
31
|
-
raise <<-EOS
|
32
|
-
|
33
|
-
Can only access data sequentially; so we can stream it (The next start position should have been: #{@next_start})
|
34
|
-
|
35
|
-
EOS
|
36
|
-
end
|
37
|
-
|
38
|
-
data = file.read(length)
|
39
|
-
|
40
|
-
@next_start = start + length
|
41
|
-
close if @next_start >= self.length
|
42
|
-
|
43
|
-
data
|
44
|
-
end
|
45
|
-
|
46
|
-
def length
|
47
|
-
@file_size ||= File.size(@path)
|
48
|
-
end
|
49
|
-
|
50
|
-
def file
|
51
|
-
@file ||= File.open(@path, "r")
|
52
|
-
end
|
53
|
-
|
54
|
-
def close
|
55
|
-
@file.close if @file
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
Capistrano.plugin :upload, Capitate::Plugins::Upload
|