lib/rda/nginx.rb in rda-0.0.6 vs lib/rda/nginx.rb in rda-0.1.0

- old
+ new

@@ -1,16 +1,14 @@ module Rda class Nginx < Thor include Thor::Actions - DEFAULT_CONF_PATHS = ['/etc/nginx', '/usr/local/nginx/conf', '/opt/nginx/conf'] - def self.source_root File.dirname(__FILE__) end - desc "Setup", "Deploy rails application to Nginx" + desc "setup", "Set up your rails application" def setup return unless installed? create_setup_load_paths mkdir_for_sites @@ -23,11 +21,11 @@ unless configured?('/etc/hosts', "127.0.0.1 #{hostname}") append_file "/etc/hosts", "127.0.0.1 #{hostname}" end end - desc "Discard", "Remove the Nginx setting of rails application" + desc "discard", "Remove the settings of your rails application from nginx" def discard return unless installed? %W(enabled available).each do |n| remove_file "#{conf_path}/sites-#{n}/#{hostname}" @@ -66,10 +64,9 @@ "#{Rda::Rails.app_name}.local" end def available_paths search_paths = Rda.config.nginx_conf_paths || [] - search_paths = DEFAULT_CONF_PATHS if search_paths.empty? @paths ||= search_paths.select { |p| Dir.exists? p if p } unless search_paths.empty? end def prompt_not_found $stderr.puts "ERROR: Config directory of Nginx is not found in the following paths:\n\n"