lib/cany/recipes/thin.rb in cany-0.0.2 vs lib/cany/recipes/thin.rb in cany-0.1.0
- old
+ new
@@ -1,25 +1,31 @@
require 'yaml'
-module Cany
- module Recipes
- # This recipes runs the application with the thin web server. At the moment it installs only a
- # upstart start script. Other init scripts are planed (e.g. systemd for debian).
- class Thin < WebServer
- register_as :thin
+module Cany::Recipes
+ # This recipes install the thin ruby web server. It is registered
+ # and started as service.
+ #
+ # A simple thin configuration file (/etc/<application name>/thin.yml) is
+ # created and can be adjusted to the user needs.
+ #
+ # @see http://code.macournoyer.com/thin/ The project website for more
+ # information about the project
+ # @note The receives relies that the 'thin' gem is included in your Gemfile
+ # and therefore installed via bundler (and the bundler recipe).
+ class Thin < WebServer
+ register_as :thin
- def launch_command
- "thin start -C /etc/#{spec.name}/thin.yml"
- end
+ def launch_command
+ %W(thin start -C /etc/#{spec.name}/thin.yml")
+ end
- def binary
- default_options = {
- 'environment' => 'production',
- 'socket' => "/var/run/#{spec.name}/sock",
- 'pid' => "/var/run/#{spec.name}/thin.pid"
- }
- install_content "/etc/#{spec.name}/thin.yml", default_options.to_yaml
- super
- end
+ def binary
+ default_options = {
+ 'environment' => 'production',
+ 'socket' => "/var/run/#{spec.name}/sock",
+ 'pid' => "/var/run/#{spec.name}/thin.pid"
+ }
+ install_content "/etc/#{spec.name}/thin.yml", default_options.to_yaml
+ super
end
end
end