Class: Luban::Deployment::Packages::Nginx::Installer

Inherits:
Service::Installer
  • Object
show all
Includes:
Controller::Commands
Defined in:
lib/luban/deployment/packages/nginx/installer.rb

Instance Method Summary collapse

Methods included from Controller::Commands

#bin_path, included, #nginx_command, #process_pattern, #start_command, #stop_command

Instance Method Details

#installed?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/luban/deployment/packages/nginx/installer.rb', line 16

def installed?
  return false unless file?(nginx_executable)
  pattern = "nginx version: nginx/#{package_major_version}"
  match?("#{nginx_executable} -v 2>&1", pattern)
end

#source_repoObject



8
9
10
# File 'lib/luban/deployment/packages/nginx/installer.rb', line 8

def source_repo
  @source_repo ||= "http://nginx.org"
end

#source_url_rootObject



12
13
14
# File 'lib/luban/deployment/packages/nginx/installer.rb', line 12

def source_url_root
  @source_url_root ||= "download"
end

#with_opt_dir(dir) ⇒ Object Also known as: with_pcre_dir, with_openssl_dir



22
23
24
25
# File 'lib/luban/deployment/packages/nginx/installer.rb', line 22

def with_opt_dir(dir)
  @cc_opts << "-I #{dir.join('include')}"
  @ld_opts << "-L #{dir.join('lib')} -Wl,-rpath,#{dir.join('lib')}"
end