Class: Autorake::Directories
- Inherits:
-
Hash
- Object
- Hash
- Autorake::Directories
- Defined in:
- lib/autorake/directories.rb
Constant Summary collapse
- STD =
{ :prefix => "/usr/local", :eprefix => "PREFIX", :cprefix => "EPREFIX", :bin => "EPREFIX/bin", :sbin => "EPREFIX/sbin", :libexec => "EPREFIX/libexec", :sysconf => "CPREFIX/etc", :localstate => "/var", :lib => "EPREFIX/lib", :include => "PREFIX/include", :data => "PREFIX/share", :info => "DATA/info", :locale => "DATA/locale", :man => "DATA/man", }
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #expand(dir) ⇒ Object
- #expanded(key) ⇒ Object
-
#initialize ⇒ Directories
constructor
A new instance of Directories.
Constructor Details
#initialize ⇒ Directories
Returns a new instance of Directories.
26 27 28 29 |
# File 'lib/autorake/directories.rb', line 26 def initialize super update STD end |
Instance Method Details
#[](key) ⇒ Object
31 32 33 |
# File 'lib/autorake/directories.rb', line 31 def [] key super key.to_sym end |
#[]=(key, value) ⇒ Object
35 36 37 |
# File 'lib/autorake/directories.rb', line 35 def []= key, value super key.to_sym, value end |
#expand(dir) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/autorake/directories.rb', line 43 def dir case dir when /\A[A-Z_]+/ then ( self[ $&.downcase]) + $' when /\A:(\w+)/ then ( self[ $1]) + $' else dir end end |
#expanded(key) ⇒ Object
39 40 41 |
# File 'lib/autorake/directories.rb', line 39 def key self[ key] end |