capper 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capper (0.1.0)
4
+ capper (0.2.1)
5
5
  capistrano
6
6
  capistrano_colors
7
7
  erubis
data/capper.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "capper"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.licenses = ["MIT"]
6
6
  s.authors = ["Benedikt Böhm"]
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Use at least one worker per core if you're on a dedicated server,
8
8
  # more will usually help for _short_ waits on databases/caches.
9
- worker_processes <%= worker_processes %>
9
+ worker_processes <%= unicorn_worker_processes %>
10
10
 
11
11
  # Help ensure your application will always spawn in the symlinked
12
12
  # "current" directory that Capistrano sets up.
@@ -37,9 +37,9 @@ Capper.load do
37
37
  desc "Generate unicorn configuration files"
38
38
  task :setup, :roles => :app, :except => { :no_release => true } do
39
39
  upload_template("unicorn.rb", unicorn_config,
40
- :mode => "0644", :prefix => "unicorn")
40
+ :mode => "0644")
41
41
  upload_template("unicorn.sh", unicorn_script,
42
- :mode => "0755", :prefix => "unicorn")
42
+ :mode => "0755")
43
43
  end
44
44
 
45
45
  desc "Kill unicorn (this should only be used if all else fails)"
@@ -15,7 +15,6 @@ class Capper
15
15
  end
16
16
 
17
17
  erb = Erubis::Eruby.new(File.open(template).read)
18
- prefix = options.delete(:prefix)
19
18
 
20
19
  if task = current_task
21
20
  servers = find_servers_for_task(task, options)
@@ -28,7 +27,7 @@ class Capper
28
27
  end
29
28
 
30
29
  servers.each do |server|
31
- result = erb.result(get_binding(prefix, server.host))
30
+ result = erb.result(get_binding(server.host))
32
31
  put(result, path, options.merge!(:host => server.host))
33
32
  end
34
33
  end
@@ -39,19 +38,16 @@ class Capper
39
38
  # "app1.example.com" => 4,
40
39
  # "app2.example.com" => 8,
41
40
  # }
42
- def get_binding(prefix, server)
41
+ def get_binding(server)
43
42
  b = binding()
44
43
 
45
- variables.keys.select do |k|
46
- k =~ /^#{prefix}_/
47
- end.each do |k|
48
- new_k = k.to_s.gsub(/^#{prefix}_/, '')
49
- new_v = fetch(k)
44
+ variables.keys.each do |k|
45
+ v = fetch(k)
50
46
 
51
- if new_v.kind_of?(Hash)
52
- eval("set(:#{new_k}, \"#{new_v[server] || new_v["default"]}\")", b)
47
+ if v.kind_of?(Hash)
48
+ eval("set(:#{k}, \"#{v[server] || v["default"]}\")", b)
53
49
  else
54
- eval("set(:#{new_k}, \"#{new_v}\")", b)
50
+ eval("set(:#{k}, \"#{v}\")", b)
55
51
  end
56
52
  end
57
53
 
metadata CHANGED
@@ -1,73 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capper
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
4
5
  prerelease:
5
- version: 0.2.0
6
6
  platform: ruby
7
- authors:
8
- - "Benedikt B\xC3\xB6hm"
7
+ authors:
8
+ - Benedikt Böhm
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-26 00:00:00 +02:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2011-07-29 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: erubis
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &11915860 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: capistrano
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *11915860
25
+ - !ruby/object:Gem::Dependency
26
+ name: capistrano
27
+ requirement: &11915420 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: capistrano_colors
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *11915420
36
+ - !ruby/object:Gem::Dependency
37
+ name: capistrano_colors
38
+ requirement: &11915000 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
47
44
  type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: bundler
51
45
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *11915000
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: &11914500 !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
51
+ requirements:
55
52
  - - ~>
56
- - !ruby/object:Gem::Version
53
+ - !ruby/object:Gem::Version
57
54
  version: 1.0.0
58
55
  type: :development
59
- version_requirements: *id004
56
+ prerelease: false
57
+ version_requirements: *11914500
60
58
  description: Capistrano is a collection of opinionated Capistrano recipes
61
- email:
59
+ email:
62
60
  - bb@xnull.de
63
61
  executables: []
64
-
65
62
  extensions: []
66
-
67
- extra_rdoc_files:
63
+ extra_rdoc_files:
68
64
  - LICENSE
69
65
  - README.md
70
- files:
66
+ files:
71
67
  - .document
72
68
  - .gitignore
73
69
  - .rvmrc
@@ -91,33 +87,29 @@ files:
91
87
  - lib/capper/utils/multistage.rb
92
88
  - lib/capper/utils/templates.rb
93
89
  - lib/capper/whenever.rb
94
- has_rdoc: true
95
90
  homepage: http://github.com/hollow/capper
96
- licenses:
91
+ licenses:
97
92
  - MIT
98
93
  post_install_message:
99
94
  rdoc_options: []
100
-
101
- require_paths:
95
+ require_paths:
102
96
  - lib
103
- required_ruby_version: !ruby/object:Gem::Requirement
97
+ required_ruby_version: !ruby/object:Gem::Requirement
104
98
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: "0"
109
- required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
104
  none: false
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: "0"
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
115
109
  requirements: []
116
-
117
110
  rubyforge_project:
118
- rubygems_version: 1.6.2
111
+ rubygems_version: 1.8.6
119
112
  signing_key:
120
113
  specification_version: 3
121
114
  summary: Capistrano is a collection of opinionated Capistrano recipes
122
115
  test_files: []
123
-