Class: Edployify::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/edployify/configuration.rb

Constant Summary collapse

CONFIGURATION_KEYS =
{
	:application => { :default => Proc.new { |c| File.basename(::RAILS_ROOT).gsub(/[^A-Za-z0-9_]/, '_').gsub(/_+/, '_') }, :type => Symbol },
	:domain => { :default => Proc.new { |c| "#{c[:application]}.com" } },
	:scm => { :default => :git, :type => Symbol },
	:git_shallow_clone => { :default => true, :boolean => true },
	:repository => { :default => Proc.new { |c| "git@HOSTNAME:#{c[:application]}.git" } },
	:git_enable_submodules => { :default => false, :boolean => true },
	:deploy_via => { :default => :fast_remote_cache, :type => Symbol },
	:deploy_to => { :default => Proc.new { |c| "/apps/#{c[:application]}" } },
	:user => { :default => 'deploy' },
	:group => { :default => 'deploy' },
	:normalize_asset_timestamps => { :default => false, :boolean => true },
	:paranoid => { :ssh_option => true, :default => false, :boolean => true },
	:forward_agent => { :ssh_option => true, :default => true, :boolean => true },
	:notify_email => { :default => Proc.new { |c| "support@#{c[:application]}.com" } }
}

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



134
135
136
# File 'lib/edployify/configuration.rb', line 134

def method_missing(method, *args, &block)
	config[method.to_sym] || config[method.to_s] || super
end

Class Method Details

.configureObject



13
14
15
# File 'lib/edployify/configuration.rb', line 13

def configure
	instance.configure
end

.get_bindingObject



17
18
19
# File 'lib/edployify/configuration.rb', line 17

def get_binding
	instance.get_binding
end

Instance Method Details

#configureObject



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/edployify/configuration.rb', line 50

def configure
	CONFIGURATION_KEYS.each do |variable, options|
		if self.respond_to?(:"ask_#{variable}")
			self.send(:"ask_#{variable}", variable, options)
		elsif options[:ssh_option]
			ask_ssh_option(variable, options)
		else
			ask_value(variable, options)
		end
	end
end

#get_bindingObject



29
30
31
# File 'lib/edployify/configuration.rb', line 29

def get_binding
	binding
end