Module: HookScriptAPI

Included in:
Installer
Defined in:
lib/roebe/setup/setup.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#curr_objdirObject



771
772
773
# File 'lib/roebe/setup/setup.rb', line 771

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

#curr_srcdirObject

srcdir/objdir (works only in the package directory)



767
768
769
# File 'lib/roebe/setup/setup.rb', line 767

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

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



752
753
754
# File 'lib/roebe/setup/setup.rb', line 752

def get_config(key)
  @config[key]
end

#set_config(key, val) ⇒ Object

obsolete: use metaconfig to change configuration



759
760
761
# File 'lib/roebe/setup/setup.rb', line 759

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

#srcdirectories(path = '.') ⇒ Object



803
804
805
806
807
# File 'lib/roebe/setup/setup.rb', line 803

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

#srcdirectory?(path) ⇒ Boolean

Returns:

  • (Boolean)


783
784
785
# File 'lib/roebe/setup/setup.rb', line 783

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

#srcentries(path = '.') ⇒ Object



791
792
793
794
795
# File 'lib/roebe/setup/setup.rb', line 791

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

#srcexist?(path) ⇒ Boolean

Returns:

  • (Boolean)


779
780
781
# File 'lib/roebe/setup/setup.rb', line 779

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

#srcfile(path) ⇒ Object



775
776
777
# File 'lib/roebe/setup/setup.rb', line 775

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

#srcfile?(path) ⇒ Boolean

Returns:

  • (Boolean)


787
788
789
# File 'lib/roebe/setup/setup.rb', line 787

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

#srcfiles(path = '.') ⇒ Object



797
798
799
800
801
# File 'lib/roebe/setup/setup.rb', line 797

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