dbconsole.rb

Path: vendor/rails/railties/lib/commands/dbconsole.rb
Last Update: Wed Nov 19 14:28:38 +0000 2008

Required files

erb   yaml   optparse  

Methods

find_cmd  

Public Instance methods

[Source]

    # File vendor/rails/railties/lib/commands/dbconsole.rb, line 22
22: def find_cmd(*commands)
23:   dirs_on_path = ENV['PATH'].to_s.split(File::PATH_SEPARATOR)
24:   commands += commands.map{|cmd| "#{cmd}.exe"} if RUBY_PLATFORM =~ /win32/
25:   commands.detect do |cmd|
26:     dirs_on_path.detect do |path|
27:       File.executable? File.join(path, cmd)
28:     end
29:   end || abort("Couldn't find database client: #{commands.join(', ')}. Check your $PATH and try again.")
30: end

[Validate]