Module: Homeward

Defined in:
lib/homeward.rb

Constant Summary collapse

VERSION =
'0.2.0'
LIBPATH =
::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR

Class Method Summary collapse

Class Method Details

.libpath(*args) ⇒ Object



12
13
14
# File 'lib/homeward.rb', line 12

def self.libpath( *args )
  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
end

.path(*args) ⇒ Object



16
17
18
# File 'lib/homeward.rb', line 16

def self.path( *args )
  args.empty? ? PATH : ::File.join(PATH, args.flatten)
end

.require_all_libs_relative_to(fname, dir = nil) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/homeward.rb', line 20

def self.require_all_libs_relative_to(fname, dir = nil)
  dir ||= ::File.basename(fname, '.*')
  search_me = ::File.expand_path(
      ::File.join(::File.dirname(fname), dir, '**', '*.rb'))

  Dir.glob(search_me).sort.each {|rb| require rb}
end

.versionObject



8
9
10
# File 'lib/homeward.rb', line 8

def self.version
  VERSION
end