Module: Blue::Unicorn
- Defined in:
- lib/blue/unicorn.rb,
lib/blue/unicorn/version.rb,
lib/blue/unicorn/capistrano/integration.rb
Defined Under Namespace
Modules: Capistrano
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.cfg_path ⇒ Object
44 45 46 |
# File 'lib/blue/unicorn.rb', line 44 def self.cfg_path File.join(Blue.shared_path, 'config/unicorn.cfg') end |
.configure ⇒ Object
9 10 11 12 13 |
# File 'lib/blue/unicorn.rb', line 9 def self.configure Blue.configure({ :unicorn => {} }) end |
.included(klass) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/blue/unicorn.rb', line 48 def self.included(klass) klass.add_role(:app) klass.add_role(:unicorn) klass.class_eval do recipe :unicorn end end |
.pid_path ⇒ Object
40 41 42 |
# File 'lib/blue/unicorn.rb', line 40 def self.pid_path File.join(Blue.rails_current, 'pids/unicorn.master.pid') end |
Instance Method Details
#unicorn(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/blue/unicorn.rb', line 15 def unicorn( = {}) file "/etc/init.d/unicorn", :ensure => :present, :mode => '744', :owner => Blue.config.user, :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'unicorn.init.erb'), binding) file Blue::Unicorn.cfg_path, :ensure => :present, :mode => '744', :owner => Blue.config.user, :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'unicorn.cfg.erb'), binding) if Blue.const_defined?(:Monit) file "/etc/monit/conf.d/unicorn.conf", :ensure => :present, :mode => '700', :backup => false, :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'monit.conf.erb'), binding), :notify => service('monit') elsif Blue.const_defined?(:God) # Define this yo'self homie. end end |