vlad-unicorn 2.1.1 → 2.2.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.
- data/.hgignore +11 -0
- data/.hgtags +4 -0
- data/History.txt +7 -0
- data/Manifest.txt +2 -0
- data/README.txt +11 -1
- data/docs/rails-configuration.txt +14 -3
- data/lib/vlad/unicorn.rb +5 -0
- data/lib/vlad/unicorn_common.rb +7 -1
- data/lib/vlad/unicorn_rails.rb +5 -0
- metadata +18 -29
- data/.gemtest +0 -0
data/.hgignore
ADDED
data/.hgtags
ADDED
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -63,11 +63,21 @@ unicorn_use_sudo:: Whether to use sudo to run the 'unicorn' command on
|
|
63
63
|
For more on specific issues when deploying Rails applications, see
|
64
64
|
rails-configuration.txt[link:docs/rails-configuration_txt.html].
|
65
65
|
|
66
|
+
== TASKS:
|
67
|
+
|
68
|
+
start_app, stop_app:: Vlad's built-in tasks to start and stop the application
|
69
|
+
processes, adapted for Unicorn.
|
70
|
+
|
71
|
+
reload_app:: Reload unicorn (in case <tt>preload_app == true</tt>).
|
72
|
+
If this is the case, you have to adapt your +before_fork+
|
73
|
+
hook so it kills the old unicorn master and workers.
|
74
|
+
Cf. "Getting started with unicorn"[http://codelevy.com/2010/02/09/getting-started-with-unicorn.html].
|
75
|
+
|
66
76
|
== LICENSE:
|
67
77
|
|
68
78
|
(The MIT License)
|
69
79
|
|
70
|
-
Copyright (c)
|
80
|
+
Copyright (c) 2012 Kevin Bullock and the rest of the Ruby Hit Squad
|
71
81
|
|
72
82
|
Permission is hereby granted, free of charge, to any person obtaining
|
73
83
|
a copy of this software and associated documentation files (the
|
@@ -11,12 +11,23 @@ environment variables in the unicorn.rb config file, like so:
|
|
11
11
|
ENV['RAILS_ENV'] = 'production'
|
12
12
|
ENV['RAILS_RELATIVE_URL_ROOT'] = '/prefix'
|
13
13
|
|
14
|
+
To use +RAILS_RELATIVE_URL_ROOT+ with Rails 3.x, you can use your project's rackup
|
15
|
+
file (config.ru) to map the application to a prefix:
|
16
|
+
|
17
|
+
# This file is used by Rack-based servers to start the application.
|
18
|
+
|
19
|
+
require ::File.expand_path('../config/environment', __FILE__)
|
20
|
+
-run MyApp::Application
|
21
|
+
+app = MyApp::Application
|
22
|
+
+app = Rack::URLMap.new(ENV['RAILS_RELATIVE_URL_ROOT'] => app) if
|
23
|
+
+ ENV['RAILS_RELATIVE_URL_ROOT']
|
24
|
+
+run app
|
25
|
+
|
14
26
|
== Using with Rails 2.3 and Bundler
|
15
27
|
|
16
28
|
When using Rails 2.3 with Bundler, you have to <code>bundle exec</code>
|
17
29
|
everything. This can be done by setting +unicorn_command+ in your deploy.rb.
|
18
30
|
Since Vlad doesn't change into the +RAILS_ROOT+ directory before attempting to
|
19
|
-
run remote commands, though, you have to explicitly tell
|
20
|
-
Gemfile is:
|
31
|
+
run remote commands, though, you have to explicitly tell it to do so:
|
21
32
|
|
22
|
-
set :unicorn_command, "
|
33
|
+
set :unicorn_command, "cd #{current_path} && bundle exec unicorn_rails"
|
data/lib/vlad/unicorn.rb
CHANGED
data/lib/vlad/unicorn_common.rb
CHANGED
@@ -2,7 +2,7 @@ require 'vlad'
|
|
2
2
|
|
3
3
|
module Vlad
|
4
4
|
module Unicorn
|
5
|
-
VERSION = '2.
|
5
|
+
VERSION = '2.2.0' #:nodoc:
|
6
6
|
|
7
7
|
# Runs +cmd+ using sudo if the +:unicorn_use_sudo+ variable is set.
|
8
8
|
def self.maybe_sudo(cmd)
|
@@ -23,6 +23,12 @@ module Vlad
|
|
23
23
|
maybe_sudo %(sh -c '#{cmd}')
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.reload(opts = '')
|
27
|
+
cmd = signal('USR2')
|
28
|
+
cmd << %( || (#{unicorn_command} -D --config-file #{unicorn_config} #{opts}))
|
29
|
+
maybe_sudo %(sh -c '#{cmd}')
|
30
|
+
end
|
31
|
+
|
26
32
|
def self.stop
|
27
33
|
cmd = signal('QUIT')
|
28
34
|
cmd << %( || echo "stale pid file #{unicorn_pid}")
|
data/lib/vlad/unicorn_rails.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vlad-unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 2.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kevin R. Bullock
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-11-09 00:00:00 -06:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: vlad
|
@@ -32,36 +33,22 @@ dependencies:
|
|
32
33
|
version: "2.0"
|
33
34
|
type: :runtime
|
34
35
|
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rdoc
|
37
|
-
prerelease: false
|
38
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 19
|
44
|
-
segments:
|
45
|
-
- 3
|
46
|
-
- 10
|
47
|
-
version: "3.10"
|
48
|
-
type: :development
|
49
|
-
version_requirements: *id002
|
50
36
|
- !ruby/object:Gem::Dependency
|
51
37
|
name: hoe
|
52
38
|
prerelease: false
|
53
|
-
requirement: &
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
54
40
|
none: false
|
55
41
|
requirements:
|
56
|
-
- -
|
42
|
+
- - ">="
|
57
43
|
- !ruby/object:Gem::Version
|
58
|
-
hash:
|
44
|
+
hash: 47
|
59
45
|
segments:
|
60
46
|
- 2
|
61
|
-
-
|
62
|
-
|
47
|
+
- 8
|
48
|
+
- 0
|
49
|
+
version: 2.8.0
|
63
50
|
type: :development
|
64
|
-
version_requirements: *
|
51
|
+
version_requirements: *id002
|
65
52
|
description: |-
|
66
53
|
Unicorn app server support for Vlad. Adds support for vlad:start_app and
|
67
54
|
vlad:stop_app using Unicorn[http://unicorn.bogomips.org/].
|
@@ -78,6 +65,8 @@ extra_rdoc_files:
|
|
78
65
|
- docs/rails-configuration.txt
|
79
66
|
files:
|
80
67
|
- .autotest
|
68
|
+
- .hgignore
|
69
|
+
- .hgtags
|
81
70
|
- History.txt
|
82
71
|
- Manifest.txt
|
83
72
|
- README.txt
|
@@ -87,7 +76,7 @@ files:
|
|
87
76
|
- lib/vlad/unicorn_common.rb
|
88
77
|
- lib/vlad/unicorn_rails.rb
|
89
78
|
- test/test_vlad_unicorn.rb
|
90
|
-
|
79
|
+
has_rdoc: true
|
91
80
|
homepage: http://bitbucket.org/krbullock/vlad-unicorn/
|
92
81
|
licenses: []
|
93
82
|
|
@@ -118,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
107
|
requirements: []
|
119
108
|
|
120
109
|
rubyforge_project: hitsquad
|
121
|
-
rubygems_version: 1.
|
110
|
+
rubygems_version: 1.3.7
|
122
111
|
signing_key:
|
123
112
|
specification_version: 3
|
124
113
|
summary: Unicorn app server support for Vlad
|
data/.gemtest
DELETED
File without changes
|