Top Level Namespace

Defined Under Namespace

Modules: DataObjects

Instance Method Summary collapse

Instance Method Details

#default_mysql_config_pathObject

The first mysql_config binary on PATH …



18
19
20
# File 'ext/do_mysql/extconf.rb', line 18

def default_mysql_config_path
  mysql_config_paths.compact.first
end

#default_prefixObject



26
27
28
29
30
31
32
# File 'ext/do_mysql/extconf.rb', line 26

def default_prefix
  if mc = default_mysql_config_path
    File.dirname(File.dirname(mc))
  else
    "/usr/local"
  end
end

#mysql_config(type) ⇒ Object



22
23
24
# File 'ext/do_mysql/extconf.rb', line 22

def mysql_config(type)
  IO.popen("#{default_mysql_config_path} --#{type}").readline.chomp rescue nil
end

#mysql_config_pathsObject

All instances of mysql_config on PATH …



10
11
12
13
14
15
# File 'ext/do_mysql/extconf.rb', line 10

def mysql_config_paths
  ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|
    [ "#{path}/mysql_config", "#{path}/mysql_config5" ].
      detect { |bin| File.exist?(bin) }
  end
end