Class: OraConf

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

Direct Known Subclasses

OraConfFC, OraConfIC

Constant Summary

Constants included from MiniRegistry

MiniRegistry::ERROR_FILE_NOT_FOUND, MiniRegistry::ERROR_SUCCESS, MiniRegistry::HKEY_LOCAL_MACHINE, MiniRegistry::RegCloseKey, MiniRegistry::RegOpenKeyExA, MiniRegistry::RegQueryValueExA

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MiniRegistry

#get_local_registry, #get_reg_value

Constructor Details

#initializeOraConf

Returns a new instance of OraConf.



215
216
217
# File 'ext/oci8/oraconf.rb', line 215

def initialize
  raise 'use OraConf.get instead'
end

Instance Attribute Details

#cc_is_gccObject (readonly)

Returns the value of attribute cc_is_gcc.



210
211
212
# File 'ext/oci8/oraconf.rb', line 210

def cc_is_gcc
  @cc_is_gcc
end

#cflagsObject (readonly)

Returns the value of attribute cflags.



212
213
214
# File 'ext/oci8/oraconf.rb', line 212

def cflags
  @cflags
end

#libsObject (readonly)

Returns the value of attribute libs.



213
214
215
# File 'ext/oci8/oraconf.rb', line 213

def libs
  @libs
end

#versionObject (readonly)

Returns the value of attribute version.



211
212
213
# File 'ext/oci8/oraconf.rb', line 211

def version
  @version
end

Class Method Details

.getObject



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'ext/oci8/oraconf.rb', line 219

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 messages:
#{$!.to_str}
---------------------------------------------------
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



266
267
268
# File 'ext/oci8/oraconf.rb', line 266

def self.ld_envs
  @@ld_envs
end