Kernel (Module)

In: basiclibrary.rb

Extensions to the Kernel module

Public Instance methods

Ensures that the version number of the installed ruby is greater than or equal to the version string supplied. Credit to Robert Klemme for posting this on ruby-talk.

 ensure_version "1.7.0"
 ensure_version "1.8.0"
 ensure_version "1.8.1"

Requires a file relative to the invoking file’s path.

For example, given the following directory structure:

  /app/run.rb
  /app/lib/relative_require.rb
  /app/code/app.rb
  /app/code/klass1.rb
  /app/code/mod1.rb
  /app/code/mod1/subklass.rb

You might use code like the following:

run.rb

  require 'lib/relative_require.rb'
  require 'code/app.rb'
  App.instance.run

app.rb

  require_relative 'klass1.rb'
  require_relative 'mod1.rb'
  ...

mod1.rb

  require_relative 'mod1/subklass.rb'
  ...

[Validate]