Skip to content

Commit

Permalink
Updated settings.rb template; prompt to manually set image magick and…
Browse files Browse the repository at this point in the history
… git paths if not set
  • Loading branch information
willcannings committed Dec 18, 2011
1 parent b0c43be commit 1bc22ab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
17 changes: 13 additions & 4 deletions lib/yodel/command/installer.rb
Expand Up @@ -9,7 +9,8 @@ class Installer
# ----------------------------------------
attr_reader :database_hostname, :database_port, :database_name,
:sites_root, :ruby_path, :web_port, :dns_port,
:user, :group, :public_directory
:user, :group, :public_directory, :git_path,
:identify_path, :convert_path

def default_sites_root
if `uname -a` =~ /Darwin/
Expand All @@ -34,9 +35,6 @@ def assign_default_user_and_group
@group = pwnam.gid
end

def default_group
end

def initialize
# assign default values; not all values have associated questions
# presented to the user depen
Expand All @@ -48,6 +46,9 @@ def initialize
@public_directory = '/var/www'
@sites_root = default_sites_root
@ruby_path = default_ruby_path
@git_path = `which git`.strip
@identify_path = `which identify`.strip
@convert_path = `which convert`.strip
assign_default_user_and_group
end

Expand Down Expand Up @@ -149,6 +150,14 @@ def install_system_files
h.say "your local user password.\n\n"
h.say "-----------------------------------------------------------------------------\n\n"

# default program paths
report('locating', "git: #{@git_path}")
report('warning', "git not found, path must be set manually in /usr/local/etc/yodel/settings.rb") if @git_path.empty?
report('locating', "identify: #{@identify_path}")
report('warning', "identify not found, path must be set manually in /usr/local/etc/yodel/settings.rb") if @identify_path.empty?
report('locating', "convert: #{@convert_path}")
report('warning', "convert not found, path must be set manually in /usr/local/etc/yodel/settings.rb") if @convert_path.empty?

# install system files
if `uname -a` =~ /Darwin/
install_mac_files
Expand Down
5 changes: 4 additions & 1 deletion system/usr/local/etc/yodel/development_settings.rb
Expand Up @@ -14,7 +14,10 @@
# environment
config.web_port = <%= web_port %>
config.dns_port = <%= dns_port %>
config.git_path = `which git`.strip
config.git_path = '<%= git_path %>'
config.identify_path = '<%= identify_path %>'
config.convert_path = '<%= convert_path %>'
config.image_quality = 95
# logging
config.logger = Logger.new('/var/log/yodel.log')
Expand Down
5 changes: 4 additions & 1 deletion system/usr/local/etc/yodel/production_settings.rb
Expand Up @@ -11,9 +11,12 @@
# environment
config.dns_port = <%= dns_port %>
config.git_path = `which git`.strip
config.public_directory = '<%= public_directory %>'
config.deploy_command = 'yodel'
config.git_path = '<%= git_path %>'
config.identify_path = '<%= identify_path %>'
config.convert_path = '<%= convert_path %>'
config.image_quality = 95
# logging
config.logger = Logger.new('/var/log/yodel.log')
Expand Down

0 comments on commit 1bc22ab

Please sign in to comment.