Module: HookScriptAPI

Included in:
Installer
Defined in:
lib/priority-queue/setup.rb

Overview

This module requires: #srcdir_root, #objdir_root, #relpath

Instance Method Summary collapse

Instance Method Details

#curr_objdirObject



711
712
713
# File 'lib/priority-queue/setup.rb', line 711

def curr_objdir
  "#{objdir_root()}/#{relpath()}"
end

#curr_srcdirObject

srcdir/objdir (works only in the package directory)



707
708
709
# File 'lib/priority-queue/setup.rb', line 707

def curr_srcdir
  "#{srcdir_root()}/#{relpath()}"
end

#get_config(key) ⇒ Object Also known as: config



692
693
694
# File 'lib/priority-queue/setup.rb', line 692

def get_config(key)
  @config[key]
end

#set_config(key, val) ⇒ Object

obsolete: use metaconfig to change configuration



699
700
701
# File 'lib/priority-queue/setup.rb', line 699

def set_config(key, val)
  @config[key] = val
end

#srcdirectories(path = '.') ⇒ Object



743
744
745
746
747
# File 'lib/priority-queue/setup.rb', line 743

def srcdirectories(path = '.')
  srcentries(path).select {|fname|
    File.dir?(File.join(curr_srcdir(), path, fname))
  }
end

#srcdirectory?(path) ⇒ Boolean



723
724
725
# File 'lib/priority-queue/setup.rb', line 723

def srcdirectory?(path)
  File.dir?(srcfile(path))
end

#srcentries(path = '.') ⇒ Object



731
732
733
734
735
# File 'lib/priority-queue/setup.rb', line 731

def srcentries(path = '.')
  Dir.open("#{curr_srcdir()}/#{path}") {|d|
    return d.to_a - %w(. ..)
  }
end

#srcexist?(path) ⇒ Boolean



719
720
721
# File 'lib/priority-queue/setup.rb', line 719

def srcexist?(path)
  File.exist?(srcfile(path))
end

#srcfile(path) ⇒ Object



715
716
717
# File 'lib/priority-queue/setup.rb', line 715

def srcfile(path)
  "#{curr_srcdir()}/#{path}"
end

#srcfile?(path) ⇒ Boolean



727
728
729
# File 'lib/priority-queue/setup.rb', line 727

def srcfile?(path)
  File.file?(srcfile(path))
end

#srcfiles(path = '.') ⇒ Object



737
738
739
740
741
# File 'lib/priority-queue/setup.rb', line 737

def srcfiles(path = '.')
  srcentries(path).select {|fname|
    File.file?(File.join(curr_srcdir(), path, fname))
  }
end