Class: Cany::Recipes::WebServer
- Inherits:
-
Cany::Recipe
- Object
- Cany::Recipe
- Cany::Recipes::WebServer
- Defined in:
- lib/cany/recipes/web_server.rb
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#group ⇒ String?
The group name as which the web server process should executed.
-
#user ⇒ String?
The user name as which the web server process should executed.
Attributes inherited from Cany::Recipe
Instance Method Summary collapse
- #binary ⇒ Object
-
#initialize(*args) ⇒ WebServer
constructor
A new instance of WebServer.
Methods inherited from Cany::Recipe
#build, #clean, #configure, #create, #depend, #exec, from_name, hook, #hook, #install, #install_content, #install_dir, #install_link, #install_service, option, #option, #prepare, #recipe, register_as, #rmtree, #ruby_bin, #run_hook
Methods included from Mixins::DependMixin
Constructor Details
#initialize(*args) ⇒ WebServer
Returns a new instance of WebServer.
14 15 16 17 18 |
# File 'lib/cany/recipes/web_server.rb', line 14 def initialize(*args) @user = 'www-data' @group = 'www-data' super end |
Instance Attribute Details
#group ⇒ String?
Returns The group name as which the web server process should executed.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cany/recipes/web_server.rb', line 8 class WebServer < Cany::Recipe attr_accessor :user, :group class DSL < Cany::Recipe::DSL delegate :user, :group end def initialize(*args) @user = 'www-data' @group = 'www-data' super end def binary recipe(:system).configure :service_pre_scripts, { mkdir_run: "mkdir -p /var/run/#{spec.name}", chown_run: "chown #{user}:#{group} /var/run/#{spec.name}" } install_service name, ["/usr/bin/#{spec.name}"] + launch_command, user: user, group: group inner.binary end end |
#user ⇒ String?
Returns The user name as which the web server process should executed.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cany/recipes/web_server.rb', line 8 class WebServer < Cany::Recipe attr_accessor :user, :group class DSL < Cany::Recipe::DSL delegate :user, :group end def initialize(*args) @user = 'www-data' @group = 'www-data' super end def binary recipe(:system).configure :service_pre_scripts, { mkdir_run: "mkdir -p /var/run/#{spec.name}", chown_run: "chown #{user}:#{group} /var/run/#{spec.name}" } install_service name, ["/usr/bin/#{spec.name}"] + launch_command, user: user, group: group inner.binary end end |
Instance Method Details
#binary ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/cany/recipes/web_server.rb', line 20 def binary recipe(:system).configure :service_pre_scripts, { mkdir_run: "mkdir -p /var/run/#{spec.name}", chown_run: "chown #{user}:#{group} /var/run/#{spec.name}" } install_service name, ["/usr/bin/#{spec.name}"] + launch_command, user: user, group: group inner.binary end |