Module: HookScriptAPI
- Included in:
- Installer
- Defined in:
- lib/mime-types-1.16/setup.rb
Overview
This module requires: #srcdir_root, #objdir_root, #relpath
Instance Method Summary collapse
- #curr_objdir ⇒ Object
-
#curr_srcdir ⇒ Object
srcdir/objdir (works only in the package directory).
- #get_config(key) ⇒ Object (also: #config)
-
#set_config(key, val) ⇒ Object
obsolete: use metaconfig to change configuration.
- #srcdirectories(path = '.') ⇒ Object
- #srcdirectory?(path) ⇒ Boolean
- #srcentries(path = '.') ⇒ Object
- #srcexist?(path) ⇒ Boolean
- #srcfile(path) ⇒ Object
- #srcfile?(path) ⇒ Boolean
- #srcfiles(path = '.') ⇒ Object
Instance Method Details
#curr_objdir ⇒ Object
710 711 712 |
# File 'lib/mime-types-1.16/setup.rb', line 710 def curr_objdir "#{objdir_root()}/#{relpath()}" end |
#curr_srcdir ⇒ Object
srcdir/objdir (works only in the package directory)
706 707 708 |
# File 'lib/mime-types-1.16/setup.rb', line 706 def curr_srcdir "#{srcdir_root()}/#{relpath()}" end |
#get_config(key) ⇒ Object Also known as: config
691 692 693 |
# File 'lib/mime-types-1.16/setup.rb', line 691 def get_config(key) @config[key] end |
#set_config(key, val) ⇒ Object
obsolete: use metaconfig to change configuration
698 699 700 |
# File 'lib/mime-types-1.16/setup.rb', line 698 def set_config(key, val) @config[key] = val end |
#srcdirectories(path = '.') ⇒ Object
742 743 744 745 746 |
# File 'lib/mime-types-1.16/setup.rb', line 742 def srcdirectories(path = '.') srcentries(path).select {|fname| File.dir?(File.join(curr_srcdir(), path, fname)) } end |
#srcdirectory?(path) ⇒ Boolean
722 723 724 |
# File 'lib/mime-types-1.16/setup.rb', line 722 def srcdirectory?(path) File.dir?(srcfile(path)) end |
#srcentries(path = '.') ⇒ Object
730 731 732 733 734 |
# File 'lib/mime-types-1.16/setup.rb', line 730 def srcentries(path = '.') Dir.open("#{curr_srcdir()}/#{path}") {|d| return d.to_a - %w(. ..) } end |
#srcexist?(path) ⇒ Boolean
718 719 720 |
# File 'lib/mime-types-1.16/setup.rb', line 718 def srcexist?(path) File.exist?(srcfile(path)) end |
#srcfile(path) ⇒ Object
714 715 716 |
# File 'lib/mime-types-1.16/setup.rb', line 714 def srcfile(path) "#{curr_srcdir()}/#{path}" end |
#srcfile?(path) ⇒ Boolean
726 727 728 |
# File 'lib/mime-types-1.16/setup.rb', line 726 def srcfile?(path) File.file?(srcfile(path)) end |
#srcfiles(path = '.') ⇒ Object
736 737 738 739 740 |
# File 'lib/mime-types-1.16/setup.rb', line 736 def srcfiles(path = '.') srcentries(path).select {|fname| File.file?(File.join(curr_srcdir(), path, fname)) } end |