Module: Win

Defined in:
lib/win/library.rb,
lib/win.rb,
lib/version.rb,
lib/win/dde.rb,
lib/win/gui.rb,
lib/win/time.rb,
lib/win/error.rb,
lib/win/gui/menu.rb,
lib/win/national.rb,
lib/win/gui/input.rb,
lib/win/gui/dialog.rb,
lib/win/gui/window.rb,
lib/win/gui/message.rb,
lib/win/system/info.rb

Overview

require ‘win/gui/message’ # needed because of SC_… constants defined there ?

Defined Under Namespace

Modules: Dde, Error, Errors, Gui, Library, National, System, Time

Constant Summary collapse

VERSION_FILE =

:nodoc:

Pathname.new(__FILE__).dirname + '../VERSION'
VERSION =
VERSION_FILE.exist? ? VERSION_FILE.read.strip : nil

Class Method Summary collapse

Class Method Details

.require_libs(libs, opts = {}) ⇒ Object

Requires ruby source file(s). Accepts either single filename/glob or Array of filenames/globs. Accepts following options:

:file

Lib(s) required relative to this file - defaults to __FILE__

:dir

Required lib(s) located under this dir name - defaults to gem name



11
12
13
14
15
16
17
# File 'lib/win.rb', line 11

def self.require_libs( libs, opts={} )
  file = Pathname.new(opts[:file] || __FILE__)
  [libs].flatten.each do |lib|
    name = file.dirname + (opts[:dir] || file.basename('.*')) + lib.gsub(/(?<!.rb)$/, '.rb')
    Pathname.glob(name.to_s).sort.each {|rb| require rb}
  end
end