vlad-unicorn 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.hgignore ADDED
@@ -0,0 +1,11 @@
1
+ syntax: glob
2
+ .DS_Store
3
+ *~
4
+ \#*\#
5
+ .\#*
6
+ *.sw?
7
+
8
+ syntax: regexp
9
+ ^pkg/
10
+ ^doc/
11
+ ^.yardoc$
data/.hgtags ADDED
@@ -0,0 +1,4 @@
1
+ d25315ab65a371c98cca14a63572a18356417738 rel-2.0.0
2
+ bdc7c2851152cf080888a2c6d5d5bf22fc04f5b2 v2.1.0
3
+ bdc7c2851152cf080888a2c6d5d5bf22fc04f5b2 semver
4
+ 90fa0693a4a0b49241357d1b7b03df6b064a14e9 v2.1.1
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 2.2.0 / 2012-11-09
2
+
3
+ * 1 minor enhancement
4
+
5
+ * Add a new task, vlad:reload_app, to send SIGUSR2 to Unicorn
6
+ (Mathieu Lemoine). vlad:start_app still uses SIGHUP.
7
+
1
8
  === 2.1.1 / 2011-12-28
2
9
 
3
10
  * 1 bug fix
data/Manifest.txt CHANGED
@@ -1,4 +1,6 @@
1
1
  .autotest
2
+ .hgignore
3
+ .hgtags
2
4
  History.txt
3
5
  Manifest.txt
4
6
  README.txt
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) 2010 Kevin Bullock and the rest of the Ruby Hit Squad
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 Bundler where the
20
- Gemfile is:
31
+ run remote commands, though, you have to explicitly tell it to do so:
21
32
 
22
- set :unicorn_command, "bundle --gemfile=#{current_path}/Gemfile exec unicorn_rails"
33
+ set :unicorn_command, "cd #{current_path} && bundle exec unicorn_rails"
data/lib/vlad/unicorn.rb CHANGED
@@ -10,4 +10,9 @@ namespace :vlad do
10
10
  remote_task :start_app, :roles => :app do
11
11
  Vlad::Unicorn.start(unicorn_rackup)
12
12
  end
13
+
14
+ desc "Reload the app servers"
15
+ remote_task :reload_app, :roles => :app do
16
+ Vlad::Unicorn.reload(unicorn_rackup)
17
+ end
13
18
  end
@@ -2,7 +2,7 @@ require 'vlad'
2
2
 
3
3
  module Vlad
4
4
  module Unicorn
5
- VERSION = '2.1.1' #:nodoc:
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}")
@@ -10,4 +10,9 @@ namespace :vlad do
10
10
  remote_task :start_app, :roles => :app do
11
11
  Vlad::Unicorn.start
12
12
  end
13
+
14
+ desc "Reload the app servers"
15
+ remote_task :reload_app, :roles => :app do
16
+ Vlad::Unicorn.reload
17
+ end
13
18
  end
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: 9
5
- prerelease:
4
+ hash: 7
5
+ prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 1
9
- - 1
10
- version: 2.1.1
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-02-01 00:00:00 Z
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: &id003 !ruby/object:Gem::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: 25
44
+ hash: 47
59
45
  segments:
60
46
  - 2
61
- - 13
62
- version: "2.13"
47
+ - 8
48
+ - 0
49
+ version: 2.8.0
63
50
  type: :development
64
- version_requirements: *id003
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
- - .gemtest
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.8.15
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