Class: OraConf

Inherits:
Object show all
Defined in:
ext/oci8/oraconf.rb

Direct Known Subclasses

OraConfFC, OraConfIC

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOraConf

Returns a new instance of OraConf.



322
323
324
# File 'ext/oci8/oraconf.rb', line 322

def initialize
  raise 'use OraConf.get instead'
end

Instance Attribute Details

#cc_is_gccObject (readonly)

Returns the value of attribute cc_is_gcc.



317
318
319
# File 'ext/oci8/oraconf.rb', line 317

def cc_is_gcc
  @cc_is_gcc
end

#cflagsObject (readonly)

Returns the value of attribute cflags.



319
320
321
# File 'ext/oci8/oraconf.rb', line 319

def cflags
  @cflags
end

#libsObject (readonly)

Returns the value of attribute libs.



320
321
322
# File 'ext/oci8/oraconf.rb', line 320

def libs
  @libs
end

#versionObject (readonly)

Returns the value of attribute version.



318
319
320
# File 'ext/oci8/oraconf.rb', line 318

def version
  @version
end

Class Method Details

.getObject



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'ext/oci8/oraconf.rb', line 326

def self.get
  original_CFLAGS = $CFLAGS
  original_defs = $defs
  ic_dir = nil
  begin
    # check Oracle instant client
    if with_config('instant-client')
      puts <<EOS
=======================================================

'--with-instant-client' is an obsolete option. ignore it.

=======================================================
EOS
    end
    ic_dir = check_ic_dir
    if ic_dir
      OraConfIC.new(ic_dir)
    else
      OraConfFC.new()
    end
  rescue
    case ENV['LANG']
    when /^ja/
      lang = 'ja'
    else
      lang = 'en'
    end
    print <<EOS
---------------------------------------------------
Error Message:
#{$!.to_s.gsub(/\n/, "\n  ")}
Backtrace:
#{$!.backtrace.join("\n  ")}
---------------------------------------------------
See:
 * http://ruby-oci8.rubyforge.org/#{lang}/HowToInstall.html
 * http://ruby-oci8.rubyforge.org/#{lang}/ReportInstallProblem.html

EOS
    exc = RuntimeError.new
    exc.set_backtrace($!.backtrace)
    raise exc
  ensure
    $CFLAGS = original_CFLAGS
    $defs = original_defs
  end
end

.ld_envsObject



375
376
377
# File 'ext/oci8/oraconf.rb', line 375

def self.ld_envs
  @@ld_envs
end